-
Notifications
You must be signed in to change notification settings - Fork 12.8k
JSDoc does not strip leading * inside markdown code block #23517
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
Labels
Bug
A bug in TypeScript
Domain: JSDoc
Relates to JSDoc parsing and type generation
Fixed
A PR has been merged for this issue
VS Code Priority
Critical issues that VS Code needs fixed in the current TypeScript milestone
Milestone
Comments
PRs welcomed. |
I only noticed this change in behavior now after updating VSCode, but this definitely was still working correctly a couple of months ago. Also using standard (non-fenced / non-GFM) Markdown for code blocks still works correctly now. Maybe there was a change/replacement of the MD parser? /**
* This works as expected (w/o leading asterisks)
*
* @example
*
* const foo = [...mapcat((x) => [x,x,x], [1,2,3])];
* // [[1,1,1], [2,2,2], [3,3,3]]
*/ |
weaverryan
added a commit
to symfony/webpack-encore
that referenced
this issue
Apr 10, 2019
…ngs (Lyrkan) This PR was squashed before being merged into the master branch (closes #550). Discussion ---------- Clean up the public API file and improve a few other things Now that we don't have many active PRs anymore I figured it was a good time to do some spring cleaning, especially in the `index.js` file (since we often recommend users to look at its content). This PR: * Moves the proxy creation into its own file (`lib/EncoreProxy.js`) * Moves the content of `initializeWebpackConfig(...)` inside of the `WebpackConfig`'s constructor (we already had some checks related to the `RuntimeConfig` there anyway) * Fixes a few JSDoc issues (missing or misplaced comments, types not resolving correctly, etc.) * Puts examples from the `index.js` file's comments inside of Markdown code-blocks, which are supported by at least PHPStorm and VSCode: * In PHPStorm | Before | After | |--------|-------| |  |  | * In VSCode (note that the leading whitespaces and asterisk are caused by this bug: microsoft/TypeScript#23517) | Before | After | |--------|-------| |  |  | * Indicates that `Encore.getWebpackConfig()` returns a Webpack configuration, which allows IDEs' autocompletion to work on it:  Commits ------- 8531000 Clean up the public API file and improve a few other things
sandersn
added a commit
that referenced
this issue
Apr 15, 2019
Previously, the jsdoc scanner had ad-hoc handling of backticks that was similar in structure to the normal scanner's handling, but much simpler. This was a smaller code change, but is handled backwards: the special case of backtick-quoted parameter names was handled in the scanner instead of in the jsdoc identifier parsing code. That made it overapply and block correct handling of asterisks across newlines, which was most obvious in code fences inside jsdoc, as in #23517. Fixes #23517
sandersn
added a commit
that referenced
this issue
Apr 18, 2019
* Scan backticks in jsdoc as a single token less often Previously, matching backticks in jsdoc would always be scanned as one token to aid parsing incorrect jsdoc that uses backticks for parameter names: ``js /** @param {string} `nope` * @param {number} `not needed` */ ``` However, this is wrong for code fences, which use triple backticks. This fix parses a single backtick as a single token if it's immediately followed by another backtick or by a newline. It retains the questionable tokenisation of backticks-as-pairs in other cases, however. A better fix might be to have the parser ignore backticks in jsdoc instead. * Add test case * Handle jsdoc backticks in the parser, not scanner Previously, the jsdoc scanner had ad-hoc handling of backticks that was similar in structure to the normal scanner's handling, but much simpler. This was a smaller code change, but is handled backwards: the special case of backtick-quoted parameter names was handled in the scanner instead of in the jsdoc identifier parsing code. That made it overapply and block correct handling of asterisks across newlines, which was most obvious in code fences inside jsdoc, as in #23517. Fixes #23517 * More cleanup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
A bug in TypeScript
Domain: JSDoc
Relates to JSDoc parsing and type generation
Fixed
A PR has been merged for this issue
VS Code Priority
Critical issues that VS Code needs fixed in the current TypeScript milestone
TypeScript Version: 2.9.0-dev.20180418
Search Terms:
Code
Hover over
foo
Bug:
The jsdoc content returned includes the leading
*
from the comment inside the code block:This is a regression from the current 2.8 builds
The text was updated successfully, but these errors were encountered: