lambdapi icon indicating copy to clipboard operation
lambdapi copied to clipboard

The LSP server does not handle file names with non ASCII characters

Open fblanqui opened this issue 6 years ago • 7 comments

When, in Emacs, I want to look at a file f.lp located in /d1/d2/../dn/, I get no feedback if one of the directory di contains non-ascii characters.

fblanqui avatar Apr 08 '20 15:04 fblanqui

@gabrielhdt do you think that this is related to the Emacs mode?

fblanqui avatar Apr 09 '20 07:04 fblanqui

It comes from the LSP server, if we have a look in the logs,

$ tail lambdapi_lsp_log.txt 
            "textDocument": { "uri": "file:///tmp/%CE%B7/f.lp" },
            "position": { "line": 0, "character": 5 }
          }
        }
[[BT]]: Raised at file "hashtbl.ml", line 194, characters 13-28
Called from file "src/lsp/lp_lsp.ml", line 124, characters 61-90
Called from file "src/lsp/lp_lsp.ml", line 291, characters 18-33
Called from file "src/lsp/lp_lsp.ml", line 378, characters 6-44

[process_input]: Not_found

gabrielhdt avatar Apr 09 '20 07:04 gabrielhdt

Thanks Gabriel. @ejgallego would it be difficult to fix this?

fblanqui avatar Apr 09 '20 07:04 fblanqui

Oh, I removed the file:// to get the file path, but I did not realise it was percent-encoded. I do not have non-ascii characters on my own files... I can try to fix that if you want. Ideally, it would be nice to implement or use a function that converts a URI into an absolute file path.

rlepigre avatar Apr 09 '20 09:04 rlepigre

Yes, please. Thank you @rlepigre !

fblanqui avatar Apr 09 '20 09:04 fblanqui

Yup, you can find many convenient functions in https://github.com/ocaml/ocaml-lsp so need to roll our own.

ejgallego avatar Apr 09 '20 22:04 ejgallego

This problem seems to be solved now. Perhaps thanks to one of @firewall2142 's contributions.

fblanqui avatar Dec 15 '21 15:12 fblanqui

Hi @fblanqui. Can we close this issue as the problem is solved? (I tried with Vscode and it works fine too)

Alidra avatar Apr 05 '24 07:04 Alidra

Perfect. Thank you.

fblanqui avatar Apr 05 '24 08:04 fblanqui