#VSCode autocomplete bug

1 messages · Page 1 of 1 (latest)

peak salmon
#

Hello, I've recently setup VSCode as my editor for unity and I'm getting a weird autocomplete bug.

When I type void OnTri and hit Tab/Enter to autocomplete to the displayed void OnTriggerEnter... it instead autocompletes to void OggerEnter....

How do I fix this?

#

I've seen this post:
https://www.reddit.com/r/Unity3D/comments/1k7vcbt/vscode_weird_autocomplete/

Setup:

  • Unity Editor 6.3 LTS (6000.3.7f1)
  • VSCode no updates available.
  • .NET SDK 10.0.102 (x64)
  • C# Dev Kit installed
  • I don't have Unity Code Snippets installed.

I tried:

  • setting "omnisharp.useModernNet": true (edit: removed typo)
  • Regenrating project files.
  • ensuring I opened project from the unity project root.
Reddit

Explore this post and more from the Unity3D community

#

From consulting my LLM, I've tried:

  • a bunch of nonsense
  • setting "editor.suggest.insertMode": "replace"

Sadly non of the things I've tried so far has fixed the bug.

safe portal
#

You mention "omnisharp.useModerNet": true but the option is "omnisharp.useModernNet": true

peak salmon
#

Typo. My bad. I have set - "omnisharp.useModernNet": true. and it didn't solve the bug.

#

Do you get the same autocomplete behavior?

hasty needle
#

i do, yeah

#

i tend to not use those snippets out of habit though

safe portal
trim harbor
#

This as well as the first { of a function not being moved to the next line made me ditch vs code for VS ages ago

wind current
#

Seems to work just fine for me.

trim harbor
#

thats good, i tried last over 1 year ago and I dont wish to move back
I always use VS if possible

wind current
#

I used to compare VS Code with VS on every new VS release and VS consistently performed worse in every way (startup time, intellisense responsiveness, memory usage, etc). Haven't done that for VS 2026 though, because at this point I wouldn't consider moving to VS anymore.

#

But OP isn't really asking for a comparison anyways.

trim harbor
#

Thats true but its worth noting that omnisharp is the old .net plugin so who knows whats different feature wise between that and the new one

#

may also explain things working better now

wind current
#

Yeah if OP has C# Dev Kit installed, I'm not sure why they would be using O#.

trim harbor
#

may be why it didnt get fixed because the setting is not even used

hasty needle
#

is omnisharp even its own extension? i couldn't find it

#

there are some options in c# prefixed with "omnisharp"

wind current
#

Pretty sure the C# extension (not the C# Dev Kit extension) by default doesn't use O#, you have to explicitly turn it on to make it use O#, which I don't see why you would ever do that.

#

Actually if you have C# Dev Kit installed, turning on O# doesn't even work anyways.

#

Regardless, fairly certain all the options related to O# is just red herring, it shouldn't affect anything.

#

I just checked my VS Code settings related to C#, I don't have anything out of the ordinary set.

#

I would recommend OP try with a clean VS Code profile with just C# + C# Dev Kit + Unity extension installed, and see if the problem also exists there. If not, then it would suggest the problem is with some other extension you are using.

hasty needle
#

hm i can't replicate this issue right now, though ive definitely encountered it in the past. i don't remember doing anything specifically to fix it, and my c# settings are all default

wind current
#

It happened some years ago with one bad C# extension release and they fixed it afterwards.

#

That's the only time I remember this happening to me.

hasty needle
#

huh, could be that

#

@peak salmon make sure your vscode and extensions are up to date

wind current
#

Oh right, I just assumed OP is using latest.

peak salmon
wind current
#

Yep.

peak salmon
#

I've used VS Code in the past for programming in other languages. I didn't like the initial config with VS. So I want to try out a setup with VS Code and if I feel limited I'll take some time to setup VS.
That being said I'm new to C# and Unity.

#

When I type everything in lowercase it works.
If changing settings etc. doesn't work, I could just work on getting capitalization out of my muscle memory.
I was lowkey hoping a setup with VS Code + Unity will be popular enough that more people ran into the problem and have a setting/fix that I'm just not aware of^^.

wind current
#

Have you tried what I've suggested to debug the issue?

wind current
#

But also check your extension version as suggested by @hasty needle.

peak salmon
#

I'm working on it now.

#

So far I've been using:
Visual Studio Code - Version: 1.109.1
Extensions:
C# - Version: 2.120.3
C# Dev Kit - Version: 2.10.3
Unity - Version: 1.2.1

peak salmon
# wind current I would recommend OP try with a clean VS Code profile with just C# + C# Dev Kit ...

Autocomplete works now. I've created a clean profile and only have the following extensions:

  • .NET Install Tool
  • C#
  • C# Dev Kit
  • Unity
  • (disabled) GitHub Copilot Chat

On the profile where it doesn't work I have additionally:

  • DotENV
  • GitHub Copilot Chat
  • WSL
    I'll test if any of the extensions are the cause. If not then I'll assume its some Profile setting and I'll have to figure out a way to find which one it is^^.
wind current
#

VS Code has an extension bisect to help you isolate the issue if you've got tons of extensions, but it seems like you don't have that many so it's probably faster to just try one by one.

#

It does seem odd that it works for you with lower case typing but not upper case though.

peak salmon
#

I can't seem to get it to work again.
I've completely reinstalled VS Code and removed all personal settings.
I've tried reducing the amount of AI interference.
Here is my profiles settings.json
{
"chat.agent.enabled": false,
"chat.disableAIFeatures": true,
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.acceptSuggestionOnEnter": "off",
"editor.inlineSuggest.enabled": false,
"dotnetAcquisitionExtension.enableTelemetry": false,
"telemetry.editStats.enabled": false,
"telemetry.feedback.enabled": false,
"workbench.startupEditor": "none"
}

#

I think its also weird that it behaves differently when i press tab to auto complete right away vs. manually getting suggestions via ctrl + space.

#

Not typing void or not capitalizing any letter also seem to work.

wind current
peak salmon
#

It works! Thank you for helping me ❤️

peak salmon
#

Well it fixed the autocomplete for "void OnTrig..." but it didn't fix it for "private void OnTrig...".

wind current
#

🤣

#

Sounds like it's time to open a bug report.

#

Tbh I never type the private void part, and I guess that probably contributes to why people haven't noticed this.