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 380380 "default" : false ,
381381 "type" : " boolean"
382382 },
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+ },
383388 "$generated-start" : {},
384389 "rust-analyzer.assist.expressionFillDefault" : {
385390 "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 {
1616 readonly extensionId = "rust-lang.rust-analyzer" ;
1717
1818 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 } ` ) ;
2226 private readonly requiresReloadOpts = [
2327 "cargo" ,
2428 "procMacro" ,
@@ -140,6 +144,10 @@ export class Config {
140144 return this . get < boolean > ( "restartServerOnConfigChange" ) ;
141145 }
142146
147+ get typingContinueCommentsOnNewline ( ) {
148+ return this . get < boolean > ( "typing.continueCommentsOnNewline" ) ;
149+ }
150+
143151 get debug ( ) {
144152 let sourceFileMap = this . get < Record < string , string > | "auto" > ( "debug.sourceFileMap" ) ;
145153 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
8484
8585 warnAboutExtensionConflicts ( ) ;
8686
87- ctx . pushCleanup ( configureLanguage ( ) ) ;
87+ if ( config . typingContinueCommentsOnNewline ) {
88+ ctx . pushCleanup ( configureLanguage ( ) ) ;
89+ }
8890
8991 vscode . workspace . onDidChangeConfiguration (
9092 ( _ ) =>
You can’t perform that action at this time.
0 commit comments