Commit Graph

33 Commits

Author SHA1 Message Date
Pavel Yaskevich
5a164c5f8a [Frontend] Switch from YAML to .strings based localization 2022-08-22 10:23:06 -07:00
Ben Barham
e9a80debd4 Prevent superfluous diagnostic-database execution
Add dependencies and output to the diagnostic-database target so that
it's not re-run every time swift-frontend is compiled.
2020-11-12 11:25:38 +10:00
Cassie Jones
20995ae0bb [build] Add FILES_MATCHING to CMakeLists.txt
The bare "PATTERN" argument by default does nothing, you need either
"EXCLUDE" or "FILES_MATCHING" to make it do something. This likely
wasn't previously a problem because clang is only installing headers,
but it should be fixed for robustness.
2020-10-05 15:07:02 -04:00
Cassie Jones
d74cad6960 [Localization] Install only *.db and *.yaml files (#34139)
This prevents us from picking up the .gitkeep file and any other stray
files that might end up in there.
2020-10-02 10:37:35 -07:00
Pavel Yaskevich
b51b1f121e [Localization] Establish dependency between def-to-yaml converter and diagnostic-database 2020-09-03 16:33:23 -07:00
HassanElDesouky
e5c42e4191 [Localization] Add .gitkeep in diagnostics folder 2020-09-03 16:33:23 -07:00
HassanElDesouky
354440402f [Localization] Create swift-def-to-yaml-converter tool 2020-09-03 16:33:23 -07:00
Rintaro Ishizaki
c48a676a1c Merge pull request #31679 from Jumhyn/implicit-member-chains-different-types
[SE-0287] [Sema] Implementation for implicit member chains
2020-08-28 10:47:53 -07:00
Luciano Almeida
4b921c3487 [Sema] Improve diagnostics for key path root type inferred as option accessing wrapped member 2020-08-27 20:07:18 -03:00
Frederick Kellison-Linn
aade4aa74b [Localization] Add new diagnostics to localization file 2020-08-26 22:42:29 -04:00
Suyash Srijan
6e6de518eb [Sema] Improve diagnostics for use of self access kind modifier on accessors inside classes (#33602) 2020-08-25 20:02:52 +01:00
HassanElDesouky
b482de01c0 [Localization] Mirror the messages' changes in .def files 2020-08-18 09:01:42 +02:00
HassanElDesouky
5f74fe31c6 [Localization] Modify messages' format in yaml 2020-08-13 22:36:04 +02:00
Robert Widmann
6a510c1cf8 Merge pull request #33410 from CodaFi/extensional-angst
Implement Richer Diagnostics for Cross-File Synthesis Failures
2020-08-11 23:39:24 -07:00
Robert Widmann
3a3f92a2f7 Implement Richer Diagnostics for Cross-File Synthesis Failures
Mention the type, the requirement, and the extension in the error that
follows. In editor mode, try to insert stubs for the missing requirement
as well so the user isn't just left with a pile of unactionable errors.
2020-08-11 15:30:23 -07:00
Eric Miotto
a4bea90c91 [build] invoke swift-serialize-diagnostics for host architecture
As a result of #33346 we are relying on the tool for the current target -- this will
work for the host architecture but will fail when crosscompiling.

Addresses rdar://66800239
2020-08-11 13:12:04 -07:00
Luciano Almeida
d62e9ddd9e [Diagnostics] Minor adjustments on MissingMember tuple base and yaml message 2020-08-10 21:06:15 -03:00
Luciano Almeida
038eae48f8 Adding SR-13359 diagnostics to localization yaml files and minor comment 2020-08-10 08:40:04 -03:00
Pavel Yaskevich
20e25e4029 Merge pull request #33346 from xedin/quality-diag-serialization-tool
[Localization] Fully qualify `swift-serialize-diagnostics` tool
2020-08-07 02:07:00 -07:00
Nathan Hawes
69abfc1e6c Merge pull request #33320 from nathawes/index-key-paths
[Sema/Index] Resolve #keyPath components so they get handled by indexing, semantic highlighting, etc
2020-08-06 15:39:36 -07:00
Pavel Yaskevich
aa229c2610 [Localization] Fully qualify swift-serialize-diagnostics tool 2020-08-06 15:33:14 -07:00
Nathan Hawes
38e2bd9c89 [Diagnostics] Demote availability errors to warning for decls in ObjC keypaths to prevent source breakage.
The change to resolve ObjC #keyPath expression components caused some source
breakage as they are now being checked for availability issues. This change
updates availability checking to demote error diagnostics to warnings
within #keyPath expressions. There were cases in the source compat suite where
unavailble properites were used in #keyPath expressions, but they caused no
issues at runtime because the properties' ObjC runtime name was still correct
(e.g. the same as its renamed-to property in Swift).
2020-08-06 10:29:11 -07:00
Pavel Yaskevich
0103b79579 [Localization] Adjust cmake to include serialized diagnostics in toolchain
Building of the diagnostic database to be done in three steps:

- Copy YAMLs from <source>/localization/diagnostics to <build>/share/swift/diagnostics
- Serialize English into <build>/share/swift/diagnostics
- Install everything (YAML and `.db`) from <build>/share/swift/diagnostics
  to share/swift/diagnostics in toolchain
2020-08-05 17:05:13 -07:00
Pavel Yaskevich
8d8da1b087 [Localization] Adjust types associated with reader/writer info
Add more usages of `offset_type` where appropriate and change
buffer type to `const unsigned char *`.
2020-08-05 15:52:46 -07:00
HassanElDesouky
a84cf7f9e8 [Locale] Serialize YAML to an OnDiskHashTable format and create a tool for serialization 2020-08-05 15:52:46 -07:00
Pavel Yaskevich
d2cb1cac4f [Diagnostics] NFC: Adjust en.yaml to mirror diagnostics in .def files 2020-08-05 12:13:15 -07:00
Suyash Srijan
d3b5996b05 [Sema] Diagnose explicit access to a lazy variable's underlying storage (#33144) 2020-07-28 19:12:53 +01:00
Suyash Srijan
7ee6319cdc [Parse] [Sema] Update confusables diagnostic to mention the character names as well (#33105)
* [Parser] Update 'Confusables.def' file to include confusable and base character names

* [Parser] Add a new utility method to return the names of the confusable and base characters for a given confusable codepoint

* [Parser] Update diagnostic for confusable character during lexing to mention confusable and base character names

* [Sema] If there is just a single confusable character, emit a tailored diagnostic that also mentions the character names

* [Diagnostics] Add new diagnostic messages to the localization file

* [Test] Update confusables test

* [Utils] Update unicode confusables txt file and update script to regenerate confusables def file

* [Parse] Regenerate 'Confusables.def' using updated script

* [Utils] Adjust generate_confusables script based on review feedback

Fix a mistake with name mapping. Updated header comment. Fix a couple of linting issues.

* [Parse] Regenerate 'Confusables.def' file once again after script changes

* [Parse] Add the newline after end of 'getConfusableAndBaseCodepointNames' method

* [Test] Update diagnostic message in 'Syntax/Parser/diags.swift'
2020-07-27 23:15:31 +01:00
Suyash Srijan
cc49c6105c [Diagnostics] Update diagnostic message for invalid overrides (#33097)
* [Diagnostics] Update 'does not override' diagnostic message to include protocol context as well

* [Sema] Check whether the override context is a class or a protocol for diagnostic purposes

* [Test] Update tests with new diagnostic message for overrides in protocol context

* [Sema] Adjust diagnostic for overrides in structs and enums to use the existing 'override_nonclass_decl' diagnostic
2020-07-27 15:15:28 +01:00
Brent Royal-Gordon
57469a6472 Allow shadowing of unavailable members
This change permits a subclass to redeclare an unavailable member from a superclass. For instance, suppose you write this code (or, more likely, a version where `Base` is an ObjC class):

```swift
class Base {
  @available(*, unavailable) init() {}
}

class Derived: Base {
  /* override */ init() {}
}
```

Previously, Swift would reject `Derived.init()` without the `override` keyword, telling you that you should add it, but it would also reject it *with* the `override` keyword, telling you that you can't override something that's unavailable. This PR makes Swift accept it without the `override` keyword; declaring it with the keyword is still forbidden.

Fixes rdar://65702529.
2020-07-22 15:49:01 -07:00
Luciano Almeida
ecb70d2ad3 [Diagnostics] Adding optional note specific to keypath application base diagnostics 2020-07-15 08:53:31 -03:00
Suyash Srijan
0aabee59d6 [Typechecker] Emit specialized diagnostic notes on automatic synthesis failure to Comparable (#32797) 2020-07-14 22:03:08 +01:00
Pavel Yaskevich
8461047ae6 [Build] Move diagnostic translations from include to dedicated localization/ directory 2020-07-13 22:23:52 -07:00