phptools-docs
phptools-docs copied to clipboard
Extension randomly stops working. Adding and removing a space "fixes" it
This has started happening pretty often recently.
Suddenly the extension stops working: popups with method signatures don't appear when hovering over method names both in function definitions and function calls; ctrl+click does nothing, etc.
This is despite the fact there is no syntax error in the current file or anywhere in the code.
I switch to another tab where I have another file open within the same project, and it works fine there. I go back to the tab I was in and it doesn't work.
Until finally I add a space somewhere and remove it, save the file again (not sure if that's needed), and things go back to working normally.
Pretty annoying.
May I ask what's
- in the OUTPUT / PHP Language Server? Any error or crash would be logged there.
- does other mouse tool-tips work in the file?
Actually it seems the extension has gone completely berserk.
Editing and saving doesn't really "fix" it, it only makes it work "locally" in the proximity of where the edit is made.
For example, now the extension is working here:
but not here, just a few lines above:
where in this case it shows a tooltip about a supposed local variable that (I checked) doesn't even exist anywhere in the entire codebase! Sometimes it shows no tooltip at all.
This time, doing and undoing a trivial edit and saving didn't change anything.
(Oh I see, the "variable name" is just a random substring of the function name I'm hovering on)
The only recent messages in Output -> PHP Language Server are these:
[Info - 5:04:12 PM] 1 file system change(s) ...
[Info - 5:04:22 PM] 2 file system change(s) ...
[Info - 5:08:00 PM] 1 file system change(s) ...
[Info - 5:19:21 PM] 1 file system change(s) ...
[Info - 5:19:39 PM] 1 file system change(s) ...
[Info - 5:23:06 PM] 1 file system change(s) ...
[Info - 5:28:00 PM] 1 file system change(s) ...
[Info - 5:28:15 PM] 1 file system change(s) ...
[Info - 5:37:00 PM] 1 file system change(s) ...
It doesn't make any sense to me.
The LSP is updating the document incrementally - which, if broken, may corrupt the internal representation of the document.
- Does closing and re-opening the file fix this issue?
- Do you have non-standard line endings or do you use the common CR/LF/CRLF?
I'll add some diagnostic command that would tell us more details.
Restarting VSCode fixed it at least for now. I'll report back if it happens again.
Does closing and re-opening the file fix this issue?
Next time I'll try that if I remember.
Do you have non-standard line endings
no