diff options
author | Marc-Andre Laperle <marc-andre.laperle@ericsson.com> | 2018-02-21 02:39:08 +0000 |
---|---|---|
committer | Marc-Andre Laperle <marc-andre.laperle@ericsson.com> | 2018-02-21 02:39:08 +0000 |
commit | 63a1098d73312c89a538d67aa2cf1188513bcc83 (patch) | |
tree | 900647d60b809967d5fb084d8c55a79c7b394d91 /clang-tools-extra/clangd/SourceCode.h | |
parent | 52525730a163c56f82a43584faa8acb8fd45e1da (diff) | |
download | bcm5719-llvm-63a1098d73312c89a538d67aa2cf1188513bcc83.tar.gz bcm5719-llvm-63a1098d73312c89a538d67aa2cf1188513bcc83.zip |
[clangd] #include statements support for Open definition
Summary: ctrl-clicking on #include statements now opens the file being pointed by that statement.
Reviewers: malaperle, krasimir, bkramer, ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: jkorous-apple, ioeric, mgrang, klimek, ilya-biryukov, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D38639
llvm-svn: 325662
Diffstat (limited to 'clang-tools-extra/clangd/SourceCode.h')
-rw-r--r-- | clang-tools-extra/clangd/SourceCode.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/SourceCode.h b/clang-tools-extra/clangd/SourceCode.h index 2471a17a30f..cd0578b14c0 100644 --- a/clang-tools-extra/clangd/SourceCode.h +++ b/clang-tools-extra/clangd/SourceCode.h @@ -14,8 +14,11 @@ #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SOURCECODE_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SOURCECODE_H #include "Protocol.h" +#include "clang/Basic/SourceLocation.h" namespace clang { +class SourceManager; + namespace clangd { /// Turn a [line, column] pair into an offset in Code. @@ -24,6 +27,9 @@ size_t positionToOffset(llvm::StringRef Code, Position P); /// Turn an offset in Code into a [line, column] pair. Position offsetToPosition(llvm::StringRef Code, size_t Offset); +/// Turn a SourceLocation into a [line, column] pair. +Position sourceLocToPosition(const SourceManager &SM, SourceLocation Loc); + } // namespace clangd } // namespace clang #endif |