@@ -19,8 +19,7 @@ import * as chokidar from "chokidar";
19
19
import { assert } from "console" ;
20
20
import { fileURLToPath } from "url" ;
21
21
import { ChildProcess } from "child_process" ;
22
- import { Location } from "vscode-languageserver" ;
23
- import { SymbolInformation , WorkspaceEdit } from "vscode-languageserver" ;
22
+ import { WorkspaceEdit } from "vscode-languageserver" ;
24
23
import { TextEdit } from "vscode-languageserver-types" ;
25
24
26
25
// https://microsoft.github.io/language-server-protocol/specification#initialize
@@ -392,16 +391,7 @@ function onMessage(msg: m.Message) {
392
391
// https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rename
393
392
let params = msg . params as p . RenameParams ;
394
393
let filePath = fileURLToPath ( params . textDocument . uri ) ;
395
- let locations : Location [ ] | null = utils . runAnalysisAfterSanityCheck (
396
- filePath ,
397
- [
398
- "references" ,
399
- filePath ,
400
- params . position . line ,
401
- params . position . character ,
402
- ]
403
- ) ;
404
-
394
+ let locations : p . Location [ ] | null = utils . getReferencesForPosition ( filePath , params . position ) ;
405
395
let result : WorkspaceEdit | null ;
406
396
if ( locations === null ) {
407
397
result = null ;
@@ -430,15 +420,7 @@ function onMessage(msg: m.Message) {
430
420
// https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references
431
421
let params = msg . params as p . ReferenceParams ;
432
422
let filePath = fileURLToPath ( params . textDocument . uri ) ;
433
- let result : typeof p . ReferencesRequest . type = utils . runAnalysisAfterSanityCheck (
434
- filePath ,
435
- [
436
- "references" ,
437
- filePath ,
438
- params . position . line ,
439
- params . position . character ,
440
- ]
441
- ) ;
423
+ let result : typeof p . ReferencesRequest . type = utils . getReferencesForPosition ( filePath , params . position ) ;
442
424
let definitionResponse : m . ResponseMessage = {
443
425
jsonrpc : c . jsonrpcVersion ,
444
426
id : msg . id ,
0 commit comments