Commit Graph

7 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
Xi Ge
48ac9e0683 sema: only require static keyword when _const is used in a type context 2022-02-05 21:23:36 -08:00
Xi Ge
337b93f797 sema: properly handle Array/Dictionary literals as compile-time literals 2021-11-23 19:23:15 -08:00
Xi Ge
d45a0ce45f sema: diagnose compile-time const variables are properly initialized 2021-11-23 13:56:10 -08:00
Xi Ge
7856bbae53 sema: require witness for _const decls to be also _const 2021-11-22 15:18:29 -08:00
Xi Ge
03c76bd32d sema: diagnose passing a non-constant value into a constant parameter 2021-11-22 11:52:57 -08:00