@@ -228,7 +228,7 @@ export class TypeScriptService {
228228 * location of a symbol at a given text document position.
229229 */
230230 textDocumentDefinition ( params : TextDocumentPositionParams , span = new Span ( ) ) : Observable < Location [ ] > {
231- const uri = params . textDocument . uri ;
231+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
232232
233233 // Fetch files needed to resolve definition
234234 return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -277,7 +277,7 @@ export class TypeScriptService {
277277 * know some information about it.
278278 */
279279 textDocumentXdefinition ( params : TextDocumentPositionParams , span = new Span ( ) ) : Observable < SymbolLocationInformation [ ] > {
280- const uri = params . textDocument . uri ;
280+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
281281
282282 // Ensure files needed to resolve SymbolLocationInformation are fetched
283283 return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -326,7 +326,7 @@ export class TypeScriptService {
326326 * given text document position.
327327 */
328328 textDocumentHover ( params : TextDocumentPositionParams , span = new Span ( ) ) : Observable < Hover > {
329- const uri = params . textDocument . uri ;
329+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
330330
331331 // Ensure files needed to resolve hover are fetched
332332 return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -373,7 +373,7 @@ export class TypeScriptService {
373373 * Returns all references to the symbol at the position in the own workspace, including references inside node_modules.
374374 */
375375 textDocumentReferences ( params : ReferenceParams , span = new Span ( ) ) : Observable < Location [ ] > {
376- const uri = params . textDocument . uri ;
376+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
377377 // Ensure all files were fetched to collect all references
378378 return Observable . from ( this . projectManager . ensureOwnFiles ( span ) )
379379 . mergeMap ( ( ) => {
@@ -551,7 +551,7 @@ export class TypeScriptService {
551551 * in a given text document.
552552 */
553553 textDocumentDocumentSymbol ( params : DocumentSymbolParams , span = new Span ( ) ) : Observable < SymbolInformation [ ] > {
554- const uri = params . textDocument . uri ;
554+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
555555
556556 // Ensure files needed to resolve symbols are fetched
557557 return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -742,7 +742,7 @@ export class TypeScriptService {
742742 * property filled in.
743743 */
744744 textDocumentCompletion ( params : TextDocumentPositionParams , span = new Span ( ) ) : Observable < CompletionList > {
745- const uri = params . textDocument . uri ;
745+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
746746
747747 // Ensure files needed to suggest completions are fetched
748748 return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -793,7 +793,7 @@ export class TypeScriptService {
793793 * information at a given cursor position.
794794 */
795795 textDocumentSignatureHelp ( params : TextDocumentPositionParams , span = new Span ( ) ) : Observable < SignatureHelp > {
796- const uri = params . textDocument . uri ;
796+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
797797
798798 // Ensure files needed to resolve signature are fetched
799799 return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -844,7 +844,7 @@ export class TypeScriptService {
844844 * to read the document's truth using the document's uri.
845845 */
846846 async textDocumentDidOpen ( params : DidOpenTextDocumentParams ) : Promise < void > {
847- const uri = params . textDocument . uri ;
847+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
848848 // Ensure files needed for most operations are fetched
849849 await this . projectManager . ensureReferencedFiles ( uri ) . toPromise ( ) ;
850850 this . projectManager . didOpen ( uri , params . textDocument . text ) ;
@@ -857,7 +857,7 @@ export class TypeScriptService {
857857 * and language ids.
858858 */
859859 async textDocumentDidChange ( params : DidChangeTextDocumentParams ) : Promise < void > {
860- const uri = params . textDocument . uri ;
860+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
861861 let text : string | undefined ;
862862 for ( const change of params . contentChanges ) {
863863 if ( change . range || change . rangeLength ) {
@@ -900,7 +900,7 @@ export class TypeScriptService {
900900 * saved in the client.
901901 */
902902 async textDocumentDidSave ( params : DidSaveTextDocumentParams ) : Promise < void > {
903- const uri = params . textDocument . uri ;
903+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
904904
905905 // Ensure files needed to suggest completions are fetched
906906 await this . projectManager . ensureReferencedFiles ( uri ) . toPromise ( ) ;
@@ -913,7 +913,7 @@ export class TypeScriptService {
913913 * (e.g. if the document's uri is a file uri the truth now exists on disk).
914914 */
915915 async textDocumentDidClose ( params : DidCloseTextDocumentParams ) : Promise < void > {
916- const uri = params . textDocument . uri ;
916+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
917917
918918 // Ensure files needed to suggest completions are fetched
919919 await this . projectManager . ensureReferencedFiles ( uri ) . toPromise ( ) ;
0 commit comments