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
Annoying error message: ValueError: File is less than 5 lines long; not compiling. #1364
Comments
Can you find a C/C++ source code with less than 5 lines worth compiling for completion? Plus ss much as it could be annoying you get that only on new files and not for that long since I presume you're going to write something in that file.
Why take an empty file, and ask the compiler: "Can you compile this file and give me the available completion at row 0, col 0?" |
@strrchr The reason for the restriction is that there were problems with libclang and compiling files with no lines of code in it. This error prevents more confusing errors coming from the compiler. |
The raised ValueError interrupts me when I switch buffers. |
I think you can try to change line 259 of clang_completer.py |
I think at least it shoud be a warning instead of error. |
+1 |
The part I dislike about this is when creating an empty file with |
We used to not inform the users that completion doesn't work when fewer than 5 lines are in the file, and then we had a HUGE number of users complaining that YCM doesn't work for them because they'd install it and try it out on a file with fewer than 5 lines in it. |
It seems a pattern that such messages can mostly increase over time. Hence it's worth analyzing to put such pattern behind a gate, an option for the ones already experienced with the plugin. This is the most fair behavior I think. |
The message is quite annoying, so +1 for option for disabling this behaviour |
I think you can provide a option to disable this warning, and prompt how to use the option in the warning message. |
Redraw the screen before displaying a message There has been several complaints about the message "ValueError: File is less than 5 lines long; not compiling". See issues #814, #1364, #1544. In fact, I believe the issue is not the message itself but the infamous "Press ENTER or type command to continue" prompt when editing a new C-family file. For example, if I create the file `foo.c`, Vim will display the line `"foo.c" [New file]` and then YouCompleteMe will display `ValueError: File is less than 5 lines long; not compiling`. Since there are now two lines, the hit-enter message is prompted. By redrawing the screen just before displaying the message from YouCompleteMe, only one line appears and we avoid this behavior. Tested on Linux and Windows. CLA signed.
Annoying error message: ValueError: File is less than 5 lines long; not compiling.
In YouCompleteMe\third_party\ycmd\ycmd\completers\cpp\clang_completer.py
I found: MIN_LINES_IN_FILE_TO_PARSE = 5
Why not change it to zero?
The text was updated successfully, but these errors were encountered: