-
Notifications
You must be signed in to change notification settings - Fork 93
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
Allow ignoring some directories (or specifying a "root directory") for language server #398
Comments
As a note, in the mode where this is reported (which is in poll mode) it should be possible to filter it (I just haven't made it customizable yet). But note that this is also mostly a warning (when it gets to 20 levels deep it stops recursing that directory structure and notifies about it, but it shouldn't be the source of errors -- unless you actually had This is to say that I'll probably make that customizable in the poll mode, but this shouldn't be the cause for undefined keywords... |
Yeah, after revisiting this it was totally unrelated to the missing keywords, I resolved that eventually. I still think this would be a nice enhancement to avoid traversing large chunks of the filesystem unnecessarily, though. |
@fabioz I ran into this again, and I'm wondering if I misremembered the issue I had seen previously. In this case I don't see red squigglies or anything, but completion, "go to definition", etc. do not work, and I think it's happening because the server is spending so much time traversing the extra directories unnecessarily. This log in particular (stuck in among all the
I see about 10 of these in my log over the last 2-3 minutes since I opened a |
I've just implemented this. See: https://github.com/robocorp/robotframework-lsp/blob/master/robotframework-ls/docs/faq.md#how-to-change-the-file-watch-mode for details on how to set it. (it'll be available for the next release, which should be 1-2 weeks away, but you can get a pre-release by downloading the .vsix from https://github.com/robocorp/robotframework-lsp/actions/runs/1075887279). |
@fabioz Thanks for working on this! I installed the vsix to try it out, but it looks like my glob patterns are not working quite as I would expect (slightly modified to scrub org-specific files but I think it's pretty representative): Relevant configuration: {
"robot.python.env": {
"ROBOTFRAMEWORK_LS_WATCH_IMPL": "fsnotify",
"ROBOTFRAMEWORK_LS_IGNORE_DIRS":
"[\"**/bazel-*\", \"**/my_org\", \"**/.bazel_out\"]"
},
"robot.language-server.args": [
"-vvv"
]
} Log output:
Some other examples:
Is there something I'm missing with the way these globs work? They seem to be defined roughly the same as e.g. It also seems like some of my rules do work as expected, i.e. if I create a
Any ideas? Thanks in advance, this looks very promising to make the extension usable for me! |
Can you try to set those patterns with i.e.: something as:
(if it was recursing it'd match it without the Also, right now you should set those environment variables in the system (or in the shell that starts vscode -- there are 2 places that'll read it and one will pick that up and the other won't). |
I tried setting the env var outside of Something I noticed just now is that my workspace does contain an infinite symlink loop, which is perhaps part of the problem? I realize this is a bit unusual and lots of tools don't handle it well, which is part of why I wanted to ignore it altogether, lol. Example:
There is a symlink I added both |
Can you get the latest version from: https://github.com/robocorp/robotframework-lsp/actions/runs/1078944316 (I added some logging to help diagnose it) and provide the full logs (following: https://github.com/robocorp/robotframework-lsp/blob/master/robotframework-ls/docs/reporting_issues.md)? |
Is your feature request related to a problem? Please describe.
Yes, when opening
.robot
files in my org's large monorepo, I see a ton of messages in the output like this (file paths abbreviated):These paths are behind symlinks and are in places that the robot language server really does not need to be traversing, since there are no robot libraries or resource files in those directories.
This also seems to lead to
Undefined keyword
errors, although the root cause of that may be different and I am still investigating.Describe the solution you'd like
Ideally, add a configuration option which can be treated like VSCode's
files.exclude
,.gitignore
, or similar. This would allow me to exclude specific directories from being traversed.Describe alternatives you've considered
From #238 it seems like the file watcher API being used might not have the ability to add ignored/excluded directories, so perhaps an alternative (in my use-case) would be to specify a "root" directory for the server to walk. In our repo, there is a top-level
robot
directory under which all of our.robot
files live, so this would solve the case for us. I imagine this is slightly less flexible in general, however.The text was updated successfully, but these errors were encountered: