-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
JSDoc type annotations work in VSCode but not Monaco #203
Comments
Hmm, it's a surprise for me too. @jrieken any ideas? I've also found function annotations to not be working /**
* @returns {string}
*/
function f() {
return canvas1;
} |
We ship different versions of TypeScript in the standalone editor and VS Code |
Meaning if I just upgrade the monaco TypeScript support to the same version in VS Code it will start working? Or, meaning the stuff in VS Code is not compatible with Monaco? |
Well if you're curious I added the monaco editor to http://webglfundamentals.org. All of the examples run in a codepen style editor using monaco. Every sample has this at the top
If monaco supported type annotations like VSCode then from that both If there's a way to make that work that would be great. |
@jrieken is there any progress with this issue? |
closing as dupe of #177 |
I can confirm JSDoc annotations still don't work. @jrieken Perhaps there is more to getting them work than updating to TS 2.1 |
Is there any way to hint Monaco of the type of a given function parameter dynamically (eg without modifying the editor source) ? |
I have added a PR in |
@kitsonk I had a quick look at your PR ( microsoft/monaco-typescript#14 ), I don't think it actually fixes this issue, which is about having the Monaco know the type of a parameter from the JSDoc annotations, so that code complete / intellisense works on that parameter? |
This works for me (without microsoft/monaco-typescript#14) on master. It is important to know that this is supported in JS files only and the we interpret files as JS when they have an uri-path that ending in |
The fix for this (microsoft/monaco-typescript@9b5c885) will be in the next release. |
Cool. Just to confirm @jrieken, a and b will have code complete within the body of foo()? |
monaco-editor npm version: 0.6.1
Browser: All
OS: all
If I put this code in VSCode 1.5.3
Both
gl
andctx
will get the correct auto-completion for their respective types but the same code does not get auto completions in Monaco. Note: Monaco does know the definitions ofWebGLRenderingContext
andCanvasRenderingContext2D
as I can typeWebGLRenderingContext.prototype.
and see all the completions.Is this a feature I just need to enable? Is it just not yet pulled from VSCode? Or is it a feature that's not meant to be part of Monaco?
The text was updated successfully, but these errors were encountered: