mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
adding code in order be able to pass in a position for the inline chat
This commit is contained in:
@@ -29,6 +29,7 @@ import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vs/platform/accessibility/co
|
||||
import { AccessibilityHelpAction } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
|
||||
CommandsRegistry.registerCommandAlias('interactiveEditor.start', 'inlineChat.start');
|
||||
|
||||
@@ -50,11 +51,12 @@ export class StartSessionAction extends EditorAction2 {
|
||||
}
|
||||
|
||||
private _isInteractivEditorOptions(options: any): options is InlineChatRunOptions {
|
||||
const { initialRange, message, autoSend } = options;
|
||||
const { initialRange, message, autoSend, position } = options;
|
||||
if (
|
||||
typeof message !== 'undefined' && typeof message !== 'string'
|
||||
|| typeof autoSend !== 'undefined' && typeof autoSend !== 'boolean'
|
||||
|| typeof initialRange !== 'undefined' && !Range.isIRange(initialRange)) {
|
||||
|| typeof initialRange !== 'undefined' && !Range.isIRange(initialRange)
|
||||
|| typeof position !== 'undefined' && typeof !Position.isIPosition(position)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -66,6 +68,7 @@ export class StartSessionAction extends EditorAction2 {
|
||||
if (arg && this._isInteractivEditorOptions(arg)) {
|
||||
options = arg;
|
||||
}
|
||||
console.log('options inside of run editor command : ', options);
|
||||
InlineChatController.get(editor)?.run(options);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user