diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2022-08-03 18:22:45 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2022-08-03 18:22:45 +0200 |
| commit | 46d6357994eb8ced835a69390dfbf01abed40ee1 (patch) | |
| tree | 26f5dc80e31df9624e54be6015c0968aa75bebf3 /editors/code/src | |
| parent | ec3586eab943d7c6c83d211f629a691fc8c14603 (diff) | |
| download | rust-46d6357994eb8ced835a69390dfbf01abed40ee1.tar.gz rust-46d6357994eb8ced835a69390dfbf01abed40ee1.zip | |
Add a setting to disable comment continuation in VSCode
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/config.ts | 14 | ||||
| -rw-r--r-- | editors/code/src/main.ts | 4 |
2 files changed, 14 insertions, 4 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index b04f18890b9..1c58040d58c 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -16,9 +16,13 @@ export class Config { readonly extensionId = "rust-lang.rust-analyzer"; readonly rootSection = "rust-analyzer"; - private readonly requiresWorkspaceReloadOpts = ["serverPath", "server"].map( - (opt) => `${this.rootSection}.${opt}` - ); + private readonly requiresWorkspaceReloadOpts = [ + "serverPath", + "server", + // FIXME: This shouldn't be here, changing this setting should reload + // `continueCommentsOnNewline` behavior without restart + "typing", + ].map((opt) => `${this.rootSection}.${opt}`); private readonly requiresReloadOpts = [ "cargo", "procMacro", @@ -140,6 +144,10 @@ export class Config { return this.get<boolean>("restartServerOnConfigChange"); } + get typingContinueCommentsOnNewline() { + return this.get<boolean>("typing.continueCommentsOnNewline"); + } + get debug() { let sourceFileMap = this.get<Record<string, string> | "auto">("debug.sourceFileMap"); if (sourceFileMap !== "auto") { diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 9ae20ddc4ac..d78b711a47a 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -84,7 +84,9 @@ async function tryActivate(context: vscode.ExtensionContext): Promise<RustAnalyz warnAboutExtensionConflicts(); - ctx.pushCleanup(configureLanguage()); + if (config.typingContinueCommentsOnNewline) { + ctx.pushCleanup(configureLanguage()); + } vscode.workspace.onDidChangeConfiguration( (_) => |
