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

Missing diagnostics due to "folder_exclude_patterns" with multiple project folders #2171

Closed
philer-jambit opened this issue Jan 16, 2023 · 2 comments · Fixed by #2237
Closed
Labels

Comments

@philer-jambit
Copy link

philer-jambit commented Jan 16, 2023

Describe the bug
A recent change has caused error messages to no longer get highlighted in my project. After some fiddling (with help on Discord) I figured out that I had a "folder_exclude_patterns" set in my Project settings. This was for a subfolder that was added as a separate project folder:

{
    "folders":
    [
        {
            "path": "my-project",
            "folder_exclude_patterns": ["frontend"],
        },
        {
            "path": "my-project/frontend",
            "name": "my-project/frontend",
        },
    ],
    // ...
}

As a result, errors reported by LSP-typescript and LSP-eslint within the my-project/frontend directory were being ignored and not rendered in my editor.

Note: I added the redundant frontend project folder a while ago because LSP-eslint needs the .eslintrc file to be found inside a project folder root. I then added the "folder_exclude_patterns" so I don't get duplicate entries in the ctrl+p file search.

Expected behavior
Errors should be reported for any folder listed in the project folders setting.

Environment (please complete the following information):

  • OS: Linus Mint 21.1
  • LSP: 1.21.0
  • Sublime Text: 4143
  • eslint, typescript (also pyright and a few others but not in this sub project)
@jwortmann
Copy link
Member

Oof... yeah that is a bug. The intention is to hide diagnostics (in the diagnostics panel and also the underline in the file if it were opened) for files which are not visible in the sidebar. For example third-party libraries which are added to "folder_exclude_patterns". I did not consider that you can add the same folder to the sidebar multiple times. Therefore

return "matches a pattern in folder_exclude_patterns"
is not a sufficient reason to hide a diagnostic. It should rather be something in the sense of "matches a file not visible in the sidebar". Unfortunately there is no ST API to check for that. So for a manual implementation of that, we need to compare all the folder paths included in the project file, to ensure that a folder hidden via "folder_exclude_patterns" is not also contained in another of the "folders" items.

That is not the only bug in the current implementation, though. I've already found and listed a few more at #2113 (comment). And some other project folder settings from https://www.sublimetext.com/docs/projects.html#folders-key, like the "folder_include_patterns", are currently ignored.

@rchl rchl added the bug label Jan 28, 2023
@alecmev
Copy link
Contributor

alecmev commented Mar 29, 2023

Hitting the same problem, I assume the only workaround is to not use folder_include_patterns for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants