By default, print 1-based line/column numbers using the defacto standard
line:column format. In debug print, continue to use the 0-based values
to match the constructor.
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.
Conflicts:
Sources/SourceKit/sourcekitd/SwiftLanguageServer.swift
Work in progress: add a basic implementation for keeping track of the
current completion session, and use the sourcekitd
complete.open/update/close requests.
Conflicts:
Sources/SourceKit/sourcekitd/CodeCompletion.swift
Sources/SourceKit/sourcekitd/SwiftLanguageServer.swift
Similar to cursor info, there is enough code here it makes sense to
separate it out.
Conflicts:
Sources/SourceKit/sourcekitd/CodeCompletion.swift
Sources/SourceKit/sourcekitd/SwiftLanguageServer.swift
* Support for clangd's go-to-definition for header files
- By forwarding the request to clangd when it fails to give
symbol information, we are able to use its built in
go-to-definition support for headers (jump to header file)
* Add static tibs test for clangd go-to-#include
* Move #include test to SourceKitTests and regenerate linux main
* Fix improper escaping of %40 in file URLs
* Add URL escaping test
* Another attempt to fix broken BuildServerBuildSystemTests test on Linux
- URL's `standardizedFileURL` removes trailing slashes from file URLs,
but only on Linux
Specifically, we care that all outstanding **writes** are finished
before we call the close handler, because otherwise we may (a) send
corrupted output during shutdown, or (b) drop notifications and replies
sent during the shutdown process. The former is a potential issue for
clients that are not robust about parse failures, and the latter is an
issue for reproducibility and robustness during testing/debugging - in
particular, we have some integration tests that send data without
waiting for individual replies and they need to finish outstanding
replies before exiting.
rdar://60159448
This avoids having a gotcha in the API where if a build system calls
these methods while it is being called back for settings or to register
for notifications it deadlocks (or crashes in libdispatch to prevent the
deadlock).
If we unregisted a file for settings and subsequently received a
settings changed notification that contained that file, we would drop
all of the *other* settings changes delivered in the same call.
If a document is re-opened really quickly after a previous open or
modification, we might get a notification from the previous state of the
document when its AST finishes building. In normal operation, this is
benign, because when we make a request to get the new diagnostics and
semantic highlights, they are guaranteed to be for the new document. But
in testing, we don't generally anticipate these spurious notifications.
The ideal fix for this would be to shutdown and restart sourcekitd
server between tests. Currently there are bugs preventing that from
working in sourcekitd, so as a workaround, make sure all URLs in tests
are uniqued so they will not collide.
rdar://59488048
SourceKit-LSP appears to be behaving correctly, but the toolchain
sourcekitd is sometimes returning 0 warnings instead of 1 in this test
when run on Linux. Disabling while we investigate, since this does not
appear to be a new issue, nor an issue without sourcekit-lsp itself.
rdar://problem/59487935
- Otherwise can lead to confusing duplicated diagnostics in VSCode
due to its usage of virtual documents for source control diffbases
- sourcekitd does not properly handle virtual files when the
`-working-directory` flag is passed
Change-Id: I9b7f435aac3f7c19082dd6c2fd7561c524356352
- Add support for recently upstreamed `forceRebuild` extension (6ff0228c6d).
Note that until it is merged into Apple-clangd we can't add a test for it with missing headers
- Add a test for the clangd functionality by modifying a generated header file
Change-Id: If53fd88da92e4fc7d9c22af7430300fb3fc0f5ce