diff options
author | Aleksey Kladov <[email protected]> | 2020-02-17 22:42:25 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-17 22:42:25 +0000 |
commit | 07a77ffb351af783df45544447eb1ea88b569540 (patch) | |
tree | eb8892c68378ebf555b57cc11d8ed8f2446284e6 /editors/code/src | |
parent | 326556b09078a398e641dd221ab870ee0fe47f68 (diff) |
Migrate to eslint
Diffstat (limited to 'editors/code/src')
-rw-r--r-- | editors/code/src/config.ts | 34 | ||||
-rw-r--r-- | editors/code/src/installation/fetch_artifact_release_info.ts | 6 |
2 files changed, 20 insertions, 20 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index c3fa788c7..fab062dda 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -22,7 +22,7 @@ export class Config { | |||
22 | "cargoFeatures", | 22 | "cargoFeatures", |
23 | "cargo-watch", | 23 | "cargo-watch", |
24 | ] | 24 | ] |
25 | .map(opt => `${Config.rootSection}.${opt}`); | 25 | .map(opt => `${Config.rootSection}.${opt}`); |
26 | 26 | ||
27 | private static readonly extensionVersion: string = (() => { | 27 | private static readonly extensionVersion: string = (() => { |
28 | const packageJsonVersion = vscode | 28 | const packageJsonVersion = vscode |
@@ -96,7 +96,7 @@ export class Config { | |||
96 | } | 96 | } |
97 | 97 | ||
98 | case "darwin": return "ra_lsp_server-mac"; | 98 | case "darwin": return "ra_lsp_server-mac"; |
99 | case "win32": return "ra_lsp_server-windows.exe"; | 99 | case "win32": return "ra_lsp_server-windows.exe"; |
100 | 100 | ||
101 | // Users on these platforms yet need to manually build from sources | 101 | // Users on these platforms yet need to manually build from sources |
102 | case "aix": | 102 | case "aix": |
@@ -126,7 +126,7 @@ export class Config { | |||
126 | 126 | ||
127 | return { | 127 | return { |
128 | type: BinarySource.Type.GithubRelease, | 128 | type: BinarySource.Type.GithubRelease, |
129 | dir: this.ctx.globalStoragePath, | 129 | dir: this.ctx.globalStoragePath, |
130 | file: prebuiltBinaryName, | 130 | file: prebuiltBinaryName, |
131 | storage: this.ctx.globalState, | 131 | storage: this.ctx.globalState, |
132 | version: Config.extensionVersion, | 132 | version: Config.extensionVersion, |
@@ -140,30 +140,30 @@ export class Config { | |||
140 | // We don't do runtime config validation here for simplicity. More on stackoverflow: | 140 | // We don't do runtime config validation here for simplicity. More on stackoverflow: |
141 | // https://stackoverflow.com/questions/60135780/what-is-the-best-way-to-type-check-the-configuration-for-vscode-extension | 141 | // https://stackoverflow.com/questions/60135780/what-is-the-best-way-to-type-check-the-configuration-for-vscode-extension |
142 | 142 | ||
143 | get highlightingOn() { return this.cfg.get("highlightingOn") as boolean; } | 143 | get highlightingOn() { return this.cfg.get("highlightingOn") as boolean; } |
144 | get rainbowHighlightingOn() { return this.cfg.get("rainbowHighlightingOn") as boolean; } | 144 | get rainbowHighlightingOn() { return this.cfg.get("rainbowHighlightingOn") as boolean; } |
145 | get lruCapacity() { return this.cfg.get("lruCapacity") as null | number; } | 145 | get lruCapacity() { return this.cfg.get("lruCapacity") as null | number; } |
146 | get displayInlayHints() { return this.cfg.get("displayInlayHints") as boolean; } | 146 | get displayInlayHints() { return this.cfg.get("displayInlayHints") as boolean; } |
147 | get maxInlayHintLength() { return this.cfg.get("maxInlayHintLength") as number; } | 147 | get maxInlayHintLength() { return this.cfg.get("maxInlayHintLength") as number; } |
148 | get excludeGlobs() { return this.cfg.get("excludeGlobs") as string[]; } | 148 | get excludeGlobs() { return this.cfg.get("excludeGlobs") as string[]; } |
149 | get useClientWatching() { return this.cfg.get("useClientWatching") as boolean; } | 149 | get useClientWatching() { return this.cfg.get("useClientWatching") as boolean; } |
150 | get featureFlags() { return this.cfg.get("featureFlags") as Record<string, boolean>; } | 150 | get featureFlags() { return this.cfg.get("featureFlags") as Record<string, boolean>; } |
151 | get rustfmtArgs() { return this.cfg.get("rustfmtArgs") as string[]; } | 151 | get rustfmtArgs() { return this.cfg.get("rustfmtArgs") as string[]; } |
152 | 152 | ||
153 | get cargoWatchOptions(): CargoWatchOptions { | 153 | get cargoWatchOptions(): CargoWatchOptions { |
154 | return { | 154 | return { |
155 | enable: this.cfg.get("cargo-watch.enable") as boolean, | 155 | enable: this.cfg.get("cargo-watch.enable") as boolean, |
156 | arguments: this.cfg.get("cargo-watch.arguments") as string[], | 156 | arguments: this.cfg.get("cargo-watch.arguments") as string[], |
157 | allTargets: this.cfg.get("cargo-watch.allTargets") as boolean, | 157 | allTargets: this.cfg.get("cargo-watch.allTargets") as boolean, |
158 | command: this.cfg.get("cargo-watch.command") as string, | 158 | command: this.cfg.get("cargo-watch.command") as string, |
159 | }; | 159 | }; |
160 | } | 160 | } |
161 | 161 | ||
162 | get cargoFeatures(): CargoFeatures { | 162 | get cargoFeatures(): CargoFeatures { |
163 | return { | 163 | return { |
164 | noDefaultFeatures: this.cfg.get("cargoFeatures.noDefaultFeatures") as boolean, | 164 | noDefaultFeatures: this.cfg.get("cargoFeatures.noDefaultFeatures") as boolean, |
165 | allFeatures: this.cfg.get("cargoFeatures.allFeatures") as boolean, | 165 | allFeatures: this.cfg.get("cargoFeatures.allFeatures") as boolean, |
166 | features: this.cfg.get("cargoFeatures.features") as string[], | 166 | features: this.cfg.get("cargoFeatures.features") as string[], |
167 | }; | 167 | }; |
168 | } | 168 | } |
169 | 169 | ||
diff --git a/editors/code/src/installation/fetch_artifact_release_info.ts b/editors/code/src/installation/fetch_artifact_release_info.ts index 7d497057a..71889e82a 100644 --- a/editors/code/src/installation/fetch_artifact_release_info.ts +++ b/editors/code/src/installation/fetch_artifact_release_info.ts | |||
@@ -14,7 +14,7 @@ export async function fetchArtifactReleaseInfo( | |||
14 | ): Promise<null | ArtifactReleaseInfo> { | 14 | ): Promise<null | ArtifactReleaseInfo> { |
15 | 15 | ||
16 | const repoOwner = encodeURIComponent(repo.owner); | 16 | const repoOwner = encodeURIComponent(repo.owner); |
17 | const repoName = encodeURIComponent(repo.name); | 17 | const repoName = encodeURIComponent(repo.name); |
18 | 18 | ||
19 | const apiEndpointPath = releaseTag | 19 | const apiEndpointPath = releaseTag |
20 | ? `/repos/${repoOwner}/${repoName}/releases/tags/${releaseTag}` | 20 | ? `/repos/${repoOwner}/${repoName}/releases/tags/${releaseTag}` |
@@ -28,8 +28,8 @@ export async function fetchArtifactReleaseInfo( | |||
28 | 28 | ||
29 | // FIXME: handle non-ok response | 29 | // FIXME: handle non-ok response |
30 | const response: GithubRelease = await fetch(requestUrl, { | 30 | const response: GithubRelease = await fetch(requestUrl, { |
31 | headers: { Accept: "application/vnd.github.v3+json" } | 31 | headers: { Accept: "application/vnd.github.v3+json" } |
32 | }) | 32 | }) |
33 | .then(res => res.json()); | 33 | .then(res => res.json()); |
34 | 34 | ||
35 | const artifact = response.assets.find(artifact => artifact.name === artifactFileName); | 35 | const artifact = response.assets.find(artifact => artifact.name === artifactFileName); |