Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for analyzers #683

Closed
frarees opened this issue Feb 12, 2021 · 3 comments
Closed

Support for analyzers #683

frarees opened this issue Feb 12, 2021 · 3 comments

Comments

@frarees
Copy link
Contributor

frarees commented Feb 12, 2021

~/.omnisharp/omnisharp.json

{
  "cake": {
     "enabled": false
  },
  "script": {
     "enabled": false
  },
  "RoslynExtensionsOptions": {
    "enableAnalyzersSupport": true,
    "locationPaths": [
      "./extensions/Microsoft.Unity.Analyzers.dll"
    ]
  },
  "FormattingOptions": {
    "EnableEditorConfigSupport": true
  }
}

This doesn't seem to load Microsoft.Unity.Analyzers.dll. IIRC OmniSharp already has some support for them, so maybe it's me not setting things up properly, or omnisharp-vim not supporting this yet?

@nickspoons
Copy link
Member

Does this config get you Unity analyser support in vscode?

@frarees
Copy link
Contributor Author

frarees commented Feb 13, 2021

Setting up vscode helped me understand the constraints.

locationPaths is treated as a relative path from the loaded sln, even when using a global omnisharp.json. I was also using a path to a specific dll which was wrong. In my specific case, I ended up using "Library/Analyzers", and placed the .dll file there.

Aside, it seems it doesn't priorize the analyzer. So for example:

private void FixedUpdate()
{
}

Using ALE it hints me IDE0051: Private member is unused. But if I launch code actions, I can see the additional UNT0001: Remove empty Unity message.

Is there any way to control diagnostics priority or order?

@frarees
Copy link
Contributor Author

frarees commented Feb 14, 2021

Is there any way to control diagnostics priority or order?

Actually, the concept I was behind is suppressors, and support is not available yet (see OmniSharp/omnisharp-roslyn#1711).

@frarees frarees closed this as completed Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants