[Bug] typescript class export is not shown in suggestion #3702
Replies: 7 comments
-
I tried this and it works good. I guess you may need to add |
Beta Was this translation helpful? Give feedback.
-
Thanks, But the real issue is Purple is not shown in suggestions, if you remove '=Purple.color' and start re-typing Purple, the suggestions will be displayed without word 'Purple'. Note: please remove import purple before testing suggestions. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I think maybe in this case, only |
Beta Was this translation helpful? Give feedback.
-
Thanks again, But still i am not able to get the suggestions for words exported in another typescript file. let s1 = let m1=monaco.editor.createModel(s1,'typescript',monaco.Uri.parse(p1)); monaco.languages.typescript.typescriptDefaults.addExtraLib(s1, p1); monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true); monaco.editor.create(document.getElementById('container'), { |
Beta Was this translation helpful? Give feedback.
-
All right man, this is all I can think about lol. |
Beta Was this translation helpful? Give feedback.
-
In your last example try this for setting it as an external lib
|
Beta Was this translation helpful? Give feedback.
-
Thanks much, this works as expected. But do we need to take declare approach, why not export is work directly. The file that needs the export items as part of suggestions, also need to be in declare global scope, if not the suggestion will not include them. Any ideas/suggestions. |
Beta Was this translation helpful? Give feedback.
-
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Code
Actual Behavior
Mouseover Purple.color will give the correct path to import './f1' file, which is good.
Now remove everything after 'shade=' and start typing the word 'Purple', it is not listed as part of the suggestions.
Expected Behavior
Word 'Purple' should also be part of the typeahead recommendations, as it is exported by another model.
Additional Context
I would like to know if the exported class name from other models should be part of suggestions. if so, how can i get it working. I tried in my local with various typescript/javascript options like setEagerModelSync=true, allowJs=true, etc. but no success.
Beta Was this translation helpful? Give feedback.
All reactions