-
Notifications
You must be signed in to change notification settings - Fork 0
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
Error when parsing mcrl2 file #1
Comments
Found what was causing the problem. In the const dir = vscode.workspace.workspaceFolders
? vscode.workspace.workspaceFolders.filter(x => x.name == vscode.workspace.name)[0].uri.fsPath
: px.dirname(vscode.window.activeTextEditor.document.fileName); I've solved it locally with the following: function toProjectPath(pathName='') {
const wsFolders = vscode.workspace.workspaceFolders ?
vscode.workspace.workspaceFolders.filter(x => x.name == vscode.workspace.name) : [];
const dir = wsFolders.length > 0
? wsFolders[0].uri.fsPath
: px.dirname(vscode.window.activeTextEditor.document.fileName);
const normalized = px.normalize(dir);
const trimmed = pathName.trim();
if (trimmed.length == 0) {
return normalized;
}
return px.join(normalized, trimmed);
} |
@keenstoat Hi, thank you for reporting this issue. Would you be willing to create a pull request to apply your fix? I will then release a new version of the extension. I will need some time to figure out how to do that again exactly, since it's been a while since I released the original version. |
@keenstoat It took me a while to get around to this, but I found some time to fix it and release a new version on the vscode marketplace. |
Actual output
When running the example for the vending machine here: https://www.mcrl2.org/web/user_manual/tutorial/machine/index.html#first-variation
And running the "Parse" action button (also for the mCRL2:Parse command)
Then an error is displayed with the message:
Cannot read properties of undefined (reading 'uri')
And the developer tools console shows the following error:
Expected output
Parsing the file with the tool shows a successful message:
![image](https://private-user-images.githubusercontent.com/48898526/371750873-1b612d12-85c5-4383-8e0e-b776fe3711ea.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NTM0NTAsIm5iZiI6MTczOTg1MzE1MCwicGF0aCI6Ii80ODg5ODUyNi8zNzE3NTA4NzMtMWI2MTJkMTItODVjNS00MzgzLThlMGUtYjc3NmZlMzcxMWVhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA0MzIzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY2Yjc1ZjY4YWM1OGE4M2M5YTAxNmU2ZDE5ZDdlYzliNzA4NDRjNDg1MmM2OTFhNzIyYTllYzU4ZTNiMjBlMjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.v-h74Kkp6QLqqpYX0TgSPLxRrfxg0PTt5kJ06MR7ebE)
Note
The error happens for all commands: parse, show graph, simulate, etc
The text was updated successfully, but these errors were encountered: