Commit da50d11
authored
refactor: don't forward -1 as the diagnosticCode (#16495)
## Description
This change ensures that if the diagnostic code is set to -1 that we
instead forward None as the code. This will hopefully help any tooling
consuming this to not have to add checks for -1 and filter that code
out, since it's a useless code.
For example I just hit on this for the first time and saw this:
<img width="834" alt="Screenshot 2022-12-10 at 11 48 44"
src="https://user-images.githubusercontent.com/13974112/206852283-07c2fa6b-1ad2-4586-860d-d958e4db88ea.png">
Ideally we don't this showing, but if the code is forwarded to the
client via LSP like it is in the image, the client has no way to know if
-1 is a valid code or not.1 file changed
+13
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
| |||
0 commit comments