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

[Bug] setExtraLibs does not work for globals in javascript mode #4323

Closed
1 of 2 tasks
jogibear9988 opened this issue Jan 3, 2024 · 4 comments
Closed
1 of 2 tasks

Comments

@jogibear9988
Copy link

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.46.0-dev-20231214#XQAAAAKTAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwzrB9RgmSaumWUF-TBOs7rE9XbZp0QEljbc6k5igJtayNyZFpJFm_mM5nJyGtaYVSA8LYfNAiH0H_SKfgOTkv8DlUboExY7GbKPnbhroY0B24jmS2R92JnItIzQGMHZXUjqq2hvRdCNtfoSooq76YgWgU381BhoMHe_tSoK2stAoyBGGGs841oh94ws9qhUvlnfPqRBj0LWu3ww-xZFSq3-X32-aYE6JaXdqOxkbXJc8xhxp32Zw9fTR5S_h0LAYlicKOopRGu9sTsR9_OkBwEjpxHxubth1Dhe2QmdfyP6LMT3m25ylnESchgP6jfFJ0Qq0yyW5wSTELD7CvokVqGtzM_9kU5SQ

Monaco Editor Playground Code

const value = `a`;

monaco.languages.typescript.typescriptDefaults.setExtraLibs(
[
{content:'declare var a : { b: "aa", c: {d:"e"}} ', filePath:''}
]);

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "javascript",
	automaticLayout: true,
});

Reproduction Steps

Try the playground, you get no completition for the object 'a'
switch to typescript, and the completition works

Actual (Problematic) Behavior

No codecompletition for global objects in javascript mode

Expected Behavior

code completition should work

Additional Context

No response

@HolgerJeromin
Copy link

HolgerJeromin commented Jan 4, 2024

A short googling gave me monaco.languages.typescript.javascriptDefaults.setExtraLibs()
Works in your playground, too.

@jogibear9988
Copy link
Author

thanks, didn't find this....

@HolgerJeromin
Copy link

HolgerJeromin commented Jan 4, 2024

Could you edit your comment in typescript repo so the issue over there is not derailed with helpful comments? Thanks.

@jogibear9988
Copy link
Author

will do

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Aug 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants