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

fix: opening file outside of workspace may throw Exception. Fixes #913 #1050

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

sebthom
Copy link
Member

@sebthom sebthom commented Aug 13, 2024

Trying to open an external file located at the root of a filesystem results in:

java.lang.IllegalArgumentException: Path must include project and resource name: /solarized-dark-color-theme.json
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:66)
	at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2234)
	at org.eclipse.core.internal.resources.Container.getFile(Container.java:196)
	at org.eclipse.lsp4e.LSPEclipseUtils.getFile(LSPEclipseUtils.java:1229)
	at org.eclipse.lsp4e.LSPEclipseUtils.toUri(LSPEclipseUtils.java:371)
	at org.eclipse.lsp4e.operations.codelens.CodeLensProvider.provideCodeMinings(CodeLensProvider.java:34)
	at org.eclipse.lsp4e.operations.codelens.CodeLensProvider.provideCodeMinings(CodeLensProvider.java:66)
	at org.eclipse.jface.internal.text.codemining.CodeMiningManager.lambda$2(CodeMiningManager.java:189)

This PR fixes #913

…ipse#913

Trying to open an external file located at the root of a filesystem
results in:

java.lang.IllegalArgumentException: Path must include project and
resource name: /solarized-dark-color-theme.json
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:66)
	at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2234)
	at org.eclipse.core.internal.resources.Container.getFile(Container.java:196)
	at org.eclipse.lsp4e.LSPEclipseUtils.getFile(LSPEclipseUtils.java:1229)
	at org.eclipse.lsp4e.LSPEclipseUtils.toUri(LSPEclipseUtils.java:371)
	at org.eclipse.lsp4e.operations.codelens.CodeLensProvider.provideCodeMinings(CodeLensProvider.java:34)
	at org.eclipse.lsp4e.operations.codelens.CodeLensProvider.provideCodeMinings(CodeLensProvider.java:66)
	at org.eclipse.jface.internal.text.codemining.CodeMiningManager.lambda$2(CodeMiningManager.java:189)
@rubenporras rubenporras merged commit 9d6b137 into eclipse:main Aug 13, 2024
6 checks passed
@sebthom sebthom deleted the fix-opening-external-files branch August 23, 2024 11:41
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

Successfully merging this pull request may close these issues.

Files outside of workspace cannot be opened in Eclipse because of IllegalArgumentException in LSPEclipseUtils
2 participants