@@ -18,7 +18,8 @@ import {
18
18
SelectionRange ,
19
19
SignatureHelp ,
20
20
SignatureHelpContext ,
21
- SemanticTokens
21
+ SemanticTokens ,
22
+ TextDocumentContentChangeEvent
22
23
} from 'vscode-languageserver' ;
23
24
import {
24
25
Document ,
@@ -45,7 +46,8 @@ import {
45
46
SignatureHelpProvider ,
46
47
UpdateImportsProvider ,
47
48
OnWatchFileChangesPara ,
48
- SemanticTokensProvider
49
+ SemanticTokensProvider ,
50
+ UpdateTsOrJsFile
49
51
} from '../interfaces' ;
50
52
import { SnapshotFragment } from './DocumentSnapshot' ;
51
53
import { CodeActionsProviderImpl } from './features/CodeActionsProvider' ;
@@ -80,7 +82,8 @@ export class TypeScriptPlugin
80
82
SignatureHelpProvider ,
81
83
SemanticTokensProvider ,
82
84
OnWatchFileChanges ,
83
- CompletionsProvider < CompletionEntryWithIdentifer > {
85
+ CompletionsProvider < CompletionEntryWithIdentifer > ,
86
+ UpdateTsOrJsFile {
84
87
private readonly configManager : LSConfigManager ;
85
88
private readonly lsAndTsDocResolver : LSAndTSDocResolver ;
86
89
private readonly completionProvider : CompletionsProviderImpl ;
@@ -100,11 +103,7 @@ export class TypeScriptPlugin
100
103
workspaceUris : string [ ]
101
104
) {
102
105
this . configManager = configManager ;
103
- this . lsAndTsDocResolver = new LSAndTSDocResolver (
104
- docManager ,
105
- workspaceUris ,
106
- configManager
107
- ) ;
106
+ this . lsAndTsDocResolver = new LSAndTSDocResolver ( docManager , workspaceUris , configManager ) ;
108
107
this . completionProvider = new CompletionsProviderImpl ( this . lsAndTsDocResolver ) ;
109
108
this . codeActionsProvider = new CodeActionsProviderImpl (
110
109
this . lsAndTsDocResolver ,
@@ -386,6 +385,11 @@ export class TypeScriptPlugin
386
385
}
387
386
}
388
387
388
+ updateTsOrJsFile ( fileName : string , changes : TextDocumentContentChangeEvent [ ] ) : void {
389
+ const snapshotManager = this . getSnapshotManager ( fileName ) ;
390
+ snapshotManager . updateTsOrJsFile ( fileName , changes ) ;
391
+ }
392
+
389
393
async getSelectionRange (
390
394
document : Document ,
391
395
position : Position
@@ -398,7 +402,9 @@ export class TypeScriptPlugin
398
402
}
399
403
400
404
async getSignatureHelp (
401
- document : Document , position : Position , context : SignatureHelpContext | undefined
405
+ document : Document ,
406
+ position : Position ,
407
+ context : SignatureHelpContext | undefined
402
408
) : Promise < SignatureHelp | null > {
403
409
if ( ! this . featureEnabled ( 'signatureHelp' ) ) {
404
410
return null ;
0 commit comments