-
Notifications
You must be signed in to change notification settings - Fork 39
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
Extensions icons are not loading in demo #549
Comments
Any error in the console maybe? |
Thanks for the quick reply, does it work on your side? Yes it looks like the requests are being blocked, I was able to make it work by removing the cross origin headers used for SharedArrayBuffer, but this means language-features will no longer work right? Is there a way around this? how is vscode.dev able to have language features working + able to load cross origin content? {
// For the *-language-features extensions which use SharedArrayBuffer
name: "configure-response-headers",
apply: "serve",
configureServer: (server) => {
server.middlewares.use((_req, res, next) => {
res.setHeader("Cross-Origin-Embedder-Policy", "credentialless");
res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
res.setHeader("Cross-Origin-Resource-Policy", "cross-origin");
next();
});
}
}, Additionally do you know if there is something similar to "retainContextWhenHidden" for custom editors? I would like to create a tab that is retained in memory even when it not visible similar to the expected behavior in a vscode extension: const customEditorProvider = new CustomEditorProvider(context);
context.subscriptions.push(
vscode.window.registerCustomEditorProvider(
'custom.customEditor',
customEditorProvider, {
webviewOptions: {
// retain the webview’s context (keep it in memory) even when switching tabs
retainContextWhenHidden: true
},
supportsMultipleEditorsPerDocument: false
})
); but when playing around with the custom panel code you have in the demo, the iframe is always reloaded when changing tabs: class CustomEditorPane extends SimpleEditorPane {
static readonly ID = "workbench.editors.customEditor";
constructor(group: IEditorGroup) {
super(CustomEditorPane.ID, group);
}
initialize(): HTMLElement {
const container = document.createElement("div");
container.style.display = "flex";
container.style.alignItems = "center";
container.style.justifyContent = "center";
container.innerHTML =
"This is a custom editor pane<br />You can render anything you want here";
return container;
}
async renderInput(input: EditorInput): Promise<monaco.IDisposable> {
if (input.resource != null) {
this.container.innerHTML = "Opened file: " + input.resource.path+ `<iframe src="https://github.com/"></iframe>`;
} else {
this.container.innerHTML =
"This is a custom editor pane<br />You can render anything you want here";
}
return {
dispose() {}
};
}
}``` |
After more research, Codesanbox is using this project and is able to run the typescript language server without SharedArrayBuffer, how is that possible? Do you think that they modified the typescript language server directly? if (isWebAndHasSharedArrayBuffers()) {
args.push('--enableProjectWideIntelliSenseOnWeb');
} They also have the same issue that the tabs of custom editors are constantly being reloaded and not kept in memory, I wonder if there is a workaround for this. |
Are you able to load https://open-vsx.org/vscode/asset/haberdashPI/vscode-select-by-indent/0.3.3/Microsoft.VisualStudio.Services.Icons.Default?targetPlatform=universal in your browser ?
But you can probably implement it yourself, by rendering in a detached element, and just attaching it when the tab is displayed?
Are you using the "devbox"? (i.e. your env is running in a codesandbox server) In that case, the extension is running on the server and |
Yes absolutely, i can see the icon.
That's a great idea, thank you very much for the suggestion.
No I am just using a simple typescript sandbox runtime (no devbox/vm involved). |
I'm not sure what is the issue then. I've just noticed it's not working at all in the published version of the demo though, like it was blocked by open-vsx 🤔
are you sure project wide intellisense is working then? it doesn't seem to be able to get types from other files |
Hi there,
I built the project locally, it works pretty great but the extensions icons are not loading, why is that? Any way to fix it?
The text was updated successfully, but these errors were encountered: