Commit Graph

16 Commits

Author SHA1 Message Date
NAKAMURA Takumi 3545ee5f3f clangDaemon: Update libdeps in r308738.
llvm-svn: 308807
2017-07-21 23:48:26 +00:00
NAKAMURA Takumi 396a3a45e2 clangDaemon requires clangLex.
llvm-svn: 306612
2017-06-28 22:57:15 +00:00
Marc-Andre Laperle 2cbf03728a [clangd] Add "Go to Declaration" functionality
Summary: This change allows to navigate to most identifiers' declarations in code. This is a first step towards implementing "Go to Definition". It reuses clangIndex in order to detect which occurrences corresponds to the position requested. The occurrences' Decls are then used to generate locations suitable for navigating to the declarations.

Reviewers: krasimir, bkramer, ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: cfe-commits, mgorny

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D34269

llvm-svn: 306558
2017-06-28 16:12:10 +00:00
Ilya Biryukov 9bab8eab49 [clangd] Added a missing dependency on clangdAST to fix the build
llvm-svn: 303636
2017-05-23 13:59:37 +00:00
Benjamin Kramer 85c7827a0a [clangd] Explicitly link against pthread.
llvm-svn: 303625
2017-05-23 10:29:54 +00:00
Benjamin Kramer b2dfa0b840 [clangd] Pick up deps via LLVM components, which will hopefully include pthread.
llvm-svn: 303623
2017-05-23 10:17:48 +00:00
Ilya Biryukov af4ed4528a [clangd] Split clangd into library+executable (mainly for unit tests).
Summary:
This commit itself doesn't add any unit tests, but one that does will
follow shortly.

Reviewers: krasimir, bkramer

Reviewed By: bkramer

Subscribers: mgorny, klimek, cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D33395

llvm-svn: 303616
2017-05-23 08:12:45 +00:00
Ilya Biryukov 38d79774d0 Restored r303067 and fixed failing test.
Summary:
This commit restores r303067(reverted by r303094) and fixes the 'formatting.test'
failure.
The failure is due to destructors of `ClangdLSPServer`'s fields(`FixItsMap` and
`FixItsMutex`) being called before destructor of `Server`. It led to the worker
thread calling `consumeDiagnostics` after `FixItsMutex` and `FixItsMap`
destructors were called.
Also, clangd is now run with '-run-synchronously' flag in 'formatting.test'.

Reviewers: bkramer, krasimir

Reviewed By: krasimir

Subscribers: mgorny, cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D33233

llvm-svn: 303151
2017-05-16 09:38:59 +00:00
Adam Nemet 076047b4d9 Revert "[ClangD] Refactor clangd into separate components"
This reverts commit r303067.

Caused http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/34305/

And even after Simon's fix there is still a test failure.

llvm-svn: 303094
2017-05-15 18:14:35 +00:00
Ilya Biryukov 96a13635f5 [ClangD] Refactor clangd into separate components
Summary: Major refactoring to split LSP implementation, Clang API calls and threading(mostly synchronization)

Reviewers: bkramer, krasimir

Reviewed By: bkramer

Subscribers: cfe-commits, mgorny, klimek

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D33047

llvm-svn: 303067
2017-05-15 14:17:35 +00:00
Krasimir Georgiev 95ef171797 [clangd] Rename ClangDMain.cpp -> ClangdMain.cpp, NFC
llvm-svn: 300077
2017-04-12 17:13:08 +00:00
Jonas Devlieghere c45b03bddc [clangd] Link against clangSema
Fixes linking issue introduced by rL299421 when building LLVM with
shared libraries.

llvm-svn: 299461
2017-04-04 19:42:29 +00:00
Benjamin Kramer 570c230357 [clangd] Unbreak the shared build.
llvm-svn: 296637
2017-03-01 16:23:40 +00:00
Benjamin Kramer f2524e6599 [clangd] Make clangd install to bin
This allows the install target to also install clangd to bin, so that
it can be deployed and used outside the build tree.

Patch by Marc-Andre Laperle!
Differential Revision: https://reviews.llvm.org/D30425

llvm-svn: 296390
2017-02-27 21:40:35 +00:00
Benjamin Kramer 4486a6c4c7 [clangd] Wire up ASTUnit and publish diagnostics with it.
Summary:
This requires an accessible compilation database. The parsing is done
asynchronously on a separate thread.

Reviewers: klimek, krasimir

Subscribers: cfe-commits, mgorny

Differential Revision: https://reviews.llvm.org/D29886

llvm-svn: 295180
2017-02-15 15:04:20 +00:00
Benjamin Kramer bb1cdb63e5 Add a prototype for clangd
clangd is a language server protocol implementation based on clang. It's
supposed to provide editor integration while not suffering from the
confined ABI of libclang.

This implementation is limited to the bare minimum functionality of
doing (whole-document) formatting and rangeFormatting. The JSON parsing
is based on LLVM's YAMLParser but yet most of the code of clangd is
currently dealing with JSON serialization and deserialization.

This was only tested with VS Code so far, mileage with other LSP clients
may vary.

Differential Revision: https://reviews.llvm.org/D29451

llvm-svn: 294291
2017-02-07 10:28:20 +00:00