-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove slash at the end of extension path #8045
Conversation
Do you know where such URIs is created? It could be that such place violating one of rules here: https://github.com/eclipse-theia/theia/wiki/Coding-Guidelines#uripath Like using path instead of uri and manipulating paths as strings |
URI is created in the extension, and this extension operates with strings, not with URIs. |
@@ -92,7 +92,6 @@ export class HostedPluginReader implements BackendApplicationContribution { | |||
if (!pluginPath) { | |||
return undefined; | |||
} | |||
pluginPath = path.normalize(pluginPath + '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about removing normalize
that's to get rid of ..
and .
in the path, don't think it is related to trailing slashes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to resolve the path?
just
pluginPath = path.resolve(pluginPath);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked the code again. I think the caller of readPackage
must care about the correct path. Further in the code, path.join
is used to concatenate the path elements.
Normalizing or resolving the path here is a bit redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any verdict on this PR? |
@vitaliy-guliy could you clean the history please: https://github.com/eclipse-theia/theia/blob/master/doc/pull-requests.md#checklist-commit-history and i will test afterwards? |
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
cb8a923
to
32e03cf
Compare
@akosyakov squashed to one commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smoked tests built-in extensions against both targets, everything seem to be loaded normal
Signed-off-by: Vitaliy Gulyy vgulyy@redhat.com
What it does
Removes the last slash from the extensionPath, which is passed to the extension withing PluginContext.
I didn't find any rules about the slash at the ending of PluginContext.extensionPath on the VS Code API.
A sample
helloworld
extension running in VS Code prints the path without the slash.This fix is necessary for some extensions, e.g. Jira and Bitbucket.
Actually we are trying to run this extension inside Che-Theia eclipse-che/che#17081, but faced the problem, that the extension forms wrong URI to some webview resources (URI contains double slashes in the Path).
Removing the slash at the end of
extensionPath
solved the issue.How to test
Currently it's difficult to test how vanilla Theia works with
Jira and Bitbucket
extension.But the reviewer can build Theia and try to run any extension, which use
PluginContext.extensionPath
.I don't know such plugin, except Jira&Bitbucket. Any other extensions I know works fine.
Review checklist
Reminder for reviewers