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

[vscode] icons for editor decorators cannot be fetched #6661

Closed
akosyakov opened this issue Nov 29, 2019 · 2 comments · Fixed by #6664
Closed

[vscode] icons for editor decorators cannot be fetched #6661

akosyakov opened this issue Nov 29, 2019 · 2 comments · Fixed by #6664
Assignees
Labels
bug bugs found in the application vscode issues related to VSCode compatibility

Comments

@akosyakov
Copy link
Member

The issue is that icons are provided as absolute fs paths: gitpod-io/gitpod#958 It does not work in the browser context. We have to translate such paths to http URLs to make it work.

@DanTup Could you share how it can be tested?

@akosyakov akosyakov added bug bugs found in the application vscode issues related to VSCode compatibility labels Nov 29, 2019
@akosyakov akosyakov self-assigned this Nov 29, 2019
@akosyakov
Copy link
Member Author

@DanTup how do you create an icon path btw? Do you call any VS Code APIs for it?

@DanTup
Copy link
Contributor

DanTup commented Nov 29, 2019

It's just a normal file URI:

vs.window.createTextEditorDecorationType({
	gutterIconPath: vs.Uri.file(filePath),
	gutterIconSize: "50%",
});

filePath here is just an arbitrary file path. In Dart-Code's case it lives inside the extension globalStorage folder, though in VS Code it could literally be anywhere on disk.

There's a VS code sample for using decorations at https://github.com/Microsoft/vscode-extension-samples/tree/master/decorator-sample that you could use (and just add a gutterIconPath to it) that's probably much easier to test with than configuring Flutter (though if you want to use Flutter, the branch I've been testing with is https://github.com/DanTup/gitpod-flutter-web/tree/debug-testing, open it in GitPod and write some code that uses colours - see https://dartcode.org/releases/v3-6/#preview-flutter-gutter-icons-and-colors).

akosyakov added a commit that referenced this issue Nov 29, 2019
VS Code extensions are using absolute paths to load editor icons. It does not work in remote environments. Instead we rewrite  files URIs to external URIs to make it work.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
svenefftinge pushed a commit that referenced this issue Dec 1, 2019
VS Code extensions are using absolute paths to load editor icons. It does not work in remote environments. Instead we rewrite  files URIs to external URIs to make it work.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
akosyakov added a commit to akosyakov/theia that referenced this issue Feb 24, 2020
…l URIs

VS Code extensions are using absolute paths to load editor icons. It does not work in remote environments. Instead we rewrite  files URIs to external URIs to make it work.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants