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

Correctly expose extensionUri for frontend modules #10747

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

thegecko
Copy link
Member

@thegecko thegecko commented Feb 13, 2022

What it does

Depends on #10721.

The extensionContext.extensionUri was incorrectly returning a file schemed Uri for frontend modules.
This meant loading assets based on context.extensionUri wasn't possible (and breaks some loading in VS Code web extensions)

This PR ensures extensionUri is correctly formed based on the type of module.

It also updates the pluginContext to use the underlying plugin extensionPath and extensionUri fields rather than recalculating them.

How to test

Create a frontend module (VS Code web extension or Theia frontend plugin) and inspect the context.extensionUri;

Review checklist

Reminder for reviewers

@thegecko thegecko changed the title Correctly expose Uri for frontend modules Correctly expose extensionUri for frontend modules Feb 13, 2022
@vince-fugnitto vince-fugnitto added the vscode issues related to VSCode compatibility label Feb 14, 2022
@vince-fugnitto
Copy link
Member

@thegecko do you mind providing additional information or perhaps a plugin to be able to test the feature, the same is true for #10745. I tried making a vscode web extension but it did not seem to work.

@thegecko
Copy link
Member Author

thegecko commented Feb 15, 2022

VSCode Web Extensions won't work until this is merged: #10721

There's a link there to a sample extension you can use.

To test this, cherry-pick that fix and use the example VS Code extension (adding extensionUri and joinPath usage).

However, it may be easier to create a Theia Plugin which uses extensionUri and joinPath

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes look good to me, I see the following:

master:

image

pull-request:

image

I also confirmed that non-web extensions work like today.

@thegecko thegecko merged commit de225dc into eclipse-theia:master Feb 18, 2022
@thegecko thegecko deleted the frontend-extensionuri branch February 18, 2022 15:28
@vince-fugnitto vince-fugnitto added this to the 1.23.0 milestone Feb 24, 2022
federicobozzini pushed a commit to ARMmbed/theia that referenced this pull request Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants