Skip to content

Commit

Permalink
Disable AutoPCH early on platforms that don't support it (#11362)
Browse files Browse the repository at this point in the history
  • Loading branch information
Colengms authored and michelleangela committed Aug 25, 2023
1 parent 97363a3 commit 9299e8d
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1597,13 +1597,27 @@ export class DefaultClient implements Client {
debug: { command: serverModule, args: [serverName], options: { detached: true } }
};

// The IntelliSense process should automatically detect when AutoPCH is
// not supportable (on platforms that don't support disabling ASLR/PIE).
// We've had reports of issues on arm64 macOS that are addressed by
// disabling the IntelliSense cache, suggesting fallback does not
// always work as expected. It's actually more efficient to disable
// the cache on platforms we know do not support it. We do that here.
let intelliSenseCacheDisabled: boolean = false;
if (os.platform() === "darwin") {
const releaseParts: string[] = os.release().split(".");
if (releaseParts.length >= 1) {
// AutoPCH doesn't work for older Mac OS's.
intelliSenseCacheDisabled = parseInt(releaseParts[0]) < 17;
// AutoPCH doesn't work for arm64 macOS.
if (os.arch() === "arm64") {
intelliSenseCacheDisabled = true;
} else {
// AutoPCH doesn't work for older x64 macOS's.
const releaseParts: string[] = os.release().split(".");
if (releaseParts.length >= 1) {
intelliSenseCacheDisabled = parseInt(releaseParts[0]) < 17;
}
}
} else {
// AutoPCH doesn't work for arm64 Windows.
intelliSenseCacheDisabled = os.platform() === "win32" && os.arch() === "arm64";
}

const localizedStrings: string[] = [];
Expand Down

0 comments on commit 9299e8d

Please sign in to comment.