Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/core/src/shared/lsp/lspResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,14 @@ export class LanguageServerResolver {
// attempt to unzip
const zipFile = new AdmZip(zip)
const extractPath = zip.replace('.zip', '')
zipFile.extractAllTo(extractPath, true)

/**
* Avoid overwriting existing files during extraction to prevent file corruption.
* On Mac ARM64 when a language server is already running in one VS Code window,
* attempting to extract and overwrite its files from another window can cause
* the newly started language server to crash with 'EXC_CRASH (SIGKILL (Code Signature Invalid))'.
*/
zipFile.extractAllTo(extractPath, false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the path/filename give a clue about whether we already extracted/downloaded the identical version before? If so, shouldn't we skip this entirely in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mentioned it in slack, but this is common code that both the initial download uses and the subsequent local resolution of the server uses

When the local resolution is happening it isn't strictly required to unzip, since it should already be unzipped when it was downloading. It's just a fail safe mechanism in-case someone deleted a file manually in the cache

} catch (e) {
return false
}
Expand Down