Skip to content

Commit

Permalink
Use arm64 lsp on macoa
Browse files Browse the repository at this point in the history
Fixes #1780
  • Loading branch information
PEZ committed Jun 24, 2022
1 parent f36a8a2 commit b250d6a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@ Changes to Calva.

- Fix: [Error reporting for load file differs from evaluate code](https://github.com/BetterThanTomorrow/calva/issues/1774)
- Fix: [Accepting and rejecting Github Copilot suggestions does not work](https://github.com/BetterThanTomorrow/calva/issues/1781)
- [Use Apple Silicon clojure-lsp builds on M1 and M2 macs when available](https://github.com/BetterThanTomorrow/calva/issues/1780)

## [2.0.286] - 2022-06-13

Expand Down
6 changes: 5 additions & 1 deletion src/lsp/download.ts
Expand Up @@ -73,7 +73,11 @@ async function unzipFile(zipFilePath: string, extensionPath: string): Promise<vo
}

async function downloadClojureLsp(extensionPath: string, version: string): Promise<string> {
const artifactName = lspUtil.getArtifactDownloadName();
// There were no Apple Silicon builds prior to version 2022.06.22-14.09.50
const artifactName =
version >= '2022.06.22-14.09.50' || process.platform !== 'darwin'
? lspUtil.getArtifactDownloadName()
: lspUtil.getArtifactDownloadName('darwin', 'x64');
const url =
version !== 'nightly'
? `https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/${artifactName}`
Expand Down
4 changes: 1 addition & 3 deletions src/lsp/utilities.ts
Expand Up @@ -7,9 +7,7 @@ const versionFileName = 'clojure-lsp-version';
const artifacts = {
darwin: {
x64: 'clojure-lsp-native-macos-amd64.zip',
// Should M1 Macs use emulated native binary or native standalone jar until M1 native available?
// For now, let's use the Intel binary
arm64: 'clojure-lsp-native-macos-amd64.zip',
arm64: 'clojure-lsp-native-macos-aarch64.zip',
},
linux: {
x64: 'clojure-lsp-native-static-linux-amd64.zip',
Expand Down

0 comments on commit b250d6a

Please sign in to comment.