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

Doc comment with comments inside is not shown properly on hover. #522

Closed
aspeddro opened this issue Jul 26, 2022 · 2 comments
Closed

Doc comment with comments inside is not shown properly on hover. #522

aspeddro opened this issue Jul 26, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@aspeddro
Copy link
Contributor

let a = Js.Re.exec_

Hover .exec_ show:

(Js.Re.t, string) => option<Js.Re.result>
Executes a search on a given string using the given RegExp object. urns Some(Js.Re.result) if a match is found, None otherwise.

res example Match "quick brown" followed by "jumps", ignoring characters in between Remember "brown" and "jumps" Ignore case

re = %re("/quick\s(brown).+?(jumps)/ig") result = Js.Re.exec_(re, "The Quick Brown Fox Jumps Over The Lazy Dog")

egExp.prototype.exec()`]([https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec](vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/code/electron-browser/workbench/workbench.html)) MDN.

Docstring:

(**
  Executes a search on a given string using the given RegExp object.
  Returns `Some(Js.Re.result)` if a match is found, `None` otherwise.

  ```res example
  /* Match "quick brown" followed by "jumps", ignoring characters in between
   * Remember "brown" and "jumps"
   * Ignore case
   */

  let re = %re("/quick\s(brown).+?(jumps)/ig")
  let result = Js.Re.exec_(re, "The Quick Brown Fox Jumps Over The Lazy Dog")
  ```

  See
  [`RegExp.prototype.exec()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)
  on MDN.
*)
external exec_ : t -> string -> result option = "exec" [@@bs.send] [@@bs.return null_to_opt]

The start of link [`R is cut.

[`RegExp.prototype.exec()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)
cristianoc added a commit that referenced this issue Jul 26, 2022
@cristianoc cristianoc changed the title Js.Re.exec_ docstring is cutting some characters Doc comment with code block (triple backquotes) is not shown properly on hover. Jul 26, 2022
@cristianoc
Copy link
Collaborator

See #526 for a self-contained example.

@cristianoc cristianoc added the bug Something isn't working label Jul 26, 2022
@cristianoc
Copy link
Collaborator

The parser handles the examples properly.
A verbatim print of what's stored in the ns.doc attribute shows the problem already.
Something must be happening between parsing and when the typed ast is created in the compiler.

@cristianoc cristianoc changed the title Doc comment with code block (triple backquotes) is not shown properly on hover. Doc comment with comments inside is not shown properly on hover. Jul 29, 2022
cristianoc added a commit that referenced this issue Jul 29, 2022
…properly on hover. (#526)

* Add an example doc comment with code block

See #522

* More tests in a separate file.

* Add example with no nested comments.

* Found the issue.

* Remove PrepareUtils

Might be the last file inherited from the original extension, which keeps on giving years later.

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants