mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 21:11:38 +01:00
Specify also the initial selection option inside of the editorChat.start options (#189137)
* extending the api to also be able to include the selection * cleaning the code * cleaning the code * Set the initial editor selection if it's provided ---------
This commit is contained in:
committed by
GitHub
parent
7a606ee393
commit
7248433faf
@@ -22,6 +22,7 @@ import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/
|
||||
import { IUntitledTextResourceEditorInput } from 'vs/workbench/common/editor';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { Selection } from 'vs/editor/common/core/selection';
|
||||
import { fromNow } from 'vs/base/common/date';
|
||||
import { IInlineChatSessionService, Recording } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSession';
|
||||
import { runAccessibilityHelpAction } from 'vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp';
|
||||
@@ -52,11 +53,12 @@ export class StartSessionAction extends EditorAction2 {
|
||||
}
|
||||
|
||||
private _isInteractivEditorOptions(options: any): options is InlineChatRunOptions {
|
||||
const { initialRange, message, autoSend, position } = options;
|
||||
const { initialSelection, 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 initialSelection !== 'undefined' && !Selection.isISelection(initialSelection)
|
||||
|| typeof position !== 'undefined' && !Position.isIPosition(position)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user