PHPantom version
phpantom_lsp 0.7.
Installation method
Built from source
Operating system
Linux x86_64
Editor
VS Code
Bug description
I've run into an issue where "Go to Definition" works perfectly for a closed file, but if I open that file and then close it, the language server can no longer find it. It seems like sending a textDocument/didClose event makes the server forget the file's location.
Because VS Code frequently opens and closes files in the background (like when generating a quick "Peek" preview), this means definitions often break immediately after clicking them once. If I keep the target file open in a tab, everything works perfectly.
Steps to reproduce
composer.json
{
"name": "test/phpantom-bug",
"autoload": {
"psr-4": {
"App\\": "src/"
}
}
}
src/ClassB.php (The target we want to jump to)
<?php
namespace App;
class ClassB {
public function doSomething() {
return "Hello from Class B!";
}
}
src/ClassB.php (The file we are clicking from)
<?php
namespace App;
class ClassA {
public function test() {
$b = new ClassB();
$b->doSomething();
}
}
- Generate the composer autoload files so PHPantom can index them
- Open it in vscode, and try "go to definition" from A while B is open and closed.
Error output or panic trace
.phpantom.toml
Additional context
I'm using the recommended zsol.vscode-glspc extension.
PHPantom version
phpantom_lsp 0.7.
Installation method
Built from source
Operating system
Linux x86_64
Editor
VS Code
Bug description
I've run into an issue where "Go to Definition" works perfectly for a closed file, but if I open that file and then close it, the language server can no longer find it. It seems like sending a
textDocument/didCloseevent makes the server forget the file's location.Because VS Code frequently opens and closes files in the background (like when generating a quick "Peek" preview), this means definitions often break immediately after clicking them once. If I keep the target file open in a tab, everything works perfectly.
Steps to reproduce
composer.json{ "name": "test/phpantom-bug", "autoload": { "psr-4": { "App\\": "src/" } } }src/ClassB.php(The target we want to jump to)src/ClassB.php(The file we are clicking from)Error output or panic trace
.phpantom.toml
Additional context
I'm using the recommended
zsol.vscode-glspcextension.