Commit Graph

28 Commits

Author SHA1 Message Date
Daniel Grumberg
d960101422 Add test to check nested exported imports in SymbolGraphGen 2024-04-25 11:33:15 +01:00
Daniel Grumberg
9964884809 Recursively collect exported imports to allow fetching all visible Decls for symbol graph generation
This change is two fold. Firstly it enables collection of exported
imports from non source file units. Additionally this recurses through
the exported imports to ensure the transitive set is collected.

Fixes https://github.com/apple/swift/issues/59920
rdar://89687175
2024-04-25 11:33:11 +01:00
QuietMisdreavus
f3ad288a9a don't assert when a module re-exports a module and one of its symbols (#64479)
rdar://106807038
2023-03-22 09:39:44 -06:00
Max Obermeier
adc1131857 fix apple/swift-docc#422 (#62409)
do not emit extension block symbols for extensions to external types when the extended type is re-exported by the extending module
2022-12-06 09:46:02 -07:00
Anthony Latsis
d553d0466a Merge pull request #62355 from AnthonyLatsis/sr-no-sr
[NFC] Migrate remnant Jira issue references to GitHub issues
2022-12-04 12:08:25 +03:00
Anthony Latsis
4cb63c8a0f [NFC] Migrate remnant Jira issue references to GitHub issues 2022-12-04 08:20:34 +03:00
Max Obermeier
504fe3c3a4 Make emission of extension block symbols formal feature
- add name to lib/Option/features.json
 - add flag for explicitly disabling extension block symbols feature
2022-10-19 19:13:11 +02:00
Anthony Latsis
90453886f7 Merge pull request #60957 from AnthonyLatsis/migrate-test-suite-to-gh-issues-23
Gardening: Migrate test suite to GH issues p. 23
2022-09-22 04:29:32 +03:00
Max Obermeier
453fd2231b Allow for emission of swift.extension symbols for extensions to external types in swiftSymbolGraphGen (#59047)
This includes:
 - bumping the SWIFT_SYMBOLGRAPH_FORMAT_MINOR version
 - introduction of the "swift.extension" symbol and "extensionTo" relationship
 - adding support for ExtensionDecl to the Symbol class
 - adding a "typeKind" field to the symbol's extension mixin which indicates what kind
   of symbol was extended
 - intoduction of the -emit-extension-block-symbols flag, which enables the behavior
   outlined below
 - adaptions to SymbolGraphASTWalker that ensure a swift.extension symbol is emitted
   for each extension to a type that does not exist in the local symbol graph
 - adaptions to SymbolGraph and SymbolGraphASTWalker that ensure member and conformance
   relationships are correctly associated with the swift.extension symbol instead of
   the original type declaration's (extended nominal's) symbol where applicable
 - adaptions to SymbolGraphASTWalker that ensure swift.extension symbols are connected
   to their respective extended nominal's symbol using an extensionTo relationship

Testing:
- adds SymbolGraph tests that test behavior only relevant in
  -emit-extension-block-symbols mode
- adapts some SymbolGraph tests to additionally test similar behavior for
  extensions to external types in -emit-extension-block-symbols mode
- adapts some SymbolGraph tests to (additionally or exclusively) test the
  behavior with -emit-extension-block-symbols mode enabled

Bugfixes:
- fixes a bug where some conformsTo relationships implicated by the conformances
  declared on an extension to an external type were not emitted
  (see test/SymbolGraph/Relationships/ConformsTo/Indirect.swift)

Further changes:
- documents the strategy for naming and associating children declared in extensions
  to typealiases (see test/SymbolGraph/Relationships/MemberOf/Typealias.swift,
  test/SymbolGraph/Symbols/Names.swift)
2022-09-16 12:02:40 -06:00
QuietMisdreavus
d043378412 [SymbolGraphGen] Refactor export-import logic (#61049)
rdar://98808363
2022-09-13 10:08:10 -06:00
QuietMisdreavus
f674b473ec introduce a @_documentation(...) attribute to influence SymbolGraphGen (#60242)
* add @_documentation(...) attribute to influence SymbolGraphGen

rdar://79049241
2022-09-06 14:12:42 -06:00
Anthony Latsis
234dea0fd9 Gardening: Migrate test suite to GH issues: SymbolGraph 2022-09-06 15:08:56 +03:00
swift-ci
bb56ee29d0 Merge remote-tracking branch 'origin/main' into rebranch 2022-07-08 08:14:09 -07:00
QuietMisdreavus
2d874788f6 [SymbolGraphGen] only include the given symbol for qualified imports (#59852)
* only include the given symbol for qualified imports

rdar://96309088

* re-exporting one type should not allow unrelated types to sneak in

* ensure that children of re-exported types are also re-exported
2022-07-08 09:13:08 -06:00
swift-ci
b6b2919f08 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-13 16:33:39 -07:00
Victoria Mitchell
3bec6223cb re-exported synthesized extensions need to go under the base module
rdar://93928003
2022-05-27 13:10:24 -06:00
Ben Barham
ac4715bb33 [rebranch] Remove check for minor version
Minor isn't provided in the `Triple` for Linux, so it's no longer added
to the output.
2022-05-23 11:37:45 -07:00
Ben Barham
f2bd6ce9cb [next] Remove subminor version from various tests
The "0" subminor is no longer included after
114b4d96e4 (which generally doesn't add a
subminor). Remove it from checks depending on it.
2022-05-11 17:06:29 -07:00
Franklin Schrans
9cd44ca5d1 [SymbolGraphGen] Emit symbols from exported modules
When emitting a symbol graph file for a module that import modules via
`@_exported import`, emits those modules' symbols as well.

SR-15753

rdar://89547374
2022-02-28 17:21:25 +00:00
Victoria Mitchell
183db81d12 rename symbol graph files for cross-import overlays
rdar://79474927
2021-06-22 16:50:34 -06:00
QuietMisdreavus
55199f510a Merge pull request #35919 from apple/QuietMisdreavus/invalid-range-raw-comment
don't load raw comments for invalid serialized ranges
2021-02-13 16:20:47 -07:00
Victoria Mitchell
3e8b3e82b1 add a test for busted source info in symbol graph tool 2021-02-11 12:40:12 -07:00
Victoria Mitchell
65665ebffa don't crash the symbol graph tool when a module fails to load 2021-02-11 12:04:58 -07:00
Victoria Mitchell
bf9274d390 add the overlay module name to the overlay symbol graph file name 2020-12-11 12:08:25 -07:00
Victoria Mitchell
85ad81625c add test for cross-import overlay symbol graphs 2020-12-10 19:13:37 -07:00
Ashley Garland
d6e49a98db [SymbolGraph] Put extending declarations in rootmost module
When extending another module's type in your module, serialize declarations in
the extension into the other module's "extension" symbol graph file, including
relationships. This mechanic should continue up to the rootmost module. For
example:

A.AStruct <- B.BStruct < C.CStruct

Both BStruct and CStruct should go in `@A` symbol graph files because AStruct
owns BStruct and by extension owns CStruct. This is reflected in
documentation curation in some form already.

rdar://60796811
2020-04-07 15:41:59 -07:00
Ashley Garland
58bbe1ec04 SymbolGraph: Don't unconditionally add edge targets to the graph
Edge targets might point outside the module, so don't include them
unconditionally.

rdar://58876107
2020-02-11 13:23:16 -08:00
Ashley Garland
7190073a85 Serialize symbol graphs for extended modules separately
When a module extends a type from another module, serialize those symbols into
separated files dedicated to those extended modules. This makes it easier to
ingest and categorize those symbols under the extended module if desired.

rdar://58941718
2020-02-11 13:23:16 -08:00