[Bug] CSS WorkerManager is no longer accessible/public
See original GitHub issueReproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Code
No response
Actual Behavior
No response
Expected Behavior
No response
Additional Context
As mentioned here: https://github.com/microsoft/monaco-editor/issues/2746#issuecomment-994927923
OLD
I use CSS completion from HTML. To do so I have done this:
languageId = "html";
require(['vs/language/css/cssMode', 'vs/language/css/cssWorker'], (mode: any, workerMod: any) => {
// THIS no longer works
const workerManager = require('vs/language/css/workerManager');
const worker = function () {
return client.getLanguageServiceWorker.apply(client, arguments);
}
// THIS no longer works
const languageFeatures = require('vs/language/css/languageFeatures');
monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures.CompletionAdapter(worker));
HACK
To make it work I go to cssMode.js
and add:
__export(cssMode_exports, {
setupMode: () => setupMode,
// THIS makes it work
WorkerManager: () => WorkerManager,
CompletionAdapter: () => CompletionAdapter,
});
Then I can replace the = requre(
with this:
const workerManager = mode;
const languageFeatures = mode;
FIX
Can I have the WorkerManager adapters to becomes “public” again?
This is my first encounter, I will test the other languages and extensions to see if there are more. I know this is not in the public documented stuff - but it would be really nice to have access to these advanced features.
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Merging monaco repositories · Issue #2746 - GitHub
I can no longer create the WorkerManager from/for e.g. CSS as its hidden/not exported now.. Will this change?
Read more >Android Work Manager: "Could not instantiate Worker"
I've followed the Android Developer's tutorial on using the Worker Manager structure to run my code in background but anytime ...
Read more >WorkManager - Android Developers
Applications can no longer launch a foreground service when they are in the background. Therefore, to better support long running work which was...
Read more >Using WorkManager in multi-process apps | by Ben Weiss
The recent release of WorkManager 2.5.0 enables easier usage in a multi-process environment and provides several stability improvements.
Read more >WorkManager's OneTimeWorkRequest stays in enqueued ...
You will need to initialize WorkManager with a custom configuration for that. * Remove the default WorkManager initializer using: <provider android:name=" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mifopen I’ve also pushed a change to export those classes in
vs/language/typescript/tsMode.js
To clarify, this is not a regression because these classes were internal and not part of the API described in
monaco.d.ts
. But I also don’t think it is a problem for us to re-export these classes fromcssMode.ts
.