-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completion for header file name fails when typing dot #1553
Comments
Similar issue with me, except the window disappears after first letter of a header file is typed. I can not bring it back using Here is my vim --version:
Here is the error I get when I try to add a header:
|
@smarttiger06's problem is a general problem with the filename completer in most files. I don't quite know how to fix it, but for reference I spent some time investigating, and it comes down to this (in function! s:OnCursorMovedInsertMode()
...
" We have to make sure we correctly leave omnifunc mode even when the user
" inserts something like a "operator[]" candidate string which fails
" CurrentIdentifierFinished check.
if s:omnifunc_mode && !pyeval( 'base.LastEnteredCharIsIdentifierChar()')
let s:omnifunc_mode = 0
endif Basically, when you type a It is certainly tricky to know how to fix this, as it is right in the core vim client stuff which is quite fiddly. |
for reference @Loumiakas's problem is not related to @smarttiger06's. It's more likely related to the ongoing discussions about non-ascii chars. There's another problem that the completion menu disappears when there are non-ascii chars in any filename in the completion list, but I haven't looked into that very much. |
Well that's is the thing, I don't use non-ASCII chars at all. The error states that I have used right single quotation mark while typing out a header even though I didn't. I did a clean reinstall of Yosemite, that still didn't help. Oddly enough my macbook air with same settings and operating system has no problems like this at all. |
What's the output of 'set encoding?' I've seen others have a problem with this. |
The output that I get from |
FYI, this error is a result of filename/ computer name (At least in Mac OS) containing non-ascii characters. |
Ugh, I remember noticing this bug ~2 years ago and trying to fix it. It ended up being too difficult to resolve at the time so I moved on to something else. Like @puremourning noticed, the root of the problem is the "is this an identifier char" check in YCM. YCM doesn't know that for filename completion, the notion of allowed identifier chars should change. Teaching it to recognize completion context is... difficult, to say the least. The whole point is that YCM shouldn't know, ycmd should (and does). With the current architecture the way it is, I'm not sure this is fixable, at least not without some really ugly hacks. To fix this once and for all, ycmd should probably return some info about the completion context that YCM could then use... something like it. |
This issue has been bugging me lately. It turns out either we changed something which makes my investigation above wrong, or it was just always wrong. The issue is actually much simpler. Take for example
I think the fix in this case is to just fix that check just look if I think we have similar problems for other completion contexts, but this is the one that bugs me the most, so I might have a go at fixing it. For reference, going out of omnifunc mode doesn't cause a problem because we immediately trigger completions anyway due to the keypress. |
Bah, OK yes I take it all back. This is annoyingly hard to fix :( |
[READY] Improve completion of include statements in C-family languages This PR fixes the issue where completion is interrupted after inserting a non-identifier character in include statements. See issues ycm-core/YouCompleteMe#281 and ycm-core/YouCompleteMe#1553. This is done by moving the include completion logic from the filename completer to the Clang one and by setting the start column to the right position thanks to PR #681. A benefit of moving the logic to the Clang completer is that `<C-Space>` now works in include statements. Here's a demo before the changes: ![include-statement-before](https://user-images.githubusercontent.com/10026824/30808129-1c03f634-a1fd-11e7-8de3-0fcc84424d89.gif) and after: ![include-statement-after](https://user-images.githubusercontent.com/10026824/30808134-1e8446e8-a1fd-11e7-9cbe-7bf9b7583fb2.gif) You'll notice that no error is shown to the user after inserting the dot. Fixes ycm-core/YouCompleteMe#281. Fixes ycm-core/YouCompleteMe#1553. <!-- 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/843) <!-- Reviewable:end -->
eaea7553 Merge pull request ycm-core#1557 from bstaletic/conditional-absl b69b980d Merge pull request ycm-core#1565 from magras/fix-double-find-executable-call a12b2014 Merge pull request ycm-core#1564 from puremourning/quiet-build-single-line 2fb2038e Merge pull request ycm-core#1559 from AP2008/try-submodule-update b7986d4d Merge pull request ycm-core#1555 from bstaletic/log-trim ef2cab84 Merge pull request ycm-core#1556 from AP2008/add-msys-support d9f84560 Merge pull request ycm-core#1553 from bstaletic/rust-analyzer-borked a33969b0 Merge pull request ycm-core#1554 from bstaletic/sig-help-offset-fix
In latest-first-order: 45f89b336 Merge pull request ycm-core#1566 from bstaletic/msvc-warnings 94999c6b0 Revert "Merge pull request ycm-core#1559 from AP2008/try-submodule-update" eaea7553 Merge pull request ycm-core#1557 from bstaletic/conditional-absl b69b980d Merge pull request ycm-core#1565 from magras/fix-double-find-executable-call a12b2014 Merge pull request ycm-core#1564 from puremourning/quiet-build-single-line 2fb2038e Merge pull request ycm-core#1559 from AP2008/try-submodule-update b7986d4d Merge pull request ycm-core#1555 from bstaletic/log-trim ef2cab84 Merge pull request ycm-core#1556 from AP2008/add-msys-support d9f84560 Merge pull request ycm-core#1553 from bstaletic/rust-analyzer-borked a33969b0 Merge pull request ycm-core#1554 from bstaletic/sig-help-offset-fix
In latest-first-order: 45f89b336 Merge pull request ycm-core#1566 from bstaletic/msvc-warnings 94999c6b0 Revert "Merge pull request ycm-core#1559 from AP2008/try-submodule-update" eaea7553 Merge pull request ycm-core#1557 from bstaletic/conditional-absl b69b980d Merge pull request ycm-core#1565 from magras/fix-double-find-executable-call a12b2014 Merge pull request ycm-core#1564 from puremourning/quiet-build-single-line 2fb2038e Merge pull request ycm-core#1559 from AP2008/try-submodule-update b7986d4d Merge pull request ycm-core#1555 from bstaletic/log-trim ef2cab84 Merge pull request ycm-core#1556 from AP2008/add-msys-support d9f84560 Merge pull request ycm-core#1553 from bstaletic/rust-analyzer-borked a33969b0 Merge pull request ycm-core#1554 from bstaletic/sig-help-offset-fix
When I inputed "#include <stdio.h>", the completing mechanism worked fine until the character ".". After the dot was typped, the completing windows disappeared.
The text was updated successfully, but these errors were encountered: