@@ -16,6 +16,9 @@ async function startLanguageClient(context: ExtensionContext) {
1616 . get < string > ( "executablePath" , "" ) ;
1717 return executablePath === "" ? "erg" : executablePath ;
1818 } ) ( ) ;
19+ const enableInlayHints = workspace . getConfiguration ( "vscode-erg" ) . get < boolean > ( "lsp.inlayHints" , true ) ;
20+ const enableSemanticTokens = workspace . getConfiguration ( "vscode-erg" ) . get < boolean > ( "lsp.semanticTokens" , true ) ;
21+ const enableHover = workspace . getConfiguration ( "vscode-erg" ) . get < boolean > ( "lsp.hover" , true ) ;
1922 const buildFeatures = await ( async ( ) => {
2023 const buildFeaturesProcess = spawn ( executablePath , [ "--build-features" ] ) ;
2124 let buildFeatures = "" ;
@@ -25,10 +28,26 @@ async function startLanguageClient(context: ExtensionContext) {
2528 return buildFeatures ;
2629 } ) ( ) ;
2730 let serverOptions : ServerOptions ;
31+ let args = [ "--language-server" ] ;
32+ if ( ! ( enableInlayHints && enableSemanticTokens && enableHover ) ) {
33+ args . push ( "--" ) ;
34+ }
35+ if ( ! enableInlayHints ) {
36+ args . push ( "--disable" ) ;
37+ args . push ( "inlayHints" ) ;
38+ }
39+ if ( ! enableSemanticTokens ) {
40+ args . push ( "--disable" ) ;
41+ args . push ( "semanticTokens" ) ;
42+ }
43+ if ( ! enableHover ) {
44+ args . push ( "--disable" ) ;
45+ args . push ( "hover" ) ;
46+ }
2847 if ( buildFeatures . includes ( "els" ) ) {
2948 serverOptions = {
3049 command : executablePath ,
31- args : [ "--language-server" ] ,
50+ args,
3251 } ;
3352 } else {
3453 serverOptions = {
0 commit comments