Commit Graph

12 Commits

Author SHA1 Message Date
Alex Hoppen
a710111001 [SourceKit] Support building sourcekitd without building swift-syntax
This allows building sourcekitd and swift-refactor with `SWIFT_BUILD_SWIFT_SYNTAX=NO`. In these builds, the `relatedidents` and `find-syntactic-rename-ranges` requests will always return an error.
2023-12-04 19:14:01 -08:00
Josh Soref
436484c8c8 Gardening: Fix spelling mistakes in */SourceKit
* about
* and
* answering
* because
* before
* cancellation
* clear
* comment
* complete
* corresponding
* cursor
* custom
* dependencies
* doesn't
* expression
* extension
* immediately
* implementation
* implicit
* innovation
* intentionally
* occasionally
* oldest
* parameter
* property
* response
* reuseastcontext
* snapshot
* sourcekit_swift_runtime_link_flags
* synchronously
* target
* that
* unlabeled
* usefulness
* work

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-21 02:03:25 -04:00
Alex Hoppen
7a80034e35 [SourceKit] Support cancellation of requests while an AST is being built
This commit refactors the way ASTs are being built in SourceKit and how `SwiftASTConsumer`s are served by the built ASTs. `SwiftASTManager.h` should give an overview of the new design.

This commit does not change the cancellation paradigm in SourceKit (yet). That is, subsequent requests with the same `OncePerASTToken` still cancel previous requests with the same token. But while previously, we were only able to cancel requests that haven’t started an AST build yet, we can now also cancel the AST build of the to-be-cancelled requests.

With this change in place, we can start looking into explicit cancellation of requests or other cancellation paradigms.
2021-09-23 11:53:45 +02:00
Alex Hoppen
e8b5bcac1d [SourceKit] Report number of instructions executed since SourceKit was started in statistics request
This can be used to measure how many instructions a request executes by retrieving the number of instructions executed since the process’s start before and after executing the request.
2021-05-20 16:30:28 +02:00
Ben Barham
73d9f5b843 [SourceKit] Remove OptimizeForIDE global configuration
Have SourceKit return locations for symbols outside of the current
module as well. Callsites of location and comment information should
explicitly disable retrieving serialized information where performance
is a concern.

Resolves rdar://75582627
2021-05-01 11:37:23 +10:00
Doug Gregor
568e943115 Enable import of the _Concurrency module by default. 2021-04-13 23:14:06 -07:00
Arnold Schwaighofer
9286ece71c Revert "Enable import of the _Concurrency module by default." 2021-04-09 13:20:30 -07:00
Doug Gregor
95fd3ede09 Update tests and testing tools for implicit _Concurrency import 2021-04-06 14:08:41 -07:00
Nathan Hawes
b9d5672ca1 [SourceKit] Add a global-configuration request to control SourceKit's behavior around .swiftsourceinfo files
SwiftSourceInfo files provide source location information for decls coming from
loaded modules. For most IDE use cases it either has an undesirable impact on
performance with no benefit (code completion), results in stale locations being
used instead of more up-to-date indexer locations (cursor info), or has no
observable effect (live diagnostics, which are filtered to just those with a
location in the primary file).

For non-IDE clients of SourceKit though, cursor info providing declaration
locations for symbols from other modules is useful, so add a global
configuration option (and a new request to set it) to control whether
.swiftsourceinfo files are loaded or not based on use case (they are loaded by
default).
2019-12-03 13:15:20 -08:00
Ben Langmuir
4c59e0f40c test/SourceKit/Misc/stats.swift: remove checks that will not be reliable
We already disabled one of these because it failed (extremely) rarely in
CI, but the assumption was that there was a bug. In reality, the
behaviour was correct, so remove the unreliable checks for good and
document why in the test.

rdar://36408114
2018-10-11 11:25:39 -07:00
Ben Langmuir
6311f07b49 [test] Disable part of a test that is failing non-deterministically
Very rarely this test fails with 1 instead of 0 AST-cache hits.
Disabling until it can be investigated and fixed.
2018-01-10 09:42:38 -08:00
Ben Langmuir
9c7d9235de [sourcekitd] Add a request to get statistics from the service
... and add a few basic statistics about the number of requests, ASTs
built, etc.  The Statistic type is loosely based on the one from LLVM,
but suitable for using without DEBUG macros and using SourceKit UIdents
to identify the statistic.  The easiest way to add a new statistic is to
add it to SwiftStatistics.def in the SwiftLangSupport.
2017-10-05 12:34:49 -07:00