Page MenuHomePhabricator

[clangd][WIP] Make use of SyntaxTrees for SemanticSelection
Needs ReviewPublic

Authored by kadircet on Jul 30 2020, 12:45 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This patch is not intended for production, it is merely an experiment
to see how SyntaxTrees can be used inside clangd.

Depends on D84973

Diff Detail

Unit TestsFailed

TimeTest
290 mslinux > Clangd Unit Tests._/ClangdTests::SemanticSelection.All
Note: Google Test filter = SemanticSelection.All [==========] Running 1 test from 1 test case. [----------] Global test environment set-up.
40 mslinux > Clangd Unit Tests._/ClangdTests::SemanticSelection.RunViaClangdServer
Note: Google Test filter = SemanticSelection.RunViaClangdServer [==========] Running 1 test from 1 test case. [----------] Global test environment set-up.
420 mswindows > Clangd Unit Tests._/ClangdTests_exe::SemanticSelection.All
Note: Google Test filter = SemanticSelection.All [==========] Running 1 test from 1 test case.
60 mswindows > Clangd Unit Tests._/ClangdTests_exe::SemanticSelection.RunViaClangdServer
Note: Google Test filter = SemanticSelection.RunViaClangdServer [==========] Running 1 test from 1 test case.

Event Timeline

kadircet created this revision.Jul 30 2020, 12:45 PM
kadircet requested review of this revision.Jul 30 2020, 12:45 PM
gribozavr2 added inline comments.
clang-tools-extra/clangd/SemanticSelection.cpp
51

It would be nice to make it into a method on syntax::Node itself, or otherwise put it into a shared location, include/clang/Tooling/Syntax/???.h.

60

lastLeaf() is traversing all children. Instead, you could compare against the location of C->nextSibling()->firstLeaf().

nridge added a subscriber: nridge.Aug 2 2020, 7:07 PM