Hi!
A problem with the LSP integration was recently brought to my attention; when autocompleting a function (maybe any multi-line autocompletion?) Nova adds a backslash to the code for some reason. This happens with the Intelephense language server integration that I’ve been maintaining.
I haven’t added any custom handlers for any of the LSP messages being sent between Nova and Intelephense — and this issue has been confirmed to not occur in other editors with LSP integration — so I think this may be a bug in Nova.
The easiest way to reproduce the bug:
- Install Intelephense in Nova.
- Disable all other extensions.
- Create a new PHP file and save it as
test.php
- Restart Intelephense (this is necessary for Intelephense to find the file you just created)
- Create a class:
<?php
class Testing {
}
- Start adding the constructor:
<?php
class Testing {
public function __construct
}
- You should see an autocomplete menu pop up. Choose the “__construct” option and expand it. The result should look something like this:
<?php
class Testing {
public function __construct( ... )
{
\} // <-- note the backslash at the beginning of the line, and incorrect indentation.
}
Screenshots
Additional thoughts
I guess this could also be because Intelephense uses some non-standard way to instruct the editor to insert the code completion? Maybe it would be better for me to add my own handler for these types of completions?
It feels like this should be standardized and handled, but maybe that’s not the case? I’m really not sure what to make of the issue
Any thoughts you have would be welcome!