microsoft / microsoft/vscode-dotnettools

Unity Package fails to locate Analyzers when VS Code is installed by Scoop

Open
#331 13 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area-unity enhancement
Dominant language
No language data
Stars
321
Forks
54
Avg merge
2d 19h
Merged PRs (30d)
2

Description

Describe the Issue

I am encountering an issue with "Unity for Visual Studio Code". Intellisense suggests that a private variable decorated with "SerializeField" should be readonly. However, making the field readonly causes it to disappear from the unity editor, which seems incorrect behavior. Is there a way to hide this suggestion?

Code_k6X8CrfdOx

Steps To Reproduce
  1. Create a new Unity project
  2. Create a monobehaviour scirpt
  3. Add a private variable decorated with "SerializeField"
  4. IntelliSense complains that it should be "readonly"
Expected Behavior

Intellisense should not complain about making a variable readonly if it is decorated with "SerializeField".

Environment Information
  • Unity 2021.3.6f1
  • Extension Version: 0.9.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the diagnostic in a Unity 2021.3.6f1 project with Unity for Visual Studio Code 0.9.0, using a private SerializeField variable. Then trace which analyzer reports the readonly suggestion and verify that the suggestion is suppressed for serialized fields without changing other readonly diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity, vscode
Domain
devtools, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.