-
Notifications
You must be signed in to change notification settings - Fork 184
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
Ability to exclude paths from lsp_goto_diagnostic
#2112
Comments
I made a PR #2113 to ignore diagnostics for files within There is no general functionality to configure other files or folders where diagnostics should be ignored, but I know that some language servers have a custom setting for that (e.g. Julia server). |
Does supporting |
@rchl I'm afraid it does not. Ideally I should still be able to see the references, go to definitions, see auto completions, etc. etc. of all the external libraries. If I exclude the folders at project level I'll lose all that ability afaik. It's just that I don't care about the diagnostics in external code. I would love if there was a general setting to at least filter out parts of a project from diagnostics listing (if not checking as well). Would it be easier or make more sense to implement on the specific server (omnisharp), should I close this and create a new issue there? |
Maybe I'm wrong but I don't think But having an option in the server for ignoring diagnostics in non-user code sounds good to me. Maybe (hopefully) the server has more knowledge to be able to tell whether something is "user code" or not. Though I imagine it could be tricky, depending on the language. |
I wanted to confirm this, cloned the LSP repo into the packages folder and installed dependencies, restarted ST. LSP works alright but I still get the diagnostics from an excluded folder. Below is my sublime-project file. {
"folders":
[
{
"path": ".",
"folder_exclude_patterns": [".svn", "Library", "Logs", "obj", "Temp"],
"file_include_patterns": ["*.cs", "*.md", "*.sublime-project", "*.sublime-workspace", "*.txt", "*.shader", "*.bat", "*.csproj", "*.sln"]
}
],
} The listed folders are excluded from the side bar and the GoTo actions so the |
Works for me. Can you provide output of |
"C:\Users\sarper\AppData\Local\Sublime Text\Package Storage\LSP-OmniSharp\OmniSharp.exe" --languageserver
{}
{
"csharp": {
"format": {
"enable": true
},
"maxProjectFileCountForDiagnosticAnalysis": 1000,
"referencesCodeLens": {
"enabled": true,
"filteredSymbols": []
},
"semanticHighlighting": {
"enabled": true
},
"suppressHiddenDiagnostics": true,
"testsCodeLens": {
"enabled": true
}
},
"omnisharp": {
"defaultLaunchSolution": null,
"enableAsyncCompletion": false,
"enableDecompilationSupport": false,
"enableEditorConfigSupport": true,
"enableImportCompletion": false,
"enableMsBuildLoadProjectsOnDemand": false,
"enableRoslynAnalyzers": false,
"loggingLevel": "information",
"maxFindSymbolsItems": 1000,
"maxProjectResults": 250,
"minFindSymbolsFilterLength": 0,
"organizeImportsOnFormat": false,
"useEditorFormattingSettings": true
},
"razor": {
"format": {
"enable": true
}
}
}
{
"FrameworkPathOverride": "${storage_path}/LSP-OmniSharp/.msbuild/Current"
} Active view
{
"auto_complete_selector": "meta.tag, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",
"lsp_active": true,
"syntax": "Packages/C#/C#.sublime-syntax"
}
Project / Workspace
[
"E:\\project\\breakout"
]
{
"folders": [
{
"file_include_patterns": [
"*.cs",
"*.md",
"*.sublime-project",
"*.sublime-workspace",
"*.txt",
"*.shader",
"*.bat",
"*.csproj",
"*.sln"
],
"folder_exclude_patterns": [
".svn",
"Library",
"Logs",
"obj",
"Temp"
],
"path": "."
}
]
} LSP configuration{
"diagnostics_highlight_style": {
"error": "",
"hint": "",
"info": "",
"warning": ""
},
"diagnostics_panel_include_severity_level": 2,
"document_highlight_style": "underline",
"show_code_actions": "",
"show_code_actions_in_hover": false,
"show_diagnostics_panel_on_save": 0,
"show_diagnostics_severity_level": 0,
"show_multiline_diagnostics_highlights": false,
"show_references_in_quick_panel": true
} System PATH
|
Thanks. |
Thank you, I've applied the changes in the commit #2142 but I'm still getting the same diagnostics listed. Did I change the correct source file at |
Yes, that should be the correct file. But you could try just checking out the PR branch since it's in the same repo. I've also added some debug prints to that branch so you can try with that and post the results you get in the ST console. |
This is what I get when I open the should-be-ignored file.
|
And this is the actual path in the os filesystem |
Right. Then this needs more work to get it right on Windows. |
I think the latest commit might work. EDIT: Or maybe not. There might still be an extra leading |
Sure, here is the log. Diagnostics still show up though.
|
Thanks. So yes, needs more work to normalize paths to use forward slashes and handle situations with initial |
When I invoke
lsp_goto_diagnostic
I want to see diagnostics of my own code only, but currently it also shows all the diagnostics from external libraries within the project.It seems
folder_exclude_patterns
in the sublime-project doesn't effect this feature either.I want to be able to exclude a bunch of paths from diagnostics checking and listing.
The text was updated successfully, but these errors were encountered: