From c783babd96123cf9a77971c30450ec948fece859 Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Fri, 8 May 2020 20:46:50 +0100 Subject: [PATCH 1/4] Handle r.a progress messages --- lib/index.js | 3 +- lib/rls-project.js | 119 ++++++++++++++++++--------------------------- 2 files changed, 50 insertions(+), 72 deletions(-) diff --git a/lib/index.js b/lib/index.js index 458f753..9cacc89 100644 --- a/lib/index.js +++ b/lib/index.js @@ -102,6 +102,7 @@ async function rustupOverrides() { let { stdout } = await exec("rustup override list") return stdout.split(/[\r\n]+/g) .map(line => { + // line.trimEnd is not a function ? let lastSpace = line.trimEnd().lastIndexOf(' ') return { path: line.slice(0, lastSpace).trim(), @@ -700,7 +701,7 @@ class RustLanguageClient extends AutoLanguageClient { return "Rust" } getServerName() { - return "RLS" + return "rust-analyzer" } filterChangeWatchedFiles(filePath) { diff --git a/lib/rls-project.js b/lib/rls-project.js index 606c445..61c2a62 100644 --- a/lib/rls-project.js +++ b/lib/rls-project.js @@ -14,7 +14,7 @@ class RlsProject { this.getBusySignalService = busySignalServiceFn this._lastSentConfig = null - /** @type {Map} */ + /** @type {Map} */ this._progress = new Map() /** @type {?BusyMessage} */ @@ -32,76 +32,7 @@ class RlsProject { await handleMultiCrateProjectErrors(this.server.projectPath, note) }) - // Rls (>= 2018-02-24) sends `window/progress` notifications - // see https://github.com/Microsoft/language-server-protocol/pull/245/files - server.connection.onCustom('window/progress', params => { - const busySignal = this.getBusySignalService() - if (!busySignal) return - - let { - id, - title, - message, - percentage, - done - } = params - let busyMessage = this._progress.get(id) - - if (done) { - if (busyMessage) busyMessage.dispose() - this._progress.delete(id) - } else { - let busyText = `${path.basename(this.server.projectPath)} RLS ${title.toLowerCase()}` - if (busyMessage) { - // use previous percentages/messages according to the spec - percentage = percentage || busyMessage.lastProgressPercentage - message = message || busyMessage.lastProgressMessage - } - if (percentage) busyText += ` ${percentage.toFixed()}%` - if (message) busyText += `: ${message}` - - if (busyMessage) { - busyMessage.setTitle(busyText) - } else { - busyMessage = busySignal.reportBusy(busyText) - this._progress.set(id, busyMessage) - } - - busyMessage.lastProgressPercentage = percentage - busyMessage.lastProgressMessage = message - } - }) - - // Rls (< 2018-02-24) sends 3 custom build notifications in sequence - // - rustDocument/beginBuild - // - rustDocument/diagnosticsBegin - // - rustDocument/diagnosticsEnd - // - // Certain factors can cause multiple builds to run concurrently - // ie a `didChangeConfiguration` during a build, so we consider Rls - // to be building as long as we're waiting for _any_ build. - server.connection.onCustom('rustDocument/beginBuild', () => { - if (this._rustDocBusyMessage) { - this._rustDocBusyMessage.count += 1 - } else { - let busySignal = this.getBusySignalService() - if (busySignal) { - this._rustDocBusyMessage = busySignal - .reportBusy(`${path.basename(this.server.projectPath)} RLS building`) - this._rustDocBusyMessage.count = 1 - } - } - }) - server.connection.onCustom('rustDocument/diagnosticsEnd', () => { - if (this._rustDocBusyMessage && this._rustDocBusyMessage.count > 0) { - this._rustDocBusyMessage.count -= 1 - - if (this._rustDocBusyMessage.count === 0) { - this._rustDocBusyMessage.dispose() - this._rustDocBusyMessage = null - } - } - }) + server.connection.onCustom('$/progress', params => this.onProgress(params)) // clean up any busy messages this.server.process.on('exit', () => { @@ -111,6 +42,52 @@ class RlsProject { }) } + // Handle r.a progress messages + onProgress({ + token, + value + }) { + const busySignal = this.getBusySignalService() + if (!busySignal) return + + let { + kind, + title, + message, + percentage, + } = value + + const done = kind === "end" + + let busyMessage = this._progress.get(token) + + if (done) { + if (busyMessage) busyMessage.dispose() + this._progress.delete(token) + } else { + if (busyMessage) { + // use previous percentages/messages according to the spec + percentage = percentage || busyMessage.lastProgressPercentage + message = message || busyMessage.lastProgressMessage + title = title || busyMessage.lastProgressTitle + } + let busyText = `${path.basename(this.server.projectPath)} ${title || "r.a"}` + if (percentage) busyText += ` ${percentage.toFixed()}%` + if (message) busyText += `: ${message}` + + if (busyMessage) { + busyMessage.setTitle(busyText) + } else { + busyMessage = busySignal.reportBusy(busyText) + this._progress.set(token, busyMessage) + } + + busyMessage.lastProgressPercentage = percentage + busyMessage.lastProgressMessage = message + busyMessage.lastProgressTitle = title + } + } + // Send rls.toml as `workspace/didChangeConfiguration` message (or default if no rls.toml) sendRlsTomlConfig() { let rlsTomlPath = path.join(this.server.projectPath, 'rls.toml') From 4d0a1ef40479257150543beaf139a75152d35672 Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Sat, 9 May 2020 15:09:36 +0100 Subject: [PATCH 2/4] npm update --- package-lock.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6b7ba4..dcf8221 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,9 +25,9 @@ } }, "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, "acorn-jsx": { @@ -88,7 +88,7 @@ "dev": true }, "atom-languageclient": { - "version": "github:alexheretic/atom-languageclient#d475682b9c084c0fc94eaa20257e8339f52c97a1", + "version": "github:alexheretic/atom-languageclient#6f0b819d905ef874d6e5bd45b2f1c32c7bccdbf5", "from": "github:alexheretic/atom-languageclient#build", "requires": { "fuzzaldrin-plus": "^0.6.0", @@ -640,18 +640,18 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } }, "ms": { From b792c921a3f5385ea02831cd295a13f8f3f2b982 Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Sun, 10 May 2020 17:58:47 +0100 Subject: [PATCH 3/4] Fix completion in atom-languageclient fork Update dependencies --- package-lock.json | 470 ++++++++++++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 292 insertions(+), 180 deletions(-) diff --git a/package-lock.json b/package-lock.json index dcf8221..93b3163 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,33 +13,58 @@ "@babel/highlight": "^7.8.3" } }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", "dev": true, "requires": { + "@babel/helper-validator-identifier": "^7.9.0", "chalk": "^2.0.0", - "esutils": "^2.0.2", "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } } }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, "acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.2.0.tgz", + "integrity": "sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ==", "dev": true }, "acorn-jsx": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", - "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true }, "ajv": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", - "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -49,12 +74,20 @@ } }, "ansi-escapes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.0.tgz", - "integrity": "sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } } }, "ansi-regex": { @@ -88,7 +121,7 @@ "dev": true }, "atom-languageclient": { - "version": "github:alexheretic/atom-languageclient#6f0b819d905ef874d6e5bd45b2f1c32c7bccdbf5", + "version": "github:alexheretic/atom-languageclient#00de7cce09b8f5131b8a02d73b5f7fb43e4907a5", "from": "github:alexheretic/atom-languageclient#build", "requires": { "fuzzaldrin-plus": "^0.6.0", @@ -129,14 +162,55 @@ "dev": true }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "chardet": { @@ -155,9 +229,9 @@ } }, "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, "color-convert": { @@ -182,24 +256,14 @@ "dev": true }, "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", + "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, "debug": { @@ -239,22 +303,22 @@ "dev": true }, "eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.0.0.tgz", + "integrity": "sha512-qY1cwdOxMONHJfGqw52UOpZDeqXy8xmD0u8CT6jIstil72jkhURC704W8CFyTPDPllz4z4lu0Ql1+07PG/XdIg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", + "eslint-utils": "^2.0.0", "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "espree": "^7.0.0", + "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", @@ -267,20 +331,27 @@ "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", + "levn": "^0.4.1", "lodash": "^4.17.14", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", "table": "^5.2.3", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } } }, "eslint-scope": { @@ -294,9 +365,9 @@ } }, "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" @@ -309,13 +380,13 @@ "dev": true }, "espree": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.2.tgz", - "integrity": "sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.0.0.tgz", + "integrity": "sha512-/r2XEx5Mw4pgKdyb7GNLQNsu++asx/dltf/CI8RFi9oGHxmQFgvLbc5Op4U6i8Oaj+kdslhJtVlEZeAqH5qOTw==", "dev": true, "requires": { - "acorn": "^7.1.0", - "acorn-jsx": "^5.1.0", + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.1.0" } }, @@ -326,12 +397,20 @@ "dev": true }, "esquery": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.1.0.tgz", - "integrity": "sha512-MxYW9xKmROWF672KqjO75sszsA8Mxhw06YFeS5VHlB98KDHbOSurm3ArsjO60Eaf3QmGMCP1yn+0JQkNLo/97Q==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "dev": true, "requires": { - "estraverse": "^4.0.0" + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + } } }, "esrecurse": { @@ -414,9 +493,9 @@ } }, "flatted": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", - "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, "fs.realpath": { @@ -451,18 +530,18 @@ } }, "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "dev": true, "requires": { "is-glob": "^4.0.1" } }, "globals": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.3.0.tgz", - "integrity": "sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==", + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "dev": true, "requires": { "type-fest": "^0.8.1" @@ -522,24 +601,76 @@ "dev": true }, "inquirer": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.4.tgz", - "integrity": "sha512-Bu5Td5+j11sCkqfqmUTiwv+tWisMtP0L7Q8WrqA2C/BbBhy1YTdFrvjjlrKq8oagA/tLQBski2Gcx/Sqyi2qSQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", "dev": true, "requires": { "ansi-escapes": "^4.2.1", - "chalk": "^2.4.2", + "chalk": "^3.0.0", "cli-cursor": "^3.1.0", "cli-width": "^2.0.0", "external-editor": "^3.0.3", "figures": "^3.0.0", "lodash": "^4.17.15", "mute-stream": "0.0.8", - "run-async": "^2.2.0", + "run-async": "^2.4.0", "rxjs": "^6.5.3", "string-width": "^4.1.0", - "strip-ansi": "^5.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "is-extglob": { @@ -563,12 +694,6 @@ "is-extglob": "^2.1.1" } }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", @@ -609,13 +734,13 @@ "dev": true }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, "lodash": { @@ -672,12 +797,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -697,17 +816,17 @@ } }, "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" } }, "os-tmpdir": { @@ -732,15 +851,15 @@ "dev": true }, "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "progress": { @@ -756,9 +875,9 @@ "dev": true }, "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, "resolve-from": { @@ -787,18 +906,15 @@ } }, "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true }, "rxjs": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", - "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -824,24 +940,24 @@ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "slice-ansi": { @@ -878,34 +994,15 @@ "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } + "ansi-regex": "^5.0.0" } }, "strip-bom-buf": { @@ -917,9 +1014,9 @@ } }, "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", "dev": true }, "supports-color": { @@ -943,6 +1040,12 @@ "string-width": "^3.0.0" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -965,6 +1068,15 @@ "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^5.1.0" } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } } } }, @@ -995,18 +1107,18 @@ "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" }, "tslib": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.0.tgz", - "integrity": "sha512-BmndXUtiTn/VDDrJzQE7Mm22Ix3PxgLltW9bSNLoeCY31gnG2OPx0QqJnuc9oMIKioYrz487i6K9o4Pdn0j+Kg==", + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.2.tgz", + "integrity": "sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg==", "dev": true }, "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" } }, "type-fest": { @@ -1016,9 +1128,9 @@ "dev": true }, "underscore": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", - "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", + "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==" }, "underscore-plus": { "version": "1.7.0", @@ -1070,9 +1182,9 @@ "integrity": "sha512-UxqnpzBToPO7Mi2tr/s5JeyPOSKSJtLB8lIdxCg9ZNdvP2cU8wS7iTDtwQKz91Ne4CUmTdf85ddR5SIZKXmMjQ==" }, "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" diff --git a/package.json b/package.json index f8ac946..7a67ae4 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "underscore-plus": "^1.7.0" }, "devDependencies": { - "eslint": "^6.7.2" + "eslint": "^7.0.0" }, "scripts": { "test": "eslint lib --max-warnings 0" From 227314ac4e2b3832f458bd616641b32a85a5341f Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Mon, 11 May 2020 12:26:57 +0100 Subject: [PATCH 4/4] Update to use rust-analyzer by default * Remove RLS stuff * Update readmes * Keep some dead code that may be re-used when r.a is on the release trains --- README.md | 68 +--- lib/competition.js | 6 +- lib/index.js | 395 +++++------------------- lib/{rls-project.js => rust-project.js} | 18 +- package-lock.json | 2 +- 5 files changed, 103 insertions(+), 386 deletions(-) rename lib/{rls-project.js => rust-project.js} (93%) diff --git a/README.md b/README.md index 990d852..86bdc05 100644 --- a/README.md +++ b/README.md @@ -1,78 +1,35 @@ # IDE-Rust -Rust language support for Atom-IDE, powered by the Rust Language Server (RLS). - -![](http://image.ibb.co/gwfQTm/output.gif "Usage Jan-2018") +Rust language support for Atom-IDE, powered by [rust-analyzer](https://github.com/rust-analyzer/rust-analyzer). ## Features - Auto-completion - - Diagnostics (errors and warnings from `rustc` and `clippy`, see `clippy_preference` setting) + - Diagnostics (errors and warnings from `rustc`) - Document outline - Go to definition (`ctrl` or `cmd` click) - Type information and Documentation on hover (hold `ctrl` or `cmd` for more information) - Find references (`ctrl-alt-shift-f` or `cmd-opt-shift-f` also in context menu) - Format file with rustfmt (`ctrl-shift-c` or `cmd-shift-c` also in context menu) - Format on save (disabled by default, see `atom-ide-ui` settings) - - Supports rustup default & override toolchains, or manually select rls toolchain in package settings - - Rls toolchain update checking at startup & every 6 hours thereafter - - Global Rls configuration for `all_targets`, `clippy_preference` - - Per-project Rls configuration using `rls.toml` file at project root, see [rls#configuration](https://github.com/rust-lang-nursery/rls#configuration) - ```toml - # rls.toml - features = ["serde"] - ``` - - Graceful handling of Rls being missing from the distribution _(which is/was somewhat common on the nightly channel)_ - * Warns before installing a rust version without Rls or when using an already installed one - * Automatic detection of, and prompt to install, the latest working dated release + - Rustup toolchain update checking at startup & every 6 hours thereafter + - Supports rustup override toolchains - Rust language snippets ## Install -You can install from the command line with: +Install from Settings view by searching for `ide-rust`, or with the command line: ``` $ apm install ide-rust ``` -Or you can install from Settings view by searching for `ide-rust`. -No other packages or manual setup is required as these will be handled with user prompts after install. However, you may wish to install `rustup` with your OS package manager instead of following prompts to install via [rustup.rs](https://rustup.rs). +### Prerequisites +**rust-analyzer** must be installed manually, if possible on the PATH _(otherwise configure this in the package settings)_. +See https://rust-analyzer.github.io/manual.html#rust-analyzer-language-server-binary. + +No other packages or manual setup is required as these will be handled with user prompts after install. +However, you may wish to install `rustup` with your OS package manager instead of following prompts to install via [rustup.rs](https://rustup.rs). ## Commands - `ide-rust:restart-all-language-servers` Restart all currently active Rls processes -## Multi-crate projects -A root `Cargo.toml` is required in each atom project, however cargo workspaces can be used to support multiple crates in a single project. -For example, a project with *'rust_foo'* & *'rust_bar'* directories/crates could have the following root `Cargo.toml` -```toml -# Cargo.toml -[workspace] -members = [ - "rust_foo", - "rust_bar", -] -``` - -Even if you only have a single crate in your Atom project, RLS can only detect it if you -have a root `Cargo.toml`. If your project is setup such that you have one or more crate nested -in folders under the root, you can add a root `Cargo.toml` file and setup a Cargo workspace that -includes all the crates in the project: -```toml -# Cargo.toml -[workspace] -members = [ - "foo/bar/rust_foo", -] -``` - -## Overriding Rls -The Rls command can be specified manually, for example to run from local source code: -```cson -# config.cson - ... - "ide-rust": - rlsCommandOverride: "cargo +nightly run --manifest-path=/rls-src/Cargo.toml" -``` -When set you'll be able to see, and remove, this from the package settings. After restarting atom an info message will inform you the override is in place. - -![](https://image.ibb.co/jsR65w/rls_Command_Override_Info.png) - ## Debugging IDE-Rust If stuff isn't working you can try **enabling logging** to debug: * Open the atom console _(ctrl-shift-i)_ @@ -81,5 +38,8 @@ If stuff isn't working you can try **enabling logging** to debug: This will spit out language server message logging into the atom console. Check if requests/responses are being sent or are incorrect. It will also include any Rls stderr messages (as warnings) which may point to Rls bugs. +## RLS +RLS is no longer supported. To use RLS install a previous version of ide-rust, `apm install ide-rust@0.21.2`. + ## License MIT License. See the [license](LICENSE) for more details. diff --git a/lib/competition.js b/lib/competition.js index 3a78dfc..daf58a4 100644 --- a/lib/competition.js +++ b/lib/competition.js @@ -3,11 +3,11 @@ const CONFLICTING_PACKAGES = [ "languageserver-rust", "tokamak", "atom-rust", - // rls provides lints + // rust-analyzer provides lints "linter-rust", - // rls provides rustfmt functionality + // rust-analyzer provides rustfmt functionality "rustfmt", - // rls provides racer completion + // rust-analyzer provides completion "racer", "racer-v2", "racer-plus", diff --git a/lib/index.js b/lib/index.js index 9cacc89..84332c7 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,14 +1,11 @@ const cp = require("child_process") const os = require("os") const path = require("path") -const _ = require("underscore-plus") const { CompositeDisposable, Disposable } = require("atom") const { AutoLanguageClient } = require("atom-languageclient") -const RlsProject = require("./rls-project.js") +const RustProject = require("./rust-project.js") const { fetchLatestDist, - checkHasRls, - suggestChannelOrDated, DATED_REGEX, } = require("./dist-fetch") const { showConflictingPackageWarnings } = require("./competition.js") @@ -35,16 +32,16 @@ function logErr(e, logFn = console.warn) { e && logFn('' + e) } -function clearIdeRustInfos() { +function clearIdeRustNotifications(prefix = 'ide-rust') { for (const note of atom.notifications.getNotifications()) { - if (note.getOptions()._src === 'ide-rust') { + if (note.getOptions()._src && note.getOptions()._src.startsWith(prefix)) { note.dismiss() } } } function atomPrompt(message, options, buttons) { - clearIdeRustInfos() + clearIdeRustNotifications() return new Promise(resolve => { const notification = atom.notifications.addInfo( @@ -74,13 +71,21 @@ function installRustup() { } function configToolchain() { - return atom.config.get('ide-rust.rlsToolchain') + return "stable" } function rustupRun(toolchain, command, opts={}) { return toolchain && exec(`rustup run ${toolchain} ${command}`, opts) || exec(`${command}`, opts) } +function notifyLanguageServerCommandFailed(languageServerCmd) { + clearIdeRustNotifications("ide-rust.langServerCommand") + atom.notifications.addError(`Language server command \`${languageServerCmd}\` failed`, { + dismissable: true, + _src: "ide-rust.langServerCommand" + }) +} + async function rustupDefaultToolchain() { // linux: "stable-x86_64-unknown-linux-gnu (default)" // mac: "stable (default)" @@ -90,7 +95,7 @@ async function rustupDefaultToolchain() { async function hasCommand(rustCommand) { try { - await exec(`${rustCommand} -V`) + await exec(`${rustCommand} --version`) return true } catch (e) { return false @@ -112,9 +117,9 @@ async function rustupOverrides() { .filter(({ path, toolchain }) => path && toolchain && path !== 'no') } -/** @return {?string} developer override of the command to start a Rls instance */ -function rlsCommandOverride() { - return atom.config.get('ide-rust.rlsCommandOverride') +/** @return {string} command to start the language server */ +function langServerCommand() { + return atom.config.get('ide-rust.languageServerCommand') || "rust-analyzer" } // Installs nightly @@ -172,9 +177,9 @@ async function serverEnv(toolchain, cwd) { env.PATH = envPath() env.RUST_BACKTRACE = env.RUST_BACKTRACE || "1" - if (!env.RUST_LOG && atom.config.get('core.debugLSP')) { - env.RUST_LOG = 'rls=warn,rls::build=info' - } + // if (!env.RUST_LOG && atom.config.get('core.debugLSP')) { + // env.RUST_LOG = 'rls=warn,rls::build=info' + // } try { let sysroot = await rustcSysroot(toolchain, cwd) @@ -185,80 +190,10 @@ async function serverEnv(toolchain, cwd) { return env } -/** - * Install rls-preview, rust-src, rust-analysis - * @param {string} toolchain - * @param {string} [cwd] - */ -async function installRlsComponents(toolchain, cwd) { - const toolchainArg = toolchain && `--toolchain ${toolchain}` || '' - try { - await exec(`rustup component add rls-preview ${toolchainArg}`, { cwd }) - } catch (e) { - - let suggestedVersion - let usingRustupOverride = false - - if (!toolchain) { - // check if using a rustup override - let override = (await rustupOverrides()).find(({ path }) => cwd.startsWith(path)) - if (override) { - toolchain = override.toolchain - usingRustupOverride = true - } - } - - if (toolchain.startsWith('nightly')) { - // 'rls' not available search for a decent suggestion - suggestedVersion = await suggestChannelOrDated('nightly').catch(logErr) - } - - const note = { - detail: 'Try configuring another toolchain, like a dated nightly or `beta`', - dismissable: true, - _src: 'ide-rust', - buttons: [{ - text: 'Configure', - onDidClick: () => atom.workspace.open('atom://config/packages/ide-rust') - }] - } - if (suggestedVersion && !usingRustupOverride) { - note.buttons.push({ - text: `Use ${suggestedVersion}`, - onDidClick: () => atom.config.set('ide-rust.rlsToolchain', suggestedVersion) - }) - } - - if (usingRustupOverride) { - note.detail = "Try removing your rustup override or reconfiguring to a dated nightly or `beta`" - if (suggestedVersion) - note.detail = note.detail.replace("a dated nightly", `\`${suggestedVersion}\``) - atom.notifications - .addError(`\`rls\` was not found on rustup override \`${toolchain}\``, note) - } else { - atom.notifications - .addError(`\`rls\` was not found on \`${toolchain || 'the default toolchain'}\``, note) - } - - throw e - } - - try { - await exec(`rustup component add rust-src ${toolchainArg}`, { cwd }) - await exec(`rustup component add rust-analysis ${toolchainArg}`, { cwd }) - } catch (e) { - atom.notifications - .addError(`\`rust-src\`/\`rust-analysis\` not found on \`${toolchain || 'the default toolchain'}\``, { - dismissable: true - }) - throw e - } -} - /** * Adds a listener on stdout to warn of non-LSP looking lines (potentially from wayward * server-side printing). Non-LSP stdout usage will break vscode-jsonrpc. - * @param {ChildProcess} process Rls + * @param {ChildProcess} process language server * @return {ChildProcess} */ function logSuspiciousStdout(process) { @@ -269,78 +204,30 @@ function logSuspiciousStdout(process) { l.length < 10000 && // ignore long chunks, these are much more likely to be false positives !l.startsWith("Content-Length:") && !l.includes('"jsonrpc":"2.0"')) - .forEach(line => console.error("Rust (RLS) suspicious stdout:", line)) + .forEach(line => console.error("Rust LS suspicious stdout:", line)) }) return process } -// ongoing promise -let _checkingRls - -/** - * Check for and install Rls - * @param {?BusySignalService} busySignalService - * @param {string} [cwd] - * @return {Promise<*>} rls installed - */ -async function checkRls(busySignalService, cwd) { - if (_checkingRls) return _checkingRls - - const toolchain = configToolchain() - const toolchainArg = toolchain && `--toolchain ${toolchain}` || "" - - _checkingRls = (async () => { - if (!await hasCommand("rustup")) { - if (await hasCommand("rls")) { - return // have system rls without rustup - } else { - throw new Error("rls & rustup missing") - } - } - - let { stdout: toolchainList } = await exec(`rustup component list ${toolchainArg}`, { cwd }) - if ( - toolchainList.search(/^rls.* \((default|installed)\)$/m) >= 0 && - toolchainList.search(/^rust-analysis.* \((default|installed)\)$/m) >= 0 && - toolchainList.search(/^rust-src.* \((default|installed)\)$/m) >= 0 - ) { - return // have rls - } - // try to install rls - const installRlsPromise = installRlsComponents(toolchain, cwd) - if (busySignalService) { - busySignalService.reportBusyWhile( - `Adding components rls-preview, rust-src, rust-analysis`, - () => installRlsPromise - ) - } - - return installRlsPromise - })() - - try { - return await _checkingRls - } finally { - _checkingRls = null // eslint-disable-line - } -} - class RustLanguageClient extends AutoLanguageClient { constructor() { super() - /** (projectPath -> RlsProject) mappings */ + /** (projectPath -> RustProject) mappings */ this.projects = {} this.activeOverrides = new Set() this.disposables = new CompositeDisposable() + // remove legacy configs + atom.config.unset("ide-rust.rlsToolchain") + atom.config.unset("ide-rust.rlsDefaultConfig") + atom.config.unset("ide-rust.rlsCommandOverride") + /** Configuration schema */ this.config = { - rlsToolchain: { - description: 'Sets the toolchain installed using rustup and used to run the Rls.' + - ' When blank will use the rustup/system default.' + - ' For example ***nightly***, ***stable***, ***beta***, or ***nightly-yyyy-mm-dd***.', + languageServerCommand: { + description: 'Command that runs rust-analyzer. By default it should in PATH.', type: 'string', - default: '', + default: 'rust-analyzer', order: 1 }, checkForToolchainUpdates: { @@ -349,31 +236,6 @@ class RustLanguageClient extends AutoLanguageClient { default: true, order: 2 }, - rlsDefaultConfig: { - title: "Rls Configuration", - description: 'Configuration default sent to all Rls instances, overridden by project rls.toml configuration', - type: 'object', - collapsed: false, - order: 3, - properties: { - allTargets: { - title: "Check All Targets", - description: 'Checks tests, examples & benches. Equivalent to `cargo check --all-targets`', - type: 'string', - default: "Rls Default", - order: 1, - enum: ["On", "Off", "Rls Default"] - }, - clippyPreference: { - title: "Clippy Preference", - description: 'Controls eagerness of clippy diagnostics. **Opt-in** requires each crate specifying `#![warn(clippy)]`. Note clippy is only available on Rls releases that have it enabled at compile time.', - type: "string", - default: "Rls Default", - order: 2, - enum: ["On", "Opt-in", "Off", "Rls Default"] - } - } - }, ignoredProjectPaths: { description: 'Disables ide-rust functionality on a comma-separated list of project paths.', type: 'string', @@ -434,28 +296,25 @@ class RustLanguageClient extends AutoLanguageClient { let newVersion = await fetchLatestDist({ toolchain, currentVersion }).catch(() => false) if (!newVersion) return - atom.notifications.addInfo(`Rls \`${toolchain}\` toolchain update available`, { + atom.notifications.addInfo(`Rust \`${toolchain}\` toolchain update available`, { description: newVersion, _src: 'ide-rust', dismissable: true, buttons: [{ - text: dated ? 'Update & Switch' : 'Update' , + text: dated ? 'Update & Switch' : 'Update', onDidClick: () => { - clearIdeRustInfos() + clearIdeRustNotifications() const updatePromise = exec(`rustup update ${toolchain}`) - // set config in case going from dated -> latest - .then(() => dated && atom.config.set('ide-rust.rlsToolchain', toolchain)) - .then(() => this._checkToolchain()) - .then(() => checkRls()) - .then(() => this._restartLanguageServers(`Updated Rls toolchain`)) - .catch(e => { - logErr(e) - e && atom.notifications.addError(`\`rustup update ${toolchain}\` failed`, { - detail: e, - dismissable: true, + .then(() => this._checkToolchain()) + .then(() => this._restartLanguageServers(`Updated rust toolchain`)) + .catch(e => { + logErr(e) + e && atom.notifications.addError(`\`rustup update ${toolchain}\` failed`, { + detail: e, + dismissable: true, + }) }) - }) if (this.busySignalService) { this.busySignalService.reportBusyWhile( @@ -471,7 +330,7 @@ class RustLanguageClient extends AutoLanguageClient { } /** - * Checks for rustup, toolchain & rls components + * Checks for rustup & toolchain components * If not found prompts to fix & throws error * @param {string} [cwd] */ @@ -480,7 +339,7 @@ class RustLanguageClient extends AutoLanguageClient { try { await rustupRun(toolchain, "rustc --version", { cwd }) - clearIdeRustInfos() + clearIdeRustNotifications() } catch (e) { this._handleMissingToolchain(toolchain) throw e @@ -494,19 +353,19 @@ class RustLanguageClient extends AutoLanguageClient { async _handleMissingToolchain(toolchain) { if (!await exec('rustup --version').catch(() => false)) { this._handleMissingRustup() - } else if (await checkHasRls(toolchain)) { + } else { let clicked = await atomPrompt(`\`rustup\` missing ${toolchain} toolchain`, { detail: `rustup toolchain install ${toolchain}`, }, ['Install']) if (clicked === 'Install') { - clearIdeRustInfos() + clearIdeRustNotifications() const installPromise = installCompiler() .then(() => this._checkToolchain()) - .then(() => this._restartLanguageServers(`Installed Rls toolchain`)) + .then(() => this._restartLanguageServers(`Installed rust toolchain`)) .catch(e => { console.warn(e) - clearIdeRustInfos() + clearIdeRustNotifications() let err = (e + '').split('\n') err = err.length && err[0] || `Error installing rust \`${toolchain}\`` atom.notifications.addError(err, { @@ -522,52 +381,7 @@ class RustLanguageClient extends AutoLanguageClient { ) } } - } else { - this._handleMissingToolchainMissingRls(toolchain) - } - } - - /** - * Takes appropriate action when missing a toolchain that itself is missing - * or missing vital components - * @param {string} toolchain - */ - async _handleMissingToolchainMissingRls(toolchain) { - const note = { - description: '**Warning**: This toolchain is unavailable or missing RLS.', - buttons: [{ - text: 'Configure', - onDidClick: () => atom.workspace.open('atom://config/packages/ide-rust') - }], - } - - if (toolchain === 'nightly') { - note.description += ' Try using a previous _dated_ nightly.' - } else if (toolchain.startsWith('nightly')) { - note.description += ' Try using another nightly version.' - } - - let suggestChannel = toolchain.startsWith('beta') && 'beta' || - toolchain.startsWith('stable') && 'stable' || - 'nightly' - - try { - let suggestedVersion = await suggestChannelOrDated(suggestChannel) - if (suggestedVersion) { - note.buttons.push({ - text: `Use ${suggestedVersion}`, - className: 'btn-success', - onDidClick: () => { - clearIdeRustInfos() - atom.config.set('ide-rust.rlsToolchain', suggestedVersion) - } - }) - } - } catch (e) { - console.warn(e) } - - atomPrompt(`\`rustup\` missing ${toolchain} toolchain`, note) } /** Takes appropriate action when missing rustup */ @@ -607,45 +421,18 @@ class RustLanguageClient extends AutoLanguageClient { // Get required dependencies require("atom-package-deps").install("ide-rust") - // Watch rls.toml file changes -> update rls - this.disposables.add(atom.project.onDidChangeFiles(events => { - if (_.isEmpty(this.projects)) return - - for (const event of events) { - if (event.path.endsWith('rls.toml')) { - let projectPath = Object.keys(this.projects).find(key => event.path.startsWith(key)) - let rlsProject = projectPath && this.projects[projectPath] - if (rlsProject) rlsProject.sendRlsTomlConfig() - } - } - })) - - // Watch config toolchain changes -> switch, install & update toolchains, restart servers - this.disposables.add(atom.config.onDidChange('ide-rust.rlsToolchain', - _.debounce(async ({ newValue }) => { - if (rlsCommandOverride()) { - // don't bother checking toolchain if an override is being used - return - } - - try { - await this._checkToolchain() - await checkRls(this.busySignalService) - let toolchainText = newValue && `\`${newValue}\`` - if (!toolchainText) { - try { - toolchainText = `default (\`${await rustupDefaultToolchain()}\`)` - } catch (e) { - toolchainText = "default" - } - } - await this._restartLanguageServers(`Switched Rls toolchain to ${toolchainText}`) - return this._promptToUpdateToolchain() - } catch (e) { - return logErr(e, console.info) - } - }, 1000) - )) + // // Watch rls.toml file changes -> update rls + // this.disposables.add(atom.project.onDidChangeFiles(events => { + // if (_.isEmpty(this.projects)) return + // + // for (const event of events) { + // if (event.path.endsWith('rls.toml')) { + // let projectPath = Object.keys(this.projects).find(key => event.path.startsWith(key)) + // let rlsProject = projectPath && this.projects[projectPath] + // if (rlsProject) rlsProject.sendRlsTomlConfig() + // } + // } + // })) // watch config toolchain updates -> check for updates if enabling this.disposables.add(atom.config.onDidChange('ide-rust.checkForToolchainUpdates', @@ -654,9 +441,9 @@ class RustLanguageClient extends AutoLanguageClient { } )) - // restart running servers if default config changes - this.disposables.add(atom.config.onDidChange('ide-rust.rlsDefaultConfig', - () => this._restartLanguageServers().catch(logErr) + // watch languageServerCommand -> restart servers + this.disposables.add(atom.config.onDidChange('ide-rust.languageServerCommand', + () => this._restartLanguageServers() )) this.disposables.add(atom.commands.add( @@ -681,7 +468,7 @@ class RustLanguageClient extends AutoLanguageClient { postInitialization(server) { // track the server so we can keep its config updated - let project = new RlsProject(server, () => this.busySignalService) + let project = new RustProject(server, () => this.busySignalService) this.projects[server.projectPath] = project server.process.on('exit', () => { @@ -689,7 +476,7 @@ class RustLanguageClient extends AutoLanguageClient { this._refreshActiveOverrides() }) - project.sendRlsTomlConfig() + // project.sendRlsTomlConfig() this._refreshActiveOverrides() } @@ -709,18 +496,17 @@ class RustLanguageClient extends AutoLanguageClient { // to inform us of the correct files to watch, until that's implemented // these filters take eliminate the brunt of the watch message spam return !filePath.includes('/.git/') && - !filePath.includes('/target/rls/') && !filePath.includes('/target/debug/') && !filePath.includes('/target/doc/') && !filePath.includes('/target/release/') } - // Rls can run a long time before gracefully shutting down, so it's better to - // kill servers as the cargo builds should be kill-safe + // Killing servers is faster and less likely to get stuck. shutdownServersGracefully() { return false } + // Can click through to out-of-project files. serversSupportDefinitionDestinations() { return true } @@ -747,47 +533,31 @@ class RustLanguageClient extends AutoLanguageClient { this._periodicUpdateChecking = true periodicUpdate().catch(logErr) } + if (!this._conflictingPackageChecking) { showConflictingPackageWarnings() this.disposables.add(atom.packages.onDidActivatePackage(showConflictingPackageWarnings)) this._conflictingPackageChecking = true } - let cmdOverride = rlsCommandOverride() - if (cmdOverride) { - if (!this._warnedAboutRlsCommandOverride) { - clearIdeRustInfos() - atom.notifications.addInfo(`Using rls command \`${cmdOverride}\``) - this._warnedAboutRlsCommandOverride = true - } - return logSuspiciousStdout(cp.spawn(cmdOverride, { - env: await serverEnv(configToolchain()), - shell: true, - cwd: projectPath - })) - } + const languageServerCmd = langServerCommand() - try { - await this._checkToolchain(projectPath) - await checkRls(this.busySignalService, projectPath) - const toolchain = configToolchain() - const opts = { - env: await serverEnv(toolchain, projectPath), - cwd: projectPath - } - if (toolchain) { - return logSuspiciousStdout(cp.spawn("rustup", ["run", toolchain, "rls"], opts)) - } else { - return logSuspiciousStdout(cp.spawn("rls", opts)) - } - } catch (e) { - throw new Error("failed to start server: " + e) + if (!(await hasCommand(languageServerCmd))) { + notifyLanguageServerCommandFailed(languageServerCmd) + return } + clearIdeRustNotifications("ide-rust.langServerCommand") + + return logSuspiciousStdout(cp.spawn(languageServerCmd, { + env: await serverEnv(configToolchain()), + shell: true, + cwd: projectPath + })) } - // Extends the outline provider by filtering the type variable, which is s - // only used for local variables by RLS. This makes the outline view - // cleaner and more useful. + // Extends the outline provider by filtering the type variable, which is + // only used for local variables by the language server. This makes the + // outline view cleaner and more useful. provideOutlines() { let provide = super.provideOutlines() let superOutline = provide.getOutline @@ -824,7 +594,6 @@ if (process.platform === "win32") { // in unix method RustLanguageClient.prototype.filterChangeWatchedFiles = filePath => { return !filePath.includes('\\.git\\') && - !filePath.includes('\\target\\rls\\') && !filePath.includes('\\target\\debug\\') && !filePath.includes('\\target\\doc\\') && !filePath.includes('\\target\\release\\') diff --git a/lib/rls-project.js b/lib/rust-project.js similarity index 93% rename from lib/rls-project.js rename to lib/rust-project.js index 61c2a62..b3ab2f9 100644 --- a/lib/rls-project.js +++ b/lib/rust-project.js @@ -8,7 +8,7 @@ const _ = require('underscore-plus') * @param {ActiveServer} server * @param {function} busySignalServiceFn `() => ?BusySignalService` */ -class RlsProject { +class RustProject { constructor(server, busySignalServiceFn) { this.server = server this.getBusySignalService = busySignalServiceFn @@ -115,19 +115,7 @@ class RlsProject { // Default Rls config according to package settings & Rls defaults defaultConfig() { - const { - allTargets, - clippyPreference - } = atom.config.get("ide-rust.rlsDefaultConfig") - - const rlsConfig = {} - if (allTargets === "On" || allTargets === "Off") { - rlsConfig.all_targets = allTargets === "On" - } - if (clippyPreference !== "Rls Default") { - rlsConfig.clippy_preference = clippyPreference - } - return rlsConfig + return {} } } @@ -221,4 +209,4 @@ async function handleMultiCrateProjectErrors(projectPath, errorNote) { } } -module.exports = RlsProject +module.exports = RustProject diff --git a/package-lock.json b/package-lock.json index 93b3163..f63b53b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -121,7 +121,7 @@ "dev": true }, "atom-languageclient": { - "version": "github:alexheretic/atom-languageclient#00de7cce09b8f5131b8a02d73b5f7fb43e4907a5", + "version": "github:alexheretic/atom-languageclient#db8812573ca741542b60464244598fffe455297f", "from": "github:alexheretic/atom-languageclient#build", "requires": { "fuzzaldrin-plus": "^0.6.0",