C
C#2y ago
Oxy

❔ C# dev kit completion "args"

Hey I'm trying vscode and I stumbled upon this behavior that seems strange. When it autocompletes after opening (), it completes with the named argument args even if I don't take it (by doing ", to input a string myself) Can I disable this behavior ?
40 Replies
Oxy
OxyOP2y ago
Result after inputing "
Oxy
OxyOP2y ago
I can prevent it by using Esc but it's boring to do for every methods
Oxy
OxyOP2y ago
You can observe exactly the same behavior on https://sharplab.io
SharpLab
C#/VB/F# compiler playground.
Oxy
OxyOP2y ago
But it has been a long time so I think it's not a particular issue of c# dev kit
333fred
333fred2y ago
Please use the command palette to file an issue on the C# extension (not devkit)
Oxy
OxyOP2y ago
Okay I just wanted to see if someone else was having the same issue
333fred
333fred2y ago
Hmm, actually, I cannot reproduce that
Oxy
OxyOP2y ago
Even on sharplab.io ?
333fred
333fred2y ago
Don't use sharplab as a testbed for this
Oxy
OxyOP2y ago
Okay you are not using copilot ?
333fred
333fred2y ago
I love it, but the editor support is terrible, and only marginally related to what vscode does
Oxy
OxyOP2y ago
Yeah you're right I'm saying that because the completion behavior is totally different with copilot
333fred
333fred2y ago
Copilot shouldn't have an impact on this behavior Really
Oxy
OxyOP2y ago
Yeah I'd like to rec a little something to show you But I'm not having the same issue at least
333fred
333fred2y ago
Not sure what copilot is doing for you there then. I cannot repro this with copilot enabled or disabled
Oxy
OxyOP2y ago
I should have showed that first
Oxy
OxyOP2y ago
Oxy
OxyOP2y ago
C# is in prerelease as hinted when installing c# dev kit c# dev kit is not
333fred
333fred2y ago
They're both prerelease, but dev kit doesn't matter here The C# extension is what is providing completion I'm trying to figure out if there's some VSCode setting that controls accepting completions on "
Oxy
OxyOP2y ago
The interesting options I found in my settins.json
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.organizeImportsOnFormat": true,
"omnisharp.enableLspDriver": true,
"omnisharp.enableDecompilationSupport": true,
"dotnet.inlayHints.enableInlayHintsForParameters": true,
"dotnet.inlayHints.enableInlayHintsForLiteralParameters": true,
"dotnet.inlayHints.enableInlayHintsForIndexerParameters": true,
"csharp.inlayHints.enableInlayHintsForTypes": true,
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true,
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.organizeImportsOnFormat": true,
"omnisharp.enableLspDriver": true,
"omnisharp.enableDecompilationSupport": true,
"dotnet.inlayHints.enableInlayHintsForParameters": true,
"dotnet.inlayHints.enableInlayHintsForLiteralParameters": true,
"dotnet.inlayHints.enableInlayHintsForIndexerParameters": true,
"csharp.inlayHints.enableInlayHintsForTypes": true,
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true,
I also have this "editor.acceptSuggestionOnCommitCharacter": true I will disable it and try again
333fred
333fred2y ago
Oh, that could very well be it I have that off Yup, that's it
Oxy
OxyOP2y ago
Oh you can reproduce it now ?
333fred
333fred2y ago
This does still feel buggy to me though: " shouldn't be a commit character in an argument list Please do file that bug
Oxy
OxyOP2y ago
Okay your help was precious I have a track now I'm on azerty maybe that's related
333fred
333fred2y ago
Nope
Oxy
OxyOP2y ago
And linux (x11) That could be a x issue
333fred
333fred2y ago
We're saying that " is a character that should accept suggestions We shouldn't be doing that
Oxy
OxyOP2y ago
Yeah indeed
333fred
333fred2y ago
Trust me. It's not a bug related to your environment
Oxy
OxyOP2y ago
Okay I'll link that issue here as soon as I wrote it, is it good for you ?
333fred
333fred2y ago
👍
Oxy
OxyOP2y ago
(Just to be sure, I guess this is the window)
333fred
333fred2y ago
That's the one Good news: it may already be about to be fixed
Oxy
OxyOP2y ago
GitHub
[Completion] " as commit character · Issue #5988 · dotnet/vscode-cs...
Type: Bug Issue Description When using the C# extension and with the option "editor.acceptSuggestionOnCommitCharacter": true " seems to be incorrectly considered as a commit characte...
Oxy
OxyOP2y ago
Oopsie I didn't see I can close it if you want
333fred
333fred2y ago
No worries
ero
ero2y ago
I have this issue as well fwiw If this is a top-level file, args shows up because it's passed by default
Oxy
OxyOP2y ago
Yeah it's related to the commit option, if you disable it you won't have this issue anymore "editor.acceptSuggestionOnCommitCharacter": true This one, if you don't need it you can put that to false It's true by default It will be fixed soon anyway Oh but you're the ero from speedrun serv 👋
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?