-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to circumvent 'smart' comment continuation #12928
Comments
Unless you have onEnter command registered you shouldn't be getting rust analyzer's behavior here. Could be that this may be another extension or vscode configuration? If you have many extensions you can try and find which one might be introducing this functionality via extension bisecting: https://code.visualstudio.com/blogs/2021/02/16/extension-bisect |
I have disabled all extensions except for RA Not sure which vscode setting could be relevant here? // Place your settings in this file to overwrite the default settings
{
"workbench.colorTheme": "Default Light+",
"typescript.check.npmIsInstalled": false,
"editor.mouseWheelScrollSensitivity": 2,
"telemetry.telemetryLevel": "off",
"files.watcherExclude": {
"**/target/**": true
},
"rewrap.wrappingColumn": 100,
"gitlens.codeLens.enabled": false,
"gitlens.currentLine.enabled": false,
"gitlens.hovers.currentLine.over": "line",
"gitlens.statusBar.command": "gitlens.toggleFileBlame",
"gitlens.hovers.avatars": false,
"gitlens.views.fileHistory.avatars": false,
"gitlens.views.repositories.avatars": false,
"gitlens.views.lineHistory.avatars": false,
"gitlens.views.search.avatars": false,
"gitlens.blame.avatars": false,
"gitlens.menus": {
"editor": false,
"editorGroup": {
"blame": true,
"compare": true
},
"editorTab": {
"clipboard": true,
"compare": true,
"history": true,
"remote": true
},
"explorer": {
"clipboard": true,
"compare": true,
"history": true,
"remote": true
},
"scmGroup": {
"compare": true,
"openClose": true,
"stash": true,
"stashInline": true
},
"scmItem": {
"clipboard": true,
"compare": true,
"history": true,
"remote": true,
"stash": true
}
},
"gitlens.advanced.telemetry.enabled": false,
"extensions.ignoreRecommendations": true,
"rust-analyzer.lens.enable": false,
"rust-analyzer.cargo.buildScripts.enable": false,
"rust-analyzer.procMacro.enable": false,
"rust-analyzer.diagnostics.disabled": [
"unlinked-file", // I guess for "normal" projects unlinked files are strange, for me they are common
"missing-match-arm", // https://github.com/rust-lang/rust-analyzer/issues/4896
"type-mismatch", // https://github.com/rust-lang/rust-analyzer/issues/1109
"unresolved-module", // https://github.com/rust-lang/rust-analyzer/issues/9173
"unresolved-extern-crate", // https://github.com/rust-lang/rust-analyzer/issues/12926
],
"rust-analyzer.checkOnSave.overrideCommand": [
"cargo", "check", "--lib", "--bins", "--tests", "--examples", "--workspace", "--message-format=json"
],
"editor.showUnused": false,
"keyboard.dispatch": "keyCode",
"files.exclude": {
"**/.*.cache": true,
"**/*.glob": true,
"**/*.vos": true,
"**/*.vok": true,
"**/*.vo": true,
},
"editor.inlayHints.enabled": "offUnlessPressed",
"editor.semanticTokenColorCustomizations": {
"rules": {
"*.unsafe:rust": "#eb5046"
}
},
"editor.acceptSuggestionOnEnter": "off",
} |
For now I think #10384 should be reverted. There exists the |
I think a config is better here, the onEnter handler has several problems which is why #10384 came to be. I'll add a config for this shortly. |
When my cursor is at the end of a doc comment line (
//! foo
), no matter whether I hit Enter or Shift-Enter, RA tries to be 'smart' and insert a//!
into the next line. That is quite annoying, I often want to type something else after the doc comment! I don't know why RA thinks it can guess whether I want to continue the comment or not; that is inherently unknoweable and should be indicated explicitly by the user (e.g., other editors use Enter for just a plain newline and Shift-Enter for smart newline with comments).The documentation in https://github.com/lnicola/rust-analyzer/blob/master/crates/ide/src/typing/on_enter.rs indicates that I need to configure something to get RA's smart enter behavior. However I have deliberately not configured this, and still I am getting the 'smart' behavior.
@bjorn3 once told me that Shift-Enter is a way to bypass smart enter handling by extensions, but it doesn't have any effect here -- even Shift-Enter.
Is there a way to opt-out of this 'smart' behavior?
The text was updated successfully, but these errors were encountered: