This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Refactor speculateCompletionFilter and also extract scope.
ClosedPublic

Authored by sammccall on Apr 10 2019, 1:45 AM.

Details

Summary

Intent is to use the heuristically-parsed scope in cases where we get bogus
results from sema, such as in complex macro expansions.
Added a motivating testcase we currently get wrong.

Name changed because we (already) use this for things other than speculation.

Diff Detail

Repository
rL LLVM

Event Timeline

sammccall created this revision.Apr 10 2019, 1:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2019, 1:45 AM
sammccall updated this revision to Diff 194462.Apr 10 2019, 1:50 AM

Handle :::: edge-case correctly.
Add test for leading :: case.

sammccall updated this revision to Diff 194463.Apr 10 2019, 1:52 AM

Fix terrible variable name.

ioeric accepted this revision.Apr 10 2019, 3:30 AM

lgtm

clangd/CodeComplete.cpp
1542 ↗(On Diff #194461)

Suffix is actually a prefix of Content? This seems a bit confusing...

This revision is now accepted and ready to land.Apr 10 2019, 3:30 AM
sammccall marked 2 inline comments as done.Apr 10 2019, 4:46 AM
sammccall added inline comments.
clangd/CodeComplete.cpp
1542 ↗(On Diff #194461)

Haha, just checking we're all paying attention...

This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2019, 4:49 AM