-
Notifications
You must be signed in to change notification settings - Fork 408
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
Add java.import.resourceFilter preference #1508
Comments
@fbricon could you look at this..? I can give you logs from what I see during startup if that helps... |
From the logs of vscode-java -> Using 'Java: Open Java language server log file' I see that the exclusions are properly forwarded as it seems (old log, ignore the rest):
I tried many combinations - not a single one of them work (even the very simple ones don't just specifying the foldername). OS: Windows 10 - globs shouldn't be FS-specific in regards to backslashes no? So I doubt that it has anything to do with it directly, maybe in the implementation? |
@thiscantbeserious @SreenivasVRao java.import.exclusions is used when importing a directory for a first time. |
I restart the server when emacs restarts - every few days. Shouldn't these
exclusions be checked when the server restarts? Are the imports cached
somewhere?
…On Fri, Jul 24, 2020, 12:28 Snjeza ***@***.***> wrote:
@thiscantbeserious <https://github.com/thiscantbeserious> @SreenivasVRao
<https://github.com/SreenivasVRao> java.import.exclusions is used when
importing a directory for a first time.
You may want to take a look at redhat-developer/vscode-java#1362 (comment)
<redhat-developer/vscode-java#1362 (comment)>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1508 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AENMNRWAZD6MS7L2NKRGLKLR5GZD7ANCNFSM4OZSMXDQ>
.
|
java.import.exclusions is checked only when you delete your workspace. You probably should use filteredResources.
to your .project file. |
I think it would be great if this could be exposed as a setting in the server. I have several java projects - and I'll have to manually modify each of these. Even if I miss it for any single project, the indexing of the workspace will happen and slow down the server. |
Totally agreed. I can understand that such a thing should be handled from the .project side rather then the workspace/userspace It does help with a larger number of legacy projects (but then, those are already handled once imported). So maybe more or less adjusting the behaviour of java.import.exclusions to handle both cases rather then a new setting? It's somewhat of a EDGE case, but then again, I'd say more people will run into this issue from time to time as it is - so either that or a better documentation in that regard would help. Can we contribute to the docs? |
I'm still seeing this problem. Seems like the workspace refreshes before the configuration is loaded? Is this a setting I need to change on my end? For example, I see
Seems like the configuration for resource filters is not applied when the server is launching? Would this be fixed if these two lines were swapped? |
No, it wouldn't. |
Ah, I'm using emacs/lsp-java. I will try to retrieve a configuration, but it's a little tricky. I have nearly the same settings as https://github.com/emacs-lsp/lsp-java/blob/master/lsp-java.el#L373 Is there any standard git repo I can use to test if this really works..? |
@SreenivasVRao Could you send your .project? |
^this is only one project though. I haven't updated all my projects. Could that be the reason? I do have resourceFilters (it's not readable since it's all on one line in my previous comment) - resourceFilters=[node_modules, .metadata, archetype-resources, META-INF/maven, runtime, env, build] |
It should work. JAVA LS will use the following:
and skip the node_modules|.metadata|archetype-resources|META-INF/maven|runtime|env|build directories
It is not important. Java LS (eclipse) should use the filteredResources property from .project and skip the mentioned directories when refreshing the workspace.
Could you send whole log? |
I think this might be a config issue on my end with emacs. I was able to work around this by changing a different part of my config, but I will share a log file when I reproduce the error reliably. To emacs users who might come across this in the future - I found that projectile was loading these files, and filtering out using |
Hi, I see that this was supposed to be fixed by #560
But I see this issue still crop up when I try JDTLS in Emacs/LSP. I tried the most recent version from http://download.eclipse.org/jdtls/snapshots/?d
I have the following import exclusions set:
But in the logs I see:
The text was updated successfully, but these errors were encountered: