diff --git a/package-lock.json b/package-lock.json index 56c3806a..c93f7bc4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vscode-motoko", - "version": "0.6.0", + "version": "0.6.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8ac2cb9c..a30feee5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-motoko", "displayName": "Motoko", "description": "Motoko language support", - "version": "0.6.0", + "version": "0.6.1", "publisher": "dfinity-foundation", "repository": "https://github.com/dfinity/vscode-motoko", "engines": { diff --git a/src/server/server.ts b/src/server/server.ts index ba5cf603..abacf141 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -57,28 +57,28 @@ const ignoreGlobs = [ ]; function getVesselSources(directory: string): [string, string][] { - if (!existsSync('vessel')) { - // Fallback Vessel functionality - return vesselSources(directory); - } - - const flags = execSync('vessel sources', { - cwd: directory, - }).toString('utf8'); - const args = flags.split(' '); - const sources: [string, string][] = []; - let nextArg; - while ((nextArg = args.shift())) { - if (nextArg === '--package') { - const name = args.shift()!; - const relativePath = args.shift(); - if (!relativePath) { - continue; + try { + const flags = execSync('vessel sources', { + cwd: directory, + }).toString('utf8'); + const args = flags.split(' '); + const sources: [string, string][] = []; + let nextArg; + while ((nextArg = args.shift())) { + if (nextArg === '--package') { + const name = args.shift()!; + const relativePath = args.shift(); + if (!relativePath) { + continue; + } + sources.push([name, relativePath]); } - sources.push([name, relativePath]); } + return sources; + } catch (err) { + console.error('Error while running `vessel sources`:', err); + return vesselSources(directory); } - return sources; } let vesselChangeTimeout: ReturnType;