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

add diagnostic dynamic long description #1825

Open
wants to merge 6 commits into
base: gh-pages
Choose a base branch
from
Open
16 changes: 14 additions & 2 deletions _specifications/lsp/3.18/types/diagnostic.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,22 @@ export interface Diagnostic {
source?: string;

/**
* The diagnostic's message.
* The diagnostic's message, e.g. 'Unknown type name "int_8_t"'.
*/
message: string;

/**
* An optional property to describe this diagnostic's message with more
* details. For example:
* The type name "int_8_t" is unknown. Did you mean any of these types?
* - int
* - int8_t
* Read more about the built-in types [here](file:///path/to/docs.md).
*
* @since 3.18.0
*/
longMessage?: string | MarkupContent;
Copy link
Contributor

@rchl rchl Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming of the property can suggest that it's an alternative version of message. Not sure if the intention would be that clients show both or choose one.

If the intention is to show both then maybe this should be called description...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling it description would be too similar to the property called codeDescription, which is a general/static description of the diagnostic.

In contrast, I thought about calling it longMessage because it is similar to message but provides more detail. Perhaps something like messageDetails would be more appropriate. I think that would infer that message is still important.


/**
* Additional metadata about the diagnostic.
*
Expand Down Expand Up @@ -155,4 +167,4 @@ export interface CodeDescription {
*/
href: URI;
}
```
```