@@ -3,6 +3,13 @@ import { Uri } from 'monaco-editor'
33import {
44 MonacoLanguageClient , Middleware , ErrorHandler , IConnectionProvider , InitializeParams , RegistrationRequest , RegistrationParams , UnregistrationRequest , UnregistrationParams , LanguageClientOptions , MessageTransports , InitializeRequest
55} from 'monaco-languageclient'
6+ import { WillSaveWaitUntilFeature } from 'vscode-languageclient/lib/common/textSynchronization'
7+ import { FileSystemWatcherFeature } from 'vscode-languageclient/lib/common/fileSystemWatcher'
8+ import { WillCreateFilesFeature , WillRenameFilesFeature , WillDeleteFilesFeature , DidRenameFilesFeature , DidCreateFilesFeature , DidDeleteFilesFeature } from 'vscode-languageclient/lib/common/fileOperations'
9+ import { CallHierarchyFeature } from 'vscode-languageclient/lib/common/callHierarchy'
10+ import { TypeHierarchyFeature } from 'vscode-languageclient/lib/common/typeHierarchy'
11+ import { NotebookDocumentSyncFeature } from 'vscode-languageclient/lib/common/notebook'
12+ import { DynamicFeature , StaticFeature } from 'vscode-languageclient'
613import { registerExtensionFeatures } from './extensions'
714import { LanguageClientId } from './languageClientOptions'
815import { Infrastructure } from './infrastructure'
@@ -134,6 +141,29 @@ class CGLSPConnectionProvider implements IConnectionProvider {
134141 }
135142}
136143
144+ const IGNORED_DYNAMIC_FEATURES : Function [ ] = [
145+ FileSystemWatcherFeature ,
146+ WillSaveWaitUntilFeature ,
147+ NotebookDocumentSyncFeature ,
148+ WillCreateFilesFeature ,
149+ WillRenameFilesFeature ,
150+ WillDeleteFilesFeature ,
151+ DidRenameFilesFeature ,
152+ DidCreateFilesFeature ,
153+ DidDeleteFilesFeature ,
154+ TypeHierarchyFeature ,
155+ CallHierarchyFeature
156+ ]
157+ class CodinGameMonacoLanguageClient extends MonacoLanguageClient {
158+ override registerFeature ( feature : StaticFeature | DynamicFeature < unknown > ) : void {
159+ if ( DynamicFeature . is ( feature ) && IGNORED_DYNAMIC_FEATURES . includes ( feature . constructor ) ) {
160+ // ignore
161+ return
162+ }
163+ super . registerFeature ( feature )
164+ }
165+ }
166+
137167function createLanguageClient (
138168 id : LanguageClientId ,
139169 infrastructure : Infrastructure ,
@@ -145,7 +175,7 @@ function createLanguageClient (
145175 errorHandler : ErrorHandler ,
146176 middleware ?: Middleware
147177) : MonacoLanguageClient {
148- const client = new MonacoLanguageClient ( {
178+ const client = new CodinGameMonacoLanguageClient ( {
149179 id : `${ id } -languageclient` ,
150180 name : `CodinGame ${ id } Language Client` ,
151181 clientOptions : {
@@ -160,8 +190,6 @@ function createLanguageClient (
160190 connectionProvider : new CGLSPConnectionProvider ( id , infrastructure )
161191 } )
162192
163- client . registerProposedFeatures ( )
164-
165193 registerExtensionFeatures ( client , id )
166194
167195 return client
0 commit comments