Skip to content

Incorrectly excluded directory #464

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

Open
fw623 opened this issue Apr 27, 2023 · 1 comment
Open

Incorrectly excluded directory #464

fw623 opened this issue Apr 27, 2023 · 1 comment

Comments

@fw623
Copy link

fw623 commented Apr 27, 2023

A problem I had was that some references remained unresolved by the language server although they were correct.
The problem turned out to be that they were under a target directory, which is excluded by the language server, as seen in the following snippet.

private val excludedPatterns = listOf(".*", "bazel-*", "bin", "build", "node_modules", "target").map { FileSystems.getDefault().getPathMatcher("glob:$it") }

Solution

I think ideally, the language server should do something more sensible than using the hardcoded exclusion rules and allow customization of that behaviour via options.

But for now, a workaround is to symlink the incorrectly excluded directories to a non-excluded name.
E.g. in my case I used ln -s target trgt.

@fwcd
Copy link
Owner

fwcd commented May 2, 2023

I agree, the current solution is not optimal and we should either query the build system (ideal) or at least the .gitignore as a heuristic on which files to exclude. Letting the user configure these exclusions manually could be convenient too. There's a todo comment a few lines above that addresses this:

// TODO: Read exclusions from gitignore/settings.json/... instead of
// hardcoding them

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