-
Notifications
You must be signed in to change notification settings - Fork 640
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
Filter "_" and other hidden members from TS intellisense #3978
Comments
Hi @alexdima, At MakeCode, we're using Monaco and monaco-typescript to provide typescript language service features for our users. Our audience is beginner coders so we want to filter out certain APIs from showing up in auto-complete, specifically ones that start with an "_". We're unsure what the best way to accomplish this is. Looking at "microsoft/monaco-typescript#65" (and "microsoft/monaco-editor#17", "microsoft/monaco-editor#1661"), it seems there are new hooks for providing an alternative TypeScriptWorker implementation. However, we're really hoping to just augment the existing worker specifically overloading "getCompletionsAtPosition" (https://github.com/microsoft/monaco-typescript/blob/main/src/tsWorker.ts#L225), but this class isn't exported in the public typings for monaco-typescript (as far as I can tell.) So it seems like our best option is to fork monaco-typescript and modify the TypeScriptWorker class as needed. |
Looking through the monaco-typescript repo, seems like we can use the customWorkerPath setting to extend the TypeScriptWorker. I was looking at this example: https://github.com/microsoft/monaco-typescript/blob/main/test/custom-worker.js @alexdima is that the correct approach? |
👍 Yes, that looks good. |
Thanks @alexdima |
With the switch to Monaco's standard TS support, we need to filter hidden members again.
The text was updated successfully, but these errors were encountered: