-
Notifications
You must be signed in to change notification settings - Fork 769
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #831 - micbou:replace-comments-strings-empty-lines, r=p…
…uremourning [READY] Fix multiline comments and strings issues When `collect_identifiers_from_comments_and_strings` is `0`, we are replacing comments and strings with empty strings before extracting the identifiers. If one of these comments or strings span multiple lines, the current line number `line_num` may become invalid and, in that case, the identifier completer will fail to add the previous identifier on the `CurrentIdentifierFinished` event: ![ignore-comments-current-identifier-finished](https://user-images.githubusercontent.com/10026824/30140028-dca4c58e-9371-11e7-9231-f8ef35130ed7.gif) As you can see, the `test` identifier is properly extracted before the comment but not after. Another issue with multiline comments and strings is that, when adding an identifier under the cursor on the `InsertLeave` event, we only remove comments and strings on the current line. This is incorrect if the current line is in the middle of a multiline comment or string: ![ignore-comments-insert-leave](https://user-images.githubusercontent.com/10026824/30140274-b8af9fee-9373-11e7-94ec-78cf00585c39.gif) The `test` identifier is extracted even though it's inside a comment. For now, I am updating the tests to showcase both issues. I'll update the PR with the fixes once the builds failed. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/831) <!-- Reviewable:end -->
- Loading branch information
Showing
4 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters