-
Notifications
You must be signed in to change notification settings - Fork 420
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
Omnisharp ignoring exclude options in omnisharp.json #1460
Comments
It seems that documentation is not being clear about that - I will also move this issue to https://github.com/OmniSharp/omnisharp-roslyn repo. |
@filipw This doesn't work for projects either. They still get processed.
|
Actually, appears to be a documentation bug. The following with
|
Bumping into this with a gRPC project: omnisharp-roslyn is reporting problems found in a project's The principle of least astonishment suggests |
I have the same problem with obj and bin as stated, is there no way to disable it scanning a folder? Is this something that should be in requested features? |
Is it |
As a workaround for
|
@aarononeal thanks 🤦♂ I corrected the docs. |
Roslyn seems to be scanning auto-gen files from the Unity Library folder, and I've tried several different versions of the globs above to exclude the respective .csproj files, but none of them seemed to work. I'll be disabling Roslyn for now, but if anyone has a workaround, specifically for this use case, I'd highly appreciate it. |
globbing doesn't work properly for |
Coming here from #1766. The description for
I feel like after reading everything here, that isn't truly representative of what it does. If it cannot actually exclude files from scanning, I think we should have a different description there. Ideally, the warning wouldn't be necessary. Maybe something like this would be better:
|
As for excluding specific files from the project, I have to agree with @zgramana:
Most of the warnings in my project are from this directory. It makes real errors incredibly difficult to find. If the feature of adding excluded files and directories from actual scanning is not planned, those directories should at least be off by default, since we as developers have little control over their output. |
I think this is semantics - Omnisharp doesn't ever "discover" .cs files since MsBuild does it. The only files OmniSharp would discover would be "sln/csproj". Plus, there is a warning just below that explains just that (in bold!) - |
Omnisharp isn't honoring my excludeSearchPatterns option. I have tried restarting it multiple times, trying multiple patterns ignoring libs. Such as:
Am I just confused?
|
I think the reason is that once it's using the solution file, it will discover all the projects in the solution. And here is no way to ask omnisharp to disregard a .sln file if it exists in your root workspace. |
I've left aside that project a while ago so I'll answer the best I can. Well they're not in my root workspace, but divided in a libs folder. |
I just tested it out: If there is any .sln file in your workspace(including subfolders), Omnisharp will always try to open one of them and use it as the entry point for discovery and I simply can not stop this behavior. And, Yes, it will include those projects which are referenced but not in solution. |
Solution Filter maybe can help |
Did someone managed to make it work with solution filter and has a working example to share? |
Issue Description
Cannot use FileOptions to prevent Omnisharp from processing unwanted directories using the FileOptions. Also cannot prevent RoslynExtensions (Roslynator) from processing directories. Tried using omnisharp.json in project folder and omnisharp.json in user folder. It does load RoslynExtensionOptions but FileOptions does not appear to work.
Steps to Reproduce
Create a project, put .cs files in a folder, add exclude options like shown here https://github.com/OmniSharp/omnisharp-roslyn/wiki/Configuration-Options
Expected Behavior
Files are not parsed by omnisharp, and problems are not highlighted by Roslynator
Actual Behavior
Directory is processed.
Environment information
VSCode version: 1.33.1
C# Extension: 1.18.0
Dotnet Information
.NET Core SDK (reflecting any global.json): Version: 2.2.203 Commit: e5bab63ecaRuntime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.203\
Host (useful for support):
Version: 2.2.4
Commit: f95848e524
.NET Core SDKs installed:
1.1.0 [C:\Program Files\dotnet\sdk]
2.2.203 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: