@@ -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 */
9999async 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