My problem is that when I’m creating a variable, let’s say int
, and later I want to add the public modifier the word int
gets deleted (I think the reason is due to the C# extension). This would not be a problem if this didn’t happen when I press space.
When I press space, I should be able to not only accept the intellisense suggestion (in this case "public") but also add a space between the suggestion and the word that was before. This wasn’t an issue before but VS Code and the C# extension had an update this week that brought this awful change.
Any suggestion of how can I solve this problem?
I tried adding "editor.suggest.insertMode": "insert"
in settings.json
, but apparently that’s not where the problem is.
2
Answers
Based on VS code docs
What you can do is set the following setting to false:
From what I’ve read, this seems to be a bug. If I’m correct on that, there’s nothing you can do except wait for the bug to get fixed.
I googled "
site:github.com/dotnet/vscode-csharp/issues replace
" and found @id:editor.suggest.insertMode not honored #5801. The description of the issue there seems to match what you have described. No maintainers have commented there yet. You can give the issue ticket a thumbs up to show support for it, and subscribe to it to get notified about discussion and progress. Please avoid making noisy comments like "+1". I’m subscribed to the issue ticket and will update this answer post as new information arrives.