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
In Improvements and new features for indexing#1290, the sig_state_of_require has been changed to Allow the --require flag to be used multiple times with the search and websearch commands.
However, this breaks the LSP server.
To reproduce :
In Vscode open any LP file (for instance tests/OK/apply.lp)
add require open Stdlib.Prop; at the begining of the file
go one step forward
in the terminal you will see somethins like : file:///......../lambdapi/tests/OK/apply.lp:1:0-66/...../.opam/default/.opam-switch/build/lambdapi-stdlib.1.3.1/Prop.lp cannot be mapped under the library root. Consider adding a package file under your source tree, or use the [--map-dir] option.
I confirm the bug, but sig_state_of_require is not the culprit. The culprit is due to the usage in the LSP of a "local" file that is actually installed using lambdapi install that relocates the file. The .lpo were not thought to be relocatable when implementing search (and indeed they are not): they concaint positions with absolute paths. The exception is raised when trying to access a file that has been moved. In particular this is required: 1) to synthesize a QID for rule names that have none ; 2) to show the query results
file:///home/blanqui/src/lambdapi/tests/OK/apply.lp:1:0-23/home/blanqui/.opam/5.5.0/.opam-switch/build/lambdapi-stdlib.1.4.0/Prop.lp cannot be mapped under the library root.
Consider adding a package file under your source tree, or use the [--map-dir] option.
/home/blanqui/.LPSearch.db: No such file or directory.
Type "lambdapi index --help" to learn how to create the index.
file:///home/blanqui/src/lambdapi/tests/OK/apply.lp:1:0-23"/home/blanqui/.opam/5.5.0/.opam-switch/build/lambdapi-stdlib.1.4.0/Prop.lp" cannot be mapped under the library root.
Consider adding a package file under your source tree, or use the [--map-dir] option.
Note that there is no space or newline between the position and the error message.
Activity
sacerdot commentedon Jul 2, 2026
I confirm the bug, but
sig_state_of_requireis not the culprit. The culprit is due to the usage in the LSP of a "local" file that is actually installed usinglambdapi installthat relocates the file. The .lpo were not thought to be relocatable when implementing search (and indeed they are not): they concaintpositions with absolute paths. The exception is raised when trying to access a file that has been moved. In particular this is required: 1) to synthesize a QID for rule names that have none ; 2) to show the query results[-]New require open breaks LSP server[/-][+]Lpo files contain absolute positions[/+]fblanqui commentedon Jul 10, 2026
The complete error message in VSCode is:
In Emacs, I get:
Strange...
fblanqui commentedon Jul 10, 2026
Concerning lpo files, what about using relative positions? The absolute position could be obtained on the fly by using file_of_path?
fblanqui commentedon Jul 10, 2026
With #1455, I get in VSCode:
Note that there is no space or newline between the position and the error message.
Do not fail in case of moved file (#1439)