Skip to content

Add support for supportsHtml on markdown strings #1344

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

Closed
DanTup opened this issue Sep 8, 2021 · 18 comments
Closed

Add support for supportsHtml on markdown strings #1344

DanTup opened this issue Sep 8, 2021 · 18 comments
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities hover
Milestone

Comments

@DanTup
Copy link
Contributor

DanTup commented Sep 8, 2021

VS Code is getting a flag on MarkdownString to say whether (some basic subset of) HTML can be rendered in addition to markdown:

microsoft/vscode#40607

I think it would be useful to support in LSP for the same reason it makes sense there. Some languages let users write their docs in Markdown and they might also include some HTML, but right now it renders literally in the tooltips which is unexpected.

@felixfbecker
Copy link

Note also that both the very original Markdown invention and the CommonMark spec (the de-facto Markdown standard) clearly allow HTML within Markdown, it's a core part of the idea behind Markdown. I.e. this is not a non-standard syntax "extension".

@dbaeumer
Copy link
Member

It does make sense to add this to LSP. However a client needs to announce the list of supported HTML tags. For VS Code they are defined here: https://github.com/microsoft/vscode/blob/6d2920473c6f13759c978dd89104c4270a83422d/src/vs/base/browser/markdownRenderer.ts#L296

@dbaeumer dbaeumer added feature-request Request for new features or functionality hover labels Sep 16, 2021
@dbaeumer dbaeumer added this to the On Deck milestone Sep 16, 2021
@dbaeumer dbaeumer added the help wanted Issues identified as good community contribution opportunities label Sep 16, 2021
@dbaeumer
Copy link
Member

PR welcome.

@dbaeumer
Copy link
Member

dbaeumer commented Nov 2, 2021

Implemented and added to the spec.

@dbaeumer dbaeumer closed this as completed Nov 2, 2021
@DanTup
Copy link
Contributor Author

DanTup commented Jan 17, 2022

@dbaeumer how does this support work? In 14f7c98 I see the client can advertise which tags it supports, but I don't see a way of passing supportsHtml on the MarkdownString to VS Code. Does it require changes in the LSP Client to set this?

@dbaeumer
Copy link
Member

For VS Code this is handled the same way as isTrusted. You specify whether this is supported via a setting in the client options. See https://github.dev/microsoft/vscode-languageserver-node/blob/e22c9bdd485d36b77cdf70fd4b34e6928822ebfe/client/src/common/client.ts#L579

@DanTup
Copy link
Contributor Author

DanTup commented Jan 17, 2022

Ah, got it - thanks!

@DanTup
Copy link
Contributor Author

DanTup commented Mar 1, 2022

@dbaeumer I don't suppose there's an approx ETA for 3.17? I thought I saw it noted in previous VS Code release notes as being published, but the site still shows 3.16 as current.

@dbaeumer
Copy link
Member

dbaeumer commented Mar 1, 2022

It is not publish. We did publish new next releases with proposed support for notebooks.

@dbaeumer
Copy link
Member

dbaeumer commented Mar 1, 2022

The plan is to have a new 3.17 release the next ~ 2 month

@DanTup
Copy link
Contributor Author

DanTup commented Mar 1, 2022

Got it, thanks! :)

@thw0rted
Copy link

thw0rted commented Mar 31, 2022

Just to check as a user who wants to consume documentation that uses inline HTML, when the new release comes out in 2 months, tags should no longer disappear in VSCode Intellisense results?

I'm having trouble finding my original issue, but I came here from microsoft/vscode#40607 -- that was resolved last year but hasn't fixed the rendering problem; I think it was only part of the puzzle.

ETA: as an end user, how do I check what version of LSP I have? It's not part of the VSCode "About" dialog.

@KamasamaK
Copy link
Contributor

KamasamaK commented Mar 31, 2022

@thw0rted The LSP client is not a part of core VS Code. The language extension would use vscode-languageclient. In order to use this new feature, it will need to use v8.0.0-next.5 or later.

@thw0rted
Copy link

thw0rted commented Apr 1, 2022

Thanks for the link. Do you know (or know how to tell) when that lands in a VSCode release? I'm just trying to figure out when the symptom (large portions of some docs are completely removed) is going to be resolved for end users, without getting passed around between the Language Service people and the VSCode people and the TypeScript people.

@KamasamaK
Copy link
Contributor

KamasamaK commented Apr 1, 2022

@thw0rted As far as I can see, the bundled typescript-language-features extension doesn't even use the LSP client. The issue you're describing would be with that bundled extension and possibly extends to the TypeScript language service it uses. It's not an issue with the LSP spec or that LSP client.

@DanTup
Copy link
Contributor Author

DanTup commented Apr 21, 2022

@dbaeumer

The plan is to have a new 3.17 release the next ~ 2 month

We're approaching 2mo from this comment - is the plan still to publish 3.17 in the near future? (not after a commitment, but a rough estimate will help me plan, there are a few things in 3.17 that would help with some things I'm working on). Thanks :)

@dbaeumer
Copy link
Member

Yes, still the plan. I am waiting for 2 APIs to be finalized in VS Code (which already happened in insider) and then I am good to go beginning of Mai..

@DanTup
Copy link
Contributor Author

DanTup commented Apr 22, 2022

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities hover
Projects
None yet
Development

No branches or pull requests

5 participants