Commit Graph

240 Commits

Author SHA1 Message Date
QuietMisdreavus
a8ecfc94ec consider requirements of an underscored protocol to also be underscored (#59480)
rdar://94336558
2022-06-16 14:20:14 -06:00
swift-ci
b6b2919f08 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-13 16:33:39 -07:00
swift-ci
9eded1516d Merge pull request #59129 from apple/QuietMisdreavus/exported-ext
re-exported synthesized extensions need to go under the base module
2022-06-13 16:33:34 -07:00
swift-ci
d48600da5b Merge remote-tracking branch 'origin/main' into rebranch 2022-06-03 08:16:16 -07:00
Jager-yoo
3b8db192a0 [Gardening] fix typo "supercede" -> "supersede" 2022-05-29 03:35:24 +09: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
swift-ci
284a50fa81 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-24 10:54:14 -07:00
QuietMisdreavus
5bef9f2118 [SymbolGraphGen] Add filename and module name to symbols' doc comments (#58857)
* move symbol graph samples to the bottom of the file

* add information about a doc comment's file and module

rdar://81190369

* refactor: group file URI collection/serialization together

* test for docComment.module to identify externally-inherited docs
2022-05-24 11:36:13 -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
4e1eb1abe8 Merge pull request #58620 from bnbarham/rebranch-fixes
[rebranch] Various fixes to get macos to a compiling state
2022-05-06 09:59:38 -07:00
Ben Barham
114b4d96e4 [next] Use new VersionTuple API
The `VersionTuple` API was changed llvm/llvm-project
219672b8dd06c4765185fa3161c98437d49b4a1b to return `VersionTuple`
from `get*Version` rather than pass in major, minor, and subminor output
parameters. Update uses to the new API.

Note that `getMacOSXVersion` is slightly different in that it returns a
boolean while taking a `VersionTuple` output parameter to match its
previous behaviour. There doesn't seem to be any use that actually
checks this value though, so we should either update the API to return
an `Optional` and actually check it *or* remove the "failure" case and
return a `VersionTuple` like all the others.
2022-05-05 16:25:10 -07:00
QuietMisdreavus
c885dc6fd6 [SymbolGraphGen] consider modules not equal if they're not from the same compiler (#58421)
* consider modules not equal if they're not from the same compiler

rdar://92263972

* add swift-symbolgraph-extract command and checks to the test
2022-05-05 14:47:35 -06:00
Josh Soref
dbaa13212c spelling: retrieve
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-30 23:36:19 -04:00
Josh Soref
40f2db337a spelling: indentation
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-30 23:36:19 -04:00
Josh Soref
90afda6dee spelling: extension
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-30 23:36:19 -04:00
Josh Soref
7a29358efc spelling: condition
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-30 23:36:19 -04:00
QuietMisdreavus
1b5c3d79dd skip underscored implicit Clang decls (#42493)
rdar://92018648
2022-04-22 16:43:31 -06:00
Ben Barham
680bf2e753 [CursorInfo] Add ObjC location to generated symbol graph
Add the file for an imported ObjC-symbol to the generated symbol graph
when ObjC documentation is requested.

Skips line/column information for now since it's not needed. If we add
those we should extract location retrieval to a common method for both
cursor info and symbol graph gen.

Resolves rdar://91658873.
2022-04-13 14:51:43 -07:00
Ben Barham
e2c9836a1d [CursorInfo] Add Clang documentation to SymbolGraph output
This currently doesn't check for inherited docs, ie. either the
imported declaration has docs or it doesn't. There's also a few odd
cases with mixed doc types and when each line is prefixed with '*', but
it's good enough for an initial implementation.

Moves UTF8 sanitisation out of ASTPrinter.h and into Unicode.h so that
it can be used here as well.

Resolves rdar://91388603.
2022-04-08 13:46:38 -07:00
QuietMisdreavus
e24f126165 [SymbolGraph] don't emit symbols for implicit inherited initializers (#41985)
rdar://90401347
2022-04-01 10:02:19 -06:00
Evan Wilde
aa51bdf17a Add noasync availability kind to available attr
This patch adds the `noasync` availability kind to `@available`. The
spelling is `@available(*, noasync)`.
2022-03-22 15:12:51 -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
cab1669e09 only recurse getDisplayDecls in SymbolGraphGen 2022-02-19 10:32:29 -07:00
Franklin Schrans
7c5a8fd0a1 [SymbolGraph] Don't emit symbols that are unavailable on all platforms
rdar://88807294
2022-02-16 10:10:02 +00:00
QuietMisdreavus
f0c96b1c97 Merge pull request #41141 from apple/QuietMisdreavus/symgraph-synth-init
[SymbolGraph] don't filter out all implicit decls
2022-02-03 16:25:05 -07:00
Victoria Mitchell
08fe7c2134 [SymbolGraph] don't filter out all implicit decls 2022-02-02 12:57:40 -07:00
Victoria Mitchell
9bd3454566 [SymbolGraph] consider underscored symbols as private if they're internal
rdar://86294802
2022-02-02 09:56:50 -07:00
Victoria Mitchell
3011a3cfca [SymbolGraphGen] don't emit access control attributes in declarations
rdar://85280786
2021-12-22 16:35:12 -07:00
Becca Royal-Gordon
1880118e70 Restructure getDisplayDecl() Sendable forcing
Move this into a helper function that lives in Sema, avoiding libswiftAST calling into libswiftSema.
2021-11-19 17:51:27 -08:00
Ben Barham
6aa3e0fd00 [SymbolGraph] Determine optional requirement by presence of OptionalAttr
Rather than checking the underlying ObjectiveC decl, use the presence of
`OptionalAttr` to determine if a requirement is optional instead. This
is already added by the importer when necessary. An added benefit here
is that this also works for optional requirements defined in Swift (ie.
`@objc optional ...`).
2021-09-25 11:50:53 +10:00
Rintaro Ishizaki
6e69a44c3d [ASTPrinter] Intorduce 'IntroducerKeyword' name kind
For more fine grained annoations. For now, it's handled as the same as
'Keyword' name kind.

Fix an issue where 'extension' wasn't marked as "keyword".

Also, move 'static' priting out of 'SkipIntroducerKeywords' guard
because 'static' is not an declaration introducer.
2021-07-29 12:50:24 -07:00
Robert Widmann
d86551de67 Lift Requirement and Parameter Accessors up to GenericSignature
Start treating the null {Can}GenericSignature as a regular signature
with no requirements and no parameters. This not only makes for a much
safer abstraction, but allows us to simplify a lot of the clients of
GenericSignature that would previously have to check for null before
using the abstraction.
2021-07-22 23:27:05 -07:00
Victoria Mitchell
dd39496098 do not synthesize subclass methods
rdar://80091081
2021-07-02 14:43:53 -06:00
Victoria Mitchell
183db81d12 rename symbol graph files for cross-import overlays
rdar://79474927
2021-06-22 16:50:34 -06:00
QuietMisdreavus
7277baa07b Merge pull request #37777 from apple/QuietMisdreavus/sourceOrigin-with-feeling
[SymbolGraph] add sourceOrigin info for all protocol implementations
2021-06-11 17:11:35 -06:00
Victoria Mitchell
703ebb6861 also add sourceOrigin for local protocols without docs 2021-06-07 09:07:28 -06:00
Victoria Mitchell
6f53e1dc04 add sourceOrigin info for all protocol implementations
rdar://78680450
2021-06-03 17:07:28 -06:00
Victoria Mitchell
d281722589 add symbol-graph flag to include SPI symbols
rdar://70794131
2021-05-20 15:10:49 -06:00
Victoria Mitchell
81bc80d565 add sourceOrigin field for symbols implementing remote protocol requirements
rdar://77626724
2021-05-10 16:41:50 -06:00
QuietMisdreavus
08d1c33e6f Merge pull request #37278 from apple/QuietMisdreavus/default-relation
[SymbolGraph] add "memberOf" relations for remote protocol implementations
2021-05-07 16:19:18 -06:00
QuietMisdreavus
4b068acf23 Merge pull request #37248 from apple/QuietMisdreavus/synthesized-sourceOrigin
[SymbolGraph] add sourceOrigin for synthesized symbols even if no docs exist
2021-05-07 10:20:40 -06:00
Victoria Mitchell
633ffece87 compare module names instead of pointers 2021-05-06 10:08:09 -06:00
Victoria Mitchell
4b5045f25a add "memberOf" relations for remote protocol implementations
rdar://75729692
2021-05-05 15:44:28 -06:00
Victoria Mitchell
d81d5d56d9 add sourceOrigin even if no docs exist
rdar://77205889
2021-05-04 10:47:13 -06:00
Alex Hoppen
e7d56037e8 Merge pull request #37133 from ahoppen/pr/serialize-text-module-symbolgraph
[SymbolGraph] Fix crasher when retrieving cursor info of method defined in ObjC
2021-04-30 23:13:15 +02:00
Alex Hoppen
5d3fb8f26d [SymbolGraph] Fix crasher when retrieving cursor info of method defined in ObjC
In a mixed Objective-C / Swift module, we have a Clang module overlay that’s a Source file, not a serialized AST as is currently assumed. That assumption caused a crash when retrieving the symbol graph as part of a cursor info request to SourceKit, which was invoked on a method defined in the Objective-C part of the module.

To fix the crash, recursively use the same logic that already exists to serialize a module to also serialize the clang overlay module since that function alreayd correctly handles the distinction between source files and serialized ASTs.

Resolves rdar://76951147
2021-04-29 17:54:18 +02:00
Alex Hoppen
370128e6b6 [SymbolGraph] Fix a crash for member in invalid extension
Don’t record a `memberOf` relationship if we couldn’t look up the target, e.g. because the member is declared in an extension whose extended type doesn’t exist.

Resolves rdar://74063899
2021-04-29 14:21:52 +02:00
QuietMisdreavus
170dcd88bc Merge pull request #36863 from apple/QuietMisdreavus/docs-inheritance
[SymbolGraph] Add information about "inherited docs" for synthesized symbols
2021-04-19 19:40:38 -06:00
QuietMisdreavus
640aa214c0 reword comment to reference inheriting, not just synthesis
Co-authored-by: Franklin Schrans <7278429+franklinsch@users.noreply.github.com>
2021-04-14 10:27:20 -05:00
Ben Barham
c54c9c7079 [Gardening] Extract basic source info structs from RawComment.h 2021-04-14 10:05:27 +10:00