-
Notifications
You must be signed in to change notification settings - Fork 15
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
[BUG] Windows Filepaths #623
Comments
The error seems to raised here: jayvee/libs/interpreter-lib/src/parsing-util.ts Lines 47 to 53 in 7a02683
The initialization happens here: jayvee/apps/interpreter/src/run-action.ts Lines 37 to 58 in 7a02683
We add cwd.process() to the list of workdirs, and later on retrieve the added document (see first code snippet) based on a relative path.
Current fault hypotheses:
|
New insights: jayvee/libs/interpreter-lib/src/parsing-util.ts Lines 47 to 49 in 7a02683
Thx @Waldleufer for helping me to debug this! |
Further insights: Langium uses the method However, this util method uses linux paths So the registered document has path: |
I see two fixes, while waiting for Langium to fix this in a future version, both in this area: jayvee/libs/interpreter-lib/src/parsing-util.ts Lines 47 to 49 in 7a02683
const fileUri = URI.parse(path.resolve(filePath));
const document =
await services.shared.workspace.LangiumDocuments.getOrCreateDocument(
fileUri,
);
const folderPath = path.dirname(filePath);
const folderUri = URI.parse(path.resolve(folderPath));
const fileName = path.basename(filePath);
// Exactly same implementation as in Langium to make sure document lookup works on Windows
// https://github.com/jvalue/jayvee/issues/623
const fileUrl = UriUtils.joinPath(folderUri, fileName);
const document =
services.shared.workspace.LangiumDocuments.getDocument(fileUrl); |
Second one is more clear and links to the issue, so I would go with that I think. |
Ok, this will have the caveat that once we have a fix in Langium, Windows users will have an issue again (because the replicated implementation changes). But I agree it is better since the problem is not masked. I created an issue in the langium repo: eclipse-langium/langium#1725 |
Steps to reproduce
jv -d cars.jv
Note: This seems to be a Windows-only issue.
Description
The text was updated successfully, but these errors were encountered: