Commit Graph

101 Commits

Author SHA1 Message Date
Josh Soref
7695f70ffb spelling: because
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-01 03:40:12 -04: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
85fabb23ed include comments on SPI symbols when they're in symbol graphs 2021-06-30 16:13:08 -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
f6e0ea2b0f update BatchMode test to fully match the source range data 2021-04-09 12:34:20 -06:00
Victoria Mitchell
8f3f06899a make ASTContext RawComment cache aware of serialization
rdar://76162972
2021-04-09 12:34:20 -06:00
QuietMisdreavus
84165788d8 Merge pull request #36422 from apple/QuietMisdreavus/enum-titles
[SymbolGraph] use fully qualified titles for enum elements
2021-03-15 10:04:14 -06:00
Victoria Mitchell
5d1b588273 use fully qualified titles for enum elements
rdar://74051287
2021-03-12 13:45:11 -07:00
Victoria Mitchell
fe4984b9a7 don't filter symbols if they have platform-agnostic availability 2021-03-10 09:17:22 -07:00
QuietMisdreavus
1451960933 [SymbolGraph] add a USR for RHS types in generic conformances (#36242)
rdar://70442228
2021-03-05 08:24:57 -07:00
Victoria Mitchell
db3685aa29 don't emit navigator name if it's the same as subHeading 2021-03-01 10:57:54 -07:00
Victoria Mitchell
1e5dc37538 don't print USRs for type parameters into symbol graphs
rdar://73478316
2021-01-28 11:15:54 -07:00
Anthony Latsis
4ce7a2d060 CodeCompletion: Annotate archetypes, generic parameters and dependent members 2020-10-27 14:39:52 +03:00
Ashley Garland
ecf8d556e5 [SymbolGraph] Don't link type identifier fragments to private symbols
These links will never resolve because the symbols are never emitted
in the first place.

rdar://64178490
2020-08-07 14:20:28 -07:00
Ashley Garland
50c365d268 [SymbolGraph] UnconditionallyUnavailable test should only run on macOS
NFC.
2020-06-21 19:44:43 -07:00
Ashley Garland
0a29ba8839 [SymbolGraph] Add back isUnconditionallyUnavailable
It turns out this needed to prevent automatically inheriting a
default introduced availability for a given module.

rdar://64536460
2020-06-19 11:16:54 -07:00
Ashley Garland
a9d692c1fb [SymbolGraph] Only include where clause constraints in swiftExtension
Otherwise, this creates noise in conditional conformance phrasings.

rdar://64425199
2020-06-17 09:51:59 -07:00
Doug Gregor
80e2b48d36 [Test] Version cleanup 2020-06-15 14:26:28 -07:00
AG
29d3cc40cf Merge pull request #32246 from bitjammer/acgarland/rdar-63941806-dont-link-self-fragment
[SymbolGraph] Don't add precise identifier to `Self` fragment
2020-06-08 15:37:38 -07:00
AG
0257c7e71a Merge pull request #32241 from bitjammer/acgarland/rdar-64047985-fully-qualified-title
[SymbolGraph] Use fully qualified name for type's page titles
2020-06-08 13:12:56 -07:00
Ashley Garland
580bf4d2c9 [SymbolGraph] Don't add precise identifier to Self fragment
So that these identifiers aren't turned into links.

rdar://63941806
2020-06-08 12:51:59 -07:00
AG
11ef9bd92f Merge pull request #32217 from bitjammer/acgarland/rdar-63120829-show-in-interface-not-underscored
[SymbolGraph] Don't consider @show_in_interface for underscored names
2020-06-08 12:21:56 -07:00
Ashley Garland
f822296cb2 [SymbolGraph] Use fully qualified name for type's page titles
rdar://64047985
2020-06-08 10:36:06 -07:00
Ashley Garland
c647c11bb5 [SymbolGraph] Don't consider @show_in_interface for underscored names
The fact that a declaration has `@_show_in_interface` shouldn't be
used to decide whether something has underscored naming, which
is just one specific kind of check regarding naming only.

Move the check for this attribute out one level.

rdar://63120829
2020-06-05 16:52:35 -07:00
Ashley Garland
dd7a7f7c89 [SymbolGraph] Print non-underscored attributes in declarations
rdar://63338507
2020-06-05 13:36:22 -07:00
Ashley Garland
a72231128e [SymbolGraph] Don't print inherited list in declaration fragments
Add a new `PrintInherited` flag to `PrintOptions` to support this.

rdar://63033669
2020-06-04 11:52:51 -07:00
AG
7c8d860e03 Merge pull request #32093 from bitjammer/acgarland/rdar-63738390-inherit-availability
[SymbolGraph] Inherit availability from parent contexts
2020-06-04 10:34:28 -07:00
Ashley Garland
975d2520e8 [SymbolGraph] Print where clause in full declaration fragments
rdar://63233737
2020-06-02 11:33:42 -07:00
Ashley Garland
118e7c3cda [SymbolGraph] Inherit availability from parent contexts
Also be a little smarter about encountering duplicate `@available`
attributes on the same declaration.

rdar://63570830
2020-06-02 11:32:04 -07:00
Ashley Garland
51ce1f2b0f [SymbolGraph] Look for @_spi on extensions
Consider declarations inside `@_spi` extensions to be internal.

Clean up the "implicitly private" check to work for `Decl` and not just
`ValueDecl`, allowing it to be used directly on extensions instead of having to
look for extensions everywhere.

rdar://63361634
2020-05-27 16:00:15 -07:00
Ashley Garland
720d3d2f2a [SymbolGraph] Show get/set on property/subscript full declarations
But don't show them in subheading contexts.

rdar://63233897
2020-05-20 14:16:45 -07:00
Ashley Garland
f2c10d2ed4 [SymbolGraph] Use identifier for type name fragments
In the cases where we specialize the presentation of type declarations in a
subheading or navigator setting, make sure to use the `identifier` fragment
kind instead of `typeIdentifier` to keep it consistent with the normal or
"full" setting.

rdar://62953144
2020-05-06 17:28:28 -07:00
Ashley Garland
d4e5c6f438 [SymbolGraph] Add navigator declaration fragments
Only print the type name for a type's navigator fragments.

Don't print where clauses for navigator or subHeading fragments.

rdar://62353465
2020-04-24 20:20:19 -07:00
Ashley Garland
9d6ec078c2 [SymbolGraph] Filter @_spi declarations
These definitely shouldn't be showing up in symbol graphs with a minimum access
level of `public`, and it's not clear whether another minimum access level
should show these. For now, filter them unconditionally.

rdar://62081711
2020-04-21 14:01:58 -07:00
Ashley Garland
115a8de9ae [SymbolGraph] Type subheadings: don't print generics/inheritance
Subheadings for types are treated more as a title element and can't be
overloaded in the same way that other declarations can be. Abridge these
fragments to only contain the keyword and identifier.

rdar://62040714
2020-04-20 14:25:19 -07:00
Ashley Garland
7d7a8d35e5 [SymbolGraph] Don't trim comment segments past the first nonspace offset
Otherwise, the `SourceManager` may skip over a blank line, causing
it to have a line number off by one.

Measure initial indentation from the first non-blank line.

rdar://61827368
2020-04-16 14:24:23 -07:00
AG
21e9307dd9 Merge pull request #31047 from bitjammer/acgarland/rdar-61746582-dont-use-innermost-context
[SymbolGraph] Don't use innermost context for swiftExtension
2020-04-15 15:43:27 -07:00
Ashley Garland
d62e4ac4d7 [SymbolGraph] Don't use innermost context for swiftExtension
`getInnerMostContext` can return the same value if it is a type, but
`swiftExtension` should always look upward for an extension.

rdar://61746582
2020-04-15 13:59:54 -07:00
Ashley Garland
98d8eb9074 [SymbolGraph] Use isImplicitlyPrivate for extended types
This was just using `hasUnderscoredNaming` before but this only checks the
leafmost type. When filtering extended types, it should continue to look up
through nesting types to see if they are also implicitly private.

rdar://61843516
2020-04-15 13:01:15 -07:00
Ashley Garland
9611047d4a [SymbolGraph] Add internal/externalParam declaration fragment
These were previously mapped to identifier. Some clients may wish to render
these differently in their declaration blocks.

rdar://61782916
2020-04-14 16:06:56 -07:00
Ashley Garland
06d1d502a1 [SymbolGraph] Ignore some Self requirements
To ease the burden on the client, ignore some generic requirements involving
Self. For example, `Self: P` where we already know that `Self` conforms to `P`.

An example case:

```
public struct S: Equatable {
  public static func ==(lhs: S, rhs: S) -> Bool { ... }
}
```

`!=` is defined in terms of `Self` and the default implementation has a `Self:
Equatable`. For the purposes of documentation, it's not necessary to specify
that again on the page of documentation for `!=`.

rdar://60963924
2020-04-13 13:17:33 -07:00
Ashley Garland
58edd83f37 [SymbolGraph] Completely filter unavailable/obsoleted symbols
Symbol graph files are processed per platform--documentation for symbols that
are unconditionally unavailable or obsoleted on a platform shouldn't be shown
for that same platform.

Also, removes `isUnconditionallyUnavailable` from the JSON format. If it's
unconditionally unavailable, it won't show up at all.

rdar://60193675
2020-03-18 09:43:08 -07:00
Ashley Garland
5b6becf186 [SymbolGraph] Omit empty docComment fields
rdar://59500543
2020-03-10 19:37:39 -07:00
Ashley Garland
f0887fa245 [SymbolGraph] Emit synthesized members
Emit copies of default implementations in protocol extensions and superclass declarations in conforming types and subclasses respectively using a virtual USR, i.e. `${REAL_USR}::SYNTHESIZED::${CONFORMING_OR_SUBCLASS_TYPE_USR}`.

- Add a -skip-synthesized-members option to skip these synthesized members.

- Create a new wrapping `Symbol` type that can also contain a base type declaration as well as the inherited declaration for those synthesized cases. Move some symbol-specific APIs there.

- Doc comments can “cascade” down to protocol extensions or refinements in concrete types. When emitting the doc comment for a symbol, look up through to superclasses or protocol requirements for where a doc comment is actually written.

- Clean up filtering of implicitly private (e.g. “public underscored”) types

rdar://problem/59128787
2020-03-04 16:04:21 -08:00
Ashley Garland
72715eaf71 SymbolGraph: Add more granular kinds
This is necessary to disambiguate some symbols with the same path components
and makes the data clearer to debug.

rdar://problem/59841727
2020-03-02 12:34:03 -08:00
Ashley Garland
be77d57121 SymbolGraph: Serialize decl and raw comment locations
- Add DocRangesLayout to the `.swiftsourceinfo`.
  This is a blob containing an array of `SingleRawComment`
  source locations.

- Add DocLocWriter for serializing `SingleRawComment` locs into the
  `DocLocsLayout` buffer.
  Serialize start line, start column, and length of `SingleRawComment`
  pieces in `.swiftsourceinfo`

- Read doc locs when loading basic declaration locs from a ModuleFile.
  - Load `DOC_LOCS` blob into ModuleFile::DocLocsData
  - Reconstitute RawComment ranges when available from .swiftsourceinfo

- Allow requesting serialized raw comment if available

rdar://problem/58339492
2020-02-17 16:20:59 -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