[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL327129: [clangd] Use identifier range as the definition range. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D44247?vs=1

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE327129: [clangd] Use identifier range as the definition range. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D44247?vs=137720&id=137736#toc Repository: rL L

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the comments! Comment at: clangd/SourceCode.cpp:55 + const auto& SM = D->getASTContext().getSourceManager(); + SourceLocation SpellingLoc = SM.getSpellingLoc(D->getLocation()); + if (D->getLocation().isMacroID()) { sammccal

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 137720. hokein marked 7 inline comments as done. hokein added a comment. Herald added a subscriber: mgorny. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44247 Files: clangd/AST.cpp clangd/AST.h clangd/CMakeLi

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-08 Thread Marc-Andre Laperle via Phabricator via cfe-commits
malaperle added a comment. In https://reviews.llvm.org/D44247#1031429, @sammccall wrote: > In https://reviews.llvm.org/D44247#1031366, @sammccall wrote: > > > In https://reviews.llvm.org/D44247#1031345, @malaperle wrote: > > > > > I was going to change the symbol index to do the opposite :) The r

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-08 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In https://reviews.llvm.org/D44247#1031366, @sammccall wrote: > In https://reviews.llvm.org/D44247#1031345, @malaperle wrote: > > > I was going to change the symbol index to do the opposite :) The range of > > definitions including the bodies of functions, etc is used

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-08 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In https://reviews.llvm.org/D44247#1031345, @malaperle wrote: > I was going to change the symbol index to do the opposite :) The range of > definitions including the bodies of functions, etc is used in a "peek > definition" feature by several LSP clients. So for examp

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-08 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/SourceCode.cpp:55 + const auto& SM = D->getASTContext().getSourceManager(); + SourceLocation SpellingLoc = SM.getSpellingLoc(D->getLocation()); + if (D->getLocation().isMacroID()) { As discussed offline, this

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-08 Thread Marc-Andre Laperle via Phabricator via cfe-commits
malaperle added a comment. I was going to change the symbol index to do the opposite :) The range of definitions including the bodies of functions, etc is used in a "peek definition" feature by several LSP clients. So for example in VSCode, you can hold Ctrl and hover on a function call and see

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: ioeric, jkorous-apple, ilya-biryukov, klimek. This also matches the range in symbol index. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44247 Files: clangd/SourceCode.cpp clangd/So