Skip to content

Commit 77effb9

Browse files
authored
Merge pull request #14260 from microsoft/main
Merge for 1.31.1 (3rd time)
2 parents 770ef31 + 304b924 commit 77effb9

18 files changed

Lines changed: 7977 additions & 26 deletions

Build/cg/cg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extends:
6161
featureFlags:
6262
autoBaseline: false
6363
settings:
64-
networkIsolationPolicy: Permissive,CFSClean
64+
networkIsolationPolicy: Permissive,CFSClean,CFSClean2
6565

6666
stages:
6767
- stage: build

Build/package/cpptools_extension_pack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extends:
3232
image: 1ESPT-Windows2022
3333
os: windows
3434
settings:
35-
networkIsolationPolicy: Permissive,CFSClean
35+
networkIsolationPolicy: Permissive,CFSClean,CFSClean2
3636

3737
stages:
3838
- stage: package

Build/package/cpptools_themes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extends:
3232
image: 1ESPT-Windows2022
3333
os: windows
3434
settings:
35-
networkIsolationPolicy: Permissive,CFSClean
35+
networkIsolationPolicy: Permissive,CFSClean,CFSClean2
3636

3737
stages:
3838
- stage: package

Build/package/jobs_package_vsix.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ jobs:
4141
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
4242
displayName: Use Yarn 1.x
4343

44+
- script: IF EXIST %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc del %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc
45+
displayName: Delete .npmrc if it exists
46+
47+
- task: Bash@3
48+
displayName: Build files
49+
inputs:
50+
targetType: 'inline'
51+
script: |
52+
export SRC_DIR=$(echo $BUILD_SOURCESDIRECTORY | sed 's|\\|/|g')
53+
cd "$SRC_DIR/${{ parameters.srcDir }}"
54+
yarn install
55+
if [ $? -ne 0 ]; then
56+
echo "yarn install failed, sleeping for 30s before retrying..."
57+
sleep 30
58+
exit 1
59+
fi
60+
retryCountOnTaskFailure: 3
61+
4462
- script: mkdir $(Build.ArtifactStagingDirectory)\vsix
4563
displayName: Create Staging Directory
4664

Extension/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# C/C++ for Visual Studio Code Changelog
22

3-
## Version 1.31.1: March 9, 2026
3+
## Version 1.31.1: March 10, 2026
44
### Enhancements
55
* Update clang-tidy and clang-format from 21.1.4 to 22.1.0.
66
* Update support for the latest compiler versions.
77

88
### Bug Fixes
9+
* Fix workspace symbol search with `scope::variable` not working after symbols are deleted and then added back. [#14200](https://github.com/microsoft/vscode-cpptools/issues/14200)
10+
* Fix bugs where a path was checked for existence but not whether it was a file or a folder. [#14257](https://github.com/microsoft/vscode-cpptools/issues/14257)
911
* Add IntelliSense support for `__builtin_is_implicit_lifetime`.
1012
* Fix three IntelliSense process crashes.
1113
* Fix a bug with `-embed-directory`.

Extension/src/Debugger/configurationProvider.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* ------------------------------------------------------------------------------------------ */
55

66
import * as jsonc from 'comment-json';
7-
import * as fs from 'fs';
87
import * as glob from 'glob';
98
import * as os from 'os';
109
import * as path from 'path';
@@ -22,8 +21,8 @@ import * as logger from '../logger';
2221
import { PlatformInformation } from '../platform';
2322
import { rsync, scp, ssh } from '../SSH/commands';
2423
import * as Telemetry from '../telemetry';
25-
import { AttachItemsProvider, AttachPicker, RemoteAttachPicker } from './attachToProcess';
2624
import { AttachItem, showQuickPick } from './attachQuickPick';
25+
import { AttachItemsProvider, AttachPicker, RemoteAttachPicker } from './attachToProcess';
2726
import { ConfigMenu, ConfigMode, ConfigSource, CppDebugConfiguration, DebuggerEvent, DebuggerType, DebugType, IConfiguration, IConfigurationSnippet, isDebugLaunchStr, MIConfigurations, PipeTransportConfigurations, TaskStatus, WindowsConfigurations, WSLConfigurations } from './configurations';
2827
import { NativeAttachItemsProviderFactory } from './nativeAttach';
2928
import { Environment, ParsedEnvironmentFile } from './ParsedEnvironmentFile';
@@ -303,7 +302,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
303302

304303
// Validate LLDB-MI
305304
if (os.platform() === 'darwin' && // Check for macOS
306-
fs.existsSync(lldb_mi_10_x_path) && // lldb-mi 10.x exists
305+
util.checkFileExistsSync(lldb_mi_10_x_path) && // lldb-mi 10.x exists
307306
(!macOSMIMode || macOSMIMode === 'lldb') &&
308307
!macOSMIDebuggerPath // User did not provide custom lldb-mi
309308
) {
@@ -657,7 +656,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
657656
];
658657

659658
for (const searchPath of searchPaths) {
660-
if (fs.existsSync(path.join(searchPath, LLDBFramework))) {
659+
if (util.checkDirectoryExistsSync(path.join(searchPath, LLDBFramework))) {
661660
// Found a framework that 'lldb-mi' can use.
662661
return searchPath;
663662
}

Extension/src/LanguageServer/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ export class DefaultClient implements Client {
12851285
}
12861286

12871287
this.rootFolder = workspaceFolder;
1288-
this.rootRealPath = this.RootPath ? fs.existsSync(this.RootPath) ? fs.realpathSync(this.RootPath) : this.RootPath : "";
1288+
this.rootRealPath = this.RootPath ? util.checkDirectoryExistsSync(this.RootPath) ? fs.realpathSync(this.RootPath) : this.RootPath : "";
12891289

12901290
this.workspaceStoragePath = util.extensionContext?.storageUri?.fsPath ?? "";
12911291
if (this.workspaceStoragePath.length > 0) {
@@ -1612,7 +1612,7 @@ export class DefaultClient implements Client {
16121612
this.currentCaseSensitiveFileSupport = new PersistentWorkspaceState<boolean>("CPP.currentCaseSensitiveFileSupport", false);
16131613
let resetDatabase: boolean = false;
16141614
const serverModule: string = getLanguageServerFileName();
1615-
const exeExists: boolean = fs.existsSync(serverModule);
1615+
const exeExists: boolean = util.checkFileExistsSync(serverModule);
16161616
if (!exeExists) {
16171617
telemetry.logLanguageServerEvent("missingLanguageServerBinary");
16181618
throw String('Missing binary at ' + serverModule);

Extension/src/LanguageServer/configurations.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export class CppProperties {
254254
// to the language server until the default include paths and frameworks have been sent.
255255

256256
const configFilePath: string = path.join(this.configFolder, "c_cpp_properties.json");
257-
if (this.rootUri !== null && fs.existsSync(configFilePath)) {
257+
if (this.rootUri !== null && util.checkFileExistsSync(configFilePath)) {
258258
this.propertiesFile = vscode.Uri.file(configFilePath);
259259
} else {
260260
this.propertiesFile = null;
@@ -481,9 +481,9 @@ export class CppProperties {
481481
list.forEach((entry) => {
482482
if (entry !== "vcpkg") {
483483
const pathToCheck: string = path.join(vcpkgRoot, entry);
484-
if (fs.existsSync(pathToCheck)) {
484+
if (util.checkDirectoryExistsSync(pathToCheck)) {
485485
let p: string = path.join(pathToCheck, "include");
486-
if (fs.existsSync(p)) {
486+
if (util.checkDirectoryExistsSync(p)) {
487487
p = p.replace(/\\/g, "/");
488488
p = p.replace(vcpkgRoot, "${vcpkgRoot}");
489489
this.vcpkgIncludes.push(p);
@@ -1171,7 +1171,7 @@ export class CppProperties {
11711171
this.configurationJson.configurations.forEach(c => {
11721172
c.compileCommands?.forEach((path: string) => {
11731173
const compileCommandsFile: string = this.resolvePath(path);
1174-
if (fs.existsSync(compileCommandsFile)) {
1174+
if (util.checkFileExistsSync(compileCommandsFile)) {
11751175
filePaths.add(compileCommandsFile);
11761176
}
11771177
});
@@ -1672,10 +1672,10 @@ export class CppProperties {
16721672
if (!isCl && compilerPathAndArgs.compilerPath) {
16731673
const compilerPathMayNeedQuotes: boolean = !resolvedCompilerPath.startsWith('"') && resolvedCompilerPath.includes(" ") && compilerPathAndArgs.compilerArgsFromCommandLineInPath.length > 0;
16741674
let pathExists: boolean = true;
1675-
const existsWithExeAdded: (path: string) => boolean = (path: string) => isWindows && !path.startsWith("/") && fs.existsSync(path + ".exe");
1675+
const existsWithExeAdded: (path: string) => boolean = (path: string) => isWindows && !path.startsWith("/") && util.checkFileExistsSync(path + ".exe");
16761676

16771677
resolvedCompilerPath = compilerPathAndArgs.compilerPath;
1678-
if (!fs.existsSync(resolvedCompilerPath)) {
1678+
if (!util.checkFileExistsSync(resolvedCompilerPath)) {
16791679
if (existsWithExeAdded(resolvedCompilerPath)) {
16801680
resolvedCompilerPath += ".exe";
16811681
} else {
@@ -1686,7 +1686,7 @@ export class CppProperties {
16861686
} else if (rootUri) {
16871687
// Test if it was a relative path.
16881688
const absolutePath: string = rootUri.fsPath + path.sep + resolvedCompilerPath;
1689-
if (!fs.existsSync(absolutePath)) {
1689+
if (!util.checkFileExistsSync(absolutePath)) {
16901690
if (existsWithExeAdded(absolutePath)) {
16911691
resolvedCompilerPath = absolutePath + ".exe";
16921692
} else {

Extension/src/LanguageServer/editorConfig.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import * as fs from 'fs';
88
import { Minimatch } from 'minimatch';
99
import * as path from 'path';
10+
import * as util from '../common';
1011
import { isWindows } from '../constants';
1112

1213
export const cachedEditorConfigSettings: Map<string, any> = new Map<string, any>();
@@ -144,7 +145,7 @@ function getEditorConfig(filePath: string): any {
144145
// Traverse from the file's directory to the root directory.
145146
for (; ;) {
146147
const editorConfigPath: string = path.join(currentDir, '.editorconfig');
147-
if (fs.existsSync(editorConfigPath)) {
148+
if (util.checkFileExistsSync(editorConfigPath)) {
148149
const configFileContent: string = fs.readFileSync(editorConfigPath, 'utf-8');
149150
const configData = parseEditorConfigContent(configFileContent);
150151

Extension/src/LanguageServer/settings.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
'use strict';
66

77
import { execSync } from 'child_process';
8-
import * as fs from 'fs';
98
import * as os from 'os';
109
import * as path from 'path';
1110
import * as semver from 'semver';
1211
import { quote } from 'shell-quote';
1312
import * as vscode from 'vscode';
1413
import * as nls from 'vscode-nls';
1514
import * as which from 'which';
15+
import * as util from '../common';
1616
import { getCachedClangFormatPath, getCachedClangTidyPath, getExtensionFilePath, getRawSetting, isArray, isArrayOfString, isBoolean, isNumber, isObject, isString, isValidMapping, setCachedClangFormatPath, setCachedClangTidyPath } from '../common';
1717
import { isWindows } from '../constants';
1818
import * as telemetry from '../telemetry';
@@ -925,7 +925,7 @@ export class CppSettings extends Settings {
925925
let foundEditorConfigWithVcFormatSettings: boolean = false;
926926
const findConfigFile: (parentPath: string) => boolean = (parentPath: string) => {
927927
const editorConfigPath: string = path.join(parentPath, ".editorconfig");
928-
if (fs.existsSync(editorConfigPath)) {
928+
if (util.checkFileExistsSync(editorConfigPath)) {
929929
const editorConfigSettings: any = getEditorConfigSettings(document.uri.fsPath);
930930
const keys: string[] = Object.keys(editorConfigSettings);
931931
for (let i: number = 0; i < keys.length; ++i) {
@@ -954,11 +954,11 @@ export class CppSettings extends Settings {
954954
}
955955
}
956956
const clangFormatPath1: string = path.join(parentPath, ".clang-format");
957-
if (fs.existsSync(clangFormatPath1)) {
957+
if (util.checkFileExistsSync(clangFormatPath1)) {
958958
return true;
959959
}
960960
const clangFormatPath2: string = path.join(parentPath, "_clang-format");
961-
return fs.existsSync(clangFormatPath2);
961+
return util.checkFileExistsSync(clangFormatPath2);
962962
};
963963
// Scan parent paths to see which we find first, ".clang-format" or ".editorconfig"
964964
const fsPath: string = document.uri.fsPath;

0 commit comments

Comments
 (0)