This is an archive of the discontinued LLVM Phabricator instance.

Use pseudoparser-based folding ranges in ClangdServer.
ClosedPublic

Authored by usaxena95 on Jul 18 2022, 7:30 AM.

Diff Detail

Event Timeline

usaxena95 created this revision.Jul 18 2022, 7:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2022, 7:30 AM
usaxena95 requested review of this revision.Jul 18 2022, 7:30 AM

as discussed offline i don't see much value in having an extra flag to choose between ast-based and pseudo-based implementation, as the pseudo-based one is a super-set of the ast-based implementation. hence it shouldn't be regressing change in any way, therefore i am in favor of just using the pseudo based implementation inside clangdserver at all times (this is already hidden behind a flag ATM).

independent of that, branch cut is next tuesday. so i'd rather not land it until the cut happens (existing implementation is also crashing, but it's the devil we know and it would be nice to not introduce new failures).

clang-tools-extra/clangd/ClangdServer.cpp
855

i think choice of runQuick deserves a comment. something like We want to make sure folding ranges are always available for all the open files, hence prefer runQuick to not wait for operations on other files

usaxena95 updated this revision to Diff 445547.Jul 18 2022, 9:39 AM

Removed option to fallback to AST based implementation.

Let us land this after the branch cut then.

hokein accepted this revision.Jul 19 2022, 6:44 AM

The change looks good to me.

as discussed offline i don't see much value in having an extra flag to choose between ast-based and pseudo-based implementation, as the pseudo-based one is a super-set of the ast-based implementation. hence it shouldn't be regressing change in any way, therefore i am in favor of just using the pseudo based implementation inside clangdserver at all times (this is already hidden behind a flag ATM).

+1

independent of that, branch cut is next tuesday. so i'd rather not land it until the cut happens (existing implementation is also crashing, but it's the devil we know and it would be nice to not introduce new failures).

What the main concern here? This feature is hidden under a flag which is off by default (and I don't think any user would turn it because the syntax-tree implementation is crashy), it should not affect any users, so it seems fine to land it even before the branch cut.

This revision is now accepted and ready to land.Jul 19 2022, 6:44 AM
This revision was automatically updated to reflect the committed changes.