Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes/No <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: Monaco Editor OS Version: macOS 13.0 (22A380) Steps to Reproduce: in the some logs in in vscode. any Monaco editor test page. the output of the consoleeach call to will re-register all registered languages. <img width="763" alt="image" src="https://user-"
Can you look into why this is the case, maybe even providing a PR?
Sorry for the late reply, I would be happy to submit a PR.

Discussion:
* @event */ export function onLanguage(languageId: string, callback: () => void): IDisposable { <del> const languageService = StandaloneServices.get(ILanguageService); const disposable = languageService.onDidRequestRichLanguageFeatures((encounteredLanguageId) => { if (encounteredLanguageId === languageId) { // stop listening disposable.dispose(); // invoke actual listener callback(); } </del> <ins> return StandaloneServices.withServices(() => { const languageService = StandaloneServices.get(ILanguageService); const disposable = languageService.onDidRequestRichLanguageFeatures((encounteredLanguageId) => { if (encounteredLanguageId === languageId) { // stop listening disposable.dispose(); // invoke actual listener callback(); } }); return disposable; </ins> }); <del> return disposable; </del> } /**

* @event */ export function onLanguageEncountered(languageId: string, callback: () => void): IDisposable { <del> const languageService = StandaloneServices.get(ILanguageService); const disposable = languageService.onDidRequestBasicLanguageFeatures((encounteredLanguageId) => { if (encounteredLanguageId === languageId) { // stop listening disposable.dispose(); // invoke actual listener callback(); } </del> <ins> return StandaloneServices.withServices(() => { const languageService = StandaloneServices.get(ILanguageService); const disposable = languageService.onDidRequestBasicLanguageFeatures((encounteredLanguageId) => { if (encounteredLanguageId === languageId) { // stop listening disposable.dispose(); // invoke actual listener callback(); } }); return disposable; </ins> }); <del> return disposable; </del> } /**

} let initialized = false; <ins> const onDidInitialize = new Emitter<void>(); </ins> export function initialize(overrides: IEditorOverrideServices): IInstantiationService { if (initialized) { return instantiationService;

} } <ins> onDidInitialize.fire(); </ins> return instantiationService; } <ins> /** * Executes callback once services are initialized. */ export function withServices(callback: () => IDisposable): IDisposable { if (initialized) { return callback(); } const disposable = new DisposableStore(); const listener = disposable.add(onDidInitialize.event(() => { listener.dispose(); disposable.add(callback()); })); return disposable; } </ins> }