Skip to content

QLDoc view omits <code> HTML elements #794

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

Open
Marcono1234 opened this issue Mar 20, 2021 · 2 comments
Open

QLDoc view omits <code> HTML elements #794

Marcono1234 opened this issue Mar 20, 2021 · 2 comments
Labels
bug Something isn't working VSCode

Comments

@Marcono1234
Copy link
Contributor

Marcono1234 commented Mar 20, 2021

Describe the bug
According to the language specification QLDoc uses CommonMark, which supports raw HTML.

It appears that the VSCode extension supports HTML entity references (e.g. &ast;), and for some HTML elements simply shows their content without any special formatting (e.g. <b>bold</b>).

However, <code> elements are apparently completely omitted, not even their content is shown:
QLDoc VSCode extension screenshot

My use case is that I would like to write /** ... */ (a Javadoc comment) in a QLDoc, however */ is recognized as end of the QLDoc. Therefore the only workaround might be to use <code>/** ... &ast;/</code>.
But this is not super important, I could probably also just omit */ from my QLDoc comment.

To Reproduce

  1. In a query file write the following QLDoc comment or add it to an existing element
    /**
     * Test <code>code</code> &ast;/ <b>bold</b> <i>italic</i>
     */
    
  2. Hover over the QLDoc
    ❌ The text "code" is completely missing from the shown rendered QLDoc

Expected behavior

  • At least the content of the <code> element should be shown in the rendered QLDoc (similar to how it is the case for <b>)
  • Or ideally the content of the <code> element is shown and formatted as code

Additional context
The LGTM Query Console seems to support <code> and even formats the text as code in the preview when hovering over a documented element:
Query Console QLDoc screenshot

@Marcono1234 Marcono1234 added the bug Something isn't working label Mar 20, 2021
Marcono1234 added a commit to Marcono1234/codeql-java-queries that referenced this issue Mar 20, 2021
non-javadoc-block-comment.ql now uses raw HTML in the QLDoc. The Query Console
seems to support it, but the VSCode extension does not, see
github/vscode-codeql#794.
Could also omit the closing `*/` from the QLDoc in the future, if necessary.
@alexet
Copy link
Contributor

alexet commented Mar 22, 2021

Vscode doesn't support non-span tags in markdown and we pass the markdown directly to vscode so this will be tricky to support. See microsoft/vscode#110945 for the upstream issue.

@Marcono1234
Copy link
Contributor Author

Thanks for the information! Feel free to close this issue then if you think VSCode should fix this issue, unless you want to perform some pre-processing.

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

No branches or pull requests

2 participants