Using `IgnoredCodeIssues` with legacy C# extension
See original GitHub issueEnvironment
- .NET CLI 1.0.0-preview1-002702
- Mac OS X 10.11
- VS Code version: 1.2.1
- C# Extension version: Legacy C# (Unity development)
Issue
There’s this annoying issue with Unity development and VS Code where you get 99+ warnings instantly upon loading your project because of using System;
at the top of virtually every Unity script.
Attempted, but Failed Solution
I found this Omnisharp Roslyn Issue (closed) which addresses what I am attempting to do, so I tried adding a omnisharp.json
file to my project root with:
{
"IgnoredCodeIssues": [
"^Unnecessary using directive.$"
]
}
This, as you may already suspect, borks everything and throws a similar error:
System.FormatException: Unsupported JSON token 'StartArray' was found.
Path 'IgnoredCodeIssues', line 2 position 27.
I‘ve described the problem and my failed solution, is there any hope?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:10 (5 by maintainers)
Top Results From Across the Web
How to Safely Extend your Legacy Code | by Daniel Rusnok
In this article, I want to present the techniques you can apply in the mentioned situations. Sprout method. When you are extending the...
Read more >Quickly testing legacy code - Clare Macrae [C++ on Sea 2019]
You've inherited some legacy code: it's valuable, but it doesn't have tests, and it wasn't designed to be testable, so you need to...
Read more >c# - How to disable the warning of Unnecessary Using of ...
i think issue has been addressed in latest version of omnisharp — because forced use legacy c# extension unity, solution remains unclear.
Read more >Как отключить предупреждение о ненужном использовании ...
... использовать legacy-расширение C# для Unity, то решение остается неясным. ... 'auto' type specifier is a C++11 extension [-Wc++11-extensions] (14, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the response @DustinCampbell
Updated Environment
The upgrade in C# extension seems to successfully replace the legacy extension with regards to mono support and working with Unity. Also, the warnings have indeed been downgraded to infos, and instead of showing 99+ it now explicitly counts 180 on my particular project.
But every file is still haunted with this…
Do you have any suggestions?
Yup. I totally agree that’s it’s pretty horrid. That’s why I’ll be taking a look at Remove Unnecessary Usings specific in 1.8.
Obsolete is probably not something I can help with – especially if it’s a generated project. I’d recommend touching base with Unity to add a <NoWarn> for obsolete warnings. Additionally, it might be worth adding a request for VS Code itself (e.g. https://github.com/Microsoft/vscode/issues) to allow turning off the display for info and warning in the Problems window.