Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc6cb3e

Browse files
authored
Add the active selection end. (microsoft#2511)
* Add the active selection end.
1 parentf44e906 commitbc6cb3e

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

‎Extension/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
],
6464
"configuration": {
6565
"type":"object",
66-
"title":"C/C++ Configuration",
66+
"title":"C/C++",
6767
"properties": {
6868
"C_Cpp.clang_format_path": {
6969
"type": [
@@ -1568,4 +1568,4 @@
15681568
"binaries": []
15691569
}
15701570
]
1571-
}
1571+
}

‎Extension/src/LanguageServer/client.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as path from 'path';
88
import*asvscodefrom'vscode';
99
import{
1010
LanguageClient,LanguageClientOptions,ServerOptions,NotificationType,TextDocumentIdentifier,
11-
RequestType,ErrorAction,CloseAction,DidOpenTextDocumentParams
11+
RequestType,ErrorAction,CloseAction,DidOpenTextDocumentParams,Range
1212
}from'vscode-languageclient';
1313
import{SourceFileConfigurationItem}from'vscode-cpptools';
1414
import{Status}from'vscode-cpptools/out/testApi';
@@ -114,7 +114,7 @@ const ResetDatabaseNotification: NotificationType<void, void> = new Notification
114114
constPauseParsingNotification:NotificationType<void,void>=newNotificationType<void,void>('cpptools/pauseParsing');
115115
constResumeParsingNotification:NotificationType<void,void>=newNotificationType<void,void>('cpptools/resumeParsing');
116116
constActiveDocumentChangeNotification:NotificationType<TextDocumentIdentifier,void>=newNotificationType<TextDocumentIdentifier,void>('cpptools/activeDocumentChange');
117-
constTextEditorSelectionChangeNotification:NotificationType<vscode.Position,void>=newNotificationType<vscode.Position,void>('cpptools/textEditorSelectionChange');
117+
constTextEditorSelectionChangeNotification:NotificationType<Range,void>=newNotificationType<Range,void>('cpptools/textEditorSelectionChange');
118118
constChangeFolderSettingsNotification:NotificationType<FolderSettingsParams,void>=newNotificationType<FolderSettingsParams,void>('cpptools/didChangeFolderSettings');
119119
constChangeCompileCommandsNotification:NotificationType<FileChangedParams,void>=newNotificationType<FileChangedParams,void>('cpptools/didChangeCompileCommands');
120120
constChangeSelectedSettingNotification:NotificationType<FolderSelectedSettingParams,void>=newNotificationType<FolderSelectedSettingParams,void>('cpptools/didChangeSelectedSetting');
@@ -171,7 +171,7 @@ export interface Client {
171171
requestNavigationList(document:vscode.TextDocument):Thenable<string>;
172172
activeDocumentChanged(document:vscode.TextDocument):void;
173173
activate():void;
174-
selectionChanged(selection:vscode.Position):void;
174+
selectionChanged(selection:Range):void;
175175
sendCustomConfigurations(configs:any):void;
176176
resetDatabase():void;
177177
deactivate():void;
@@ -976,7 +976,7 @@ class DefaultClient implements Client {
976976
this.resumeParsing();
977977
}
978978

979-
publicselectionChanged(selection:vscode.Position):void{
979+
publicselectionChanged(selection:Range):void{
980980
this.notifyWhenReady(()=>this.languageClient.sendNotification(TextEditorSelectionChangeNotification,selection));
981981
}
982982

@@ -1194,7 +1194,7 @@ class NullClient implements Client {
11941194
requestNavigationList(document:vscode.TextDocument):Thenable<string>{returnPromise.resolve("");}
11951195
activeDocumentChanged(document:vscode.TextDocument):void{}
11961196
activate():void{}
1197-
selectionChanged(selection:vscode.Position):void{}
1197+
selectionChanged(selection:Range):void{}
11981198
resetDatabase():void{}
11991199
deactivate():void{}
12001200
pauseParsing():void{}

‎Extension/src/LanguageServer/clientCollection.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export class ClientCollection {
159159
this.activeClient=this.getClientFor(this.activeDocument.uri);
160160
this.activeClient.activeDocumentChanged(this.activeDocument);
161161
// may not need this, the navigation UI should not have changed.
162-
// this.activeClient.selectionChanged(vscode.window.activeTextEditor.selection.start);
162+
// this.activeClient.selectionChanged(Range.create(vscode.window.activeTextEditor.selection.start, vscode.window.activeTextEditor.selection.end);
163163
}
164164

165165
client.dispose();

‎Extension/src/LanguageServer/extension.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { CppSettings } from './settings';
1717
import{PersistentWorkspaceState}from'./persistentState';
1818
import{getLanguageConfig}from'./languageConfig';
1919
import{getCustomConfigProviders}from'./customProviders';
20+
import{Range}from'vscode-languageclient';
2021

2122
letprevCrashFile:string;
2223
letclients:ClientCollection;
@@ -169,7 +170,7 @@ function onDidChangeActiveTextEditor(editor: vscode.TextEditor): void {
169170
}else{
170171
activeDocument=editor.document.uri.toString();
171172
clients.activeDocumentChanged(editor.document);
172-
clients.ActiveClient.selectionChanged(editor.selection.start);
173+
clients.ActiveClient.selectionChanged(Range.create(editor.selection.start,editor.selection.end));
173174
}
174175
ui.activeDocumentChanged();
175176
}
@@ -187,7 +188,7 @@ function onDidChangeTextEditorSelection(event: vscode.TextEditorSelectionChangeE
187188
clients.activeDocumentChanged(event.textEditor.document);
188189
ui.activeDocumentChanged();
189190
}
190-
clients.ActiveClient.selectionChanged(event.selections[0].start);
191+
clients.ActiveClient.selectionChanged(Range.create(event.selections[0].start,event.selections[0].end));
191192
}
192193

193194
functiononDidChangeVisibleTextEditors(editors:vscode.TextEditor[]):void{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp