Skip to content

Commit

Permalink
Auto merge of ycm-core#292 - oblitum:improved-semantic-trigger-match,…
Browse files Browse the repository at this point in the history
… r=Valloric

Improves semantic trigger match.

Improves semantic trigger match.

Match triggers until user's caret column solely. Trying to match
triggers with characters after user's caret column doesn't seem
to have any utility.

---

This is the first in a series of pull-requests that will transparently enable
ycm-core#1300 for any completer that cares for. After this minimal foundation is
stablished, an initial Swift completer will be available, supporting diagnostics,
fix-it's, semantic completion and argument hints. Changes will also be
proposed to enable hints for C and C++.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/292)
<!-- Reviewable:end -->
  • Loading branch information
homu committed Jan 9, 2016
2 parents 7c9be69 + c26a4e5 commit 9e0c19d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ycmd/completers/completer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ def _MatchesSemanticTrigger( line_value, start_column, trigger_list ):
if not line_length or start_column > line_length:
return False

# ignore characters after user's caret column
line_value = line_value[ :start_column ]

match = False
for trigger in trigger_list:
match = ( _StringTriggerMatches( trigger, line_value, start_column )
Expand Down

0 comments on commit 9e0c19d

Please sign in to comment.