@@ -31,8 +31,8 @@ export function registerCommands(
31
31
context . subscriptions . push (
32
32
vscode . commands . registerCommand (
33
33
'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 )
36
36
)
37
37
) ;
38
38
context . subscriptions . push (
@@ -97,7 +97,7 @@ async function restartServer(languageServer: RoslynLanguageServer): Promise<void
97
97
* @param newPosition The offset for new cursor position. -1 if the edit has not specified one.
98
98
*/
99
99
async function completionComplexEdit (
100
- uriStr : string ,
100
+ textDocument : languageClient . TextDocumentIdentifier ,
101
101
textEdit : vscode . TextEdit ,
102
102
isSnippetString : boolean ,
103
103
newOffset : number ,
@@ -106,18 +106,21 @@ async function completionComplexEdit(
106
106
const componentName = '[roslyn.client.completionComplexEdit]' ;
107
107
108
108
// Find TextDocument, opening if needed.
109
- const uri = UriConverter . deserialize ( uriStr ) ;
109
+ const uri = UriConverter . deserialize ( textDocument . uri ) ;
110
110
const document = await vscode . workspace . openTextDocument ( uri ) ;
111
111
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 } '` ) ;
113
113
}
114
114
115
115
// Use editor if we need to deal with selection or snippets.
116
116
let editor : vscode . TextEditor | undefined = undefined ;
117
117
if ( isSnippetString || newOffset >= 0 ) {
118
118
editor = await vscode . window . showTextDocument ( document ) ;
119
119
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
+ ) ;
121
124
}
122
125
}
123
126
0 commit comments