-
Notifications
You must be signed in to change notification settings - Fork 38
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
Missing initialize
from vscode/extensions
#283
Comments
Looking at a295d70 it seems it's been removed. |
This documentation https://github.com/CodinGame/monaco-vscode-api#vscode-api-usage doesn't seem to be aligned with the actual code. |
I figured I need to use: import 'vscode/localExtensionHost';` But it seems, that things will starts working only after I perform some action (like opening a command palette): initialization.mp4 |
I did dig deeper and the issue is with monaco service initialization. The simplest code to reproduce: import { initialize as initializeMonacoServices } from 'vscode/services';
import 'vscode/localExtensionHost';
console.dir('initializing');
await initializeMonacoServices({});
console.dir('initialized');
Following seems to work; I'm performing some random service action which allows initialization to fall through (resolve). import { initialize as initializeMonacoServices, StandaloneServices, IQuickInputService, } from 'vscode/services';
import 'vscode/localExtensionHost';
console.dir('initializing');
setTimeout(() => {
StandaloneServices.get(IQuickInputService).quickAccess.show('>', {
itemActivation: 0,
});
}, 0);
await initializeMonacoServices({});
console.dir('initialized'); |
Working on way to improve the changelog
Right, will fix
No idea, I'm interested if you find the cause of it |
I fails in async function startup(instantiationService) { specifically in: await instantiationService.invokeFunction(async (accessor) => {
await Promise.all(( serviceInitializePostParticipants.map(participant => participant(accessor))));
}); This will never resolve. If I remove this code, everything works as expected. The |
It'll be fixed soon in #285 in the meantime, you can add this workaround: import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions'
import { registerServiceInitializeParticipant } from 'vscode/lifecycle'
registerServiceInitializeParticipant(accessor => accessor.get(IExtensionService)) |
I can confirm, the workaround works. Thanks! |
Hi @CGNonofr,
It seems that following import now longer works:
initialize
is no longer part of that file. Affected version is@codingame/monaco-vscode-api@=1.83.15
.The text was updated successfully, but these errors were encountered: