Commit Graph

240 Commits

Author SHA1 Message Date
Victoria Mitchell
8faaee8ab7 synthesized symbols should always inherit docs 2021-04-13 11:47:44 -05:00
Victoria Mitchell
977f134aef non-synthesized symbols can inherit docs too 2021-04-12 18:26:08 -05:00
Victoria Mitchell
f4154d6019 add flag to skip docs on synthesized symbols 2021-04-11 17:40:37 -05:00
Victoria Mitchell
983cbdf12f include information about synthesized symbols' sources
rdar://75741632
2021-04-11 17:40:32 -05:00
Victoria Mitchell
ba2b92be4e call it PrintMessages instead 2021-04-07 08:58:20 -06:00
Victoria Mitchell
0c5955b7fa silence symbolgraph-extract output without -v flag
rdar://72630103
2021-04-06 16:40:38 -06:00
Nathan Hawes
08250f058a [SourceKit/CursorInfo] Report the set of decls referenced in the symbol graph's "declarationFragments" field.
Resolves rdar://75809521
2021-04-03 09:42:54 +10:00
Victoria Mitchell
19e6144be4 always print enum elements
in some situations, enum element decls are being skipped when rendering
declaration fragments. this trips an assertion in the declaration
fragment renderer that ensures that it always renders something. by
always rendering enum elements, we can sidestep this issue.
2021-03-19 10:43:52 -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
QuietMisdreavus
5871025259 Merge pull request #36367 from apple/QuietMisdreavus/symbol-availability
[SymbolGraph] don't filter out symbols if their availability was for a platform-agnostic target

rdar://74670284
2021-03-15 08:03:22 -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
Nathan Hawes
7886b5047d Merge pull request #36330 from nathawes/include-symbol-itself-in-parent-context-list
[SourceKit][CursorInfo] Also include the symbol itself in the "parent" contexts list
2021-03-10 12:53:52 +10:00
Nathan Hawes
b8832f4fbc [SourceKit][SymbolGraphGen] Also include the symbol itself in the "parent" contexts list.
Including the symbol itself means if clients want the same info we provide
about the parent contexts for the symbol under the cursor they won’t need to
parse it out from the symbol graph json.

Resolves rdar://problem/75121535
2021-03-06 12:04:37 +10: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
AG
a5b804602d Merge pull request #35110 from bitjammer/acgarland/emit-symbol-graph
Add optional -emit-symbol-graph output when emitting modules
2021-02-12 09:00:58 -08:00
Nathan Hawes
6d940951ca [SourceKit][SymbolGraph] Add a 'ParentContexts' field the CursorInfo response
When the SymbolGraph json is requested via (key.retrieve_symbol_graph: 1) this adds
a new field in the response that lists all the parent contexts of the symbol under
the cursor with their symbol graph kind and name, and their USR:

key.parent_contexts: [
    {
      key.kind: "swift.struct",
      key.name: "Parent",
      key.usr: "s:27cursor_symbol_graph_parents6ParentV"
    },
    ...
  ]
}

Resolves rdar://problem/73904365
2021-02-10 16:35:57 +10:00
QuietMisdreavus
50032a6567 Merge pull request #35629 from apple/QuietMisdreavus/symbolgraph-typaram-usr
SymbolGraphGen: don't print USRs for type parameters
2021-01-28 14:46:03 -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
Ashley Garland
69c4fc47cb Add optional -emit-symbol-graph output when emitting modules
rdar://71497047
2021-01-28 09:55:33 -08:00
Varun Gandhi
f9570b2d34 [NFC] Pass full convention printing boolean for types etc.
When -experimental-print-full-convention is set, we should be printing
the full convention in diagnostics, doc comments etc.
2021-01-25 18:47:39 -08:00
Nathan Hawes
968504db34 [SymbolGraphGen] Address review comments on new printSymbolGraphForDecl entrypoint.
Change it to use EXIT_SUCCESS/FAILURE rather than a bool to match
emitSymbolGraphForModule.
2020-12-12 14:38:41 +10:00
Nathan Hawes
388052b6ab [SymbolGraph][CursorInfo] Add option to SourceKit's CursorInfo request to include the SymbolGraph JSON
Adds a new 'key.retrieve_symbol_graph' option to the request. When set to 1 it
includes the JSON for a SymbolGraph containing a single node for the symbol at
the requested position.

This also extends the SymbolGraph library with a new entry point to get a graph
for a single symbol, and to additionally support type substitution to match the
existing CursorInfo behavior (e.g. so that when invoked on `first` in
`Array<Int>().first`, the type is given as `Int?` rather than `Element?`).

Resolves rdar://problem/70551509
2020-12-12 14:38:41 +10: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
bfb2793e8a include cross-import overlay information in the symbol graph itself 2020-12-10 19:13:37 -07:00
Saleem Abdulrasool
7c968c6ccf AST: support availability on Windows
Enable Windows specific availability annotations in Swift.
2020-11-09 20:03:52 -08:00
3405691582
b59910ef5b Add OpenBSD to PlatformKinds.def.
In #31686 changes were introduced to ensure that capacity was stored in
the ManagedBuffer allocation, and @lorentey sugested that as a stopgap
measure for addressing the lack of platform malloc introspection on
OpenBSD, we use Swift availability attributes instead on the relevant
parts of ManagedBuffer and friends.

Since platform availability symbols must be specifically set up to be
used, this commit does so in advance of the above change.
2020-09-09 18:57:26 -04:00
David Zarzycki
1e940c2c7e [NFC] Fix -Wsuggest-override warnings
LLVM, as of 77e0e9e17daf0865620abcd41f692ab0642367c4, now builds with
-Wsuggest-override. Let's clean up the swift sources rather than disable
the warning locally.
2020-08-13 16:17:46 -04: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
Nathan Hawes
244dc4a768 [AST] Rename PlatformKind::OSX to PlatformKind::macOS
Because the names are coming from a .def file used for printing too, this
simplifies the printing logic as well.
2020-07-08 16:29:31 -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
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
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
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
dd7a7f7c89 [SymbolGraph] Print non-underscored attributes in declarations
rdar://63338507
2020-06-05 13:36:22 -07:00
AG
fb99cfcf6b Merge pull request #32189 from bitjammer/acgarland/rdar-63033669-sgf-full-decl-no-inherited
[SymbolGraph] Don't print inherited list in declaration fragments
2020-06-05 12:55:42 -07:00
Ashley Garland
0e7a329ccd [SymbolGraph] Don't emit extension symbol graphs if empty
rdar://63058801
2020-06-04 15:40:07 -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
AG
ef7da4d47a Merge pull request #31903 from bitjammer/acgarland/rdar-63233897-get-set-proto-req
[SymbolGraph] Show get/set on property/subscript full declarations
2020-05-26 11:04:48 -07:00
Owen Voorhees
45bc578ae5 [SourceManager] Rename line and column APIs for clarity 2020-05-21 12:54:07 -05: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
Anthony Latsis
55447e66aa Merge pull request #31645 from AnthonyLatsis/relocate-to-iterabledc
[NFC] AST: Relocate some conformance lookup client methods from DeclContext to IterableDeclContext
2020-05-18 22:25:08 +03:00
Anthony Latsis
edcf7640c0 [NFC] AST: Define and use IterableDeclContext::getAsGenericContext() 2020-05-08 03:15:07 +03:00
Saleem Abdulrasool
09975d1253 sprinkle llvm_unreachable for covered switches (NFC)
Annotate the covered switches with `llvm_unreachable` to avoid the MSVC
warning which does not recognise the covered switches.  This allows us
to avoid a spew of warnings.
2020-05-07 11:05:35 -07:00