You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let say I have somewhere a C function int my_func(char *str, int num).
If I want to use it, I will start to type its name, let's say my_f, and I will be proposed the auto-complete choices:
my_func
my_func (char *str, int num)
There is an issue if I select my_func (char *str, int num) ; The text is inserted in my buffer, then, after I replace the parameters with my own ones, ccls will always give errors on the line, which are very difficult to get rid of:
Even If I delete function name/parameters on the line, and re-type everything completely (function and parameters), the error will not disappear. It looks like ccls keeps some wrong status.
The only solution is to save then revert buffer, so that ccls "forgets" something about the inserted function declaration.
Killing the line (C-a C-k) works also.
It will be clearer with an example :
Initial situation. I start to type a function name line 153, some choices are proposed.
I select the prototype.
After doing it, the text is inserted, with parameters highlighted.
I type the letter "i", the highlighted text is replaced with "i". Note that ccls looks unhappy with "i".
I complete the func call with a semicolon
After moving the cursor we can see there are likely 2 errors
Showing Flycheck all errors line 153, :
After deleting the function call (using "DEL" from EOL to first char function), an error remain on line.
Remaining Flycheck error on "empty" line
After "C-x C-s" and "M-x revert-buffer", the error is gone
Feel free to ask if you need more information/testing.
The text was updated successfully, but these errors were encountered:
braoult
changed the title
Using prototypes auto-completion has strange behavior
Using function prototypes auto-completion has strange behavior
Jun 13, 2024
Note: I use lsp-mode, ccls and flycheck.
Let say I have somewhere a C function
int my_func(char *str, int num)
.If I want to use it, I will start to type its name, let's say
my_f
, and I will be proposed the auto-complete choices:There is an issue if I select
my_func (char *str, int num)
; The text is inserted in my buffer, then, after I replace the parameters with my own ones, ccls will always give errors on the line, which are very difficult to get rid of:Even If I delete function name/parameters on the line, and re-type everything completely (function and parameters), the error will not disappear. It looks like ccls keeps some wrong status.
The only solution is to save then revert buffer, so that ccls "forgets" something about the inserted function declaration.
Killing the line (
C-a C-k
) works also.It will be clearer with an example :
Feel free to ask if you need more information/testing.
The text was updated successfully, but these errors were encountered: