Closed bitinn closed 1 week ago
The best option is for Unity to decorate these APIs with the EditorBrowsable attribute.
I don't see the C# extension solving this problem.
@richlander I could request it, but there is a problem:
Here is no Deprecated
key for EditorBrowsableState
, meaning there is no way to tell IntelliSense "we want to deprioritize this class in suggestion".
The Advanced
key not well supported and doesn't change display order neither, I believe: https://github.com/dotnet/roslyn/issues/19940
@bitinn @richlander As always, the situation is nuanced:
With regards to preferring if
over iPhoneSettings
: VS Code extensions don't have any control over how the list is filtered as you type. We provide the full list of items up front VS Code makes all decisions about what order to choose things.
The best we could do would be for all of the bullet points above to get implemented, in which case iPhoneSettings would always be hidden. However, there's no way for us to use EditorBrowsable data to drive how matches are selected as you type.
I'll keep this open in our backlog as a feature request.
@rchande Thx, I have opened a fix report to Unity, hopefully they will eventually add the EditorBrowsableState.Never
to this class.
This is a very annoying issue I have to admit. Really hope something can be done.
I'd like to chime in to say this impacts me as well.
Much of the time if I quickly type "int" and spacebar it changes to "iPhoneSettings". Over a long period of time this had been a rather large drain on my productivity.
workaround: "editor.snippetSuggestions": "top"
workaround:
"editor.snippetSuggestions": "top"
This works. However I'm also getting a full-blown foreach now instead of just the keyword :/ This issue is annoying as fruits :(
Would it be too inconvenient/hard/clumsy/expensive to keep a mini database of the amount of times each word was used and suggest first the most used one that matches what's being typed?
I am frustrated by this one as well. Especially IPhoneSettings often appearing when I want to type if
or int
. Would it be possible to always prefer such basic language keywords over imported classes?
Closing as the fix for this issue is outside the C# extension.
Issue Description
UnityEngine has a deprecated public class
iPhoneSettings
, which always show beforeif
for me. It lives underUnityEngine
namespace so I can't avoid importing it.Since very few class names start with lowercase letters, I wonder if I could control the order of this specific example. Or just exclude classes with lowercase letters from suggestions.
(Also I would like to confirm this behaviour is by-design: this plugin will always list
iClass
beforeif
when typing on a newline?)Steps to Reproduce
Open any Unity project repo, create a new script, import
UnityEngine
namespace, and type.Expected Behavior
Prefer to list
if
overiPhoneSettings
as it's more likely to be used (given context).Actual Behavior
iPhoneSettings
always listed beforeif
.Logs
N/A
OmniSharp log
N/A
C# log
N/A
Environment information
VSCode version: 1.33.1 C# Extension: 1.18.0
Mono Information
OmniSharp using global mono :5.18.1Dotnet Information
.NET Core SDK (reflecting any global.json): Version: 2.2.105 Commit: 7cecb35b92 Runtime Environment: OS Name: Mac OS X OS Version: 10.14 OS Platform: Darwin RID: osx.10.14-x64 Base Path: /usr/local/share/dotnet/sdk/2.2.105/ Host (useful for support): Version: 2.2.3 Commit: 6b8ad509b6 .NET Core SDKs installed: 2.1.4 [/usr/local/share/dotnet/sdk] 2.2.105 [/usr/local/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |applescript|idleberg|0.14.2| |csharp|ms-vscode|1.18.0| |mel|sator-imaging|0.1.2| |python|ms-python|2019.3.6139| |shader|slevesque|1.1.4| |shaderlabvscodefree|amlovey|1.1.3| |unity-debug|Unity|2.7.2| |vscode-jade-snippets|mrmlnc|1.0.1|;