File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 380
380
"default" : false ,
381
381
"type" : " boolean"
382
382
},
383
+ "rust-analyzer.typing.continueCommentsOnNewline" : {
384
+ "markdownDescription" : " Whether to prefix newlines after comments with the corresponding comment prefix." ,
385
+ "default" : true ,
386
+ "type" : " boolean"
387
+ },
383
388
"$generated-start" : {},
384
389
"rust-analyzer.assist.expressionFillDefault" : {
385
390
"markdownDescription" : " Placeholder expression to use for missing expressions in assists." ,
Original file line number Diff line number Diff line change @@ -16,9 +16,13 @@ export class Config {
16
16
readonly extensionId = "rust-lang.rust-analyzer" ;
17
17
18
18
readonly rootSection = "rust-analyzer" ;
19
- private readonly requiresWorkspaceReloadOpts = [ "serverPath" , "server" ] . map (
20
- ( opt ) => `${ this . rootSection } .${ opt } `
21
- ) ;
19
+ private readonly requiresWorkspaceReloadOpts = [
20
+ "serverPath" ,
21
+ "server" ,
22
+ // FIXME: This shouldn't be here, changing this setting should reload
23
+ // `continueCommentsOnNewline` behavior without restart
24
+ "typing" ,
25
+ ] . map ( ( opt ) => `${ this . rootSection } .${ opt } ` ) ;
22
26
private readonly requiresReloadOpts = [
23
27
"cargo" ,
24
28
"procMacro" ,
@@ -140,6 +144,10 @@ export class Config {
140
144
return this . get < boolean > ( "restartServerOnConfigChange" ) ;
141
145
}
142
146
147
+ get typingContinueCommentsOnNewline ( ) {
148
+ return this . get < boolean > ( "typing.continueCommentsOnNewline" ) ;
149
+ }
150
+
143
151
get debug ( ) {
144
152
let sourceFileMap = this . get < Record < string , string > | "auto" > ( "debug.sourceFileMap" ) ;
145
153
if ( sourceFileMap !== "auto" ) {
Original file line number Diff line number Diff line change @@ -84,7 +84,9 @@ async function tryActivate(context: vscode.ExtensionContext): Promise<RustAnalyz
84
84
85
85
warnAboutExtensionConflicts ( ) ;
86
86
87
- ctx . pushCleanup ( configureLanguage ( ) ) ;
87
+ if ( config . typingContinueCommentsOnNewline ) {
88
+ ctx . pushCleanup ( configureLanguage ( ) ) ;
89
+ }
88
90
89
91
vscode . workspace . onDidChangeConfiguration (
90
92
( _ ) =>
You can’t perform that action at this time.
0 commit comments