@@ -228,7 +228,7 @@ export class TypeScriptService {
228
228
* location of a symbol at a given text document position.
229
229
*/
230
230
textDocumentDefinition ( params : TextDocumentPositionParams , span = new Span ( ) ) : Observable < Location [ ] > {
231
- const uri = params . textDocument . uri ;
231
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
232
232
233
233
// Fetch files needed to resolve definition
234
234
return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -277,7 +277,7 @@ export class TypeScriptService {
277
277
* know some information about it.
278
278
*/
279
279
textDocumentXdefinition ( params : TextDocumentPositionParams , span = new Span ( ) ) : Observable < SymbolLocationInformation [ ] > {
280
- const uri = params . textDocument . uri ;
280
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
281
281
282
282
// Ensure files needed to resolve SymbolLocationInformation are fetched
283
283
return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -326,7 +326,7 @@ export class TypeScriptService {
326
326
* given text document position.
327
327
*/
328
328
textDocumentHover ( params : TextDocumentPositionParams , span = new Span ( ) ) : Observable < Hover > {
329
- const uri = params . textDocument . uri ;
329
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
330
330
331
331
// Ensure files needed to resolve hover are fetched
332
332
return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -373,7 +373,7 @@ export class TypeScriptService {
373
373
* Returns all references to the symbol at the position in the own workspace, including references inside node_modules.
374
374
*/
375
375
textDocumentReferences ( params : ReferenceParams , span = new Span ( ) ) : Observable < Location [ ] > {
376
- const uri = params . textDocument . uri ;
376
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
377
377
// Ensure all files were fetched to collect all references
378
378
return Observable . from ( this . projectManager . ensureOwnFiles ( span ) )
379
379
. mergeMap ( ( ) => {
@@ -551,7 +551,7 @@ export class TypeScriptService {
551
551
* in a given text document.
552
552
*/
553
553
textDocumentDocumentSymbol ( params : DocumentSymbolParams , span = new Span ( ) ) : Observable < SymbolInformation [ ] > {
554
- const uri = params . textDocument . uri ;
554
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
555
555
556
556
// Ensure files needed to resolve symbols are fetched
557
557
return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -742,7 +742,7 @@ export class TypeScriptService {
742
742
* property filled in.
743
743
*/
744
744
textDocumentCompletion ( params : TextDocumentPositionParams , span = new Span ( ) ) : Observable < CompletionList > {
745
- const uri = params . textDocument . uri ;
745
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
746
746
747
747
// Ensure files needed to suggest completions are fetched
748
748
return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -793,7 +793,7 @@ export class TypeScriptService {
793
793
* information at a given cursor position.
794
794
*/
795
795
textDocumentSignatureHelp ( params : TextDocumentPositionParams , span = new Span ( ) ) : Observable < SignatureHelp > {
796
- const uri = params . textDocument . uri ;
796
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
797
797
798
798
// Ensure files needed to resolve signature are fetched
799
799
return this . projectManager . ensureReferencedFiles ( uri , undefined , undefined , span )
@@ -844,7 +844,7 @@ export class TypeScriptService {
844
844
* to read the document's truth using the document's uri.
845
845
*/
846
846
async textDocumentDidOpen ( params : DidOpenTextDocumentParams ) : Promise < void > {
847
- const uri = params . textDocument . uri ;
847
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
848
848
// Ensure files needed for most operations are fetched
849
849
await this . projectManager . ensureReferencedFiles ( uri ) . toPromise ( ) ;
850
850
this . projectManager . didOpen ( uri , params . textDocument . text ) ;
@@ -857,7 +857,7 @@ export class TypeScriptService {
857
857
* and language ids.
858
858
*/
859
859
async textDocumentDidChange ( params : DidChangeTextDocumentParams ) : Promise < void > {
860
- const uri = params . textDocument . uri ;
860
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
861
861
let text : string | undefined ;
862
862
for ( const change of params . contentChanges ) {
863
863
if ( change . range || change . rangeLength ) {
@@ -900,7 +900,7 @@ export class TypeScriptService {
900
900
* saved in the client.
901
901
*/
902
902
async textDocumentDidSave ( params : DidSaveTextDocumentParams ) : Promise < void > {
903
- const uri = params . textDocument . uri ;
903
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
904
904
905
905
// Ensure files needed to suggest completions are fetched
906
906
await this . projectManager . ensureReferencedFiles ( uri ) . toPromise ( ) ;
@@ -913,7 +913,7 @@ export class TypeScriptService {
913
913
* (e.g. if the document's uri is a file uri the truth now exists on disk).
914
914
*/
915
915
async textDocumentDidClose ( params : DidCloseTextDocumentParams ) : Promise < void > {
916
- const uri = params . textDocument . uri ;
916
+ const uri = util . normalizeUri ( params . textDocument . uri ) ;
917
917
918
918
// Ensure files needed to suggest completions are fetched
919
919
await this . projectManager . ensureReferencedFiles ( uri ) . toPromise ( ) ;
0 commit comments