Page MenuHomePhabricator

Make very minor generality improvements to the scope selector
ClosedPublic

Authored by epriestley on Apr 25 2019, 10:31 PM.
Tags
None
Referenced Files
F19103484: D20479.id48851.diff
Fri, Dec 5, 10:33 AM
F19094315: D20479.diff
Thu, Dec 4, 12:28 AM
F19079964: D20479.id48851.diff
Mon, Dec 1, 11:40 PM
F19060738: D20479.id.diff
Sat, Nov 29, 10:12 AM
F19057424: D20479.diff
Fri, Nov 28, 10:30 PM
F19028543: D20479.diff
Mon, Nov 24, 3:46 PM
F18958018: D20479.id48861.diff
Nov 13 2025, 3:47 AM
F18958017: D20479.id48851.diff
Nov 13 2025, 3:47 AM
Subscribers
None

Details

Reviewers
amckinley
Summary

See PHI985. I think we pretty much need to start applying language-specific rules, but we can apply at least one more relatively language-agnostic rule: don't match lines which are indented 3+ levels.

In C++, we may have symbols like this:

class X {
  public:
    int m() { ... }
}

..but I believe no mainstream language puts symbol definitions 3+ levels deep.

Also clean up some of the tab handling very slightly.

Test Plan

Tests pass, looked at some C++ code and got slightly better (but still not great) matches.

Diff Detail

Repository
rP Phabricator
Branch
scope1
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/infrastructure/diff/PhabricatorDiffScopeEngine.php:119XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 22726
Build 31154: Run Core Tests
Build 31153: arc lint + arc unit