Skip to content
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

Closed
darzu opened this issue Apr 13, 2021 · 5 comments · Fixed by microsoft/pxt#8201
Closed

Filter "_" and other hidden members from TS intellisense #3978

darzu opened this issue Apr 13, 2021 · 5 comments · Fixed by microsoft/pxt#8201

Comments

@darzu
Copy link
Contributor

darzu commented Apr 13, 2021

image

With the switch to Monaco's standard TS support, we need to filter hidden members again.

@darzu
Copy link
Contributor Author

darzu commented Apr 26, 2021

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.)

image

So it seems like our best option is to fork monaco-typescript and modify the TypeScriptWorker class as needed.
Does this match your understanding? Or are we missing something?

CC @abchatra , @riknoll

@abchatra
Copy link
Contributor

@alexdima, any thoughts for the above request? If it is easier, we can schedule a quick call as well. @riknoll fyi

@riknoll
Copy link
Member

riknoll commented May 26, 2021

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?

@alexdima
Copy link
Member

alexdima commented Jun 8, 2021

Looking through the monaco-typescript repo, seems like we can use the customWorkerPath setting to extend the TypeScriptWorker

👍 Yes, that looks good.

@abchatra
Copy link
Contributor

abchatra commented Jun 8, 2021

Thanks @alexdima

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants