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

Draft: Fix minor issues to enable Serokell to use the IDE for local testing #281

Draft
wants to merge 1 commit into
base: viper
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export async function startServer(context: ExtensionContext) {
viperTools = normalise(viperTools, config.paths.viperToolsPath);
const buildVersion = config.buildVersion || 'Stable';
const homePath = homedir();
// Viper extension v3.0.1
// Viper extension v4.3.1
if (
viperTools ===
path.resolve(homePath, 'Library/Application Support/Viper') ||
Expand All @@ -191,7 +191,7 @@ export async function startServer(context: ExtensionContext) {
);
}
// WSL tweak
if (env.remoteName === 'wsl') {
if (env.remoteName === 'wsl' || env.remoteName === 'ssh-remote') {
viperTools = viperTools.replace(
path.join(homePath, '.config', 'Code'),
path.join(homePath, '.vscode-server', 'data'),
Expand Down
6 changes: 3 additions & 3 deletions src/server/motoko.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// import getMotoko from 'motoko/lib';
import mo from 'motoko';
import getMotoko from 'motoko/lib';
// import mo from 'motoko';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be removed?

Copy link
Collaborator Author

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.


process.env.MOC_UNLOCK_VERIFICATION = '1';

// const mo = getMotoko(require('../generated/moc.js').Motoko as any);
const mo = getMotoko(require('../generated/moc.js').Motoko as any);

export default mo;
3 changes: 3 additions & 0 deletions src/server/viper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ try {
}
};
server.stdout.on('data', dataListener);
server.stderr.on('data', (data) => {
console.error(`child stderr:\n${data}`);
});
} catch (err) {
console.error(`Error while initializing Viper LSP: ${err}`);
}
Expand Down