Commit Graph

29 Commits

Author SHA1 Message Date
Fredrik Wieczerkowski
2703d08877 Add CollectVariableType request to SourceKit
- Add VariableTypeCollector
  This new SourceEntityWalker collects types from variable declarations.
- Add SwiftLangSupport::collectVariableTypes
- Implement CollectVariableType request
- Provide information about explicit types in CollectVarType
- Fix HasExplicitType in VariableTypeArray
- Fix typo
- Implement ranged CollectVariableTypes requests
- Use offset/length params for CollectVariableType in sourcekitd-test
- Address a bunch of PR suggestions
- Remove CanonicalType from VariableTypeCollector
  This turned out not to be needed (for now).
- Improve doc comment on VariableTypeCollector::getTypeOffsets
- Remove unused CanonicalTy variable
- Remove out-of-date comment
- Run clang-format on the CollectVariableType implementation
- Fix some minor style issues
- Use emplace_back while collecting variable infos
- Pass CollectVariableType range to VariableTypeCollector
- Use capitalized variable names in VariableTypeArray
  ...as recommended by the LLVM coding standards
- Use PrintOptions for type printing in VariableTypeCollector
- Return void for collectVariableType
  This seems to be cleaner stylistically.
- Avoid visiting subranges of invalid range in VariableTypeCollector
- Use std::string for type buffer in VariableTypeCollectorASTConsumer
- Use plural for PrintedType in VariableTypeArray
- Remove unused fields in VariableTypeArrayBuilder
- Add suggested doc comments to VariableTypeArray
- Remove unused VariableTypeInfo.TypeLength
- Fix typo of ostream in VariableTypeCollectorASTConsumer
- Fix typo
- Document Offset and Length semantics in collectVariableTypes
2021-06-21 19:28:29 +02:00
fwcd
71a34ff428 Represent diagnostic categories as UIDs in SourceKit (WIP) 2021-05-10 20:38:00 +02:00
fwcd
754d19910e Expose diagnostic category via SourceKit 2021-05-08 19:39:09 +02:00
fwcd
f6ba1314d0 Add ID field to SourceKit's diagnostics 2021-05-07 17:45:21 +02:00
Owen Voorhees
f11df3ee22 [Diagnostics][SourceKit] Expose diagnostic educational notes through SourceKit requests 2020-02-26 14:30:28 -08:00
Xi Ge
35b17d7a6c SourceKit: allow expression type request to specify a list of protocol USRs for filtering
The client usually cares about a subset of all expressions. A way to differentiate
them is by the protocols these expressions' types conform to. This patch allows
the request to add a list of protocol USRs so that the response only includes those
interested expressions that conform to any of the input protocols.

We also add a field to the response for each expression type to indicate the
conforming protocols names that were originally in the input list.

When an empty list of protocol USRs are given, we report all expressions' types
in the file like the old behavior.

rdar://35199889
2019-03-13 14:07:33 -07:00
Xi Ge
dd7f52898f Doc: update protocol for expression type request after adopting custom buffer 2019-02-27 11:47:44 -08:00
Xi Ge
934104a5a7 Docs/SourceKit: add some documentation for expression type request. 2019-02-20 10:52:50 -08:00
Marcelo Fabri
f61751bdcf [SR-9630][SourceKit] Add request to get compiler version 2019-01-20 10:39:25 -08:00
practicalswift
49ed8579c4 [gardening] Use American English. 2017-05-09 20:44:30 +02:00
Ben Langmuir
d13b1c719f [cursor-info] Add a way to opt out of automatic request cancellation
The OncePerASTToken machinery lets us automatically cancel "stale"
requests after a new one comes in.  This avoid wasting time processing
requests that have been superceded, which is common for cursor-info, but
sometimes you really want to get results even later, so this commit adds
a way to opt out of the cancellation.

Incidentally, disable cancellation of name translation, which doesn't
really make sense and no one should be relying on that.

rdar://problem/31905379
2017-05-08 12:01:33 -07:00
Tyler Stromberg
b2a099230f [SourceKit] Document source.request.mangle_simple_class 2017-01-09 14:20:02 -08:00
David Aghassi
da6111117e Fixed wording around codecomplete def 2016-11-11 09:37:50 -05:00
David Aghassi
a2ffcfbbda Swapped wrong definitions and corrected minor mistakes
-  key.codecomplete.options, not key.options
-  Moved codecomplete definition to codecomplete.open
and vice versa
2016-11-08 20:31:26 -05:00
David Aghassi
29bf6a5ed0 Reformatted documentation based on benlangmuir recs 2016-11-08 08:24:18 -05:00
David Aghassi
a1d77ee3f8 [SourceKit] Added completion.open-result docs 2016-11-04 21:50:26 -04:00
David Aghassi
4eced39f4b [SourceKit] Adds documentation for complete.open 2016-11-04 21:06:33 -04:00
practicalswift
8d6251de66 [gardening] Fix accidental uses of \t 2016-09-17 13:15:26 +02:00
practicalswift
3a4ee89034 [gardening] Use consistent formatting. 2016-09-17 12:12:49 +02:00
practicalswift
7c63623ffc [gardening] Fix 13 recently introduced typos. 2016-09-16 20:30:57 +02:00
Ryan Lovelett
54bb4084b2 [SourceKit] Add a table of contents and format tweak
- Make the Demangle header match the other headers in the doc (e.g.,
  double hash)
- Add a table of contents that is sorted alphabetically by request key
  with a link to the header in the document
2016-07-27 21:37:40 -04:00
Ryan Lovelett
9432de218f [SourceKit] Document source.request.cursorinfo 2016-07-27 21:03:16 -04:00
Ryan Lovelett
e6a1a8c541 [SourceKit] Document source.request.protocol_version 2016-07-27 21:02:40 -04:00
Brian Gesiak
183cb54838 [SourceKit] Document source.request.demangle (#3603) 2016-07-19 10:45:56 -07:00
Brian Gesiak
4e0358bfb0 [docs] Add SourceKit's is_test_candidate
When indexing, SourceKit finds methods that match what XCTest considers
to be a test; see: 197875ab6d/tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp (L889-L890).
Document this behavior.
2016-05-09 21:29:23 -04:00
Brian Gesiak
cfeece9f07 [docs] Spruce up Protocol docs for "docinfo" (#2401)
Modify the documentation for `source.request.docinfo` to match the
format of the rest of the documentation: "Request", "Response", and
"Testing".
2016-05-04 22:44:11 -07:00
Brian Gesiak
8c759f6468 [SourceKit] Convert Protocol docs to Markdown (#2392)
- Convert `Protocol.txt` to `Protocol.md`, and use valid Markdown
  syntax.
- Spruce up the documentation in the "code completion": more details on
  how to test via the REPL, clearer sentences, etc.
- Fix an error in which `sourcekitd-test -req=complete -offset=<offset>`
  used the incorrect option `-cc-offset`.
2016-05-04 16:25:06 -07:00
practicalswift
73e60ea50e Fix documentation typo. 2015-12-27 13:05:39 +01:00
Argyrios Kyrtzidis
8ff6a98a99 [sourcekit] Merge SourceKit into the Swift repo.
The code goes into its own sub-tree under 'tools' but tests go under 'test',
so that running 'check-swift' will also run all the SourceKit tests.

SourceKit is disabled on non-darwin platforms.
2015-11-05 01:09:08 -08:00