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

Ignore folder from workspace #814

Closed
s0meRandomDev opened this issue May 14, 2020 · 2 comments
Closed

Ignore folder from workspace #814

s0meRandomDev opened this issue May 14, 2020 · 2 comments

Comments

@s0meRandomDev
Copy link

s0meRandomDev commented May 14, 2020

Is it possible to speciffy the java language server to ignore some folders in the workspace ?
I would need this because if the language server does not have rights to read one of the folder, it will stop solving imports.

Environment
  • Operating System: Linux Ubuntu 19.10
  • JDK version: 8
  • Visual Studio Code version: 1.45.0
  • Java extension version: 0.61.0
Steps To Reproduce

1.Have a working java project in your workspace
2. Add a folder with no access rights
3. Language server cannot solve imports anymore.

Log error:

Failed to scan /home/tomtom/Code/Levanna/templater-front
org.eclipse.core.runtime.CoreException: Failed to scan /home/tomtom/Code/Levanna/templater-front
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:136)
	at org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.applies(GradleProjectImporter.java:77)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.getImporter(ProjectsManager.java:233)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:102)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:94)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:196)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.nio.file.AccessDeniedException: /home/tomtom/Code/Levanna/templater-front/docker/mysql/data/performance_schema
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:432)
	at java.base/java.nio.file.Files.newDirectoryStream(Files.java:471)
	at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:300)
	at java.base/java.nio.file.FileTreeWalker.next(FileTreeWalker.java:373)
	at java.base/java.nio.file.Files.walkFileTree(Files.java:2760)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scanDir(BasicFileDetector.java:170)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:134)
@snjeza
Copy link

snjeza commented May 14, 2020

@liteultom you can use the java.import.exclusions property. See redhat-developer/vscode-java#1084

"java.import.exclusions": [
        "**/node_modules/**",
        "**/.metadata/**",
        "**/archetype-resources/**",
        "**/META-INF/maven/**",
        "**/templater-front/**",
    ]

@testforstephen
Copy link
Contributor

The import feature is provided by vscode-java extension, please open an issue there. https://github.com/redhat-developer/vscode-java/issues

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

No branches or pull requests

3 participants