-
Notifications
You must be signed in to change notification settings - Fork 132
Multiline JSDoc Types #467
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
Comments
We used the jsdoc grammar from https://github.com/atom/language-javascript. Please file the issue there and once fixed we will pick it up. Thank you. |
Fixes microsoft#467 Adds a begin/while rule so that doc blocks also consume the leading *. This approach has been used by VS Code to support highlighting example blocks (see microsoft#693) Remove the `invalid.illegal.type.jsdoc` rule since we now can highlight multiline types better
Can we re-open this issue ? The upstream repository is not maintained anymore ( atom/language-javascript#645 (comment) ) Any changes to the jsdoc grammar to support multiline syntax highlighting wil lhave to be made directly in this repository. |
+1. Rephrasing info from linked issue (microsoft/vscode#206516), even simple line break before closing */ of "line" JSDoc comment makes it appear like a normal insignificant comment: /** @type {string} */
var a = "OK, highlighted as JSDoc.";
/** @type {string}
*/
var b = "ERROR, highlighted like a regular comment."; And this code monster demonstrating that LSP crunches it without a problem, but highlighter fails: // @ts-check
/** @typedef
* {
typeof
* ABC [
number
* ]
}
* Ch -
this
- still
* works
*/
// ↑ ERROR, highlighted as a comment, but processed
const ABC = /** @type {const} */(["a", "b", "c"]);
/** @type {Ch}
*/
// ↑ ERROR, highlighted as a comment, but processed
var x = 'd';
/** @type {Ch} */
// ↑ OK, highlighted
var y = 'd'; |
From microsoft/vscode#27777
TS and JS Grammar Extension version: 0.0.20
Code
Current highlighting:
There seems to be some debate about whether this is supported or not: jscs-dev/node-jscs#245 but it seems closure supports this syntax
The text was updated successfully, but these errors were encountered: