-
Notifications
You must be signed in to change notification settings - Fork 12.8k
28911 - change Diagnostic.code to 'string | number' #28959
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
28911 - change Diagnostic.code to 'string | number' #28959
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the same change be made to DiagnosticWithLinePosition
and DiagnosticRelatedInformation
?
@ajaff ok, will add changes to DiagnosticWithLinePosition, DiagnosticRelatedInformation. |
The unfortunate thing here is that we're going to cause a few bugs where people create a |
Hey @amcasey, can VS handle non-numeric diagnostic codes? |
@DanielRosenwasser, I believe so, but I'll confirm. Edit: Yes, it can. |
…ticWithLinePosition and DiagnosticRelatedInformation
@DanielRosenwasser I misspoke - Roslyn can accept strings but TS deserializes them as int so old versions of VS will break (probably by dropping these diagnostics). But we can definitely have newer versions of VS opt into receiving string error codes. |
Sounds like we'd need to change our API to also support a new configuration option on to say that the client can support string error codes. Even if we decided to add this functionality, we would need to keep numeric error codes around f o r e v e r. As terrible as it sounds, it might be better to return a new property on |
@DanielRosenwasser Your suggestion doesnt sound terrible. Infact i like having optional friendlyName property sounds good. That way even we could add the names to error codes (instead of numbers) and editors can decide to use them over number if present to displayed. We should keep errorCode required so that editors not handling the additional optional property can show something that user can search about. |
Friendly human readable short names are good. Although question, if we go there: Can multiple messages share a short name (so, eg, we can group all the excess property variant messages under one "name")? I don't really see why not. |
I think this PR has to be closed. |
@DanielRosenwasser just to clarify on #28959 (comment) I feel like a configuration option isn't necessary if we simply add a new optional |
Fixes #28911