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

Proposal: treat CompletionItem#description as markdown #111

Closed
rictic opened this issue Nov 3, 2016 · 16 comments
Closed

Proposal: treat CompletionItem#description as markdown #111

rictic opened this issue Nov 3, 2016 · 16 comments
Labels
feature-request Request for new features or functionality
Milestone

Comments

@rictic
Copy link
Contributor

rictic commented Nov 3, 2016

In the polymer language server we have the same documentation available for a symbol whether we're autocompleting it or giving the docs on hover. I expect most other servers to be in a similar boat. The markdown rendering for hover documentation is great, and we'd like to have similar rendering for the same content.

@svenefftinge
Copy link
Contributor

In general whenever the LSP passes a strings to be displayed to the user (also showMessage for instance) it should allow the same kind of mark up.
Always assuming markdown seems good enough to me.

@dbaeumer dbaeumer added info-needed Issue requires more information from poster feature-request Request for new features or functionality labels Nov 21, 2016
@dbaeumer
Copy link
Member

@rictic are you talking about details or documentation. I agree it would make sense to allow markdown in the documentation part.

@jrieken did you have such requests against the VS Code API as well ?

@rictic
Copy link
Contributor Author

rictic commented Nov 22, 2016

@dbaeumer Yeah, I'm talking about documentation. No opinion on details.

@jrieken
Copy link
Member

jrieken commented Nov 22, 2016

Yes - we have request to allow markdown in more places but haven't tackled that yet

@dbaeumer dbaeumer removed the info-needed Issue requires more information from poster label Nov 22, 2016
@dbaeumer dbaeumer added this to the Backlog milestone Nov 22, 2016
@dbaeumer
Copy link
Member

@jrieken cool. We keep it as a feature request then.

@felixfbecker
Copy link

The PHP stubs for the PHP standard libraries all contain HTML in their docblocks, which looks awful at the moment. Using markdown in docblocks is very common, and would also solve the HTML case, since markdown can contain HTML.

@jrieken
Copy link
Member

jrieken commented Dec 27, 2016

and would also solve the HTML case, since markdown can contain HTML.

fyi - we currently don't allow html in markdown

@felixfbecker
Copy link

Any reason why?

@jrieken
Copy link
Member

jrieken commented Dec 27, 2016

script execution

@felixfbecker
Copy link

felixfbecker commented Dec 27, 2016

Good point, but I think it would be pretty easy to not allow any <script>, <style>, onclick etc. but only basic elements like <b>, <br>, <table>, etc. If the markdown parser you're using doesn't provide this, sanitize-html is super easy to use.

@jrieken
Copy link
Member

jrieken commented Dec 27, 2016

I still haven't found a complete list of onclick etc attributes...

@felixfbecker
Copy link

Instead of blacklisting all script execution attributes, you can just whitelist safe attributes. Normally you don't use that many attributes in HTML in markdown, it's mostly basic elements like the ones I mentioned above that could also be represented in markdown.

@rcjsuen
Copy link
Contributor

rcjsuen commented Jun 15, 2017

Would also love it if the documentation field on CompletionItem supported Markdown.

@dbaeumer
Copy link
Member

@dbaeumer dbaeumer modified the milestones: Backlog, November 2017 Nov 23, 2017
@dbaeumer
Copy link
Member

Implemented in the npm node modules as speced in the protocol in a backwards compatible way.

@dbaeumer
Copy link
Member

Besides CompletionItem, SignatureHelp can provide Markdown as well.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

6 participants