112
112
proto .on (' textDocument/didOpen' , function (params )
113
113
workspace .awaitReady ()
114
114
local doc = params .textDocument
115
- local uri = doc .uri
115
+ local uri = files . getRealUri ( doc .uri )
116
116
local text = doc .text
117
117
log .debug (' didOpen' , uri )
118
118
files .setText (uri , text , true )
121
121
122
122
proto .on (' textDocument/didClose' , function (params )
123
123
local doc = params .textDocument
124
- local uri = doc .uri
124
+ local uri = files . getRealUri ( doc .uri )
125
125
log .debug (' didClose' , uri )
126
126
files .close (uri )
127
127
if not files .isLua (uri ) then
@@ -133,7 +133,7 @@ proto.on('textDocument/didChange', function (params)
133
133
workspace .awaitReady ()
134
134
local doc = params .textDocument
135
135
local changes = params .contentChanges
136
- local uri = doc .uri
136
+ local uri = files . getRealUri ( doc .uri )
137
137
-- log.debug('changes', util.dump(changes))
138
138
local text = files .getOriginText (uri ) or ' '
139
139
local rows = files .getCachedRows (uri )
144
144
145
145
proto .on (' textDocument/hover' , function (params )
146
146
local doc = params .textDocument
147
- local uri = doc .uri
147
+ local uri = files . getRealUri ( doc .uri )
148
148
if not workspace .isReady () then
149
149
local count , max = workspace .getLoadProcess ()
150
150
return {
@@ -177,7 +177,7 @@ proto.on('textDocument/definition', function (params)
177
177
workspace .awaitReady ()
178
178
local _ <close> = progress .create (lang .script .WINDOW_PROCESSING_DEFINITION , 0.5 )
179
179
local core = require ' core.definition'
180
- local uri = params .textDocument .uri
180
+ local uri = files . getRealUri ( params .textDocument .uri )
181
181
if not files .exists (uri ) then
182
182
return nil
183
183
end
@@ -212,7 +212,7 @@ proto.on('textDocument/typeDefinition', function (params)
212
212
workspace .awaitReady ()
213
213
local _ <close> = progress .create (lang .script .WINDOW_PROCESSING_TYPE_DEFINITION , 0.5 )
214
214
local core = require ' core.type-definition'
215
- local uri = params .textDocument .uri
215
+ local uri = files . getRealUri ( params .textDocument .uri )
216
216
if not files .exists (uri ) then
217
217
return nil
218
218
end
@@ -247,7 +247,7 @@ proto.on('textDocument/references', function (params)
247
247
workspace .awaitReady ()
248
248
local _ <close> = progress .create (lang .script .WINDOW_PROCESSING_REFERENCE , 0.5 )
249
249
local core = require ' core.reference'
250
- local uri = params .textDocument .uri
250
+ local uri = files . getRealUri ( params .textDocument .uri )
251
251
if not files .exists (uri ) then
252
252
return nil
253
253
end
268
268
269
269
proto .on (' textDocument/documentHighlight' , function (params )
270
270
local core = require ' core.highlight'
271
- local uri = params .textDocument .uri
271
+ local uri = files . getRealUri ( params .textDocument .uri )
272
272
if not files .exists (uri ) then
273
273
return nil
274
274
end
@@ -291,7 +291,7 @@ proto.on('textDocument/rename', function (params)
291
291
workspace .awaitReady ()
292
292
local _ <close> = progress .create (lang .script .WINDOW_PROCESSING_RENAME , 0.5 )
293
293
local core = require ' core.rename'
294
- local uri = params .textDocument .uri
294
+ local uri = files . getRealUri ( params .textDocument .uri )
295
295
if not files .exists (uri ) then
296
296
return nil
297
297
end
316
316
317
317
proto .on (' textDocument/prepareRename' , function (params )
318
318
local core = require ' core.rename'
319
- local uri = params .textDocument .uri
319
+ local uri = files . getRealUri ( params .textDocument .uri )
320
320
if not files .exists (uri ) then
321
321
return nil
322
322
end
@@ -332,7 +332,7 @@ proto.on('textDocument/prepareRename', function (params)
332
332
end )
333
333
334
334
proto .on (' textDocument/completion' , function (params )
335
- local uri = params .textDocument .uri
335
+ local uri = files . getRealUri ( params .textDocument .uri )
336
336
if not workspace .isReady () then
337
337
local count , max = workspace .getLoadProcess ()
338
338
return {
@@ -483,7 +483,7 @@ proto.on('textDocument/signatureHelp', function (params)
483
483
end
484
484
workspace .awaitReady ()
485
485
local _ <close> = progress .create (lang .script .WINDOW_PROCESSING_SIGNATURE , 0.5 )
486
- local uri = params .textDocument .uri
486
+ local uri = files . getRealUri ( params .textDocument .uri )
487
487
if not files .exists (uri ) then
488
488
return nil
489
489
end
@@ -523,7 +523,7 @@ proto.on('textDocument/documentSymbol', function (params)
523
523
workspace .awaitReady ()
524
524
local _ <close> = progress .create (lang .script .WINDOW_PROCESSING_SYMBOL , 0.5 )
525
525
local core = require ' core.document-symbol'
526
- local uri = params .textDocument .uri
526
+ local uri = files . getRealUri ( params .textDocument .uri )
527
527
528
528
local symbols = core (uri )
529
529
if not symbols then
562
562
563
563
proto .on (' textDocument/codeAction' , function (params )
564
564
local core = require ' core.code-action'
565
- local uri = params .textDocument .uri
565
+ local uri = files . getRealUri ( params .textDocument .uri )
566
566
local range = params .range
567
567
local diagnostics = params .context .diagnostics
568
568
if not files .exists (uri ) then
@@ -641,7 +641,7 @@ proto.on('workspace/symbol', function (params)
641
641
end )
642
642
643
643
proto .on (' textDocument/semanticTokens/full' , function (params )
644
- local uri = params .textDocument .uri
644
+ local uri = files . getRealUri ( params .textDocument .uri )
645
645
workspace .awaitReady ()
646
646
local _ <close> = progress .create (lang .script .WINDOW_PROCESSING_SEMANTIC_FULL , 0.5 )
647
647
local core = require ' core.semantic-tokens'
@@ -652,7 +652,7 @@ proto.on('textDocument/semanticTokens/full', function (params)
652
652
end )
653
653
654
654
proto .on (' textDocument/semanticTokens/range' , function (params )
655
- local uri = params .textDocument .uri
655
+ local uri = files . getRealUri ( params .textDocument .uri )
656
656
workspace .awaitReady ()
657
657
local _ <close> = progress .create (lang .script .WINDOW_PROCESSING_SEMANTIC_RANGE , 0.5 )
658
658
local core = require ' core.semantic-tokens'
673
673
674
674
proto .on (' textDocument/foldingRange' , function (params )
675
675
local core = require ' core.folding'
676
- local uri = params .textDocument .uri
676
+ local uri = files . getRealUri ( params .textDocument .uri )
677
677
if not files .exists (uri ) then
678
678
return nil
679
679
end
@@ -706,7 +706,7 @@ proto.on('window/workDoneProgress/cancel', function (params)
706
706
end )
707
707
708
708
proto .on (' $/didChangeVisibleRanges' , function (params )
709
- local uri = params .uri
709
+ local uri = files . getRealUri ( params .uri )
710
710
await .close (' visible:' .. uri )
711
711
await .setID (' visible:' .. uri )
712
712
await .delay ()
@@ -732,7 +732,7 @@ proto.on('textDocument/onTypeFormatting', function (params)
732
732
workspace .awaitReady ()
733
733
local _ <close> = progress .create (lang .script .WINDOW_PROCESSING_TYPE_FORMATTING , 0.5 )
734
734
local ch = params .ch
735
- local uri = params .textDocument .uri
735
+ local uri = files . getRealUri ( params .textDocument .uri )
736
736
if not files .exists (uri ) then
737
737
return nil
738
738
end
@@ -766,7 +766,7 @@ proto.on('$/requestHint', function (params)
766
766
return
767
767
end
768
768
workspace .awaitReady ()
769
- local uri = params .textDocument .uri
769
+ local uri = files . getRealUri ( params .textDocument .uri )
770
770
local start , finish = converter .unpackRange (uri , params .range )
771
771
local results = core (uri , start , finish )
772
772
local hintResults = {}
@@ -848,7 +848,7 @@ files.watch(function (ev, uri)
848
848
if ev == ' update'
849
849
or ev == ' remove' then
850
850
for id , p in pairs (proto .holdon ) do
851
- if p .params .textDocument and p .params .textDocument .uri == uri then
851
+ if p .params .textDocument and files . getRealUri ( p .params .textDocument .uri ) == uri then
852
852
proto .close (id , define .ErrorCodes .ContentModified )
853
853
end
854
854
end
0 commit comments