Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP: DSLX_PATH stopped working #1731

Open
hzeller opened this issue Nov 19, 2024 · 1 comment
Open

LSP: DSLX_PATH stopped working #1731

hzeller opened this issue Nov 19, 2024 · 1 comment
Assignees
Labels
dslx:lsp DSLX language server/protocol implementation

Comments

@hzeller
Copy link
Member

hzeller commented Nov 19, 2024

The DSLX_PATH environment variable used to be the way to tell he language server what the base path is for finding import paths.

Let's assume the XLS checkout is in a subdirectory of my homedir: /home/myhomedir/src/xls and thelanguage server configured for the editor.

Now opening a DSLX file. To make sure the language server finds all import paths, I am setting the DSLX_PATH to the root of the directory:

DSLX_PATH=/home/myhomedir/src/xls emacs src/xls/xls/dslx/stdlib/float32.x

This now lets the language server crash while opening the file:

XLS testing language server
Path configuration:
        stdlib=xls/dslx/stdlib
        dslx_path=/home/myhomedir/src/xls
        cwd=/home/myhomedir/src/xls
F1119 11:00:35.471252 1009793 language_server_adapter.cc:232] Check failed: absl::StartsWith(importer_filename, "file://") || absl::StartsWith(importer_filename, "memfile://") importer_filename: xls/dslx/stdlib/apfloat.x imported: "xls/dslx/stdlib/std.x"

It looks like some part of the code assumes regular host filenames, while others assume the file:// URI notation, which then clashes here.

@hzeller hzeller added the dslx:lsp DSLX language server/protocol implementation label Nov 19, 2024
@hzeller
Copy link
Member Author

hzeller commented Nov 19, 2024

Looks like this broke with the introduction of the virtual filesystem in 1b175c6
Maybe @cdleary sees immediately what is amiss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dslx:lsp DSLX language server/protocol implementation
Projects
None yet
Development

No branches or pull requests

2 participants