@@ -6,7 +6,7 @@ import { ResultUpdate, ToolPreparator } from "./toolPreparator";
66import {
77 LanguageClient ,
88 LanguageClientOptions ,
9- StreamInfo
9+ StreamInfo ,
1010} from 'vscode-languageclient/node' ;
1111
1212import { workspace } from 'vscode' ;
@@ -25,24 +25,18 @@ export class Ctx {
2525 private _extensionContext : vscode . ExtensionContext ;
2626 private _commands : Record < string , CommandCallback > ;
2727 private _config : Config ;
28- private _workspaceDiagnostic : vscode . DiagnosticCollection ;
2928
3029 constructor ( ctx : vscode . ExtensionContext ) {
3130 this . _client = null ;
3231 this . _extensionContext = ctx ;
3332 this . _commands = { } ;
3433 this . _config = null ;
35- this . _workspaceDiagnostic = vscode . languages . createDiagnosticCollection ( "4d_workspace" ) ;
3634 }
3735
3836 public get config ( ) : Config {
3937 return this . _config ;
4038 }
4139
42- public get workspaceDiagnostic ( ) : vscode . DiagnosticCollection {
43- return this . _workspaceDiagnostic ;
44- }
45-
4640 public get extensionContext ( ) : vscode . ExtensionContext {
4741 return this . _extensionContext ;
4842 }
@@ -213,22 +207,17 @@ export class Ctx {
213207 const clientOptions : LanguageClientOptions = {
214208 // Register the server for plain text documents
215209 documentSelector : [
216- { scheme : 'file' , language : '4d' } ,
210+ { scheme : 'file' , language : '4d' } ,
217211 { scheme : 'file' , language : '4qs' }
218212 ] ,
219213 synchronize : {
220214 // Notify the server about file changes to '.clientrc files contained in the workspace
221- fileEvents : workspace . createFileSystemWatcher ( '**/.4DSettings' )
215+ fileEvents : workspace . createFileSystemWatcher ( '**/.4DSettings' ) ,
216+ // Configure textDocument sync options to include save notifications
217+ configurationSection : '4D-Analyzer'
222218 } ,
223219 initializationOptions : this . _config . cfg ,
224220 diagnosticCollectionName : "4d" ,
225- middleware : {
226- provideDiagnostics : ( document , previousResultId , token , next ) => {
227- if ( this . _config . diagnosticEnabled )
228- this . _workspaceDiagnostic . set ( document instanceof vscode . Uri ? document : document . uri , undefined ) ;
229- return next ( document , previousResultId , token ) ;
230- }
231- }
232221 } ;
233222 // Create the language client and start the client.
234223 this . _client = new LanguageClient (
@@ -243,6 +232,7 @@ export class Ctx {
243232
244233 public start ( ) {
245234 this . _config = new Config ( this . _extensionContext ) ;
235+
246236 if ( this . _config . IsTool4DEnabled ( ) ) {
247237 this . prepareTool4D ( this . _config . tool4DWanted ( ) , this . _config . tool4DLocation ( ) , this . _config . tool4DDownloadChannel ( ) )
248238 . then ( result => {
0 commit comments