diff --git a/package.json b/package.json index fdeb183..c0d6a49 100644 --- a/package.json +++ b/package.json @@ -206,6 +206,36 @@ "default": true, "description": "Enable the Code Lens feature of language server. (Compile, Execute, Info, Profile, Run Test links above entry functions and tests)" }, + "noir.enableInlayHints": { + "scope": "resource", + "type": "boolean", + "default": true, + "description": "Enable the Inlay Hints feature of language server. (Shows the type of varaibles)" + }, + "noir.enableCompletions": { + "scope": "resource", + "type": "boolean", + "default": true, + "description": "Enable the Completions feature of language server. (Suggests variables, methods, etc.)" + }, + "noir.enableSignatureHelp": { + "scope": "resource", + "type": "boolean", + "default": true, + "description": "Enable the Signature Help feature of language server. (Shows arguments and its types when writing function calls)" + }, + "noir.enableCodeActions": { + "scope": "resource", + "type": "boolean", + "default": true, + "description": "Enable the Code Actions feature of language server. (Suggests quick fixes)" + }, + "noir.enableLightweightMode": { + "scope": "resource", + "type": "boolean", + "default": false, + "description": "Enable the lightweight mode. (Disables code lens, inlay hints, completions, signature help and code actions)" + }, "noir.trace.server": { "scope": "resource", "type": "string", diff --git a/src/client.ts b/src/client.ts index 132c38c..a5ee6c7 100644 --- a/src/client.ts +++ b/src/client.ts @@ -129,12 +129,22 @@ export default class Client extends LanguageClient { const config = workspace.getConfiguration('noir', uri); const enableCodeLens = config.get('enableCodeLens'); + const enableInlayHints = config.get('enableInlayHints'); + const enableCompletions = config.get('enableCompletions'); + const enableSignatureHelp = config.get('enableSignatureHelp'); + const enableCodeActions = config.get('enableCodeActions'); + const enableLightweightMode = config.get('enableLightweightMode'); const clientOptions: LanguageClientOptions = { documentSelector, workspaceFolder, initializationOptions: { enableCodeLens, + enableInlayHints, + enableCompletions, + enableSignatureHelp, + enableCodeActions, + enableLightweightMode, }, outputChannelName: file ? `${extensionName} (${file})` : `${extensionName}`, traceOutputChannel: file ? null : window.createOutputChannel(`${extensionName} Trace`), diff --git a/src/extension.ts b/src/extension.ts index f72f229..8773d00 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -357,12 +357,15 @@ async function didOpenTextDocument(document: TextDocument): Promise registerWorkspaceCommands(folder); } - if (e.affectsConfiguration('noir.enableLSP', folder.uri)) { - await removeWorkspaceClient(folder); - await addWorkspaceClient(folder); - } - - if (e.affectsConfiguration('noir.enableCodeLens', folder.uri)) { + if ( + e.affectsConfiguration('noir.enableLSP', folder.uri) || + e.affectsConfiguration('noir.enableCodeLens', folder.uri) || + e.affectsConfiguration('noir.enableInlayHints', folder.uri) || + e.affectsConfiguration('noir.enableCompletions', folder.uri) || + e.affectsConfiguration('noir.enableSignatureHelp', folder.uri) || + e.affectsConfiguration('noir.enableCodeActions', folder.uri) || + e.affectsConfiguration('noir.enableLightweightMode', folder.uri) + ) { await removeWorkspaceClient(folder); await addWorkspaceClient(folder); }