C
C#16mo 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
OxyOP16mo ago
Result after inputing "
Oxy
OxyOP16mo ago
I can prevent it by using Esc but it's boring to do for every methods
Oxy
OxyOP16mo ago
You can observe exactly the same behavior on https://sharplab.io
SharpLab
C#/VB/F# compiler playground.
Oxy
OxyOP16mo ago
But it has been a long time so I think it's not a particular issue of c# dev kit
333fred
333fred16mo ago
Please use the command palette to file an issue on the C# extension (not devkit)
Oxy
OxyOP16mo ago
Okay I just wanted to see if someone else was having the same issue
333fred
333fred16mo ago
Hmm, actually, I cannot reproduce that
Oxy
OxyOP16mo ago
Even on sharplab.io ?
333fred
333fred16mo ago
Don't use sharplab as a testbed for this
Oxy
OxyOP16mo ago
Okay you are not using copilot ?
333fred
333fred16mo ago
I love it, but the editor support is terrible, and only marginally related to what vscode does
Oxy
OxyOP16mo ago
Yeah you're right I'm saying that because the completion behavior is totally different with copilot
333fred
333fred16mo ago
Copilot shouldn't have an impact on this behavior Really
Oxy
OxyOP16mo ago
Yeah I'd like to rec a little something to show you But I'm not having the same issue at least
333fred
333fred16mo ago
Not sure what copilot is doing for you there then. I cannot repro this with copilot enabled or disabled
Oxy
OxyOP16mo ago
I should have showed that first
Oxy
OxyOP16mo ago
Oxy
OxyOP16mo ago
C# is in prerelease as hinted when installing c# dev kit c# dev kit is not
333fred
333fred16mo 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
OxyOP16mo 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
333fred16mo ago
Oh, that could very well be it I have that off Yup, that's it
Oxy
OxyOP16mo ago
Oh you can reproduce it now ?
333fred
333fred16mo 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
OxyOP16mo ago
Okay your help was precious I have a track now I'm on azerty maybe that's related
333fred
333fred16mo ago
Nope
Oxy
OxyOP16mo ago
And linux (x11) That could be a x issue
333fred
333fred16mo ago
We're saying that " is a character that should accept suggestions We shouldn't be doing that
Oxy
OxyOP16mo ago
Yeah indeed
333fred
333fred16mo ago
Trust me. It's not a bug related to your environment
Oxy
OxyOP16mo ago
Okay I'll link that issue here as soon as I wrote it, is it good for you ?
333fred
333fred16mo ago
👍
Oxy
OxyOP16mo ago
(Just to be sure, I guess this is the window)
333fred
333fred16mo ago
That's the one Good news: it may already be about to be fixed
Oxy
OxyOP16mo 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
OxyOP16mo ago
Oopsie I didn't see I can close it if you want
333fred
333fred16mo ago
No worries
ero
ero16mo 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
OxyOP16mo 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
Accord16mo 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.
Want results from more Discord servers?
Add your server