Skip to content

Commit ee7a112

Browse files
committed
Use explicit text document for override completion path
1 parent d12c889 commit ee7a112

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
}
3838
},
3939
"defaults": {
40-
"roslyn": "4.10.0-2.24123.4",
40+
"roslyn": "4.10.0-2.24124.2",
4141
"omniSharp": "1.39.11",
4242
"razor": "7.0.0-preview.24115.3",
4343
"razorOmnisharp": "7.0.0-preview.23363.1",

src/lsptoolshost/commands.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export function registerCommands(
3131
context.subscriptions.push(
3232
vscode.commands.registerCommand(
3333
'roslyn.client.completionComplexEdit',
34-
async (uriStr, textEdit, isSnippetString, newOffset) =>
35-
completionComplexEdit(uriStr, textEdit, isSnippetString, newOffset, outputChannel)
34+
async (textDocument, textEdit, isSnippetString, newOffset) =>
35+
completionComplexEdit(textDocument, textEdit, isSnippetString, newOffset, outputChannel)
3636
)
3737
);
3838
context.subscriptions.push(
@@ -97,7 +97,7 @@ async function restartServer(languageServer: RoslynLanguageServer): Promise<void
9797
* @param newPosition The offset for new cursor position. -1 if the edit has not specified one.
9898
*/
9999
async function completionComplexEdit(
100-
uriStr: string,
100+
textDocument: languageClient.TextDocumentIdentifier,
101101
textEdit: vscode.TextEdit,
102102
isSnippetString: boolean,
103103
newOffset: number,
@@ -106,18 +106,21 @@ async function completionComplexEdit(
106106
const componentName = '[roslyn.client.completionComplexEdit]';
107107

108108
// Find TextDocument, opening if needed.
109-
const uri = UriConverter.deserialize(uriStr);
109+
const uri = UriConverter.deserialize(textDocument.uri);
110110
const document = await vscode.workspace.openTextDocument(uri);
111111
if (document === undefined) {
112-
outputAndThrow(outputChannel, `${componentName} Can't open document with path: '${uriStr}'`);
112+
outputAndThrow(outputChannel, `${componentName} Can't open document with path: '${textDocument.uri}'`);
113113
}
114114

115115
// Use editor if we need to deal with selection or snippets.
116116
let editor: vscode.TextEditor | undefined = undefined;
117117
if (isSnippetString || newOffset >= 0) {
118118
editor = await vscode.window.showTextDocument(document);
119119
if (editor === undefined) {
120-
outputAndThrow(outputChannel, `${componentName} Editor unavailable for document with path: '${uriStr}'`);
120+
outputAndThrow(
121+
outputChannel,
122+
`${componentName} Editor unavailable for document with path: '${textDocument.uri}'`
123+
);
121124
}
122125
}
123126

0 commit comments

Comments
 (0)