Commit Graph

22 Commits

Author SHA1 Message Date
David Goldman
79795bf4d9 Decrease verbosity of info-level logging (#331)
- Don't log entire LSP notifications/requests for the `info` level, instead log of the form:
  - `Notification<method>` e.g. Notification<textDocument/publishDiagnostics>
  - `Request<method(id)>` e.g. Request<textDocument/hover(6)>
  - `Response<method(id)` e.g. Response<textDocument/hover(6)>

- Only log sourcekitd requests/responses at the debug level
2020-10-08 18:20:56 -04:00
Saleem Abdulrasool
67aaa09d70 build: allow building with dispatch and Foundation from the toolchain
This allows building without dispatch and Foundation build roots, which
allows for a multi-phase build.  This is intended to support the Windows
staged build where dispatch and Foundation are part of the SDK and
SourceKit-LSP is part of the devtools.
2020-10-07 19:08:02 -07:00
David Goldman
ae96dcae4e Improve performance of workspace/symbol for large queries + projects (#317)
- Avoid short queries (< 3 characters) since they are slow and noisy. Xcode does the same thing.

- Limit the number of results returned:
  - Improves performance for queries which match many symbols
  - Currently take the first N results to improve performance for large projects
    but once we support cancellation we should take the top N.
2020-09-28 15:13:36 -04:00
Ben Langmuir
70d5c6dea2 Update references to 'master' to 'main' 2020-09-23 11:40:42 -07:00
Saleem Abdulrasool
c55c71d111 build: update CMakeLists.txt
This updates the CMakeLists.txt to allow building SourceKit-LSP with
CMake.
2020-09-06 18:44:34 -07:00
Ben Langmuir
d82c52c003 [logging] Avoid logging cancellation as warnings/errors
Cancellation shows up as an error code, but it is not a real error, so
don't log it like one.

https://bugs.swift.org/browse/SR-13344
2020-08-04 10:04:21 -07:00
Ben Langmuir
bbb2a34694 [completion] Add doc comment for CodeCompletionSession 2020-07-29 10:29:20 -07:00
Ben Langmuir
bf9053c671 [gardening] Rename CodeCompletionOptions -> SKCompletionOptions
Since it is being used in the LSP protocol layer, give it a name that
clarifies that it is SourceKit-specific.
2020-07-29 10:01:24 -07:00
Ben Langmuir
a5832e978b [gardening] Fix copyright headers and formating in modified files 2020-07-29 09:55:02 -07:00
Ben Langmuir
fe283fa2c2 [completion] Add an extension to pass completion options per-request 2020-07-29 09:42:47 -07:00
Ben Langmuir
232fb7bfe0 [completion] Fix tests when using server-side filtering
With this change, tests pass whether we default to server-side or
client-side filtering. Also duplicate a few interesting tests to run
both ways. A future commit will beef up the test coverage for
server-side filtering specifically.
2020-07-29 09:42:47 -07:00
Ben Langmuir
024ebdd9b7 [completion] Set default maxResults = 200 2020-07-29 09:42:47 -07:00
Ben Langmuir
c9800bf1a1 [completion] Add initial server-side filtering implementation
Work in progress: add a basic implementation for keeping track of the
current completion session, and use the sourcekitd
complete.open/update/close requests.
2020-07-29 09:42:18 -07:00
Ben Langmuir
c719711afd [gardening] Split code-completion into its own file
Similar to cursor info, there is enough code here it makes sense to
separate it out.
2020-07-29 09:42:18 -07:00
Ben Langmuir
c27a76c9c5 [completion] Pass through new code-completion options 2020-07-29 09:42:18 -07:00
David Goldman
2840c7dac9 Forward definition requests when index lookup fails (#294)
* Forward definition requests when index lookup fails

If we're unable to look up a definition or declaration via the
index, forward the request to the language service.

This allows clangd to support go to definition or declaration
for symbols defined/declared in the AST.
2020-07-09 15:41:08 -04:00
David Goldman
5977d611aa Withhold diagnostics when fallback arguments are being used (#281)
While fallback arguments are being used (either from the fallback build system or fallback settings from the primary build system), withhold semantic diagnostics from sourcekitd and all diagnostics from clangd. This helps prevent user confusion from spurious errors.

- Also remove the DocumentURI standardization in favor of proper equality + hash checks to work around the %40 --> @ encoding issue seen on CI.
2020-06-11 11:38:50 -04:00
Ben Langmuir
1040621ae1 Shutdown toolchain connections on exit
When using SourceKit-LSP in tests (or otherwise in a library), we do not
want to leak the toolchain connections.
2020-06-09 13:20:15 -07:00
Ben Langmuir
5449a2acb7 [jsonrpc] Workaround file descriptor lifetime issue
We should solve this in the JSONRPCConnection itself, but in the
meantime workaround by keeping pipes alive until the connection has
closed.
2020-06-09 13:20:15 -07:00
Ben Langmuir
40525486b7 Fix target name after rebase 2020-06-08 09:13:04 -07:00
Saleem Abdulrasool
f3f0795cdc build: repair build on Windows
This enables building SourceKit-LSP on Windows.  This is sufficient to
repair the build, though it is insufficient to run currently.
2020-06-05 08:28:26 -07:00
Ben Langmuir
4ff14d278d Rename module SourceKit -> SourceKitLSP
Clarify its role, since it is not really an LSP-independent interface
right now.
2020-06-04 14:49:00 -07:00