-
Notifications
You must be signed in to change notification settings - Fork 17
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
Draft: Fix minor issues to enable Serokell to use the IDE for local testing #281
Conversation
src/server/motoko.ts
Outdated
// import getMotoko from 'motoko/lib'; | ||
import mo from 'motoko'; | ||
import getMotoko from 'motoko/lib'; | ||
// import mo from 'motoko'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, these changes would need to be removed before merging this. But they are helpful for local development, so let's keep them in the unmerged PR until Serokell's contributions are merged into moc.
I'll change the PR title to indicate it's not supposed to be merged just yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we ready to merge? I can take over releasing these changes if it would be beneficial for the upcoming demo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we ready to merge?
From my p.o.v., we're ready to merge!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Updated the extension on the VS Code marketplace. Let me know if you encounter any issues or if we need any other last-minute changes. |
How to use this fix:
Make sure you have the "Viper v4.3.1" extension installed in VS Code, and that it has installed its dependencies (this happen via a prompt when you open e.g., an empty Viper file in VS Code with this extension installed). Verifying Viper files should work automatically upon saving .vpr files.
Setup the VS Code extension repo as follows:
This should print something like
/nix/store/x7amwi31gzavs8r7q89ljwwaksg5kqzw-moc.js
(which is a directory). Copy the internal JS file into a place that would be seen by the VS Code extension, e.g.:code .
) and enter a debug session (e.g., hit F5 or click play in the Run and Debug panel of VS Code):In the new window, open a folder (a.k.a. workspace) containing some Motoko-san source files. For example, open "motoko/test/viper/".
Choose one Motoko-san source file, e.g., "reverse.mo", from your workspace.
Ensure that you have
// @verify
on the very first line of the file (this tells the motoko-san extension that it needs to try to verify this file).Upon assertion violation, you should see some interactive feedback from the tool upon saving the file, e.g.: