Commit Graph

9 Commits

Author SHA1 Message Date
Alex Hoppen
66104395d7 [Sema/SourceKit] Emit same diagnostics for missing protocol requirements on the command line and in SourceKit
Some editors use diagnostics from SourceKit to replace build issues. This causes issues if the diagnostics from SourceKit are formatted differently than the build issues. Make sure they are rendered the same way, removing most uses of `DiagnosticsEditorMode`.

To do so, always emit the `add stubs for conformance` note (which previously was only emitted in editor mode) and remove all `; add <something>` suffixes from notes that state which requirements are missing.

rdar://129283608
2024-08-07 14:01:30 -07:00
Nishith Shah
8e2e625543 [Diagnostics] Use imperative msg for protocol conformance & switch-case fixits
This commit changes fixit messages from a question/suggestion to an
imperative message for protocol conformances and switch-case. Addresses
https://github.com/apple/swift/issues/67510.
2023-08-13 22:34:26 -07:00
Robert Widmann
d42ac6264f Account for Deserialized VarDecls in Setter Mismatch Diagnostics
If the setter conflict occurs in a deserialized declaration, the parent
pattern binding can be NULL. Guard the fixit on the existence of the
pattern binding so

1) we don't crash
2) we don't try to emit a fixit in otherwise extremely broken code

rdar://56558082
2020-05-21 19:22:09 -07:00
Suyash Srijan
5077b0036c [Test] Update test and add trailing space to 'static' fix-its 2019-09-04 19:27:30 +01:00
Suyash Srijan
535364c030 [Typechecker] We could also have a subscript when diagnosing SettableConflict, so guard against that 2019-09-03 21:46:31 +01:00
Suyash Srijan
37ffd6ba1b [Test] Add a test case for static subscript 2019-09-03 20:15:27 +01:00
Suyash Srijan
eb045f5b0b [Test] Add a test case for computed property 2019-09-03 20:03:11 +01:00
Suyash Srijan
8c3cb7111a [Typechecker] Remove some questionable fix-its when there is a witness mismatch 2019-09-03 19:54:09 +01:00
Suyash Srijan
7f959fd7e8 [Typechecker] Emit fix-its for witness mismatches 2019-09-02 22:05:01 +01:00