Skip to content

Commit 9299e8d

Browse files
Colengmsmichelleangela
authored andcommitted
Disable AutoPCH early on platforms that don't support it (#11362)
1 parent 97363a3 commit 9299e8d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,13 +1597,27 @@ export class DefaultClient implements Client {
15971597
debug: { command: serverModule, args: [serverName], options: { detached: true } }
15981598
};
15991599

1600+
// The IntelliSense process should automatically detect when AutoPCH is
1601+
// not supportable (on platforms that don't support disabling ASLR/PIE).
1602+
// We've had reports of issues on arm64 macOS that are addressed by
1603+
// disabling the IntelliSense cache, suggesting fallback does not
1604+
// always work as expected. It's actually more efficient to disable
1605+
// the cache on platforms we know do not support it. We do that here.
16001606
let intelliSenseCacheDisabled: boolean = false;
16011607
if (os.platform() === "darwin") {
1602-
const releaseParts: string[] = os.release().split(".");
1603-
if (releaseParts.length >= 1) {
1604-
// AutoPCH doesn't work for older Mac OS's.
1605-
intelliSenseCacheDisabled = parseInt(releaseParts[0]) < 17;
1608+
// AutoPCH doesn't work for arm64 macOS.
1609+
if (os.arch() === "arm64") {
1610+
intelliSenseCacheDisabled = true;
1611+
} else {
1612+
// AutoPCH doesn't work for older x64 macOS's.
1613+
const releaseParts: string[] = os.release().split(".");
1614+
if (releaseParts.length >= 1) {
1615+
intelliSenseCacheDisabled = parseInt(releaseParts[0]) < 17;
1616+
}
16061617
}
1618+
} else {
1619+
// AutoPCH doesn't work for arm64 Windows.
1620+
intelliSenseCacheDisabled = os.platform() === "win32" && os.arch() === "arm64";
16071621
}
16081622

16091623
const localizedStrings: string[] = [];

0 commit comments

Comments
 (0)