Commit Graph

18 Commits

Author SHA1 Message Date
Alex Hoppen
f84cfecbf2 Make CompilationDatabase use DocumentURI instead of URL 2024-06-01 12:54:07 -07:00
Alex Hoppen
42140c57b0 Make SKCore build with strict concurrency 2024-03-20 11:48:50 +01:00
Alex Hoppen
f7f474a0c8 Don’t crash if a compilation database is malformed JSON
Fixes #1019
rdar://120804823
2024-02-21 15:47:18 -08:00
Alex Hoppen
cfea67276d Add logic to split command line arguments on Windows
Previously, we were splitting command line arguments on Windows using the same rules as on Unix, which was incorrect, most importantly because backslashes in the first component of a Windows command line invocation are not escaping anything but interpreted verbatim.

Fixes #1020
rdar://120809063
2024-01-17 22:14:28 -08:00
George
170b44bb05 Add support for compile databases not at the root of the workspace 2023-10-21 05:17:01 +00:00
Alex Hoppen
d0fc00ce98 Format using swift-format
Add `.swift-format` to the repo and format the repo with `swift-format`.

This commit does not add any automation to enforce formatting of sourcekit-lsp in CI. The goal of this commit is to get the majority of source changes out of the way so that the diff of actually enforcing formatting will have fewer changes or conflicts.
2023-10-10 13:44:47 -07:00
Max Desiatov
f5a30d9351 Fix uses of deprecated non-throwing AbsolutePath.init (#709)
These warnings appeared after an update to TSC deprecated this initializer.
2023-02-09 14:04:57 +00:00
Boris Buegling
43c072dc84 Adopt to path API changes
We are moving to a better model for TSC's path APIs in apple/swift-tools-support-core#353. The previous API is still available (but deprecated) as much as possible, but since SourceKit-LSP was using `resolveSymlinks` (which is now throwing) quite a bit, there are some changes necessary.
2022-10-18 15:28:54 -07:00
Saleem Abdulrasool
4896cc6fe7 SKCore: use resolvingSymlinks to resolve symlinks
Rather than using the `resolvingSymlinksInPath` on `URL` use
`resolvingSymlink` from tools-support-core as the semantics for the two
differ ever so slightly which matters for Windows (the former expands
symlinks on the terminal arc iterative where as the latter simply
expands the path).
2022-09-21 09:42:53 -07:00
Saleem Abdulrasool
7d1bcee1b0 explicitly import TSCBasic types
Explicitly import interfaces from TSCBasic which now allows us to
identify all the swift-tools-support-core interfaces which are in
use in SourceKit-LSP.
2022-09-10 12:53:30 -07:00
Ahmad Alhashemi
08c9d40c89 Use compiler flags dir as command dir 2021-03-13 21:37:09 +03:00
Ahmad Alhashemi
da4ff93bfe Implement support for fixed compilation database 2021-03-13 18:46:01 +03:00
Ben Langmuir
f24f798ac4 Speed up compilation database loading when using "command"
The JSON compilation database allows specifying arguments either as an
array of string ("arguments") or as a single shell-escaped string
("command"). When using "command", we were hitting very slow load times
for large compilation databases. This commit speeds up splitting the
shell-escaped command by not iterating the UTF-8 view instead of the
graphemes.

In release builds I see ~10x speedup of the splitting perf test, and
~3-5x in a debug build. In a real-world test using the cmake-generated
compile_commands.json for llvm+clang this sped up overall compilation
database loading from 11 seconds to 1.2 seconds on my machine.
2020-02-03 12:31:34 -08:00
Ben Langmuir
b917ebe5d9 Infer index store path from compilation database
Find the index store path by searching through the command-line
arguments, and if found, also provide a default database path next to
the index store. Also add command-line arguments so that either of these
can be overridden. We could also easily add these as initialization
options if an LSP client wanted to provide them in the future.
2020-02-03 09:07:01 -08:00
Ben Langmuir
e1fa70d086 Update SPM -> TSC module name prefixes 2019-09-03 08:29:19 -07:00
Ben Langmuir
b92abf4140 Remove testable imports of SKCore 2019-08-08 21:33:02 -07:00
Ben Langmuir
87914fcd1e [compdb] Log only once per query on failure 2018-12-03 21:50:00 -08:00
Ben Langmuir
aabf57a252 Import SourceKit-LSP sources 2018-11-13 15:50:48 -08:00