Compare commits

...
24 Commits
Author SHA1 Message Date
Colen Garoutte-Carson 380dcbbb58 Fix changelog release date for 1.9.8 (#9210) 2022-04-20 11:26:20 -07:00
Colen Garoutte-Carson 0a002db1e5 Merge pull request #9206 from microsoft/coleng/1.9.8-cherry-picks 2022-04-19 17:12:24 -07:00
Colen Garoutte-Carson b5b1c2b9df Update changelog for 1.9.8 (#9207) 2022-04-19 17:10:46 -07:00
Colen Garoutte-Carson dd8f358076 Fix exception when IntelliSenseEngine is Diabled (#9178) 2022-04-19 16:34:07 -07:00
Andrew Wang 34cd49174e Add back 'aiKey' in package.json (#9183)
* Add back 'aiKey' in package.json

* Add _aiKeyComment
2022-04-19 16:33:47 -07:00
Sean McManus 2874fd2600 Merge pull request #9070 from microsoft/main
Merge for 1.9.7
2022-03-22 18:52:16 -07:00
Sean McManus 56db55a3dc Update minimist. (#9071) 2022-03-22 18:35:26 -07:00
Sean McManus 8b9e009fc9 Merge branch 'release' into main 2022-03-22 14:48:13 -07:00
Sean McManus 23720f5fd8 1.9.7 changelog (#9069)
* Update changelog.
* Update version.
2022-03-22 14:44:35 -07:00
Michelle Matias dd3938c934 Fix periods to descriptions and title (#9052) 2022-03-21 10:34:36 -07:00
Sean McManus cf9b2565d0 Update changelog. (#9047)
* Update changelog.
2022-03-18 20:21:31 -07:00
Sean McManus a250a53361 Fix typo in changelog. (#9044) 2022-03-17 12:09:47 -07:00
Sean McManus 375d62c335 Update changelog. (#9042) 2022-03-17 11:26:31 -07:00
Sean McManus df9469ca4e Update changelog. (#9029) 2022-03-15 18:08:12 -07:00
Colen Garoutte-Carson d4df455dc0 Merge pull request #8782 from microsoft/coleng/merge_release_1_8_4 2022-02-04 17:14:09 -08:00
Colen Garoutte-Carson 025ab76ca6 Update changelog for 1.8.4 (#8778) 2022-02-04 16:39:38 -08:00
Sean McManus 1613298710 Remove offline installation from ReadMes. (#8769) 2022-02-04 16:39:34 -08:00
Colen Garoutte-Carson bcd6c9ef50 Suppress incorrect warnings on Mac M1 (#8757) 2022-02-04 16:39:29 -08:00
Sean McManus 6f62c61bb4 Update changelog. (#8754)
* Update changelog.
2022-02-04 16:39:25 -08:00
Sean McManus 3b4c8e71e7 Merge pull request #8746 from microsoft/main
Merge for 1.8.2
2022-01-31 14:09:54 -08:00
Colen Garoutte-Carson a18b91b864 Merge pull request #8303 from microsoft/main 2021-10-19 14:56:40 -07:00
Colen Garoutte-Carson a06d8e601b Merge pull request #8267 from microsoft/main 2021-10-12 17:53:30 -07:00
Colen Garoutte-Carson e792d23cbc Merge pull request #8265 from microsoft/main
Merge main into release again for 1.7.0
2021-10-12 17:35:17 -07:00
Colen Garoutte-Carson e24c264f89 Merge pull request #8263 from microsoft/main 2021-10-12 14:42:11 -07:00
9 changed files with 213 additions and 232 deletions
+39 -72
View File
@@ -1,102 +1,69 @@
# C/C++ for Visual Studio Code Change Log
## Version 1.9.4-debug: March 14, 2022
* This is a debug build for Windows x64 intended to be used to get assertion failure information for bug [#8851](https://github.com/microsoft/vscode-cpptools/issues/8851).
## Version 1.9.8: April 20, 2022
### Bug Fixes
* Fix an issue with extension activation failing if `C_Cpp.intelliSenseEngine` was set to `Disabled`. [#9083](https://github.com/microsoft/vscode-cpptools/issues/9083)
## Enhancements
* Reserved identifiers with characters that match typed characters in the correct order but not contiguously are initially filtered in the auto-completion list. Doing a `ctrl` + `space` in the same location will show all auto-complete suggestions. [#4939](https://github.com/microsoft/vscode-cpptools/issues/4939)
* Show "Catastrophic error" during tag parsing with an Error logging severity and report the number of occurrences via telemetry. [#9013](https://github.com/microsoft/vscode-cpptools/issues/9013)
## Bug Fixes
* Fix temp files randomly not getting deleted on Windows with a `C_Cpp.loggingLevel` of `Warning` or greater. [#9008](https://github.com/microsoft/vscode-cpptools/issues/9008)
* Fix mingw clang being detected as gcc. [#9024](https://github.com/microsoft/vscode-cpptools/issues/9024)
## Version 1.9.3: March 9, 2022
### New Feature
## Version 1.9.7: March 23, 2022
### New Features
* Add debugger support for Apple M1 (osx-arm64). [#7035](https://github.com/microsoft/vscode-cpptools/issues/7035)
* Resolves issue "[Big Sur M1] ERROR: Unable to start debugging. Unexpected LLDB output from command "-exec-run". process exited with status -1 (attach failed ((os/kern) invalid argument))". [#6779](https://github.com/microsoft/vscode-cpptools/issues/6779)
* Add a build and debug button when `C_Cpp.debugShortcut` is `true`. [#7497](https://github.com/microsoft/vscode-cpptools/issues/7497)
* The "Build and Debug Active File" command has been split into "Debug C++ File" and "Run C++ File", and it has been removed from the context menu.
* Add Alpine Linux arm64 support (VSIX).
* Add x64 debugger for CppVsdbg on Windows x64.
### Enhancements
* Reserved identifiers with characters that match typed characters in the correct order but not contiguously are initially filtered in the auto-completion list. Doing a `ctrl` + `space` in the same location will show all auto-complete suggestions. [#4939](https://github.com/microsoft/vscode-cpptools/issues/4939)
* Add `dotConfig` property to IntelliSense Configuration (c_cpp_properties.json) to use .config file created by Kconfig system.
* Matheus Castello (@microhobby) [PR #7845](https://github.com/microsoft/vscode-cpptools/pull/7845)
* Rework how cancelation is processed for semantic tokens and folding operations. [PR #8739](https://github.com/microsoft/vscode-cpptools/pull/8739)
* Make SwitchHeaderSource use the `workbench.editor.revealIfOpen` setting.
* Joel Smith (@joelmsmith) [PR #8857](https://github.com/microsoft/vscode-cpptools/pull/8857)
* Add tag parser error logging. [#8907](https://github.com/microsoft/vscode-cpptools/issues/8907)
* Add error and warning messages if the VSIX for an incompatible or mismatching platform or architecture is installed. [#8908](https://github.com/microsoft/vscode-cpptools/issues/8908)
* Add a "More Info" option when an incompatible VSIX is encountered. [PR #8920](https://github.com/microsoft/vscode-cpptools/pull/8920)
* Add `;` to `break` and `continue` completion keywords. [#8932](https://github.com/microsoft/vscode-cpptools/issues/8932)
* Prevent stripping of format specifiers from -exec commands.
* Gareth Rees (@gareth-rees) [MIEngine#1277](https://github.com/microsoft/MIEngine/pull/1278)
* Improve messages for unknown breakpoints and watchpoints.
* Gareth Rees (@gareth-rees) [MIEngine#1282](https://github.com/microsoft/MIEngine/pull/1283)
### Bug Fixes
* Fix some IntelliSense parsing bugs. [#5117](https://github.com/microsoft/vscode-cpptools/issues/5117)
* Fix IntelliSense process crashes caused by a stack overflow on Mac. [#7215](https://github.com/microsoft/vscode-cpptools/issues/7215), [#8653](https://github.com/microsoft/vscode-cpptools/issues/8653)
* Fix exclusions not applying during tag parsing of non-recursive dependent includes. [#8702](https://github.com/microsoft/vscode-cpptools/issues/8702)
* Fix issue that could cause an infinite loop when clicking on a preprocessor conditional directive. [#8717](https://github.com/microsoft/vscode-cpptools/issues/8717)
* Fix excludes applying to cases it should not when running code analysis. [#8724](https://github.com/microsoft/vscode-cpptools/issues/8724)
* Fix a crash when visualizing local variables for Microsoft Edge (msedge.exe) [#8738](https://github.com/microsoft/vscode-cpptools/issues/8738)
* Fix some system defines being incorrectly removed when running code analysis. [#8740](https://github.com/microsoft/vscode-cpptools/issues/8740)
* Prevent an error from being logged due to custom configuration processing prior to the provider being ready. [#8752](https://github.com/microsoft/vscode-cpptools/issues/8752)
* Fix incorrect crash recovery with multiroot. [#8762](https://github.com/microsoft/vscode-cpptools/issues/8762)
* Fix random compiler query, clang-tidy, or clang-format failure on Windows. [#8764](https://github.com/microsoft/vscode-cpptools/issues/8764)
* Fix invoking commands before cpptools is activated. [#8785](https://github.com/microsoft/vscode-cpptools/issues/8785)
* Fix a bug on Windows with semantic tokens updating. [#8799](https://github.com/microsoft/vscode-cpptools/issues/8799)
* Fix tag parser failure due to missing DLL dependencies on Windows. [#8851](https://github.com/microsoft/vscode-cpptools/issues/8851)
* Fix semantic tokens getting cleared for all other files in a TU after editing a file. [#8867](https://github.com/microsoft/vscode-cpptools/issues/8867)
* Fix a bug and typos with cppbuild task providers.
* InLAnn (@inlann) [PR #8897](https://github.com/microsoft/vscode-cpptools/pull/8897)
* Fix an issue that could cause the extension to fail to start up properly. [PR #8906](https://github.com/microsoft/vscode-cpptools/pull/8906)
* Fix handling of `-B` with compiler querying. [#8962](https://github.com/microsoft/vscode-cpptools/issues/8962)
* Fix incorrect "Running clang-tidy" status indications with multi-root workspaces. [#8964](https://github.com/microsoft/vscode-cpptools/issues/8964)
* Fix a crash during shutdown and potential database resetting due to shutdown being aborted too soon. [PR #8969](https://github.com/microsoft/vscode-cpptools/pull/8969)
* Fix an issue that could cause the active file to not be configured by a configuration provider when custom configurations are reset. [#8974](https://github.com/microsoft/vscode-cpptools/issues/8974)
* Fix detection of Visual Studio 2015. [#8975](https://github.com/microsoft/vscode-cpptools/issues/8975)
* Fix a bug with relative paths with the gcc problem matcher. [#8988](https://github.com/microsoft/vscode-cpptools/issues/8988)
* Update translated text.
## Version 1.9.2 (insiders3): March 1, 2022
### New Feature
* Add Alpine Linux arm64 support (VSIX).
### Enhancements
* Read an existing `launch.json` when the `Run and Debug` button is used. [#8930](https://github.com/microsoft/vscode-cpptools/issues/8930)
* Add `;` to `break` and `continue` completion keywords. [#8932](https://github.com/microsoft/vscode-cpptools/issues/8932)
### Bug Fixes
* Add a "More Info" option when an incompatible VSIX is encountered. [PR #8920](https://github.com/microsoft/vscode-cpptools/pull/8920)
* Fix mingw clang being detected as gcc. [#9024](https://github.com/microsoft/vscode-cpptools/issues/9024)
* Fix a random crash on file open.
* Fix some IntelliSense crashes.
* Fix some IntelliSense parsing bugs.
## Version 1.9.1 (insiders2): February 24, 2022
### New Features
* Ship x64 debugger for CppVsdbg on Windows x64.
### Enhancements
* Add `dotConfig` property to IntelliSense Configuration (c_cpp_properties.json) to use .config file created by Kconfig system.
* Matheus Castello (@microhobby) [PR #7845](https://github.com/microsoft/vscode-cpptools/pull/7845)
* Make SwitchHeaderSource use the `workbench.editor.revealIfOpen` setting.
* Joel Smith (@joelmsmith) [PR #8857](https://github.com/microsoft/vscode-cpptools/pull/8857)
* Add error and warning messages if the VSIX for an incompatible or mismatching platform or architecture is installed. [#8908](https://github.com/microsoft/vscode-cpptools/issues/8908)
* Improvements to `Run and Debug` in the debug panel to make it consistent with our play button. [#8773](https://github.com/microsoft/vscode-cpptools/issues/8773)
### Bug Fixes
* Fix issue that could cause a hang when clicking on a preprocessor conditional directive. [#8717](https://github.com/microsoft/vscode-cpptools/issues/8717)
* Fix Crash when visualizing local variables for Microsoft Edge (msedge.exe) [#8738](https://github.com/microsoft/vscode-cpptools/issues/8738)
* Prevent error from being logged due to custom configuration processing prior to the provider being ready. [#8752](https://github.com/microsoft/vscode-cpptools/issues/8752)
* Fix a bug on Windows with semantic tokens updating. [#8799](https://github.com/microsoft/vscode-cpptools/issues/8799)
* Fix code analysis showing "Error while processing" on line 1 col 1 (when it shouldn't) when there's an error in a source file. [#8849](https://github.com/microsoft/vscode-cpptools/issues/8849)
* Fix issue with cpptools restarting when it should not. [PR #8850](https://github.com/microsoft/vscode-cpptools/pull/8850)
* Fix semantic tokens getting cleared for all other files in a TU after editing a file. [#8867](https://github.com/microsoft/vscode-cpptools/issues/8867)
* Fix a bug with IntelliSense updating not working if a file was closed and reopened while its TU was processing an update.
* Fix a bug and typos with cppbuild task providers.
* InLAnn (@inlann) [PR #8897](https://github.com/microsoft/vscode-cpptools/pull/8897)
* Fix a failure when parsing `.editorconfig` files. [#8900](https://github.com/microsoft/vscode-cpptools/issues/8900)
* Fix issue that could cause the extension to fail to start up properly. [PR #8906](https://github.com/microsoft/vscode-cpptools/pull/8906)
* Fix a potential heap corruption when `files.associations` are changed.
* Update translated text.
### Documentation
* Clarify how to get binaries when debugging the source from GitHub.
* Hamir Mahal (@hamirmahal) [PR #8788](https://github.com/microsoft/vscode-cpptools/pull/8788)
## Version 1.9.0 (insiders): February 10, 2022
### New Features
* Add a build and debug button when `C_Cpp.debugShortcut` is `true`. [#7497](https://github.com/microsoft/vscode-cpptools/issues/7497)
* The "Build and Debug Active File" command has been split into "Debug C++ File" and "Run C++ File", and it has been removed from the context menu.
### Enhancements
* Rework how cancelation is processed for semantic tokens and folding operations. [PR #8739](https://github.com/microsoft/vscode-cpptools/pull/8739)
### Workarounds
* Temporarily make x86_64 as default build and debugging target to unblock debugging on Apple Silicon (M1 chip). [#8755](https://github.com/microsoft/vscode-cpptools/issues/8755)
### Bug Fixes
* Fix some IntelliSense parsing bugs. [#5117](https://github.com/microsoft/vscode-cpptools/issues/5117)
* Fix IntelliSense process crashes caused by a stack overflow on Mac. [#7215](https://github.com/microsoft/vscode-cpptools/issues/7215), [#8653](https://github.com/microsoft/vscode-cpptools/issues/8653)
* Fix exclusions not applying during tag parsing of non-recursive dependent includes. [#8702](https://github.com/microsoft/vscode-cpptools/issues/8702)
* Fix excludes applying to cases it should not when running code analysis. [#8724](https://github.com/microsoft/vscode-cpptools/issues/8724)
* Fix some system defines being incorrectly removed when running code analysis. [#8740](https://github.com/microsoft/vscode-cpptools/issues/8740)
* Fix random compiler query, clang-tidy, or clang-format failure on Windows. [#8764](https://github.com/microsoft/vscode-cpptools/issues/8764)
* Fix incorrect crash recovery with multiroot. [#8762](https://github.com/microsoft/vscode-cpptools/issues/8762)
* Fix invoking commands before cpptools is activated. [#8785](https://github.com/microsoft/vscode-cpptools/issues/8785)
* Fix some IntelliSense crashes.
## Version 1.8.4: February 7, 2022
### Bug Fixes
* Suppress incorrect warnings on ARM64 macOS. [#8756](https://github.com/microsoft/vscode-cpptools/issues/8756)
+6 -2
View File
@@ -2,7 +2,7 @@
"name": "cpptools",
"displayName": "C/C++",
"description": "C/C++ IntelliSense, debugging, and code browsing.",
"version": "1.9.4-main",
"version": "1.9.8-main",
"publisher": "ms-vscode",
"icon": "LanguageCCPP_color_128x.png",
"readme": "README.md",
@@ -2755,6 +2755,8 @@
"cpp",
"cuda-cpp"
],
"_aiKeyComment": "Ignore 'Property aiKey is not allowed'. See https://github.com/microsoft/vscode/issues/76493",
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"variables": {
"pickProcess": "extension.pickNativeProcess",
"pickRemoteProcess": "extension.pickRemoteNativeProcess"
@@ -3430,6 +3432,8 @@
"cpp",
"cuda-cpp"
],
"_aiKeyComment": "Ignore 'Property aiKey is not allowed'. See https://github.com/microsoft/vscode/issues/76493",
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"variables": {
"pickProcess": "extension.pickNativeProcess"
},
@@ -4401,7 +4405,7 @@
"gulp-sourcemaps": "^2.6.5",
"gulp-typescript": "^5.0.1",
"http-proxy-agent": "^2.1.0",
"minimist": "^1.2.5",
"minimist": "^1.2.6",
"mocha": "^8.3.2",
"parse-git-config": "^3.0.0",
"parse5": "^5.1.0",
+2 -2
View File
@@ -209,9 +209,9 @@
"c_cpp.configuration.filesExcludeBoolean.markdownDescription": { "message": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] },
"c_cpp.configuration.filesExcludeWhen.markdownDescription": { "message": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] },
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription": { "message": "If `true`, debugger shell command substitution will use obsolete backtick ``(`)``.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] },
"c_cpp.contributes.views.cppReferencesView.title": "C/C++: Other references results.",
"c_cpp.contributes.views.cppReferencesView.title": "C/C++: Other references results",
"c_cpp.contributes.viewsWelcome.contents": { "message": "To learn more about launch.json, see [Configuring C/C++ debugging](https://code.visualstudio.com/docs/cpp/launch-json-reference).", "comment": [ "Markdown text between () should not be altered: https://en.wikipedia.org/wiki/Markdown" ] },
"c_cpp.configuration.debugShortcut.description": "Show the Run and Debug play button in the editor title bar for C++ files",
"c_cpp.configuration.debugShortcut.description": "Show the Run and Debug play button in the editor title bar for C++ files.",
"c_cpp.debuggers.pipeTransport.description": "When present, this tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between VS Code and the MI-enabled debugger backend executable (such as gdb).",
"c_cpp.debuggers.pipeTransport.default.pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'.",
"c_cpp.debuggers.pipeTransport.default.debuggerPath": "The full path to the debugger on the target machine, for example /usr/bin/gdb.",
@@ -7,17 +7,17 @@ import * as debugUtils from './utils';
import * as os from 'os';
import * as path from 'path';
import * as vscode from 'vscode';
import { CppBuildTask, CppBuildTaskDefinition } from '../LanguageServer/cppBuildTaskProvider';
import { CppBuildTask, CppBuildTaskDefinition, cppBuildTaskProvider } from '../LanguageServer/cppBuildTaskProvider';
import * as util from '../common';
import * as fs from 'fs';
import * as Telemetry from '../telemetry';
import { cppBuildTaskProvider, configPrefix } from '../LanguageServer/extension';
import * as logger from '../logger';
import * as nls from 'vscode-nls';
import { IConfiguration, IConfigurationSnippet, DebuggerType, DebuggerEvent, MIConfigurations, WindowsConfigurations, WSLConfigurations, PipeTransportConfigurations, TaskConfigStatus } from './configurations';
import { parse } from 'comment-json';
import { PlatformInformation } from '../platform';
import { Environment, ParsedEnvironmentFile } from './ParsedEnvironmentFile';
import { configPrefix } from '../LanguageServer/extension';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -94,10 +94,6 @@ export class CppBuildTaskProvider implements TaskProvider {
try {
activeClient = ext.getActiveClient();
} catch (errJS) {
const e: Error = errJS as Error;
if (!e || e.message !== ext.intelliSenseDisabledError) {
console.error("Unknown error calling getActiveClient().");
}
return emptyTasks; // Language service features may be disabled.
}
@@ -347,6 +343,8 @@ export class CppBuildTaskProvider implements TaskProvider {
}
export const cppBuildTaskProvider: CppBuildTaskProvider = new CppBuildTaskProvider();
class CustomBuildTaskTerminal implements Pseudoterminal {
private writeEmitter = new EventEmitter<string>();
private closeEmitter = new EventEmitter<number>();
+9 -132
View File
@@ -25,12 +25,9 @@ import { Readable } from 'stream';
import * as nls from 'vscode-nls';
import { CppBuildTaskProvider } from './cppBuildTaskProvider';
import { UpdateInsidersAccess } from '../main';
import { PlatformInformation } from '../platform';
import * as semver from 'semver';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
export const cppBuildTaskProvider: CppBuildTaskProvider = new CppBuildTaskProvider();
export const CppSourceStr: string = "C/C++";
export const configPrefix: string = "C/C++: ";
@@ -41,7 +38,6 @@ let ui: UI;
const disposables: vscode.Disposable[] = [];
let languageConfigurations: vscode.Disposable[] = [];
let intervalTimer: NodeJS.Timer;
let taskProvider: vscode.Disposable;
let codeActionProvider: vscode.Disposable;
export const intelliSenseDisabledError: string = "Do not activate the extension when IntelliSense is disabled.";
@@ -157,129 +153,20 @@ function sendActivationTelemetry(): void {
telemetry.logLanguageServerEvent("Activate", activateEvent);
}
async function checkVsixCompatibility(): Promise<void> {
const ignoreMismatchedCompatibleVsix: PersistentState<boolean> = new PersistentState<boolean>("CPP." + util.packageJson.version + ".ignoreMismatchedCompatibleVsix", false);
let resetIgnoreMismatchedCompatibleVsix: boolean = true;
// Check to ensure the correct platform-specific VSIX was installed.
const vsixManifestPath: string = path.join(util.extensionPath, ".vsixmanifest");
// Skip the check if the file does not exist, such as when debugging cpptools.
if (await util.checkFileExists(vsixManifestPath)) {
const content: string = await util.readFileText(vsixManifestPath);
const matches: RegExpMatchArray | null = content.match(/TargetPlatform="(?<platform>[^"]*)"/);
if (matches && matches.length > 0 && matches.groups) {
const vsixTargetPlatform: string = matches.groups['platform'];
const platformInfo: PlatformInformation = await PlatformInformation.GetPlatformInformation();
let isPlatformCompatible: boolean = true;
let isPlatformMatching: boolean = true;
switch (vsixTargetPlatform) {
case "win32-x64":
isPlatformMatching = platformInfo.platform === "win32" && platformInfo.architecture === "x64";
// x64 binaries can also be run on arm64 Windows 11.
isPlatformCompatible = platformInfo.platform === "win32" && (platformInfo.architecture === "x64" || (platformInfo.architecture === "arm64" && semver.gte(os.release(), "10.0.22000")));
break;
case "win32-ia32":
isPlatformMatching = platformInfo.platform === "win32" && platformInfo.architecture === "x86";
// x86 binaries can also be run on x64 and arm64 Windows.
isPlatformCompatible = platformInfo.platform === "win32" && (platformInfo.architecture === "x86" || platformInfo.architecture === "x64" || platformInfo.architecture === "arm64");
break;
case "win32-arm64":
isPlatformMatching = platformInfo.platform === "win32" && platformInfo.architecture === "arm64";
isPlatformCompatible = isPlatformMatching;
break;
case "linux-x64":
isPlatformMatching = platformInfo.platform === "linux" && platformInfo.architecture === "x64" && platformInfo.distribution?.name !== "alpine";
isPlatformCompatible = isPlatformMatching;
break;
case "linux-arm64":
isPlatformMatching = platformInfo.platform === "linux" && platformInfo.architecture === "arm64" && platformInfo.distribution?.name !== "alpine";
isPlatformCompatible = isPlatformMatching;
break;
case "linux-armhf":
isPlatformMatching = platformInfo.platform === "linux" && platformInfo.architecture === "arm" && platformInfo.distribution?.name !== "alpine";
// armhf binaries can also be run on aarch64 linux.
isPlatformCompatible = platformInfo.platform === "linux" && (platformInfo.architecture === "arm" || platformInfo.architecture === "arm64") && platformInfo.distribution?.name !== "alpine";
break;
case "alpine-x64":
isPlatformMatching = platformInfo.platform === "linux" && platformInfo.architecture === "x64" && platformInfo.distribution?.name === "alpine";
isPlatformCompatible = isPlatformMatching;
break;
case "alpine-arm64":
isPlatformMatching = platformInfo.platform === "linux" && platformInfo.architecture === "arm64" && platformInfo.distribution?.name === "alpine";
isPlatformCompatible = isPlatformMatching;
break;
case "darwin-x64":
isPlatformMatching = platformInfo.platform === "darwin" && platformInfo.architecture === "x64";
isPlatformCompatible = isPlatformMatching;
break;
case "darwin-arm64":
isPlatformMatching = platformInfo.platform === "darwin" && platformInfo.architecture === "arm64";
// x64 binaries can also be run on arm64 macOS.
isPlatformCompatible = platformInfo.platform === "darwin" && (platformInfo.architecture === "x64" || platformInfo.architecture === "arm64");
break;
default:
console.log("Unrecognized TargetPlatform in .vsixmanifest");
break;
}
const moreInfoButton: string = localize("more.info.button", "More Info");
const ignoreButton: string = localize("ignore.button", "Ignore");
let promise: Thenable<string | undefined> | undefined;
if (!isPlatformCompatible) {
promise = vscode.window.showErrorMessage(localize("vsix.platform.incompatible", "The C/C++ extension installed does not match your system.", vsixTargetPlatform), moreInfoButton);
} else if (!isPlatformMatching) {
if (!ignoreMismatchedCompatibleVsix.Value) {
resetIgnoreMismatchedCompatibleVsix = false;
promise = vscode.window.showWarningMessage(localize("vsix.platform.mismatching", "The C/C++ extension installed is compatible with but does not match your system.", vsixTargetPlatform), moreInfoButton, ignoreButton);
}
}
if (promise) {
promise.then(async (value) => {
if (value === moreInfoButton) {
await vscode.commands.executeCommand("markdown.showPreview", vscode.Uri.file(util.getLocalizedHtmlPath("Reinstalling the Extension.md")));
} else if (value === ignoreButton) {
ignoreMismatchedCompatibleVsix.Value = true;
}
});
}
} else {
console.log("Unable to find TargetPlatform in .vsixmanifest");
}
}
if (resetIgnoreMismatchedCompatibleVsix) {
ignoreMismatchedCompatibleVsix.Value = false;
}
}
/**
* activate: set up the extension for language services
*/
export async function activate(): Promise<void> {
await checkVsixCompatibility();
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
for (let i: number = 0; i < vscode.workspace.workspaceFolders.length; ++i) {
const config: string = path.join(vscode.workspace.workspaceFolders[i].uri.fsPath, ".vscode/c_cpp_properties.json");
if (await util.checkFileExists(config)) {
const doc: vscode.TextDocument = await vscode.workspace.openTextDocument(config);
vscode.languages.setTextDocumentLanguage(doc, "jsonc");
}
}
}
if (new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined).intelliSenseEngine === "Disabled") {
throw new Error(intelliSenseDisabledError);
} else {
console.log("activating extension");
sendActivationTelemetry();
const checkForConflictingExtensions: PersistentState<boolean> = new PersistentState<boolean>("CPP." + util.packageJson.version + ".checkForConflictingExtensions", true);
if (checkForConflictingExtensions.Value) {
checkForConflictingExtensions.Value = false;
const clangCommandAdapterActive: boolean = vscode.extensions.all.some((extension: vscode.Extension<any>, index: number, array: Readonly<vscode.Extension<any>[]>): boolean =>
extension.isActive && extension.id === "mitaki28.vscode-clang");
if (clangCommandAdapterActive) {
telemetry.logLanguageServerEvent("conflictingExtension");
}
console.log("activating extension");
sendActivationTelemetry();
const checkForConflictingExtensions: PersistentState<boolean> = new PersistentState<boolean>("CPP." + util.packageJson.version + ".checkForConflictingExtensions", true);
if (checkForConflictingExtensions.Value) {
checkForConflictingExtensions.Value = false;
const clangCommandAdapterActive: boolean = vscode.extensions.all.some((extension: vscode.Extension<any>, index: number, array: Readonly<vscode.Extension<any>[]>): boolean =>
extension.isActive && extension.id === "mitaki28.vscode-clang");
if (clangCommandAdapterActive) {
telemetry.logLanguageServerEvent("conflictingExtension");
}
}
@@ -311,21 +198,14 @@ export async function activate(): Promise<void> {
registerCommands();
taskProvider = vscode.tasks.registerTaskProvider(CppBuildTaskProvider.CppBuildScriptType, cppBuildTaskProvider);
vscode.tasks.onDidStartTask(event => {
getActiveClient().PauseCodeAnalysis();
if (event.execution.task.definition.type === CppBuildTaskProvider.CppBuildScriptType
|| event.execution.task.name.startsWith(configPrefix)) {
telemetry.logLanguageServerEvent('buildTaskStarted');
}
});
vscode.tasks.onDidEndTask(event => {
getActiveClient().ResumeCodeAnalysis();
if (event.execution.task.definition.type === CppBuildTaskProvider.CppBuildScriptType
|| event.execution.task.name.startsWith(configPrefix)) {
telemetry.logLanguageServerEvent('buildTaskFinished');
if (event.execution.task.scope !== vscode.TaskScope.Global && event.execution.task.scope !== vscode.TaskScope.Workspace) {
const folder: vscode.WorkspaceFolder | undefined = event.execution.task.scope;
if (folder) {
@@ -1032,9 +912,6 @@ export function deactivate(): Thenable<void> {
disposables.forEach(d => d.dispose());
languageConfigurations.forEach(d => d.dispose());
ui.dispose();
if (taskProvider) {
taskProvider.dispose();
}
if (codeActionProvider) {
codeActionProvider.dispose();
}
+146 -16
View File
@@ -18,6 +18,12 @@ import { CppTools1 } from './cppTools1';
import { CppSettings } from './LanguageServer/settings';
import { PersistentState } from './LanguageServer/persistentState';
import { TargetPopulation } from 'vscode-tas-client';
import * as semver from 'semver';
import * as nls from 'vscode-nls';
import { cppBuildTaskProvider, CppBuildTaskProvider } from './LanguageServer/cppBuildTaskProvider';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
const cppTools: CppTools1 = new CppTools1();
let languageServiceDisabled: boolean = false;
@@ -58,27 +64,59 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
// Notify users if debugging may not be supported on their OS.
util.checkDistro(info);
await checkVsixCompatibility();
UpdateInsidersAccess();
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
if (settings.intelliSenseEngine === "Disabled") {
languageServiceDisabled = true;
disposables.push(vscode.workspace.onDidChangeConfiguration(() => {
if (!reloadMessageShown && settings.intelliSenseEngine !== "Disabled") {
reloadMessageShown = true;
util.promptForReloadWindowDueToSettingsChange();
}
}));
} else {
disposables.push(vscode.workspace.onDidChangeConfiguration(() => {
if (!reloadMessageShown && settings.intelliSenseEngine === "Disabled") {
reloadMessageShown = true;
util.promptForReloadWindowDueToSettingsChange();
}
}));
}
await LanguageServer.activate();
let currentIntelliSenseEngineValue: string | undefined = settings.intelliSenseEngine;
disposables.push(vscode.workspace.onDidChangeConfiguration(() => {
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
if (!reloadMessageShown && settings.intelliSenseEngine !== currentIntelliSenseEngineValue) {
if (currentIntelliSenseEngineValue === "Disabled") {
// If switching from disabled to enabled, we can continue activation.
currentIntelliSenseEngineValue = settings.intelliSenseEngine;
languageServiceDisabled = false;
LanguageServer.activate();
} else {
// We can't deactivate or change engines on the fly, so prompt for window reload.
reloadMessageShown = true;
util.promptForReloadWindowDueToSettingsChange();
}
}
}));
UpdateInsidersAccess();
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
for (let i: number = 0; i < vscode.workspace.workspaceFolders.length; ++i) {
const config: string = path.join(vscode.workspace.workspaceFolders[i].uri.fsPath, ".vscode/c_cpp_properties.json");
if (await util.checkFileExists(config)) {
const doc: vscode.TextDocument = await vscode.workspace.openTextDocument(config);
vscode.languages.setTextDocumentLanguage(doc, "jsonc");
}
}
}
disposables.push(vscode.tasks.registerTaskProvider(CppBuildTaskProvider.CppBuildScriptType, cppBuildTaskProvider));
vscode.tasks.onDidStartTask(event => {
if (event.execution.task.definition.type === CppBuildTaskProvider.CppBuildScriptType
|| event.execution.task.name.startsWith(LanguageServer.configPrefix)) {
Telemetry.logLanguageServerEvent('buildTaskStarted');
}
});
vscode.tasks.onDidEndTask(event => {
if (event.execution.task.definition.type === CppBuildTaskProvider.CppBuildScriptType
|| event.execution.task.name.startsWith(LanguageServer.configPrefix)) {
Telemetry.logLanguageServerEvent('buildTaskFinished');
}
});
if (settings.intelliSenseEngine !== "Disabled") {
await LanguageServer.activate();
}
return cppTools;
}
@@ -87,7 +125,6 @@ export function deactivate(): Thenable<void> {
DebuggerExtension.dispose();
Telemetry.deactivate();
disposables.forEach(d => d.dispose());
if (languageServiceDisabled) {
return Promise.resolve();
}
@@ -187,3 +224,96 @@ export function UpdateInsidersAccess(): void {
vscode.commands.executeCommand("workbench.extensions.installExtension", "ms-vscode.cpptools", { installPreReleaseVersion: true });
}
}
async function checkVsixCompatibility(): Promise<void> {
const ignoreMismatchedCompatibleVsix: PersistentState<boolean> = new PersistentState<boolean>("CPP." + util.packageJson.version + ".ignoreMismatchedCompatibleVsix", false);
let resetIgnoreMismatchedCompatibleVsix: boolean = true;
// Check to ensure the correct platform-specific VSIX was installed.
const vsixManifestPath: string = path.join(util.extensionPath, ".vsixmanifest");
// Skip the check if the file does not exist, such as when debugging cpptools.
if (await util.checkFileExists(vsixManifestPath)) {
const content: string = await util.readFileText(vsixManifestPath);
const matches: RegExpMatchArray | null = content.match(/TargetPlatform="(?<platform>[^"]*)"/);
if (matches && matches.length > 0 && matches.groups) {
const vsixTargetPlatform: string = matches.groups['platform'];
const platformInfo: PlatformInformation = await PlatformInformation.GetPlatformInformation();
let isPlatformCompatible: boolean = true;
let isPlatformMatching: boolean = true;
switch (vsixTargetPlatform) {
case "win32-x64":
isPlatformMatching = platformInfo.platform === "win32" && platformInfo.architecture === "x64";
// x64 binaries can also be run on arm64 Windows 11.
isPlatformCompatible = platformInfo.platform === "win32" && (platformInfo.architecture === "x64" || (platformInfo.architecture === "arm64" && semver.gte(os.release(), "10.0.22000")));
break;
case "win32-ia32":
isPlatformMatching = platformInfo.platform === "win32" && platformInfo.architecture === "x86";
// x86 binaries can also be run on x64 and arm64 Windows.
isPlatformCompatible = platformInfo.platform === "win32" && (platformInfo.architecture === "x86" || platformInfo.architecture === "x64" || platformInfo.architecture === "arm64");
break;
case "win32-arm64":
isPlatformMatching = platformInfo.platform === "win32" && platformInfo.architecture === "arm64";
isPlatformCompatible = isPlatformMatching;
break;
case "linux-x64":
isPlatformMatching = platformInfo.platform === "linux" && platformInfo.architecture === "x64" && platformInfo.distribution?.name !== "alpine";
isPlatformCompatible = isPlatformMatching;
break;
case "linux-arm64":
isPlatformMatching = platformInfo.platform === "linux" && platformInfo.architecture === "arm64" && platformInfo.distribution?.name !== "alpine";
isPlatformCompatible = isPlatformMatching;
break;
case "linux-armhf":
isPlatformMatching = platformInfo.platform === "linux" && platformInfo.architecture === "arm" && platformInfo.distribution?.name !== "alpine";
// armhf binaries can also be run on aarch64 linux.
isPlatformCompatible = platformInfo.platform === "linux" && (platformInfo.architecture === "arm" || platformInfo.architecture === "arm64") && platformInfo.distribution?.name !== "alpine";
break;
case "alpine-x64":
isPlatformMatching = platformInfo.platform === "linux" && platformInfo.architecture === "x64" && platformInfo.distribution?.name === "alpine";
isPlatformCompatible = isPlatformMatching;
break;
case "alpine-arm64":
isPlatformMatching = platformInfo.platform === "linux" && platformInfo.architecture === "arm64" && platformInfo.distribution?.name === "alpine";
isPlatformCompatible = isPlatformMatching;
break;
case "darwin-x64":
isPlatformMatching = platformInfo.platform === "darwin" && platformInfo.architecture === "x64";
isPlatformCompatible = isPlatformMatching;
break;
case "darwin-arm64":
isPlatformMatching = platformInfo.platform === "darwin" && platformInfo.architecture === "arm64";
// x64 binaries can also be run on arm64 macOS.
isPlatformCompatible = platformInfo.platform === "darwin" && (platformInfo.architecture === "x64" || platformInfo.architecture === "arm64");
break;
default:
console.log("Unrecognized TargetPlatform in .vsixmanifest");
break;
}
const moreInfoButton: string = localize("more.info.button", "More Info");
const ignoreButton: string = localize("ignore.button", "Ignore");
let promise: Thenable<string | undefined> | undefined;
if (!isPlatformCompatible) {
promise = vscode.window.showErrorMessage(localize("vsix.platform.incompatible", "The C/C++ extension installed does not match your system.", vsixTargetPlatform), moreInfoButton);
} else if (!isPlatformMatching) {
if (!ignoreMismatchedCompatibleVsix.Value) {
resetIgnoreMismatchedCompatibleVsix = false;
promise = vscode.window.showWarningMessage(localize("vsix.platform.mismatching", "The C/C++ extension installed is compatible with but does not match your system.", vsixTargetPlatform), moreInfoButton, ignoreButton);
}
}
if (promise) {
promise.then(async (value) => {
if (value === moreInfoButton) {
await vscode.commands.executeCommand("markdown.showPreview", vscode.Uri.file(util.getLocalizedHtmlPath("Reinstalling the Extension.md")));
} else if (value === ignoreButton) {
ignoreMismatchedCompatibleVsix.Value = true;
}
});
}
} else {
console.log("Unable to find TargetPlatform in .vsixmanifest");
}
}
if (resetIgnoreMismatchedCompatibleVsix) {
ignoreMismatchedCompatibleVsix.Value = false;
}
}
+1 -1
View File
@@ -709,7 +709,7 @@
<div class="section">
<div class="section-title" data-loc-id="database.filename">Browse: database filename</div>
<div class="section-text">
<span data-loc-id="database.filename.description">The path to the generated symbol database. This instructs the extension to save the Tag Parser's symbol database somewhere other than the workspace's default storage location. If a relative path is specified, it will be made relative to the workspace's default storage location, not the workspace folder itself. The <code>${workspaceFolder}</code> variable can be used to specify a path relative to the workspace folder (e.g. <code>${workspaceFolder}/.vscode/browse.vc.db</code>)</span>
<span data-loc-id="database.filename.description">The path to the generated symbol database. This instructs the extension to save the Tag Parser's symbol database somewhere other than the workspace's default storage location. If a relative path is specified, it will be made relative to the workspace's default storage location, not the workspace folder itself. The <code>${workspaceFolder}</code> variable can be used to specify a path relative to the workspace folder (e.g. <code>${workspaceFolder}/.vscode/browse.vc.db</code>).</span>
</div>
<div>
<input name="inputValue" id="databaseFilename" style="width: 798px"></input>
+6 -1
View File
@@ -3772,11 +3772,16 @@ [email protected], minimist@^0.2.1:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.1.tgz#827ba4e7593464e7c221e8c5bed930904ee2c455"
integrity sha512-GY8fANSrTMfBVfInqJAY41QkOM+upUTytK1jZ0c8+3HdHrJxBJ3rF5i9moClXTE8uUSnUo8cAsCoxDXvSY4DHg==
minimist@^1.2.0, minimist@^1.2.5:
minimist@^1.2.0:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
minimist@^1.2.5, minimist@^1.2.6:
version "1.2.6"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
mixin-deep@^1.2.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566"