-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Allow diagnostics messages to have markdown (or formatted text) content #54272
Comments
Also related: vuejs/vetur#849. |
At the very least it would be helpful to have to ability to link them to an external url (EG: web resource explaining the cause of the problem) |
Issue #74632 was marked as dupe of this issue. @sandy081 , @jrieken , @mjbvz - I hope the current feature request will be implemented in such a way which would allow the content of a problem list item to differ from content of the pop-up shown for it in the editor. Please see #74632 for details. Also, I would be happy to contribute PRs for implementing this. |
@samrat-gavale I do not think it is a good idea to show different data for the same diagnostic at different places. If we support markdown we have to think how we want to show it in problems view. We can render the markdown also in problems view given that tree supports dynamic height. |
#11847 might also be relevant. |
@sandy081 - by different data, I didn't mean completely unrelated data. We want to show detailed information (e.g. markdown with links) in pop-up and a short, one line summary in problems list for a given diagnostic. Given the scenario that the opened folder may have large number of diagnostics, if we show same detailed information at both places, the problems list is going to bloat up making it difficult for users to quickly go through all the diagnostics in the problems list to choose the most impactful ones to act on. |
@sandy081 - To add to @samrat-gavale when you are in the problems list, the user is triaging through issues that apply to the entire workspace in a UI element that is ~1/5 the size of the app. Once the user finds an item of interest, they double click. The context has changed from the entire workspace to only a specific file, and a specific line of that file with the context of the rest of the code around it in a UI element that is ~3/5 the size of the app. I think it's appropriate for the information presented to similarly mirror that scope and allow a data provider to add more rich information in this pane, where the user has clearly drilled in. We can actually do this today by leverage two different systems - and that is what we'd like to avoid hacking around (others on this thread could do a similar hack until this is resolved). We have the ability in VSCode to "setDecorations" that is unrelated to the problems list. As such, we create one issue in the problems list that has triage text for that quick summary view pan - and when the user selects, we use the decoration interface to provide a detailed popup on that line to further guide them. The UI is clunky here, because we technically have both the problems list and custom popup present on this line of code. We'd really prefer to just use problems list end to end. We can share screenshots or video if that helps. |
I got it, but I wonder how can such a Diagnostic model object will look like in the API? At present the model has |
Perhaps a new property |
Introducing a new property makes sense to me, but might need a better naming. /**
* The human-readable message.
*/
message: string;
/**
* The human-readable description.
*/
details|description: MarkdownString; @jrieken What's your opinion? |
If For Problems View, can't we truncate the message to fit one line if it's longer than one line? The only thing that might cause problem is code block, and I think it's fine to convert them into plain, un-highlighted |
It would be really really helpful to not only have working links in the problems panel, but also at least a second color. As there are some languages that highlight important parts of a problem description. |
Better approach is to make message a |
This extension is a great solution for VS Code and TypeScript, but we should really fix this issue with the Language Server Protocol, so it's fixed for all languages. By improving the LSP, we could also see the pretty errors with the command "Go to Next Problem" and maybe even in the Problems panel, instead of just the hover. |
Copied from microsoft/vscode-eslint#1719:
|
It looks like I think that ideally the user should be able to choose to enable/disable the If you want to implement it now to the hover, you could use |
Bumping this issue. Sadly this very much affects the usability of the popular "Pretty TypeScript Errors" extension, and makes it near unusable when long errors are displayed as the original typescript errors clutter the "mini problems view" and for now there seem to be no way to disable those. |
Related to #100742 on Stack Overflow: How to pretty print clean TypeScript errors in VS Code? |
bump! until this is solved, pretty ts errors is useless, unfortunately! see yoavbls/pretty-ts-errors#3 |
That's just not correct, and therefor off topic. Been using it for years and can assure you that it's not useless. |
Is there any progress? I found LSP Specification has already supported markdown string as diagnostic text, see Change the type of Diagnostic.message to MarkedString. |
it's frankly unbelievable that MS would ship a product like this with such unreadable TS lint errors, when TS is also a MS product. |
Sadly, +6 years and running since the issue was opened. Someone has kindly contributed code already, which is waiting for a merge. Equally sad that the atom editor had support for this, but was conveniently killed by GitHub :-( Perhaps ping @jrieken ? |
Feature request
Allow diagnostics to display formatted content. The specific request was to show part of a diagnostic message in bold.
A few potential options:
(This request came out of the FB meeting)
The text was updated successfully, but these errors were encountered: