Skip to content

Commit

Permalink
Merge pull request #12185 from microsoft/main
Browse files Browse the repository at this point in the history
Merge for 1.20.1
  • Loading branch information
sean-mcmanus committed Apr 10, 2024
2 parents 6f19496 + 4650cfe commit a1487e5
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 15 deletions.
95 changes: 95 additions & 0 deletions Build/cg/cg.yml
@@ -0,0 +1,95 @@
name: $(date:yyyyMMdd)$(rev:.r)
trigger:
branches:
include:
- main
- release

schedules:
- cron: 30 5 * * 0
branches:
include:
- main
always: true

resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release

extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
tsa:
enabled: false
featureFlags:
autoBaseline: false

stages:
- stage: build
jobs:
- job: Phase_1
displayName: Build cpptools.vsix
timeoutInMinutes: 60
cancelTimeoutInMinutes: 1
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'cpptools.vsix'
condition: succeeded()
targetPath: $(Build.ArtifactStagingDirectory)\Extension
artifactName: cpptools.vsix

steps:
- checkout: self

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
displayName: Use Yarn 1.x

- task: UseNode@1
displayName: Use Node 16.x
inputs:
version: 16.x

- task: CmdLine@2
displayName: Delete .npmrc if it exists
inputs:
script: IF EXIST %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc del %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc

- task: Npm@0
name: NpmInstall_2
displayName: Install vsce
inputs:
arguments: --global @vscode/vsce

- task: CmdLine@1
name: ProcessRunner_11
displayName: Create Extension Staging Directory
inputs:
filename: mkdir
arguments: $(Build.ArtifactStagingDirectory)\Extension

- task: CmdLine@1
name: ProcessRunner_12
displayName: Run VSCE to package vsix
inputs:
filename: vsce
arguments: package --yarn -o $(Build.ArtifactStagingDirectory)\Extension\cpptools.vsix
workingFolder: $(Build.SourcesDirectory)\Extension

- task: Npm@0
displayName: Uninstall vsce
inputs:
command: uninstall
arguments: --global @vscode/vsce
8 changes: 7 additions & 1 deletion Extension/CHANGELOG.md
@@ -1,11 +1,17 @@
# C/C++ for Visual Studio Code Changelog

## Version 1.20.1: April 9, 2024
### Bug Fixes
* Fix 'Add #include' code actions for code scoped by a namespace or class. [#11541](https://github.com/microsoft/vscode-cpptools/issues/11541)
* Fix the IntelliSense server not starting when a completion, signature help, or document highlight occurs from external commands. [#12143](https://github.com/microsoft/vscode-cpptools/issues/12143)
* Fix the IntelliSense configuration not falling back to the `c_cpp_properties.json` configuration for a file not handled by a configuration provider. [#12144](https://github.com/microsoft/vscode-cpptools/issues/12144)

## Version 1.20.0: March 26, 2024
### Enhancements
* Add support for C++ modules IFC version 0.43. [#10843](https://github.com/microsoft/vscode-cpptools/issues/10843)
* Add support for `${userHome}` in `c_cpp_properties.json`. [#11756](https://github.com/microsoft/vscode-cpptools/issues/11756)
* Reduce the default max workspace symbol search results and add `C_Cpp.maxSymbolSearchResults`. [PR #12131](https://github.com/microsoft/vscode-cpptools/pull/12131)
* Update to `clang-format`/`clang-tidy` 18.1.2. [PR #12135](https://github.com/microsoft/vscode-cpptools/pull/12135)
* Update `clang-format`/`clang-tidy` to 18.1.2. [PR #12135](https://github.com/microsoft/vscode-cpptools/pull/12135)
* Update IntelliSense engine.

### Bug Fixes
Expand Down
37 changes: 35 additions & 2 deletions Extension/ThirdPartyNotices.txt
Expand Up @@ -1793,7 +1793,7 @@ THE SOFTWARE.

---------------------------------------------------------

follow-redirects 1.15.5 - MIT
follow-redirects 1.15.6 - MIT
https://github.com/follow-redirects/follow-redirects

Copyright 2014-present Olivier Lalonde <olalonde@gmail.com> , James Talmage <james@talmage.io> , Ruben Verborgh
Expand Down Expand Up @@ -3003,9 +3003,10 @@ The notices below are from non-npm sources.
- ANTLR (http://www.antlr2.org/)
- C++11 Sublime Text Snippets (https://github.com/Rapptz/cpp-sublime-snippet)
- Clang (https://clang.llvm.org/)
- gcc-9/libgcc (https://packages.ubuntu.com/focal/gcc-9-base)
- gcc-11/libgcc (https://packages.ubuntu.com/jammy/gcc-11-base)
- Guidelines Support Library (https://github.com/Microsoft/GSL)
- libc++ (https://libcxx.llvm.org/index.html)
- libexecinfo (https://github.com/ronchaine/libexecinfo)
- libuv (https://github.com/libuv/libuv)
- LLDB (https://lldb.llvm.org/)
- LLVM (http://llvm.org/)
Expand Down Expand Up @@ -3850,6 +3851,38 @@ obstacle to adoption, that text has been removed.
=========================================
END OF musl NOTICES AND INFORMATION

%% libexecinfo NOTICES AND INFORMATION BEGIN HERE
=========================================
libexecinfo is licensed for use as follows:

====
Copyright (c) 2003 Maxim Sobolev <sobomax@FreeBSD.org>
All rights reserved.
*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
*
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

=========================================
END OF libexecinfo NOTICES AND INFORMATION

%% libuv NOTICES AND INFORMATION BEGIN HERE
=========================================
libuv is licensed for use as follows:
Expand Down
2 changes: 1 addition & 1 deletion Extension/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "cpptools",
"displayName": "C/C++",
"description": "C/C++ IntelliSense, debugging, and code browsing.",
"version": "1.20.0-main",
"version": "1.20.1-main",
"publisher": "ms-vscode",
"icon": "LanguageCCPP_color_128x.png",
"readme": "README.md",
Expand Down
4 changes: 2 additions & 2 deletions Extension/src/LanguageServer/client.ts
Expand Up @@ -1489,8 +1489,8 @@ export class DefaultClient implements Client {
}
const serverName: string = this.getName(this.rootFolder);
const serverOptions: ServerOptions = {
run: { command: serverModule, options: { detached: false } },
debug: { command: serverModule, args: [serverName], options: { detached: true } }
run: { command: serverModule, options: { detached: false, cwd: util.getExtensionFilePath("bin") } },
debug: { command: serverModule, args: [serverName], options: { detached: true, cwd: util.getExtensionFilePath("bin") } }
};

// The IntelliSense process should automatically detect when AutoPCH is
Expand Down
20 changes: 11 additions & 9 deletions Extension/src/LanguageServer/extension.ts
Expand Up @@ -144,7 +144,6 @@ function sendActivationTelemetry(): void {
* activate: set up the extension for language services
*/
export async function activate(): Promise<void> {

sendActivationTelemetry();
const checkForConflictingExtensions: PersistentState<boolean> = new PersistentState<boolean>("CPP." + util.packageJson.version + ".checkForConflictingExtensions", true);
if (checkForConflictingExtensions.Value) {
Expand Down Expand Up @@ -960,7 +959,7 @@ function reportMacCrashes(): void {
}

export function watchForCrashes(crashDirectory: string): void {
if (process.platform !== "win32") {
if (process.platform !== "win32" && (process.platform === "darwin" || os.arch() === "x64")) {
prevCrashFile = "";
fs.stat(crashDirectory, (err) => {
const crashObject: Record<string, string> = {};
Expand Down Expand Up @@ -1125,9 +1124,9 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er
data = crashFile + "\n";
const filtPath: string | null = which.sync("c++filt", { nothrow: true });
const isMac: boolean = process.platform === "darwin";
const startStr: string = isMac ? " _" : "(";
const offsetStr: string = isMac ? " + " : "+0x";
const endOffsetStr: string = isMac ? " " : ")";
const startStr: string = isMac ? " _" : "<";
const offsetStr: string = isMac ? " + " : "+";
const endOffsetStr: string = isMac ? " " : " <";
const dotStr: string = "…";
data += lines[0]; // signal type
for (let lineNum: number = 2; lineNum < lines.length - 3; ++lineNum) { // skip first/last lines
Expand All @@ -1137,7 +1136,7 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er
}
const line: string = lines[lineNum];
const startPos: number = line.indexOf(startStr);
if (startPos === -1 || line[startPos + 1] === "+") {
if (startPos === -1 || line[startPos + (isMac ? 1 : 4)] === "+") {
data += dotStr;
const startAddressPos: number = line.indexOf("0x");
const endAddressPos: number = line.indexOf(endOffsetStr, startAddressPos + 2);
Expand All @@ -1156,7 +1155,10 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er
const startPos2: number = startPos + 1;
let funcStr: string = line.substring(startPos2, offsetPos);
if (filtPath) {
const ret: util.ProcessReturnType | undefined = await util.spawnChildProcess(filtPath, [funcStr], undefined, true).catch(logAndReturn.undefined);
let ret: util.ProcessReturnType | undefined = await util.spawnChildProcess(filtPath, ["--no-strip-underscore", funcStr], undefined, true).catch(logAndReturn.undefined);
if (ret?.output === funcStr) {
ret = await util.spawnChildProcess(filtPath, [funcStr], undefined, true).catch(logAndReturn.undefined);
}
if (ret !== undefined) {
funcStr = ret.output;
funcStr = funcStr.replace(/std::(?:__1|__cxx11)/g, "std"); // simplify std namespaces.
Expand All @@ -1179,9 +1181,9 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er
}
addressData += `${line.substring(startAddressPos, startPos)}`;
} else {
const endPos: number = line.indexOf(")", offsetPos2);
const endPos: number = line.indexOf(">", offsetPos2);
if (endPos === -1) {
data += "<Missing )>";
data += "<Missing > >";
continue; // unexpected
}
data += line.substring(offsetPos2, endPos);
Expand Down
2 changes: 2 additions & 0 deletions Extension/src/main.ts
Expand Up @@ -188,6 +188,8 @@ async function makeBinariesExecutable(): Promise<void> {
];
oldMacBinaries.forEach(binary => promises.push(util.allowExecution(util.getExtensionFilePath(binary))));
}
} else if (os.arch() === "x64") {
promises.push(util.allowExecution(util.getExtensionFilePath("./bin/libc.so")));
}
}
await Promise.all(promises);
Expand Down

0 comments on commit a1487e5

Please sign in to comment.