diff options
-rw-r--r-- | editors/code/src/client.ts | 4 | ||||
-rw-r--r-- | editors/code/src/installation/fetch_latest_artifact_release_info.ts (renamed from editors/code/src/installation/fetch_latest_artifact_metadata.ts) | 6 | ||||
-rw-r--r-- | editors/code/src/installation/interfaces.ts | 2 | ||||
-rw-r--r-- | editors/code/src/installation/lang_server.ts (renamed from editors/code/src/installation/language_server.ts) | 10 |
4 files changed, 11 insertions, 11 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index dcf9d0c06..33d9b66df 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts | |||
@@ -2,7 +2,7 @@ import * as lc from 'vscode-languageclient'; | |||
2 | import * as vscode from 'vscode'; | 2 | import * as vscode from 'vscode'; |
3 | 3 | ||
4 | import { Config } from './config'; | 4 | import { Config } from './config'; |
5 | import { ensureLanguageServerBinary } from './installation/language_server'; | 5 | import { ensureLangServerBinary } from './installation/lang_server'; |
6 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; | 6 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; |
7 | 7 | ||
8 | export async function createClient(config: Config): Promise<null | lc.LanguageClient> { | 8 | export async function createClient(config: Config): Promise<null | lc.LanguageClient> { |
@@ -11,7 +11,7 @@ export async function createClient(config: Config): Promise<null | lc.LanguageCl | |||
11 | // It might be a good idea to test if the uri points to a file. | 11 | // It might be a good idea to test if the uri points to a file. |
12 | const workspaceFolderPath = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? '.'; | 12 | const workspaceFolderPath = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? '.'; |
13 | 13 | ||
14 | const langServerPath = await ensureLanguageServerBinary(config.langServerBinarySource); | 14 | const langServerPath = await ensureLangServerBinary(config.langServerBinarySource); |
15 | if (!langServerPath) return null; | 15 | if (!langServerPath) return null; |
16 | 16 | ||
17 | const run: lc.Executable = { | 17 | const run: lc.Executable = { |
diff --git a/editors/code/src/installation/fetch_latest_artifact_metadata.ts b/editors/code/src/installation/fetch_latest_artifact_release_info.ts index 7e3700603..29ee029a7 100644 --- a/editors/code/src/installation/fetch_latest_artifact_metadata.ts +++ b/editors/code/src/installation/fetch_latest_artifact_release_info.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import fetch from "node-fetch"; | 1 | import fetch from "node-fetch"; |
2 | import { GithubRepo, ArtifactMetadata } from "./interfaces"; | 2 | import { GithubRepo, ArtifactReleaseInfo } from "./interfaces"; |
3 | 3 | ||
4 | const GITHUB_API_ENDPOINT_URL = "https://api.github.com"; | 4 | const GITHUB_API_ENDPOINT_URL = "https://api.github.com"; |
5 | 5 | ||
@@ -7,9 +7,9 @@ const GITHUB_API_ENDPOINT_URL = "https://api.github.com"; | |||
7 | * Fetches the latest release from GitHub `repo` and returns metadata about | 7 | * Fetches the latest release from GitHub `repo` and returns metadata about |
8 | * `artifactFileName` shipped with this release or `null` if no such artifact was published. | 8 | * `artifactFileName` shipped with this release or `null` if no such artifact was published. |
9 | */ | 9 | */ |
10 | export async function fetchLatestArtifactMetadata( | 10 | export async function fetchLatestArtifactReleaseInfo( |
11 | repo: GithubRepo, artifactFileName: string | 11 | repo: GithubRepo, artifactFileName: string |
12 | ): Promise<null | ArtifactMetadata> { | 12 | ): Promise<null | ArtifactReleaseInfo> { |
13 | 13 | ||
14 | const repoOwner = encodeURIComponent(repo.owner); | 14 | const repoOwner = encodeURIComponent(repo.owner); |
15 | const repoName = encodeURIComponent(repo.name); | 15 | const repoName = encodeURIComponent(repo.name); |
diff --git a/editors/code/src/installation/interfaces.ts b/editors/code/src/installation/interfaces.ts index 8039d0b90..93ea577d4 100644 --- a/editors/code/src/installation/interfaces.ts +++ b/editors/code/src/installation/interfaces.ts | |||
@@ -6,7 +6,7 @@ export interface GithubRepo { | |||
6 | /** | 6 | /** |
7 | * Metadata about particular artifact retrieved from GitHub releases. | 7 | * Metadata about particular artifact retrieved from GitHub releases. |
8 | */ | 8 | */ |
9 | export interface ArtifactMetadata { | 9 | export interface ArtifactReleaseInfo { |
10 | releaseName: string; | 10 | releaseName: string; |
11 | downloadUrl: string; | 11 | downloadUrl: string; |
12 | } | 12 | } |
diff --git a/editors/code/src/installation/language_server.ts b/editors/code/src/installation/lang_server.ts index 4797c3f01..ccb936bf5 100644 --- a/editors/code/src/installation/language_server.ts +++ b/editors/code/src/installation/lang_server.ts | |||
@@ -7,13 +7,13 @@ import { spawnSync } from "child_process"; | |||
7 | import { throttle } from "throttle-debounce"; | 7 | import { throttle } from "throttle-debounce"; |
8 | 8 | ||
9 | import { BinarySource } from "./interfaces"; | 9 | import { BinarySource } from "./interfaces"; |
10 | import { fetchLatestArtifactMetadata } from "./fetch_latest_artifact_metadata"; | 10 | import { fetchLatestArtifactReleaseInfo } from "./fetch_latest_artifact_release_info"; |
11 | import { downloadFile } from "./download_file"; | 11 | import { downloadFile } from "./download_file"; |
12 | 12 | ||
13 | export async function downloadLatestLanguageServer( | 13 | export async function downloadLatestLangServer( |
14 | {file: artifactFileName, dir: installationDir, repo}: BinarySource.GithubRelease | 14 | {file: artifactFileName, dir: installationDir, repo}: BinarySource.GithubRelease |
15 | ) { | 15 | ) { |
16 | const { releaseName, downloadUrl } = (await fetchLatestArtifactMetadata( | 16 | const { releaseName, downloadUrl } = (await fetchLatestArtifactReleaseInfo( |
17 | repo, artifactFileName | 17 | repo, artifactFileName |
18 | ))!; | 18 | ))!; |
19 | 19 | ||
@@ -53,7 +53,7 @@ export async function downloadLatestLanguageServer( | |||
53 | ); | 53 | ); |
54 | console.timeEnd("Downloading ra_lsp_server"); | 54 | console.timeEnd("Downloading ra_lsp_server"); |
55 | } | 55 | } |
56 | export async function ensureLanguageServerBinary( | 56 | export async function ensureLangServerBinary( |
57 | langServerSource: null | BinarySource | 57 | langServerSource: null | BinarySource |
58 | ): Promise<null | string> { | 58 | ): Promise<null | string> { |
59 | 59 | ||
@@ -97,7 +97,7 @@ export async function ensureLanguageServerBinary( | |||
97 | if (userResponse !== "Download now") return null; | 97 | if (userResponse !== "Download now") return null; |
98 | 98 | ||
99 | try { | 99 | try { |
100 | await downloadLatestLanguageServer(langServerSource); | 100 | await downloadLatestLangServer(langServerSource); |
101 | } catch (err) { | 101 | } catch (err) { |
102 | vscode.window.showErrorMessage( | 102 | vscode.window.showErrorMessage( |
103 | `Failed to download language server from ${langServerSource.repo.name} ` + | 103 | `Failed to download language server from ${langServerSource.repo.name} ` + |