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

plugin-ext: fix local-dir resolution #8385

Merged
merged 1 commit into from
Aug 14, 2020
Merged

Conversation

paul-marechal
Copy link
Member

@paul-marechal paul-marechal commented Aug 14, 2020

Windows: Extensions are not picked up from the user's home.
Node's FS API.

Use FileUri.fsPath to get a valid system path.

Signed-off-by: Paul Maréchal [email protected]

How to test

Windows:

  • Install an extension via the Extensions view.
  • Close and reload the app.
  • Extension should be loaded.

Review checklist

Reminder for reviewers

@paul-marechal paul-marechal requested a review from benoitf August 14, 2020 13:37
@akosyakov akosyakov added Os/Windows/WSL issues related to Windows Subsystem for Linux vscode issues related to VSCode compatibility labels Aug 14, 2020
@@ -26,7 +26,7 @@ export class PluginVSCodeDeployerParticipant implements PluginDeployerParticipan

async onWillStart(context: PluginDeployerStartContext): Promise<void> {
const extensionsDirUri = await this.environments.getExtensionsDirUri();
context.userEntries.push(extensionsDirUri.withScheme('local-dir').toString());
context.userEntries.push(extensionsDirUri.withScheme('local-dir').toString(true));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it is necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, it works without. Will remove.

Copy link
Member Author

@paul-marechal paul-marechal Aug 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we prefer URI encoded strings? It made goofy-looking paths when debugging, and if someone doesn't parse it back into a URI object it will most likely cause issues. I could not find a reason why we want URI encoded strings here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use encoded by default since we pass them over the wire and not encoded when we need to give to a user for navigation. Here it does not matter. What is important that one should use FileUri.parse to get a system dependent path it can handle encoded and not encoded URIs.

@akosyakov
Copy link
Member

@eclipse-theia/ecd-theia-committers Could someone with the window machine verify?

@paul-marechal paul-marechal force-pushed the mp/plugin-dir-fix branch 2 times, most recently from a7bfef9 to 52d394a Compare August 14, 2020 14:02
@paul-marechal paul-marechal changed the title plugin-ext(-vscode): fix local-dir resolution plugin-ext: fix local-dir resolution Aug 14, 2020
@paul-marechal paul-marechal added OS/Windows issues related to the Windows OS and removed Os/Windows/WSL issues related to Windows Subsystem for Linux labels Aug 14, 2020
Windows: Extensions are not picked up from the user's home.
Node's FS API.

Use `FileUri.fsPath` to get a valid system path.

Signed-off-by: Paul Maréchal <[email protected]>
@kittaakos kittaakos self-requested a review August 14, 2020 14:40
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified. I installed the Go To Method extension. Quit the app, start the app, the extension was in the view among the installed ones. It did not work from the master.

@paul-marechal paul-marechal merged commit 12eabf0 into master Aug 14, 2020
@paul-marechal paul-marechal deleted the mp/plugin-dir-fix branch August 14, 2020 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS/Windows issues related to the Windows OS vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants