Compare commits

..
48 Commits
Author SHA1 Message Date
Sean McManus e53b190380 Merge pull request #11253 from microsoft/main
Merge (again) for 1.17.0
2023-07-26 16:56:43 -07:00
Sean McManus 4f805c4263 Update changelog (again) for 1.17.0 (#11251)
* Update changelog.
2023-07-26 16:26:40 -07:00
Michał Mąka a7870fc1b2 Added support for Toybox to remote process picker (#11175)
* Added separate remote process command for ToyBox
2023-07-26 16:08:07 -07:00
Michelle Matias 1846fd4001 Merge pull request #11250 from microsoft/main 2023-07-26 14:15:17 -07:00
Michelle Matias d48fd4343b fix merge (#11249) 2023-07-26 14:11:18 -07:00
Colen Garoutte-Carson 62e09945e3 Merge pull request #11241 from microsoft/main 2023-07-24 17:32:28 -07:00
Michelle Matias 9ce7b5a87c update change log (#11240) 2023-07-24 16:35:29 -07:00
Michelle Matias 460aee5971 'Create Declaration / Definition' command via 'Quick Fix...' hover (#11239) 2023-07-24 15:49:19 -07:00
Sean McManus 0e309a7e7f Fix config provider ordering. (#11237) 2023-07-24 11:48:18 -07:00
Sean McManus 27f9fafc73 Fix console logging. (#11233) 2023-07-24 10:38:26 -07:00
Michelle Matias c9b0db02fd Merge pull request #11230 from microsoft/main
Merge 1.17.0
2023-07-21 14:08:21 -07:00
Sean McManus 72ea4d5eb9 Update ThirdPartyNotices.txt. (#11232) 2023-07-21 13:52:52 -07:00
Michelle Matias 3c63457e38 changelog 17 (#11227) 2023-07-21 13:19:32 -07:00
Garrett Serack 477eb06f2b Fix out-of-order message handling (#11212) 2023-07-21 12:44:14 -07:00
dependabot[bot] 62b27eadce Bump word-wrap from 1.2.3 to 1.2.4 in /.github/actions (#11213) 2023-07-18 15:25:09 -07:00
browntarik 668499169e Add Setting to Enable Markdown Comment Formatting (#11177)
* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR
2023-07-18 14:34:25 -07:00
Bob Brown 2133b871be Remove walkthrough experiment and update the Help links to point to it (#11191) 2023-07-18 15:46:52 +00:00
Bob Brown d6370f3dcf compliance: update dependencies to remove usage of fsevents 1.2.7 (#11206) 2023-07-17 12:54:43 -07:00
Sean McManus 4589c6a731 Update IntelliSense loc strings. (#11193) 2023-07-14 15:50:57 -07:00
Sean McManus c4ea718dd5 Update ThirdPartyNotices.txt again. (#11184) 2023-07-11 17:58:15 -07:00
dependabot[bot] f26308c09f Bump semver from 5.7.1 to 5.7.2 in /.github/actions (#11183) 2023-07-11 16:44:36 -07:00
Sean McManus 420b479896 Update package.json/yarn.lock (#11181)
* Update yarn.lock.
* Clean up old/unneeded resolutions.
2023-07-11 16:34:49 -07:00
Colen Garoutte-Carson 2dfbeb16b2 Add license for SoftFloat to ThirdPartyNotices.txt (#11168) 2023-07-07 11:24:36 -07:00
Sean McManus f293e59478 Update IntelliSense loc strings. (#11166) 2023-07-06 18:55:15 -07:00
browntarik b747b98cde resolve paths with /, /*, /** and \\** (#11136)
* resolve paths with '/', '/*', '/**' and '\\**'

* resolve multiple path parsing

* create generalized approach for wildcard support

* Add windows conditional for backslashes

* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve variables for globs

* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR
2023-07-06 16:25:22 -07:00
Sean McManus 094596961a Update ThirdPartyNotices.txt (#11144) 2023-06-30 11:38:36 -07:00
Garrett Serack 503f95b085 Modernize packages, code patterns (#11085)
Modernize packages, code patterns
2023-06-29 13:18:48 -07:00
3612c02d07 Add wildcard support for includeDir (#10388)
For example, using the following tree:

  rootUri
  - sources
    - main
      - main.c
    - vendor
      - khash.h
  - headers
    - C001
      - a.h
    - C002
      - b.h

The following directory paths works:

- `sources/**`  for plain old recursive path
- `headers/C*/` dynamic path
- `missing/`    reported as "not found"
- `missing/*`   expanded as empty result (silent fail)

Note: bakslash paths need to be slash-converted to avoid be considered as "Dynamic"

Co-authored-by: Sean McManus <[email protected]>
Co-authored-by: browntarik <[email protected]>
2023-06-27 09:53:35 -07:00
Michelle Matias ddbc92a990 1.16.3 changelog (#11125) 2023-06-23 16:55:56 -07:00
Colen Garoutte-Carson ce587c6f06 Fix possible race condition that could lead to multiple didOpen's (#11120) 2023-06-22 19:26:13 -07:00
Michelle Matias baa93534f0 update log (#11115) 2023-06-21 15:05:31 -07:00
[email protected] 68777f9873 [Auto] Localization - Translated Strings (#10992) 2023-06-21 13:28:59 -07:00
browntarik 4037db9783 remove extra adjustments to textEdit for CDD (#11110)
* remove extra adjustments to textEdit

* combine conditionals
2023-06-21 12:23:02 -07:00
Michelle Matias a67c6610a7 1.16.2 changelog (#11111) 2023-06-21 10:57:55 -07:00
browntarik 4f5ec73173 Add configuration telemetry (#11093) 2023-06-19 16:44:44 -07:00
Bob Brown 79f4e8ded0 Update LICENSE.md (#11102) 2023-06-16 12:05:56 -07:00
Michelle Matias 51da619eec Merge pull request #11099 from microsoft/main
1.16.1 pre-release
2023-06-15 21:19:13 -07:00
Michelle Matias 7544de0b47 1.16.1 changelog (#11094) 2023-06-15 17:34:45 -07:00
Michelle Matias 491456e8de Fix references cancellation and preview (#11056) 2023-06-15 17:02:46 -07:00
Caio Hamamura 5b51db1999 configurationProvider.ts: default cppvsdbg integratedTerminal (#11035) 2023-06-15 16:41:32 -07:00
Chang-Yen Tseng 46eaddc411 include miDebuggerArgs in attach option (#11066) 2023-06-15 16:35:31 -07:00
Michelle Matias 71c6cb6c6c add file path to call hierarchy details (#11095) 2023-06-15 15:04:44 -07:00
Colen Garoutte-Carson 0452f0aad9 Remove line preventing Don't Show Again (#11076) 2023-06-12 14:54:29 -07:00
Sean McManus 478ccb6abd Update vscode/dts (#11047)
* Update vscode/dts
2023-06-05 15:40:29 -07:00
browntarik 7504532e58 Removed LanguageStatus experiment code and merged ui.ts and ui_new.ts (#11030)
* merge ui and ui_new, finsih status experiment

* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR
2023-06-02 05:56:18 -07:00
Sean McManus 9621430533 Make sure empty non-enum string settings are equivalent to undefined. (#11031)
* Make sure empty non-enum string settings are equivalent to undefined.
* Check for null. Remove null default for "string" setting.
2023-05-31 17:42:33 -07:00
Sean McManus 3ef10f294e Stop using vcFormat for non-formatting editorconfig settings. (#11015) 2023-05-31 13:57:31 -07:00
Sean McManus e394edb630 Fix Other References not getting cleared for Call Hierarchy. (#10989) 2023-05-22 17:53:00 -07:00
135 changed files with 13377 additions and 12933 deletions
+30 -30
View File
@@ -774,9 +774,9 @@
}
},
"node_modules/@opentelemetry/instrumentation/node_modules/semver": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.4.0.tgz",
"integrity": "sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw==",
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dependencies": {
"lru-cache": "^6.0.0"
},
@@ -1029,9 +1029,9 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
@@ -1154,9 +1154,9 @@
}
},
"node_modules/@typescript-eslint/typescript-estree/node_modules/semver": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
@@ -3569,9 +3569,9 @@
"dev": true
},
"node_modules/semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"bin": {
"semver": "bin/semver"
}
@@ -3888,9 +3888,9 @@
}
},
"node_modules/word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
"integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@@ -4688,9 +4688,9 @@
},
"dependencies": {
"semver": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.4.0.tgz",
"integrity": "sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw==",
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"requires": {
"lru-cache": "^6.0.0"
}
@@ -4903,9 +4903,9 @@
},
"dependencies": {
"semver": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
@@ -4968,9 +4968,9 @@
},
"dependencies": {
"semver": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
@@ -6682,9 +6682,9 @@
"dev": true
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="
},
"serialize-javascript": {
"version": "6.0.0",
@@ -6910,9 +6910,9 @@
}
},
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
"integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
"dev": true
},
"workerpool": {
+49 -49
View File
@@ -1,4 +1,9 @@
module.exports = {
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended"
//"plugin:@typescript-eslint/strict", // I want to enable this. Lots of little changes will happen.
],
"env": {
"browser": true,
"es6": true,
@@ -7,16 +12,29 @@ module.exports = {
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
"ecmaVersion": 2022,
"sourceType": "module",
"warnOnUnsupportedTypeScriptVersion": false,
},
"plugins": [
"@typescript-eslint",
"@typescript-eslint/tslint",
"eslint-plugin-jsdoc",
"@typescript-eslint/eslint-plugin-tslint",
"@typescript-eslint/eslint-plugin",
"eslint-plugin-import",
"eslint-plugin-header"
],
"rules": {
"indent": [
"warn",
4,
{
"SwitchCase": 1,
"ObjectExpression": "first"
}
],
"@typescript-eslint/indent": [
"error", 4
],
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
@@ -41,6 +59,11 @@ module.exports = {
}
}
],
"no-case-declarations": "off",
"no-useless-escape": "off",
"no-floating-decimal": "error",
"keyword-spacing": ["error", { "before": true, "overrides": { "this": { "before": false } } }],
"arrow-spacing": ["error", { "before": true, "after": true }],
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-misused-promises": "error",
@@ -57,8 +80,15 @@ module.exports = {
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/method-signature-style": ["error", "method"],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"arrow-body-style": "error",
"comma-dangle": "error",
"comma-spacing": "off",
"@typescript-eslint/comma-spacing": "error",
"constructor-super": "error",
"curly": "error",
"eol-last": "error",
@@ -82,7 +112,6 @@ module.exports = {
"no-irregular-whitespace": "error",
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1, "maxBOF": 0 }],
"no-new-wrappers": "error",
"no-redeclare": "error",
"no-return-await": "error",
"no-sequences": "error",
"no-sparse-arrays": "error",
@@ -103,54 +132,25 @@ module.exports = {
"never"
],
"spaced-comment": [
"error",
"always"
"off",
"always",
{ "line": { "exceptions": ["/"] } } // triple slash directives
],
"use-isnan": "error",
"valid-typeof": "error",
"yoda": "error",
"@typescript-eslint/tslint/config": [
"error",
{
"rules": {
"encoding": true,
"file-header": [
true,
".*"
],
"import-spacing": true,
"match-default-export-name": true,
"no-boolean-literal-compare": true,
"no-mergeable-namespace": true,
"no-reference-import": true,
"no-unnecessary-callback-wrapper": true,
"number-literal-format": true,
"one-line": [
true,
"check-catch",
"check-finally",
"check-else",
"check-open-brace",
"check-whitespace"
],
"prefer-method-signature": true,
"prefer-while": true,
"typedef": [
true,
"variable-declaration",
"call-signature",
"variable-declaration-ignore-function"
],
"whitespace": [
true,
"check-branch",
"check-operator",
"check-separator",
"check-preblock",
"check-type"
]
}
}
]
"space-infix-ops": "error",
"header/header": [
"warn",
"block",
[
" --------------------------------------------------------------------------------------------",
" * Copyright (c) Microsoft Corporation. All Rights Reserved.",
" * See 'LICENSE' in the project root for license information.",
" * ------------------------------------------------------------------------------------------ "
],
],
}
};
+141 -126
View File
@@ -1,128 +1,143 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch Extension (development)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "Compile Dev",
},
{
"name": "Launch Extension (production)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "TypeScript Compile",
},
{
"name": "Launch Extension (do not build)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
]
},
{
"name": "Launch Extension (watch, development)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "Compile Dev Watch",
},
{
"name": "Launch Extension (watch, production)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "TypeScript Compile Watch",
},
{
"name": "Launch Unit Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/unitTests/index"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "Pretest"
},
{
"name": "Launch Integration Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceFolder}/test/integrationTests/testAssets/SimpleCppProject/simpleCppProject.code-workspace",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/integrationTests/languageServer/index"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "Pretest",
},
{
"name": "Launch E2E IntelliSense features tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"C:/git/Vcls-vscode-test/MultirootDeadlockTest/test.code-workspace",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/integrationTests/IntelliSenseFeatures/index"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "Pretest"
},
{
"name": "Node Attach",
"type": "node",
"request": "attach",
"port": 5858
},
]
}
"version": "0.1.0",
"configurations": [
{
"name": "Launch Extension (development)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "Compile Dev",
},
{
"name": "Launch Extension (production)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "TypeScript Compile",
},
{
"name": "Launch Extension (do not build)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
]
},
{
"name": "Launch Extension (watch, development)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "Compile Dev Watch",
},
{
"name": "Launch Extension (watch, production)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "TypeScript Compile Watch",
},
{
"name": "Launch Unit Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/unitTests/index"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "Pretest"
},
{
"name": "Launch Integration Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceFolder}/test/integrationTests/testAssets/SimpleCppProject/simpleCppProject.code-workspace",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/integrationTests/languageServer/index"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "Pretest",
},
{
"name": "Launch E2E IntelliSense features tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceFolder}/../../Vcls-vscode-test/MultirootDeadlockTest/test.code-workspace",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/integrationTests/IntelliSenseFeatures/index"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "Pretest"
},
{
"name": "Node Attach",
"type": "node",
"request": "attach",
"port": 5858
},
{
"name": "MochaTest",
"type": "node",
"request": "attach",
"port": 9229,
"continueOnAttach": true,
"autoAttachChildProcesses": false,
"skipFiles": [
"<node_internals>/**"
],
"outFiles": [
"${workspaceFolder}/**/out/**/*.js",
"!**/node_modules/**"
]
}
]
}
+50 -8
View File
@@ -1,10 +1,52 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
}
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version
// if you install the mocha test explorer extension, you can run the unit tests from the test explorer UI
"testExplorer.useNativeTesting": true,
"mochaExplorer.files": "./**/internalUnitTests/**/*.test.js",
"mochaExplorer.watch": "./**/internalUnitTests/**/*.test.js",
"mochaExplorer.ignore": [
"**/*skip*",
"**/dist/test/**/*.d.ts",
"**/node_modules/**"
],
"mochaExplorer.debuggerConfig": "MochaTest",
"mochaExplorer.logpanel": true,
"mochaExplorer.timeout": 500000,
"mochaExplorer.require": [
"source-map-support/register"
],
"mochaExplorer.monkeyPatch": true,
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "vscode.json-language-features",
"editor.tabSize": 4,
"files.insertFinalNewline": true
},
"[jsonc]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "vscode.json-language-features",
"editor.tabSize": 4,
"files.insertFinalNewline": true
},
"[typescript]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": true
},
},
"eslint.format.enable": true,
"[javascript]": {
"editor.tabSize": 4,
}
}
+36 -1
View File
@@ -166,6 +166,41 @@
}
}
]
},
{
"label": "Compile:Watch (unit-tests)",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "yarn",
"args": [
"run",
"compile-watch-unit-tests"
],
"isBackground": true,
"problemMatcher": "$tsc-watch",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"label": "Compile (unit-tests)",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "yarn",
"args": [
"run",
"compile-unit-tests"
],
"problemMatcher": "$tsc",
"group": {
"kind": "build",
"isDefault": false
}
}
]
}
}
+49 -1
View File
@@ -1,6 +1,40 @@
# C/C++ for Visual Studio Code Changelog
## Version 1.16.0: May 22, 2023
## Version 1.17.0: July 26, 2023
### Enhancements
* Enable a subset of markdown to render in hover by default and a `C_Cpp.markdownInComments` setting. [#6020](https://github.com/microsoft/vscode-cpptools/issues/6020), [#10461](https://github.com/microsoft/vscode-cpptools/issues/10461)
* Add default compiler detection of additional compilers in MSYS environments. [#11211](https://github.com/microsoft/vscode-cpptools/issues/11211)
* Add support for additional compiler wrappers: gomacc, distcc, buildcache, and icecc.
### Bug Fixes
* Fix a couple bugs with documentation comments. [#5241](https://github.com/microsoft/vscode-cpptools/issues/5241)
* Added `__float128` support in gcc IntelliSense mode. [#9558](https://github.com/microsoft/vscode-cpptools/issues/9558)
* Address various issues with support for gcc 13. [#11038](https://github.com/microsoft/vscode-cpptools/issues/11038)
* Fix `#include` completion leaving an extra `>`. [#11042](https://github.com/microsoft/vscode-cpptools/issues/11042)
* Fix an issue with matching of glob patterns containing path delimiters. [#11132](https://github.com/microsoft/vscode-cpptools/issues/11132)
* Fix Create Declaration/Definition via `Quick Fix…` from hover tooltip. [#11157](https://github.com/microsoft/vscode-cpptools/issues/11157)
* Fix issues with compiler querying of clang-cl. [#11207](https://github.com/microsoft/vscode-cpptools/issues/11207)
* Fix `files.encoding` setting on startup. [#11210](https://github.com/microsoft/vscode-cpptools/issues/11210)
* Fix a crash related to directories with a very large number of files. [#11226](https://github.com/microsoft/vscode-cpptools/issues/11226)
* Fix Rank > 1 Display Strings for Natvis. [PR MIEngine#1406](https://github.com/microsoft/MIEngine/pull/1406)
* Fix some crashes identified by crash telemetry.
* Fix an issue that could cause zombie processes on Linux/Mac.
* Address some issues with glibc version compatibility. Native binaries for cpptools and the bundled clang-tidy/clang-format are now built with musl and fully statically linked.
* Fix the wrong compiler being set as default when configured to use `compile_commands.json` and overriding the compiler used there with an explicit `compilerPath`.
### Thank You to the Contributors
* [@gareth-rees (Gareth Rees)](https://github.com/gareth-rees): Always use `--simple-values` in newer versions of GDB. [PR MIEngine#1400](https://github.com/microsoft/MIEngine/pull/1400)
* [@iAbadia (Iñaki)](https://github.com/iAbadia): Align use of 'sendInvalidate' request arguments. [PR MIEngine#1402](https://github.com/microsoft/MIEngine/pull/1402)
* [@intel-rganesh (Rakesh Ganesh)](https://github.com/intel-rganesh): Introduce `--thread` and `--frame options`. [PR MIEngine#1401](https://github.com/microsoft/MIEngine/pull/1401)
* [@michalmaka (Michał Mąka)](https://github.com/michalmaka): Add support for Toybox to the remote process picker. [PR #11175](https://github.com/microsoft/vscode-cpptools/pull/11175)
* [@sbobko (Sergey Bobko)](https://github.com/sbobko): Add 'sendInvalidate' request. [PR MIEngine#1367](https://github.com/microsoft/MIEngine/pull/1367)
* [@yne (Rémy F.)](https://github.com/yne): Add wildcard support for `includePath`. [PR #10388](https://github.com/microsoft/vscode-cpptools/pull/10388)
## Version 1.16.3: June 23, 2023
### Bug Fix
* Fix "cout is ambiguous" error. [#11122](https://github.com/microsoft/vscode-cpptools/issues/11122)
## Version 1.16.2: June 22, 2023
### New Features
* Add Call Hierarchy. [#16](https://github.com/microsoft/vscode-cpptools/issues/16)
* Add "Copy Definition" and "Copy Declaration" code actions (for when the default Create placement isn't desired). [#10238](https://github.com/microsoft/vscode-cpptools/issues/10238), [#10942](https://github.com/microsoft/vscode-cpptools/issues/10942)
@@ -8,9 +42,15 @@
### Enhancements
* Add support for other glob pattern syntax, such as `[]` and `^`. [#8960](https://github.com/microsoft/vscode-cpptools/issues/8960)
* Add support for C++23 z/Z and zu/ZU suffixes in clang/gcc modes. [#10190](https://github.com/microsoft/vscode-cpptools/issues/10190)
* Add warning logging when the database is reset due to a version change. [#10984](https://github.com/microsoft/vscode-cpptools/issues/10984)
* Move user compilers to the beginning of the "known compilers" lists. [#10985](https://github.com/microsoft/vscode-cpptools/issues/10985)
* Add file path to the details of a call hierarchy result. [#10997](https://github.com/microsoft/vscode-cpptools/issues/10997)
* Add `miDebuggerArgs` to debugger attach option.
* Thank you for the contribution @Summon528 [PR #11066](https://github.com/microsoft/vscode-cpptools/pull/11066)
### Bug Fixes
* Fix an IntelliSense parsing bug with C++20 ranges. [#8039](https://github.com/microsoft/vscode-cpptools/issues/8039)
* Fix incorrect insertion of Create Declaration/Definition when it also adds a #include. [#10464](https://github.com/microsoft/vscode-cpptools/issues/10464)
* Fix an IntelliSense bug with user-defined floating-point literals. [#10837](https://github.com/microsoft/vscode-cpptools/issues/10837)
* Fix deadlock with Find All References. [#10855](https://github.com/microsoft/vscode-cpptools/issues/10855)
* Fix performance issues on machines with > 32 threads. [#10874](https://github.com/microsoft/vscode-cpptools/issues/10874)
@@ -21,6 +61,14 @@
* Fix the "known compilers" list not getting updated with "user compilers". [#10943](https://github.com/microsoft/vscode-cpptools/issues/10943)
* Fix cancelation of Find All References while confirming references. [#10947](https://github.com/microsoft/vscode-cpptools/issues/10947)
* Fix a bug with workspace parsing status. [PR #10974](https://github.com/microsoft/vscode-cpptools/pull/10974)
* Fix some bugs if settings were empty string or null. [#10994](https://github.com/microsoft/vscode-cpptools/issues/10994)
* Fix cancellation for Find All References/Rename/Call Hierarchy. [#10998](https://github.com/microsoft/vscode-cpptools/issues/10998)
* Fix two Doxygen comment generation bugs. [#10995](https://github.com/microsoft/vscode-cpptools/issues/10995), [#11016](https://github.com/microsoft/vscode-cpptools/issues/11016)
* Fix the thread pool sometimes not increasing in size, which could lead to the cpptools process incorrectly being shut down. [#11003](https://github.com/microsoft/vscode-cpptools/issues/11003)
* Stop using vcFormat if .editorconfig exists with only non-formatting cpp settings. [PR #11015](https://github.com/microsoft/vscode-cpptools/pull/11015)
* Use integratedTerminal when user is running cl.exe for debugger. [#11032](https://github.com/microsoft/vscode-cpptools/issues/11032)
* Thank you for the contribution @caiohamamura [PR #11035](https://github.com/microsoft/vscode-cpptools/pull/11035)
* Fix the configure your IntelliSense notification to not show again when the "Don't Show Again" option is selected. [#11070](https://github.com/microsoft/vscode-cpptools/issues/11070)
* Fix a bug that could cause incomplete reading of stdout/stderr of child processes on Windows.
* Fix incorrect "declaration is incompatible" IntelliSense errors.
* Fix some potential crashes.
+212 -222
View File
@@ -336,7 +336,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------
anymatch 3.1.2 - ISC
anymatch 3.1.3 - ISC
https://github.com/micromatch/anymatch
Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com)
@@ -417,7 +417,7 @@ the licensed code:
---------------------------------------------------------
glob 7.1.6 - ISC
glob 7.2.3 - ISC
https://github.com/isaacs/node-glob#readme
Copyright (c) Isaac Z. Schlueter and Contributors
@@ -628,6 +628,32 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
minimatch 5.1.6 - ISC
https://github.com/isaacs/minimatch#readme
Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors
The ISC License
Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@@ -710,7 +736,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------
semver 5.7.1 - ISC
semver 5.7.2 - ISC
https://github.com/npm/node-semver#readme
Copyright Isaac Z.
@@ -738,7 +764,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------
semver 7.3.7 - ISC
semver 7.5.4 - ISC
https://github.com/npm/node-semver#readme
Copyright Isaac Z. Schlueter
@@ -895,7 +921,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------
@microsoft/1ds-core-js 3.2.3 - MIT
@microsoft/1ds-core-js 3.2.12 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme
copyright Microsoft 2018
@@ -903,11 +929,10 @@ copyright Microsoft 2019
Copyright (c) Microsoft Corporation
copyright Microsoft 2019 Simplified
Copyright (c) Microsoft and contributors
copyright Microsoft 2018 import AppInsightsCore as InternalCore
Copyright (c) Microsoft Corporation.
The MIT License (MIT)
MIT License
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -919,7 +944,7 @@ furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@@ -931,7 +956,7 @@ SOFTWARE.
---------------------------------------------------------
@microsoft/1ds-post-js 3.2.3 - MIT
@microsoft/1ds-post-js 3.2.12 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme
copyright Microsoft 2018
@@ -940,12 +965,11 @@ copyright Microsoft 2018-2020
copyright Microsoft 2022 Simple
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
copyright Microsoft 2018-2020 import IExtendedAppInsightsCore, SendRequestReason, EventSendType
copyright Microsoft 2018-2020 import IPerfManagerProvider, IValueSanitizer, FieldValueSanitizerType, FieldValueSanitizerFunc, SendRequestReason, EventSendType
copyright Microsoft 2018-2020 import EventSendType, FieldValueSanitizerFunc, FieldValueSanitizerType, IPerfManagerProvider, IValueSanitizer, SendRequestReason
Copyright (c) Microsoft Corporation.
The MIT License (MIT)
MIT License
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -957,7 +981,7 @@ furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@@ -969,134 +993,100 @@ SOFTWARE.
---------------------------------------------------------
@microsoft/applicationinsights-core-js 2.8.4 - MIT
@microsoft/applicationinsights-core-js 2.8.14 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
MIT License
The MIT License (MIT)
Copyright (c) Microsoft Corporation. All rights reserved.
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@microsoft/applicationinsights-shims 2.0.1 - MIT
@microsoft/applicationinsights-shims 2.0.2 - MIT
https://github.com/microsoft/ApplicationInsights-JS/tree/master/tools/shims
Copyright (c) Microsoft Corporation.
Copyright (c) Microsoft and contributors.
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
MIT License
The MIT License (MIT)
Copyright (c) Microsoft Corporation. All rights reserved.
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@microsoft/dynamicproto-js 1.1.6 - MIT
@microsoft/dynamicproto-js 1.1.9 - MIT
https://github.com/microsoft/DynamicProto-JS#readme
(c) James Halliday
Copyright (c) Microsoft Corporation
Copyright (c) 2012 Maximilian Antoni
Copyright (c) 2013 Maximilian Antoni
Copyright (c) 2020 Oliver Nightingale
Copyright (c) 2020 Oliver Nightingale A
Copyright (c) 2020 Oliver Nightingale An
Copyright (c) Microsoft and contributors
Copyright (c) 2010-2013 Christian Johansen
Copyright (c) 2010-2014 Christian Johansen
Copyright (c) 2011 Sven Fuchs, Christian Johansen
Copyright Joyent, Inc. and other Node contributors
Copyright jQuery Foundation and other contributors
Copyright 2013 jQuery Foundation, Inc. and other contributors
Copyright (c) 2010-2014, Christian Johansen, [email protected]
Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
Copyright 2006 Google Inc. https://code.google.com/p/google-diff-match-patch
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
---------------------------------------------------------
---------------------------------------------------------
@types/lodash 4.14.192 - MIT
https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash
The MIT License (MIT)
Copyright (c) Microsoft Corporation
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Copyright (c) <year> <copyright holders>
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
@@ -1132,6 +1122,26 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@xmldom/xmldom 0.8.8 - MIT
https://github.com/xmldom/xmldom
Copyright 2012 - 2017 jindw <[email protected]> and other contributors
Copyright 2019 - present Christopher J. Brody and other contributors
Copyright 2019 - present Christopher J. Brody and other contributors, as listed in: https://github.com/xmldom/xmldom/graphs/contributors
Copyright 2012 - 2017 @jindw <[email protected]> and other contributors, as listed in: https://github.com/jindw/xmldom/graphs/contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@@ -1167,7 +1177,7 @@ THE SOFTWARE.
---------------------------------------------------------
axios 0.22.0 - MIT
axios 0.26.1 - MIT
https://axios-http.com/
Copyright (c) 2014-present Matt Zabriskie
@@ -1197,7 +1207,7 @@ THE SOFTWARE.
---------------------------------------------------------
balanced-match 1.0.0 - MIT
balanced-match 1.0.2 - MIT
https://github.com/juliangruber/balanced-match
Copyright (c) 2013 Julian Gruber <[email protected]>
@@ -1344,6 +1354,38 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
brace-expansion 2.0.1 - MIT
https://github.com/juliangruber/brace-expansion
Copyright (c) 2013 Julian Gruber <[email protected]>
MIT License
Copyright (c) 2013 Julian Gruber <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@@ -1477,10 +1519,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
comment-json 4.1.1 - MIT
comment-json 4.2.3 - MIT
https://github.com/kaelzhang/node-comment-json#readme
Copyright (c) 2013
Copyright (c) 2013 kaelzhang
Copyright (c) 2013 kaelzhang <>, contributors
http://kael.me/
@@ -1537,7 +1579,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
core-util-is 1.0.2 - MIT
core-util-is 1.0.3 - MIT
https://github.com/isaacs/core-util-is#readme
Copyright Joyent, Inc. and other Node contributors
@@ -1704,7 +1746,7 @@ THE SOFTWARE.
---------------------------------------------------------
follow-redirects 1.14.8 - MIT
follow-redirects 1.15.2 - MIT
https://github.com/follow-redirects/follow-redirects
Copyright 2014-present Olivier Lalonde <[email protected]> , James Talmage <[email protected]> , Ruben Verborgh
@@ -1841,7 +1883,7 @@ THE SOFTWARE.
---------------------------------------------------------
is-glob 4.0.1 - MIT
is-glob 4.0.3 - MIT
https://github.com/micromatch/is-glob
Copyright (c) 2014-2017, Jon Schlinkert
@@ -1907,9 +1949,11 @@ THE SOFTWARE.
---------------------------------------------------------
json5 1.0.2 - MIT
json5 2.2.3 - MIT
http://json5.org/
(c) 2019 Denis Pushkarev
copyright (c) 2019 Denis Pushkarev
Copyright (c) 2012-2018 Aseem Kishore, and others
MIT License
@@ -1972,67 +2016,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
lodash 4.17.21 - MIT
https://lodash.com/
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.
---------------------------------------------------------
---------------------------------------------------------
minimist 1.2.7 - MIT
minimist 1.2.8 - MIT
https://github.com/minimistjs/minimist
@@ -2060,7 +2044,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
mkdirp 0.5.5 - MIT
mkdirp 0.5.6 - MIT
https://github.com/substack/node-mkdirp#readme
Copyright 2010 James Halliday ([email protected])
@@ -2222,11 +2206,11 @@ SOFTWARE.
---------------------------------------------------------
picomatch 2.2.2 - MIT
picomatch 2.3.1 - MIT
https://github.com/micromatch/picomatch
Copyright (c) 2017-present, Jon Schlinkert.
Copyright (c) 2017-present, Jon Schlinkert (https://github.com/jonschlinkert).
Copyright (c) 2017-present, Jon Schlinkert
Copyright (c) 2017-present, Jon Schlinkert (https://github.com/jonschlinkert)
The MIT License (MIT)
@@ -2251,41 +2235,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
plist 3.0.5 - MIT
https://github.com/TooTallNate/node-plist#readme
Copyright (c) 2010-2017 Nathan Rajlich <[email protected]>
(The MIT License)
Copyright (c) 2010-2017 Nathan Rajlich <[email protected]>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@@ -2387,8 +2336,8 @@ THE SOFTWARE.
---------------------------------------------------------
shell-quote 1.7.3 - MIT
https://github.com/substack/node-shell-quote
shell-quote 1.8.1 - MIT
https://github.com/ljharb/shell-quote
Copyright (c) 2013 James Halliday ([email protected])
@@ -2421,7 +2370,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
ssh-config 4.1.6 - MIT
ssh-config 4.2.1 - MIT
https://github.com/cyjake/ssh-config#readme
Copyright (c) 2017 Chen Yangjian
@@ -2542,7 +2491,7 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
---------------------------------------------------------
vscode-jsonrpc 8.1.0-next.5 - MIT
vscode-jsonrpc 8.1.0 - MIT
https://github.com/Microsoft/vscode-languageserver-node#readme
Copyright (c) Microsoft Corporation
@@ -2564,7 +2513,7 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
---------------------------------------------------------
vscode-languageclient 8.1.0-next.4 - MIT
vscode-languageclient 8.1.0 - MIT
https://github.com/Microsoft/vscode-languageserver-node#readme
Copyright (c) Microsoft Corporation
@@ -2586,7 +2535,7 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
---------------------------------------------------------
vscode-languageserver-protocol 3.17.3-next.4 - MIT
vscode-languageserver-protocol 3.17.3 - MIT
https://github.com/Microsoft/vscode-languageserver-node#readme
Copyright (c) Microsoft Corporation
@@ -2609,7 +2558,7 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
---------------------------------------------------------
vscode-languageserver-types 3.17.3-next.1 - MIT
vscode-languageserver-types 3.17.3 - MIT
https://github.com/Microsoft/vscode-languageserver-node#readme
Copyright (c) Microsoft Corporation
@@ -2631,10 +2580,10 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
---------------------------------------------------------
vscode-nls 5.0.0 - MIT
vscode-nls 5.2.0 - MIT
https://github.com/Microsoft/vscode-nls#readme
Copyright (c) Microsoft Corporation.
Copyright (c) Microsoft Corporation
The MIT License (MIT)
@@ -2659,7 +2608,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
---------------------------------------------------------
xmlbuilder 9.0.7 - MIT
xmlbuilder 15.1.1 - MIT
http://github.com/oozcitak/xmlbuilder-js
Copyright (c) 2013 Ozgur Ozcitak
@@ -2741,6 +2690,7 @@ The notices below are from non-npm sources.
- Mono (https://github.com/mono/mono)
- SQLite (https://www.sqlite.org/)
Includes:functions (from fossil) (https://fossil-scm.org)
- SoftFloat (http://www.jhauser.us/arithmetic/SoftFloat.html)
%% ANTLR NOTICES AND INFORMATION BEGIN HERE
=========================================
@@ -3683,3 +3633,43 @@ as representing official policies, either expressed or implied, of anybody
else.
=========================================
END OF SQLite NOTICES AND INFORMATION
%% SoftFloat NOTICES AND INFORMATION BEGIN HERE
=========================================
License for Berkeley SoftFloat Release 3e
John R. Hauser
2018 January 20
The following applies to the whole of SoftFloat Release 3e as well as to
each source file individually.
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the
University of California. 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.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 SoftFloat NOTICES AND INFORMATION
+25 -6
View File
@@ -1214,7 +1214,7 @@
"Tato direktiva pragma se nedá použít v operátoru __Pragma (musí se použít direktiva #pragma).",
"Pole používá koncové odsazení základní třídy.",
"Kompilátory GNU C++ můžou používat odsazení bitového pole.",
"%nd se deklarovalo jako zastaralé.",
"%n se deklarovalo jako zastaralé",
"Název asm není povolený u deklarace nestatického člena.",
"Nerozpoznaný typ formátovací funkce %sq se ignoruje.",
"Základní třída %no1 používá koncové odsazení základní třídy %no2.",
@@ -1443,7 +1443,7 @@
"Komplexní integrálové typy se nepodporují.",
"__real a __imag se dají použít jenom u komplexních hodnot.",
"__real/__imag se použilo na reálnou hodnotu.",
"%nd se deklarovalo jako zastaralé (%sq).",
"%n se deklarovalo jako zastaralé (%sq)",
"neplatná změna definice %nd",
"Došlo k použití dllimport/dllexport u člena nepojmenovaného oboru názvů.",
"Klíčové slovo __thiscall se může vyskytovat jenom u deklarací nestatických členských funkcí.",
@@ -3419,8 +3419,8 @@
"Když se vynechá seznam parametrů výrazu lambda, nepodporuje se klauzule requires na konci.",
"Požádalo se o neplatný oddíl modulu %sq.",
"Požádalo se nedefinovaný oddíl modulu %sq1 (předpokládalo se, že je to %sq2).",
"Pro oddíl %sq2 se požádalo o pozici v souboru %d1 (relativní pozice %d2) v modulu %sq1, pozice je ale prázdná.",
"Pro oddíl %sq2 se požádalo o pozici v souboru %d1 (relativní pozice %d2) v modulu %sq1, pozice ale předchází začátek oddílu.",
null,
null,
"Pro oddíl %sq2 se požádalo o pozici v souboru %d1 (relativní pozice %d2) v modulu %sq1, pozice ale přetéká konec svého oddílu.",
"Pro oddíl %sq2 se požádalo o pozici v souboru %d1 (relativní pozice %d2) v modulu %sq1, pozice ale není zarovnaná s elementy oddílu.",
"z dílčího pole %sq (relativní pozice k uzlu %d)",
@@ -3440,7 +3440,7 @@
"Vytvoření adresy funkce s explicitním this vyžaduje operátor &.",
"řetězcový literál nelze použít k inicializaci člena flexibilního pole.",
"Reprezentace IFC definice funkce %sq je neplatná.",
"byla provedena oprava vedoucí k zahození implicitní parametru this.",
null,
"graf UniLevel IFC se nepoužil k zadání parametrů.",
"V grafu definice parametrů IFC byl zadán tento počet parametrů: %d1, zatímco deklarace IFC určovala tento počet parametrů: %d2.",
"V grafu definice parametrů IFC byl zadán %d1 parametr, zatímco deklarace IFC určovala tento počet parametrů: %d2.",
@@ -3497,5 +3497,24 @@
"Aby bylo možné používat soubor modulu %sq (modul Microsoft Visual Studio IFC), musí být povolený režim Microsoftu.",
"soubor modulu %sq se nepovedlo otevřít",
"nalezeno v mapě modulu %sq.",
"nalezeno v mapě jednotek hlaviček pro %sq"
"nalezeno v mapě jednotek hlaviček pro %sq",
"nerozpoznaný režim výstupu (musí to být text, sarif): %s",
"možnost c23_typeof se dá použít jenom při kompilaci C",
"neplatné číslo verze Clang: %s",
"řetězec IFC obsahuje neočekávaný znak null (nula) v modulu %sq",
"bylo použito %d1 z %d2 bajtů",
"z informací o řetězci v oddílu %sq, elementu %d1 (pozice souboru %d2, relativní pozice %d3)",
"nejde vyhodnotit inicializátor pro člena flexibilního pole",
"výchozí inicializátor bitového pole je funkce C++20",
"příliš mnoho argumentů v seznamu argumentů šablony v modulu %sq",
"zjištěno pro argument šablony reprezentovaný %sq elementem %d1 (pozice souboru %d2, relativní pozice %d3)",
"příliš málo argumentů v seznamu argumentů šablony v modulu %sq",
"zjištěno při zpracování seznamu argumentů šablony reprezentovaného %sq elementem %d1 (pozice souboru %d2, relativní pozice %d3)",
"převod z vymezeného výčtového typu %t je nestandardní",
"zrušení přidělení se neshoduje s druhem přidělení (jedno je pro pole a druhé ne)",
"porovnání zahrnuje neznámou adresu (např. adresu slabé proměnné)",
"__make_signed je kompatibilní jenom s typem integer a výčtovým typem, které nejsou typu bool",
"__make_unsigned je kompatibilní jenom s typem integer a výčtovým typem, které nejsou typu bool",
"vnitřní název %sq bude odsud považován za běžný identifikátor",
"přístup k neinicializovanému podobjektu v indexu %d"
]
+26 -7
View File
@@ -1214,7 +1214,7 @@
"Dieses Pragma kann nicht in einem _Pragma-Operator verwendet werden (es muss eine #pragma-Direktive verwendet werden).",
"Das Feld verwendet die Endauffüllung einer Basisklasse.",
"GNU C++-Compiler verwenden möglicherweise eine Bitfeldauffüllung.",
"%nd wurde als veraltet deklariert",
"%n wurde als veraltet deklariert",
"In einer nicht statischen Memberdeklaration ist kein ASM-Name zulässig.",
"Unbekannter Formatfunktionstyp \"%sq\" wird ignoriert.",
"Die Basisklasse \"%no1\" verwendet die Endauffüllung von Basisklasse \"%no2\".",
@@ -1443,7 +1443,7 @@
"Komplexe integrale Typen werden nicht unterstützt.",
"__real und __imag können nur auf komplexe Werte angewendet werden.",
"__real/__imag wurde auf den tatsächlichen Wert angewendet.",
"%nd wurde als veraltet deklariert (%sq)",
"%n wurde als veraltet deklariert (%sq)",
"Ungültige Neudefinition von \"%nd\".",
"dllimport/dllexport wurde auf ein Member eines unbenannten Namespaces angewendet.",
"__thiscall kann nur in nicht statischen Memberfunktionsdeklarationen vorkommen.",
@@ -3419,8 +3419,8 @@
"eine „trailing-requires“-Klausel ist nicht zulässig, wenn die Lambda-Parameterliste ausgelassen wird",
"Modul %sq ungültige Partition angefordert",
"Modul %sq1 undefinierte Partition (könnte %sq2 sein) wurde angefordert",
"Modul %sq1 Dateiposition %d1 (relative Position %d2) wurde für Partition %sq2 angefordert die leer ist",
"Modul %sq1 Dateiposition %d1 (relative Position %d2) wurde für Partition %sq2 angefordert was dem Start der Partition vorausgeht",
null,
null,
"Modul %sq1 Dateiposition %d1 (relative Position %d2) wurde für die Partition %sq2 angefordert was das Ende ihrer Partition überschreitet",
"Modul %sq1 Dateiposition %d1 (relative Position %d2) wurde für die Partition %sq2 angefordert welche mit ihren Partitionselementen falsch ausgerichtet ist",
"von Unterfeld %sq (relative Position zum Knoten %d)",
@@ -3440,7 +3440,7 @@
"das Formatieren der Adresse einer expliziten „dies“-Funktion erfordert den Operator „&“",
"Ein Zeichenfolgenliteral kann nicht zum Initialisieren eines flexiblen Arraymembers verwendet werden.",
"Die IFC-Darstellung der Definition der Funktion %sq ist ungültig.",
"Es wurde eine Korrektur vorgenommen, um den impliziten „this“-Parameter zu löschen.",
null,
"Ein UniLevel-IFC-Chart wurde nicht zum Angeben von Parametern verwendet.",
"%d1 Parameter wurden im IFC-Parameterdefinitionschart angegeben, während %d2 Parameter in der IFC-Deklaration angegeben wurden.",
"%d1 Parameter wurde im IFC-Parameterdefinitionschart angegeben, während %d2 Parameter in der IFC-Deklaration angegeben wurden.",
@@ -3497,5 +3497,24 @@
"Der Microsoft-Modus muss aktiviert sein, um die Moduldatei %sq (ein Microsoft Visual Studio IFC-Modul) zu verwenden.",
"Die Moduldatei \"%sq\" konnte nicht importiert werden.",
"wurde in der Modulzuordnung für das Modul %sq gefunden",
"wurde in der Headereinheitszuordnung für %sq gefunden"
]
"wurde in der Headereinheitszuordnung für %sq gefunden",
"nicht erkannter Ausgabemodus (muss einer von text, sarif sein): %s",
"Die Option \"c23_typeof\" kann nur beim Kompilieren von C verwendet werden",
"ungültige Clang-Versionsnummer: %s",
"die IFC-Zeichenfolge enthält ein unerwartetes NULL-Zeichen (null) im Modul %sq",
"%d1 von %d2 Bytes wurden verwendet",
"aus Zeichenfolgeninformationen in Partition %sq Element %d1 (Dateiposition %d2, relative Position %d3)",
"ein Initialisierer für einen flexiblen Arraymember kann nicht ausgewertet werden",
"ein Standard-Bitfeldinitialisierer ist ein C++20-Feature",
"zu viele Argumente in der Vorlagenargumentliste im Modul %sq",
"für das Vorlagenargument erkannt, das durch das %sq-Element %d1 dargestellt wird (Dateiposition %d2, relative Position %d3)",
"zu wenige Argumente in der Vorlagenargumentliste im Modul %sq",
"wurde beim Verarbeiten der Vorlagenargumentliste erkannt, die durch das %sq-Element %d1 dargestellt wird (Dateiposition %d2, relative Position %d3)",
"die Konvertierung vom bereichsbezogenen Enumerationstyp \"%t\" entspricht nicht dem Standard",
"die Zuordnungsfreigabe stimmt nicht mit der Zuordnungsart überein (eine ist für ein Array und die andere nicht)",
"der Vergleich umfasst eine unbekannte Adresse (z. B. die Adresse einer schwachen Variablen)",
"__make_signed ist nur mit nicht booleschen Integer- und Enumerationstypen kompatibel",
"__make_unsigned ist nur mit nicht booleschen Integer- und Enumerationstypen kompatibel",
"der systeminterne Name\"%sq wird von hier aus als gewöhnlicher Bezeichner behandelt.",
"Zugriff auf nicht initialisiertes Teilobjekt bei Index %d"
]
+26 -7
View File
@@ -1214,7 +1214,7 @@
"esta pragma no se puede usar en un operador _Pragma (se debe usar una directiva #pragma)",
"el campo usa el relleno posterior de una clase base",
"los compiladores de GNU C++ pueden usar espacio de campo de bits",
"%nd se declaró como deprecated",
"%n se declaró desusado",
"no se permite un nombre asm en una declaración de miembro no estático",
"se ha omitido el tipo de función de formato %sq no reconocido",
"la clase base %no1 usa el espacio de cola de la clase base %no2",
@@ -1443,7 +1443,7 @@
"no se admiten los tipos enteros complejos",
"__real e __imag solo se pueden aplicar a valores complejos",
"se ha aplicado __real o __imag a un valor real",
"%nd se declaró como deprecated (%sq)",
"%n se declaró como deprecated (%sq)",
"nueva definición de %nd no válida",
"se ha aplicado dllimport/dllexport a un miembro de un espacio de nombres sin nombre",
"__thiscall solo puede aparecer en declaraciones de funciones miembro no estáticas",
@@ -3419,8 +3419,8 @@
"no se permite una cláusula trailing-requires-clause cuando se omite la lista de parámetros lambda",
"se solicitó una partición no válida del módulo %sq",
"módulo %sq1 partición no definida (se considera que es %sq2) solicitada",
"módulo %sq1, posición de archivo %d1 (posición relativa %d2) solicitada para la partición %sq2, que está vacía",
"módulo %sq1, posición de archivo %d1 (posición relativa %d2) solicitada para la partición %sq2, que es anterior al inicio de la partición",
null,
null,
"módulo %sq1, posición de archivo %d1 (posición relativa %d2) solicitada para la partición %sq2, que desborda el final de su partición",
"módulo %sq1 posición de archivo %d1 (posición relativa %d2) solicitada para la partición %sq2, que está mal alineada con sus elementos de particiones",
"desde el subcampo %sq (posición relativa al nodo %d)",
@@ -3440,7 +3440,7 @@
"la formación de la dirección de una función explícita 'this' requiere el operador '&'",
"no se puede usar un literal de cadena para inicializar un miembro de matriz flexible",
"La representación IFC de la definición de la función %sq no es válida",
"se realizó una corrección para quitar un parámetro \"this\" implícito",
null,
"no se usó un gráfico IFC UniLevel para especificar parámetros",
"el gráfico de definición de parámetros IFC especificó %d1 parámetros, mientras que la declaración IFC especificó %d2 parámetros",
"el gráfico de definición de parámetros IFC especificó %d1 parámetro, mientras que la declaración IFC especificó %d2 parámetros",
@@ -3497,5 +3497,24 @@
"El modo Microsoft debe estar habilitado para usar el archivo de módulo %sq (un módulo IFC de Microsoft Visual Studio).",
"no se pudo abrir el archivo de módulo %sq",
"se encuentra en la asignación de módulo para el módulo %sq",
"se encuentra en el mapa de unidad de encabezado para %sq"
]
"se encuentra en el mapa de unidad de encabezado para %sq",
"modo de salida no reconocido (debe ser uno de texto, sarif): %s",
"la opción 'c23_typeof' solo se puede usar al compilar C",
"número de versión de clang no válido: %s",
"La cadena IFC contiene un carácter nulo inesperado (cero) en el módulo %sq",
"Se usaron %d1 de %d2 bytes",
"de la información de la cadena %sq elemento %d1 (posición de archivo %d2, posición relativa %d3)",
"no se puede evaluar un inicializador para un miembro de matriz flexible",
"un inicializador de campo de bits predeterminado es una característica de C++20",
"demasiados argumentos en la lista de argumentos de plantilla en el módulo %sq",
"detectado para el argumento de plantilla representado por el elemento %sq %d1 (posición de archivo %d2, posición relativa %d3)",
"demasiado pocos argumentos en la lista de argumentos de plantilla en el módulo %sq",
"detectado al procesar la lista de argumentos de plantilla representada por el elemento %sq %d1 (posición de archivo %d2, posición relativa %d3)",
"la conversión del tipo de enumeración con ámbito %t no es estándar",
"la desasignación no coincide con la clase de asignación (una es para una matriz y la otra no)",
"la comparación implica una dirección desconocida (por ejemplo, la dirección de una variable débil)",
"__make_signed solo es compatible con tipos de enumeración y enteros no booleanos",
"__make_unsigned solo es compatible con tipos de enumeración y enteros no booleanos",
"el nombre intrínseco %sq se tratará como un identificador normal desde aquí",
"acceso al subobjeto no inicializado en el índice %d"
]
+25 -6
View File
@@ -1214,7 +1214,7 @@
"impossible d'utiliser ce pragma dans un opérateur _Pragma (une directive #pragma doit être utilisée)",
"le champ utilise le remplissage de fin d'une classe de base",
"les compilateurs C++ GNU peuvent utiliser le remplissage de champ de bits",
"%nd a été déclaré déconseillé",
"%n a été déclaré déconseillé",
"nom asm non autorisé sur une déclaration membre non statique",
"type de fonction de format non reconnu %sq ignoré",
"la classe de base %no1 utilise le remplissage de fin de la classe de base %no2",
@@ -1443,7 +1443,7 @@
"types intégraux complexes non pris en charge",
"__real et __imag ne peuvent s'appliquer qu'à des valeurs complexes",
"__real/__imag appliqué à une valeur réelle",
"%nd a été déclaré déconseillé (%sq)",
"%n a été déclaré déconseillé (%sq)",
"redéfinition non valide de %nd",
"dllimport/dllexport appliqué à un membre d'un espace de noms sans nom",
"__thiscall peut uniquement apparaître sur des déclarations de fonctions membres non statiques",
@@ -3419,8 +3419,8 @@
"une clause requires de fin nest pas autorisée lorsque la liste de paramètres lambda est omise",
"module %sq partition non valide demandée",
"module %sq1 partition non définie (on pense quil sagirait de %sq2) demandée",
"module %sq1 position de fichier %d1 (position relative %d2) demandée pour la partition %sq2, qui est vide",
"module %sq1 position de fichier %d1 (position relative %d2) demandée pour la partition %sq2, qui précède le début de la partition",
null,
null,
"module %sq1 position de fichier %d1 (position relative %d2) demandée pour la partition %sq2, qui dépasse la fin de sa partition",
"module %sq1 position de fichier %d1 (position relative %d2) demandée pour la partition %sq2, qui est mal alignée avec ses éléments de partitions",
"à partir du sous-champ %sq (position relative par rapport au nœud %d)",
@@ -3440,7 +3440,7 @@
"la création de ladresse dune fonction « this » explicite nécessite lopérateur '&'",
"impossible dutiliser un littéral de chaîne pour initialiser un membre de tableau flexible",
"La représentation IFC de la définition de la fonction %sq nest pas valide.",
"une correction a été apportée pour supprimer « ce » paramètre implicite.",
null,
"un graphique IFC UniLevel na pas été utilisé pour spécifier des paramètres.",
"%d1 paramètre a été spécifié par le graphique de définition de paramètres IFC alors que %d2 paramètres ont été spécifiés par la déclaration IFC.",
"%d1 paramètre a été spécifié par le graphique de définition de paramètres IFC alors que %d2 paramètres ont été spécifiés par la déclaration IFC.",
@@ -3497,5 +3497,24 @@
"Le mode Microsoft doit être activé pour utiliser le fichier de module %sq (module IFC Microsoft Visual Studio)",
"impossible douvrir le fichier de module %sq",
"trouvé dans le mappage de module pour le module %sq",
"trouvé dans le mappage dunité den-tête pour %sq"
"trouvé dans le mappage dunité den-tête pour %sq",
"mode de sortie non reconnu (doit être un mode texte, sarif) : %s",
"loption 'c23_typeof' ne peut être utilisée que lors de la compilation de C",
"numéro de version Clang non valide : %s",
"La chaîne IFC contient un caractère null inattendu (zéro) dans le module %sq",
"%d1 octet sur %d2 ont été utilisés",
"à partir de linformation de chaîne dans la partition %sq, élément %d1 (position de fichier %d2, position relative %d3)",
"ne peut pas évaluer un initialiseur pour un membre de tableau flexible",
"un initialiseur de champ de bits par défaut est une fonctionnalité C++20",
"beaucoup darguments dans la liste darguments du modèle du module %sq",
"détecté pour largument du modèle représenté par %sq élément %d1 (position de fichier %d2, position relative %d3)",
"nombre insuffisant darguments dans la liste darguments du modèle du module %sq",
"détecté lors du traitement de la liste darguments du modèle représentée par %sq élément %d1 (position du fichier %d2, position relative %d3)",
"conversion à partir du type d’énumération étendue %t nest pas standard",
"la désallocation ne correspond pas au genre dallocation (lun est pour un tableau et lautre non)",
"la comparaison implique une adresse inconnue (par exemple, ladresse dune variable faible)",
"__make_signed nest compatible quavec les types entier et enum non bool",
"__make_unsigned nest compatible quavec les types entier et enum non bool",
"le nom intrinsèque %sq sera considéré comme un identificateur ordinaire à partir dici",
"accès au sous-objet non initialisé à lindex %d"
]
+25 -6
View File
@@ -1214,7 +1214,7 @@
"impossibile utilizzare questa direttiva pragma in un operatore _Pragma. È necessario utilizzare una direttiva #pragma",
"nel campo viene utilizzato il riempimento finale di una classe base",
"nei compilatori GNU C++ è possibile utilizzare il riempimento dei campi di bit",
"%nd è stato dichiarato deprecato",
"%n è stato dichiarato deprecato",
"nome asm non consentito in una dichiarazione di membro non statica",
"il tipo di funzione formato non riconosciuto %sq è stato ignorato",
"nella classe base %no1 viene utilizzato il riempimento finale della classe base %no2",
@@ -1443,7 +1443,7 @@
"tipi integrali generici non supportati",
"__real e __imag possono essere applicati solo a valori complessi",
"__real/__imag applicato al valore reale",
"%nd è stato dichiarato deprecato (%sq)'",
"%n è stato dichiarato deprecato (%sq)",
"ridefinizione non valida di %nd",
"dllimport/dllexport applicato a un membro di uno spazio dei nomi senza nome",
"__thiscall può essere utilizzato solo in dichiarazioni di funzione membro non statiche",
@@ -3419,8 +3419,8 @@
"una clausola requires finale non è consentita quando l'elenco di parametri lambda viene omesso",
"modulo %sq partizione non valida richiesta",
"richiesta partizione non definita del modulo %sq1 (che si ritiene sia %sq2)",
"modulo %sq1 posizione file %d1 (posizione relativa %d2) richiesta per la partizione %sq2, che è vuota",
"modulo %sq1 posizione del file %d1 (posizione relativa %d2) richiesta per la partizione %sq2, che precede l'inizio della partizione",
null,
null,
"modulo %sq1 posizione del file %d1 (posizione relativa %d2) richiesta per la partizione %sq2, che causa l'overflow della fine della partizione",
"modulo %sq1 posizione file %d1 (posizione relativa %d2) richiesta per la partizione %sq2, che non è allineata con i relativi elementi di partizioni",
"dal sottocampo %sq (posizione relativa al nodo %d)",
@@ -3440,7 +3440,7 @@
"per formare l'indirizzo di una funzione esplicita 'this' è necessario l'operatore '&'",
"impossibile utilizzare un valore letterale stringa per inizializzare un membro di matrice flessibile",
"La rappresentazione IFC della definizione della funzione %sq non è valida",
"è stata apportata una correzione per eliminare un parametro 'this' implicito",
null,
"un grafico IFC UniLevel non è stato usato per specificare i parametri",
"%d1 parametri specificati dal grafico di definizione dei parametri IFC mentre %d2 parametri sono stati specificati dalla dichiarazione IFC",
"%d1 parametro è stato specificato dal grafico di definizione del parametro IFC mentre %d2 parametri sono stati specificati dalla dichiarazione IFC",
@@ -3497,5 +3497,24 @@
"È necessario abilitare la modalità Microsoft per usare il file del modulo %sq (un modulo IFC Microsoft Visual Studio)",
"non è stato possibile aprire il file del modulo %sq",
"trovato nella mappa dei moduli per il modulo %sq",
"trovato nella mappa delle unità intestazione per %sq"
"trovato nella mappa delle unità intestazione per %sq",
"Modalità di output non riconosciuta (deve essere una modalità di testo, sarif): %s",
"È possibile usare l'opzione 'c23_typeof' solo durante la compilazione in C",
"numero di versione clang non valido: %s",
"la stringa IFC contiene un carattere Null (zero) imprevisto nel modulo %sq",
"%d1 di %d2 byte usati",
"da informazioni stringa nella partizione %sq dellelemento %d1 (posizione file %d2, posizione relativa %d3)",
"non è possibile valutare un inizializzatore per un membro di matrice flessibile",
"un inizializzatore di campo di bit predefinito è una funzionalità di C++20",
"troppi argomenti nell'elenco degli argomenti del modello nel modulo %sq",
"rilevato per l'argomento del modello rappresentato dall'elemento %sq %d1 (posizione file %d2, posizione relativa %d3)",
"argomenti insufficienti nell'elenco degli argomenti del modello nel modulo %sq",
"rilevato durante l'elaborazione dell'elenco di argomenti del modello rappresentato dallelemento %sq %d1 (posizione file %d2, posizione relativa %d3)",
"la conversione dal tipo di enumerazione con ambito %t non è conforme allo standard",
"la deallocazione non corrisponde al tipo di allocazione (una è per una matrice e l'altra no)",
"il confronto include un indirizzo sconosciuto (ad esempio, l'indirizzo di una variabile debole)",
"__make_signed è compatibile solo con i tipi di numero intero ed enumerazione non booleani",
"__make_unsigned è compatibile solo con i tipi di numero intero ed enumerazione non booleani",
"il nome intrinseco %sq verrà trattato come un identificatore ordinario a partire da qui",
"accesso a un sotto-oggetto non inizializzato all'indice %d"
]
+25 -6
View File
@@ -1214,7 +1214,7 @@
"このプラグマは _Pragma 演算子内では使用できません (#pragma ディレクティブを使用する必要があります)",
"フィールドは基底クラスの後部埋め込みを使用しています",
"GNU C++ コンパイラはビット フィールドの埋め込みを使用できます",
"%nd は deprecated と宣言されました",
"%nが古い形式として宣言されました",
"asm 名は静的でないメンバー宣言では使用できません",
"認識されない形式の関数型 %sq は無視されました",
"基底クラス %no1 は基底クラス %no2 の後部埋め込みを使用します",
@@ -1443,7 +1443,7 @@
"複合整数型はサポートされていません",
"__real および __imag は複合値に対してのみ適用できます",
"__real/__imag が実数値に適用されています",
"%nd が deprecated (%sq) と宣言されました",
"%n が deprecated (%sq) として宣言されました",
"%nd の再定義が無効です",
"dllimport/dllexport が名前なし名前空間のメンバーに適用されています",
"____thiscall は非静的メンバー関数宣言でのみ使用できます",
@@ -3419,8 +3419,8 @@
"ラムダ パラメーター リストが省略されている場合、末尾の Requires 句は許可されません",
"モジュール %sq 無効なパーティションが要求されました",
"モジュール %sq1 個の未定義のパーティション (%sq2 と推定) が要求されました",
"モジュール %sq1 ファイル位置 %d1 (相対位置 %d2) がパーティション %sq2 に対して要求されました - これは空です",
"モジュール %sq1 ファイル位置 %d1 (相対位置 %d2) がパーティション %sq2 に対して要求されました - これはパーティションの始点より前です",
null,
null,
"モジュール %sq1 ファイル位置 %d1 (相対位置 %d2) がパーティション %sq2 に対して要求されました - これはそのパーティションの終点をオーバーフローしています",
"モジュール %sq1 ファイル位置 %d1 (相対位置 %d2) がパーティション %sq2 に対して要求されました - これはそのパーティション要素の整列誤りです",
"サブフィールド %sq から (ノード %d への相対位置)",
@@ -3440,7 +3440,7 @@
"明示的な 'this' 関数のアドレスの形成には '&' 演算子が必要です",
"文字列リテラルを柔軟な配列メンバーを初期化するのに使用することはできません",
"関数 %sq の定義の IFC 表現が無効です",
"暗黙的な `this` パラメーターを削除するように修正が行われました",
null,
"パラメーターの指定に UniLevel IFC グラフが使用されませんでした",
"%d1 個のパラメーターが IFC パラメーター定義グラフで指定されましたが、IFC 宣言では %d2 個のパラメーターが指定されました",
"%d1 個のパラメーターが IFC パラメーター定義グラフで指定されましたが、IFC 宣言では %d2 個のパラメーターが指定されました",
@@ -3497,5 +3497,24 @@
"モジュール ファイル %sq (Microsoft Visual Studio IFC モジュール) を使用するには、Microsoft モードを有効にする必要があります",
"モジュール ファイル %sq を開くことができませんでした",
"モジュール %sq のモジュール マップで見つかりました",
"%sq のヘッダー ユニット マップで見つかりました"
"%sq のヘッダー ユニット マップで見つかりました",
"認識できない出力モード (テキスト、sarif のいずれかである必要があります): %s",
"オプション 'c23_typeof' は C をコンパイルするときにのみ使用できます",
"無効な Clang バージョン番号: %s",
"IFC 文字列に、モジュール %sq 内の予期しない null (ゼロ) 文字が含まれています",
"%d2 バイト中 %d1 が使用されました",
"パーティション元 %sq 要素 %d1 (ファイル位置 %d2、相対位置 %d3) 内の文字列情報から",
"柔軟な配列メンバーの初期化子を評価できません",
"既定のビット フィールド初期化子は C++20 機能です",
"モジュール %sq 内のテンプレート引数リストの引数が多すぎます",
"%sq 要素 %d1 (ファイル位置 %d2、相対位置 %d3) で表されるテンプレート引数に対して検出されました",
"モジュール %sq 内のテンプレート引数リストの引数が少なすぎます",
"%sq 要素 %d1 (ファイル位置 %d2、相対位置 %d3) で表されるテンプレート引数リストの処理中に検出されました",
"スコープを持つ列挙型 %t からの変換は非標準です",
"割り当て解除の種類が一致割り当ての種類と一致しません (一方が配列用で、もう一方が配列用ではありません)",
"比較に不明なアドレス (弱い変数のアドレスなど) が含まれています",
"__make_signed はブール型以外の整数型および列挙型とのみ互換性があります",
"__make_unsigned はブール型以外の整数型および列挙型とのみ互換性があります",
"組み込み名前 %sq は、ここから通常の識別子として扱われます",
"インデックス %d にある初期化されていないサブオブジェクトへのアクセス"
]
+25 -6
View File
@@ -1214,7 +1214,7 @@
"_Pragma 연산자에서 이 pragma를 사용할 수 없습니다(#pragma 지시문을 사용해야 함).",
"필드에서 기본 클래스의 끝 채우기를 사용합니다.",
"GNU C++ 컴파일러는 비트 필드 채우기를 사용할 수 있습니다.",
"%nd이(가) deprecated로 선언되었습니다.",
"%n이(가) 사용되지 않음으로 선언되었습니다.",
"비정적 멤버 선언에서 asm 이름을 사용할 수 없습니다.",
"인식할 수 없는 형식의 함수 형식 %sq이(가) 무시되었습니다.",
"기본 클래스 %no1이(가) 기본 클래스 %no2의 끝 채우기를 사용합니다.",
@@ -1443,7 +1443,7 @@
"복소수 정수 계열 형식은 지원되지 않습니다.",
"__real 및 __imag는 복소수 값에만 적용할 수 있습니다.",
"__real/__imag가 실수 값에 적용되었습니다.",
"%nd이(가) deprecated (%sq)(으)로 선언되었습니다.",
"%n이(가) 사용되지 않음으로 선언되었습니다(%sq).",
"%nd의 재정의가 잘못되었습니다.",
"dllimport/dllexport가 명명되지 않은 네임스페이스의 멤버에 적용되었습니다.",
"__thiscall은 비정적 멤버 함수 선언에만 표시될 수 있습니다.",
@@ -3419,8 +3419,8 @@
"람다 매개 변수 목록을 생략하면 후행-requires 절이 허용되지 않습니다.",
"모듈 %sq 잘못된 파티션이 요청됨",
"모듈 %sq1 정의되지 않은 파티션(%sq2로 추정됨) 요청됨",
"%sq1 모듈 파일 위치 %d1(상대 위치 %d2)이(가) %sq2 파티션에 대해 요청되었습니다. 이 위치는 비어 있습니다.",
"%sq1 모듈 파일 위치 %d1(상대 위치 %d2)이(가) 파티션 %sq2에 대해 요청되었습니다. 이는 파티션의 시작을 선행합니다.",
null,
null,
"모듈 %sq1 파일 위치 %d1(상대 위치 %d2)이(가) 파티션의 끝을 오버플로하는 파티션 %sq2에 대해 요청되었습니다.",
"모듈 %sq1 파일 위치 %d1(상대 위치 %d2)이(가) 파티션 요소가 잘못 정렬된 파티션 %sq2에 대해 요청되었습니다.",
"하위 필드 %sq(노드 %d에 대한 상대 위치)에서",
@@ -3440,7 +3440,7 @@
"명시적 'this' 함수의 주소를 구성하려면 '&' 연산자가 필요합니다.",
"가변 배열 멤버를 초기화하는 데 문자열 리터럴을 사용할 수 없습니다.",
"함수 %sq의 정의에 대한 IFC 표현이 잘못되었습니다.",
"암시적 'this' 매개 변수를 삭제하도록 수정되었습니다.",
null,
"매개 변수를 지정하는 데 UniLevel IFC 차트가 사용되지 않았습니다.",
"%d1 매개 변수는 IFC 매개 변수 정의 차트에 의해 지정되었지만 %d2 매개 변수는 IFC 선언에 의해 지정되었습니다.",
"%d1 매개 변수는 IFC 매개 변수 정의 차트에 의해 지정되었지만 %d2 매개 변수는 IFC 선언에 의해 지정되었습니다.",
@@ -3497,5 +3497,24 @@
"모듈 파일 %sq(Microsoft Visual Studio IFC 모듈)을 사용하려면 Microsoft 모드를 활성화해야 합니다.",
"모듈 파일 %sq을(를) 열 수 없습니다.",
"모듈 %sq에 대한 모듈 맵에서 찾았습니다.",
"%sq의 헤더 단위 맵에서 찾았습니다."
"%sq의 헤더 단위 맵에서 찾았습니다.",
"인식할 수 없는 출력 모드(텍스트, Sarif 중 하나여야 함): %s",
"'c23_typeof' 옵션은 C를 컴파일할 때만 사용할 수 있습니다.",
"잘못된 clang 버전 번호: %s",
"IFC 문자열에 모듈 %sq에 예기치 않은 null(0) 문자가 포함되어 있습니다.",
"%d2바이트 중 %d1바이트를 사용했습니다.",
"파티션 %sq 요소 %d1의 문자열 정보에서(파일 위치 %d2, 상대 위치 %d3)",
"유연한 배열 멤버에 대한 이니셜라이저를 평가할 수 없습니다.",
"기본 비트 필드 이니셜라이저는 C++20 기능입니다.",
"%sq 모듈의 템플릿 인수 목록에 인수가 너무 많습니다.",
"%sq 요소 %d1(파일 위치 %d2, 상대 위치 %d3)이(가) 나타내는 템플릿 인수에 대해 검색되었습니다.",
"%sq 모듈의 템플릿 인수 목록에 인수가 너무 적습니다.",
"%sq 요소 %d1(파일 위치 %d2, 상대 위치 %d3)이(가) 나타내는 템플릿 인수 목록을 처리하는 동안 검색되었습니다.",
"범위가 지정된 열거형 형식 %t에서의 변환이 표준이 아닙니다.",
"할당 취소가 할당 종류와 일치하지 않습니다(하나는 배열용이고 다른 할당 종류는 일치하지 않음).",
"비교에는 알 수 없는 주소(예: 약한 변수의 주소)가 포함됩니다.",
"__make_signed 부울이 아닌 정수 및 열거형 형식과만 호환됩니다.",
"__make_unsigned 부울이 아닌 정수 및 열거형 형식과만 호환됩니다.",
"내장 이름 %sq은(는) 여기에서 일반 식별자로 처리됩니다.",
"인덱스 %d에서 초기화되지 않은 하위 개체에 대한 액세스"
]
+24 -5
View File
@@ -1214,7 +1214,7 @@
"tej pragmy nie można użyć w operatorze _Pragma (należy użyć dyrektywy #pragma)",
"pole używa dopełniania na końcu takiego jak w klasie bazowej",
"kompilatory GNU C++ mogą używać dopełniania pól bitowych",
"element %nd został zadeklarowany jako przestarzały",
"%n został zadeklarowany jako przestarzały",
"nazwa funkcji asm jest niedozwolona w deklaracji niestatycznej składowej",
"nierozpoznany typ funkcji formatu %sq został zignorowany",
"klasa bazowa %no1 używa dopełniania na końcu takiego jak w klasie bazowej %no2",
@@ -3419,8 +3419,8 @@
"klauzula trailing-requires-clause jest niedozwolona, gdy lista parametrów lambda zostanie pominięta",
"zażądano nieprawidłowej partycji modułu %sq",
"zażądano niezdefiniowanej partycji modułu %sq1 (prawdopodobnie %sq2)",
"zażądano modułu %sq1 pozycji pliku %d1 (pozycja względna %d2) dla partycji %sq2 — która jest pusta",
"zażądano modułu %sq1 pozycji pliku %d1 (względna pozycja %d2) dla partycji %sq2, która poprzedza rozpoczęcie partycji",
null,
null,
"zażądano modułu %sq1 pozycji pliku %d1 (pozycja względna %d2) dla partycji %sq2, która powoduje przepełnienie końca partycji",
"zażądano modułu %sq1 pozycji pliku %d1 (pozycja względna %d2) dla partycji %sq2, która jest nieprawidłowo wyrównana do jej elementów partycji",
"z podpola %sq (względne położenie w stosunku do węzła %d)",
@@ -3440,7 +3440,7 @@
"utworzenie adresu jawnej funkcji „this” wymaga operatora \"&\"",
"literału ciągu nie można użyć do zainicjowania elastycznej składowej tablicy",
"Reprezentacja IFC definicji funkcji %sq jest nieprawidłowa",
"korekta została wprowadzona w celu porzucenia niejawnego parametru „this”",
null,
"wykres IFC UniLevel nie został użyty do określenia parametrów",
"Parametry (%d1) zostały określone przez wykres definicji parametru IFC, podczas gdy parametry (%d2) zostały określone przez deklarację IFC",
"Parametry (%d1) zostały określone przez wykres definicji parametru IFC, podczas gdy parametry (%d2) zostały określone przez deklarację IFC",
@@ -3497,5 +3497,24 @@
"Aby można było używać pliku modułu %sq (modułu MICROSOFT Visual Studio IFC) musi być włączony tryb firmy Microsoft.",
"nie można otworzyć pliku modułu %sq",
"znaleziono w mapie modułu dla modułu %sq",
"znaleziono na mapie jednostki nagłówka dla %sq"
"znaleziono na mapie jednostki nagłówka dla %sq",
"nierozpoznany tryb wyjścia (musi być jednym z następujących: text, sarif): %s",
"opcji „c23_typeof” można użyć tylko podczas kompilowania elementu C",
"nieprawidłowy numer wersji clang: %s",
"Ciąg IFC zawiera nieoczekiwany znak null (zero) w module %sq",
"Użyto %d1 z %d2 bajtów",
"z ciągu informacji w partycji %sq element %d1 (pozycja pliku %d2, względna pozycja %d3)",
"nie może ocenić inicjatora dla elastycznego elementu członkowskiego tablicy",
"domyślny inicjator pola bitowego jest funkcją C++20",
"zbyt wiele argumentów na liście argumentów szablonu w module %sq",
"wykryty dla argumentu szablonu reprezentowanego przez element %sq %d1 (pozycja pliku %d2, położenie względne %d3)",
"zbyt mało argumentów na liście argumentów szablonu w module %sq",
"wykryty podczas przetwarzania listy argumentów szablonu reprezentowanej przez element %sq %d1 (pozycja pliku %d2, pozycja względna %d3)",
"konwersja z typu wyliczenia z zakresem %t jest niestandardowa",
"cofnięcie alokacji nie pasuje do rodzaju alokacji (jedna dotyczy tablicy, a druga nie)",
"porównanie obejmuje nieznany adres (np. adres słabej zmiennej)",
"__make_signed jest zgodna tylko z niepustymi typami liczb całkowitych i wyliczeniami",
"__make_unsigned jest zgodna tylko z nieliczbową liczbą całkowitą i typami wyliczenia",
"nazwa wewnętrzna %sq będzie traktowana jako zwykły identyfikator z tego miejsca",
"dostęp do odinicjowanego podobiektu w indeksie %d"
]
+25 -6
View File
@@ -1214,7 +1214,7 @@
"esse pragma não pode ser usado em um operador _Pragma (uma diretiva #pragma deve ser usada)",
"o campo usa proteção de origem para uma classe de base",
"compiladores GNU C++ podem usar proteção de campo de bit",
"%nd foi declarado 'obsoleto'",
"%n foi declarado preterido",
"um nome asm não é permitido em uma declaração de membro não estática",
"tipo de função de formato não conhecido %sq ignorado",
"a classe de base %no1 usa proteção de origem da classe de base %no2",
@@ -1443,7 +1443,7 @@
"os tipos integrais complexos não são suportados",
"__real e __imag somente podem ser aplicáveis a valores complexos",
"__real/__imag aplicado ao valor real",
"%nd foi declarado obsoleto (%sq)",
"%n foi declarado preterido (%sq)",
"redefinição inválida de %nd",
"dllimport/dllexport aplicado a um membro de um namespace não nomeado",
"__thiscall somente pode ser exibido em declarações de função de membro não estático",
@@ -3419,8 +3419,8 @@
"uma cláusula-requer à direita não é permitida quando a lista de parâmetros lambda é omitida",
"módulo %sq partição inválida solicitada",
"módulo %sq1 partição indefinida (acredita-se que seja %sq2) solicitada",
"módulo %sq1 posição de arquivo %d1 (posição relativa %d2) solicitada para a partição %sq2 - que está vazia",
"módulo %sq1 posição de arquivo %d1 (posição relativa %d2) solicitada para a partição %sq2 - que impede o início da partição",
null,
null,
"módulo %sq1 posição de arquivo %d1 (posição relativa %d2) solicitada para a partição %sq2 - que estoura o final de sua partição",
"módulo %sq1 posição de arquivo %d1 (posição relativa %d2) solicitada para a partição %sq2 - que está desalinhada com seus elementos de partições",
"do subcampo %sq (posição relativa ao nó %d)",
@@ -3440,7 +3440,7 @@
"formar o endereço de uma função 'this' explícita requer o operador '&'",
"um literal de cadeia de caracteres não pode ser usado para inicializar um membro de matriz flexível",
"A representação IFC da definição da função %sq é inválida",
"foi feita uma correção para descartar um parâmetro 'this' implícito",
null,
"um gráfico UNILevel IFC não foi usado para especificar parâmetros",
"%d1 parâmetros foram especificados pelo gráfico de definição de parâmetro IFC, enquanto %d2 parâmetros foram especificados pela declaração IFC",
"O parâmetro %d1 foi especificado pelo gráfico de definição de parâmetro IFC, enquanto %d2 parâmetros foram especificados pela declaração IFC",
@@ -3497,5 +3497,24 @@
"O modo Microsoft deve estar ativado para usar o arquivo de módulo %sq (um módulo IFC do Microsoft Visual Studio)",
"não foi possível abrir o arquivo de módulo %sq",
"encontrado no mapa de módulo para o módulo %sq",
"encontrado no mapa de unidade de cabeçalho para %sq"
"encontrado no mapa de unidade de cabeçalho para %sq",
"modo de saída não reconhecido (deve ser um texto, sarif): %s",
"a opção 'c23_typeof' pode ser usada somente ao compilar C",
"número de versão clang inválido: %s",
"A cadeia de caracteres IFC contém um caractere nulo (zero) inesperado no módulo %sq",
"%d1 de %d2 bytes foram usados",
"de informações de cadeia de caracteres na partição %sq elemento %d1 (posição do arquivo %d2, posição relativa %d3)",
"não é possível avaliar um inicializador para um membro de matriz flexível",
"um inicializador de campo de bit padrão é um recurso C++20",
"muitos argumentos na lista de argumentos do modelo no módulo %sq",
"detectado para o argumento de modelo representado pelo elemento %sq %d1 (posição do arquivo %d2, posição relativa %d3)",
"poucos argumentos na lista de argumentos do modelo no módulo %sq",
"detectado durante o processamento da lista de argumentos do modelo representada pelo elemento %sq %d1 (posição do arquivo %d2, posição relativa %d3)",
"a conversão do tipo de enumeração com escopo %t não é padrão",
"a desalocação não corresponde ao tipo de alocação (uma é para uma matriz e a outra não)",
"comparação envolve endereço desconhecido (por exemplo, o endereço de uma variável fraca)",
"__make_signed é compatível apenas com tipos inteiros e enum não bool",
"__make_unsigned só é compatível com inteiros não bool e tipos enum",
"o nome intrínseco %sq será tratado como um identificador comum a partir daqui",
"acesso ao subobjeto não inicializado no índice %d"
]
+25 -6
View File
@@ -1214,7 +1214,7 @@
"эту директиву pragma нельзя использовать в операторе _Pragma (следует использовать директиву #pragma)",
"в поле используется выравнивание хвостового элемента базового класса",
"компиляторы GNU C++ могут использовать выравнивание битового поля",
"%nd объявлено как deprecated",
"%n объявлено как deprecated",
"использование имени ассемблерного кода в объявлении нестатического члена не допускается",
"нераспознанный тип функции формата %sq пропущен",
"в базовом классе %no1 используется выравнивание хвостового элемента базового класса %no2",
@@ -1443,7 +1443,7 @@
"сложные целые типы не поддерживаются",
"__real и __imag могут применяться только к комплексным значениям",
"__real или __imag применяется к действительному значению",
"%nd объявлено как deprecated (%sq)",
"%n объявлено как deprecated (%sq)",
"недопустимое повторное объявление %nd",
"dllimport или dllexport применяется к члену неименованного пространства имен",
"__thiscall может использоваться только в объявлениях статических функций-членов",
@@ -3419,8 +3419,8 @@
"конечное предложение requires не допускается, если список лямбда-параметров опущен",
"запрошен недопустимый раздел модуля %sq",
"запрошен неопределенный раздел модуля %sq1 (предполагается — %sq2)",
"модуль %sq1, позиция файла %d1 (относительная позиция %d2) запрошена для раздела %sq2, который пуст",
"модуль %sq1, позиция файла %d1 (относительная позиция %d2) запрошена для раздела %sq2, который находится перед началом раздела",
null,
null,
"модуль %sq1, позиция файла %d1 (относительная позиция %d2) для раздела %sq2, который переполняет окончание этого раздела",
"модуль %sq1, позиция файла %d1 (относительная позиция %d2) запрошена для раздела %sq2, который не выровнен по элементам разделов",
"из подполя %sq (относительное положение к узлу %d)",
@@ -3440,7 +3440,7 @@
"для формирования адреса явной функции \"this\" требуется оператор \"&\"",
"строковый литерал нельзя использовать для инициализации элемента гибкого массива",
"Представление IFC определения функции %sq недопустимо",
"внесено исправление для удаления неявного параметра \"this\"",
null,
"диаграмма IFC UniLevel не использовалось для указания параметров",
"несколько (%d1) параметров указаны в диаграмме определения параметров IFC, в то время как несколько (%d2) параметров указаны в объявлении IFC",
"%d1 параметр указан в диаграмме определения параметров IFC, в то время как несколько (%d2) параметров указаны в объявлении IFC",
@@ -3497,5 +3497,24 @@
"Для использования файла модуля %sq должен быть включен режим Майкрософт (модуль IFC Microsoft Visual Studio)",
"не удалось открыть файл модуля %sq",
"найдено в сопоставлении модулей для модуля %sq",
"найдено в сопоставлении единиц заголовка для %sq"
"найдено в сопоставлении единиц заголовка для %sq",
"нераспознанный режим вывода (должен быть одним из текстовых, sarif): %s",
"параметр 'c23_typeof' можно использовать только при компиляции С",
"недопустимый номер версии Clang: %s",
"Строка IFC содержит непредвиденный символ NULL (ноль) в модуле %sq",
"Использовано байт: %d1 из %d2",
"из сведений строки раздела %sq, элемент %d1 (позиция файла %d2, относительная позиция %d3)",
"не удается оценить инициализатор для элемента гибкого массива",
"стандартный инициализатор битового поля является функцией C++20",
"слишком много аргументов в списке аргументов шаблона в модуле %sq",
"обнаружено для аргумента шаблона, представленного элементом %sq %d1 (позиция файла %d2, относительная позиция %d3)",
"слишком мало аргументов в списке аргументов шаблона в модуле %sq",
"обнаружено при обработке для списка аргументов шаблона, представленного элементом %sq %d1 (позиция файла %d2, относительная позиция %d3)",
"преобразование из типа ограниченного перечисления %t является нестандартным",
"освобождение не соответствует типу выделения (одно из них для массива, а другое нет)",
"сравнение включает неизвестный адрес (например, адрес слабой переменной)",
"__make_signed совместимо только с нелогическими целыми числами и типами перечислений",
"__make_unsigned совместимо только с нелогическими целыми числами и типами перечислений",
"внутреннее имя %sq будет рассматриваться с этого момента как обычный идентификатор",
"доступ к неинициализированному подобъекту в индексе %d"
]
+25 -6
View File
@@ -1214,7 +1214,7 @@
"bu pragma bir _Pragma işleci içinde kullanılamaz (bir #pragma yönergesi kullanılmalı)",
"alan, bir temel sınıfın kuyruk dolgusunu kullanıyor",
"GNU C++ derleyicileri bit alanı dolgusu kullanabilir",
"%nd kullanım dışı olarak bildirildi",
"%n kullanımdan kaldırıldığı bildirildi",
"statik olmayan bir üye bildiriminde bir asm adına izin verilmiyor",
"tanınmayan biçim işlevi türü %sq yoksayılıyor",
"temel %no1 sınıfı, temel %no2 sınıfının kuyruk dolgusunu kullanıyor",
@@ -1443,7 +1443,7 @@
"karmaşık tam sayı türleri desteklenmiyor",
"__real ve __imag yalnızca karmaşık değerlere uygulanabilir",
"__real/__imag gerçek değere uygulandı",
"%nd kullanım dışı olarak bildirildi (%sq)",
"%n kullanımdan kaldırıldı (%sq) olarak bildirildi",
"%nd öğesinin yeniden tanımlanması geçersiz",
"dll/dllexport adlandırılmamış bir ad uzayının bir üyesine uygulanıyor",
"__thiscall, yalnızca statik olmayan üye işlev bildirimlerinde bulunabilir",
@@ -3419,8 +3419,8 @@
"lambda parametre listesi atlandığında trailing-requires-clausea izin verilmez",
"%sq modülünün geçersiz bölümü istendi",
"%sq1 modülünün tanımsız bölümü (%sq2 olduğu düşünülüyor) istendi",
"%sq1 modülünün %d1 dosya konumu (%d2 göreli konumu) boş olan %sq2 bölümü için istekte bulundu",
"%sq1 modülünün %d1 dosya konumu (%d2 göreli konumu) bölümün başlangıcından önce gelen %sq2 bölümü için istekte bulundu",
null,
null,
"%sq1 modülünün %d1 dosya konumu (%d2 göreli konumu) bölümünün sonundan taşan %sq2 bölümü için istekte bulundu",
"%sq1 modülünün %d1 dosya konumu (%d2 göreli konumu) bölüm öğeleriyle yanlış hizalanan %sq2 bölümü için istekte bulundu",
"%sq alt alanından (%d düğümüne göreli olan konum)",
@@ -3440,7 +3440,7 @@
"açık 'this' işlevine ait adresin oluşturulabilmesi için '&' operatörü gerekir",
"sabit değerli dize, esnek bir dizi üyesini başlatmak için kullanılamaz",
"%sq işlevine ait tanımın IFC gösterimi geçersiz",
"örtük this parametresini kaldırmak için bir düzeltme yapıldı",
null,
"parametreleri belirtmek için UniLevel IFC grafiği kullanılmadı",
"%d1 parametre IFC parametre tanım grafiği tarafından belirtilirken %d2 parametre IFC bildirimi tarafından belirtildi",
"%d1 parametre IFC parametre tanım grafiği tarafından belirtilirken %d2 parametre IFC bildirimi tarafından belirtildi",
@@ -3497,5 +3497,24 @@
"Microsoft modu, %sq modül dosyasını (Microsoft Visual Studio IFC modülü) kullanmak için etkinleştirilmelidir",
"%sq modül dosyası açılamadı",
"%sq modülü için modül eşlemesinde bulundu",
"%sq için üst bilgi birimi eşlemesinde bulundu"
"%sq için üst bilgi birimi eşlemesinde bulundu",
"tanınmayan çıkış modu (metin, sarif olmalıdır): %s",
"'c23_typeof' seçeneği yalnızca C derlerken kullanılabilir",
"geçersiz clang sürüm numarası: %s",
"IFC dizesi, %sq modülünde beklenmeyen boş (sıfır) karakter içeriyor",
"%d2 bayttan %d1'i kullanıldı",
"%sq bölümündeki %d1 öğesinden (%d2 dosya konumu, %d3 göreli konumu)",
"esnek bir dizi üyesi için bir başlatıcıyı değerlendiremez",
"varsayılan bir bit alanı başlatıcı, bir C++20 özelliğidir",
"%sq modülündeki şablon argüman listesinde çok fazla argüman var",
"%sq öğesi %d1 tarafından temsil edilen şablon bağımsız değişkeni için algılandı (dosya konumu %d2, göreli konum %d3)",
"%sq modülündeki şablon argüman listesinde çok az argüman var",
"%sq öğesi %d1 tarafından temsil edilen şablon bağımsız değişken listesi işlenirken algılandı (dosya konumu %d2, göreli konum %d3)",
"%t kapsamlı sabit listesi türünden dönüştürme standart değil",
"serbest bırakma, tahsis türüyle eşleşmiyor (biri bir dizi için, diğeri değil)",
"karşılaştırma, bilinmeyen adresi içerir (örneğin, zayıf bir değişkenin adresi)",
"__make_signed yalnızca bool olmayan tamsayı ve sabit listesi türleri ile uyumludur",
"__make_unsigned yalnızca bool olmayan tamsayı ve sabit listesi türleriyle uyumludur",
"%sq gerçek adı buradan sıradan bir tanımlayıcı olarak ele alınacaktır.",
"%d dizinindeki başlatılmamış alt nesneye erişim"
]
+25 -6
View File
@@ -1214,7 +1214,7 @@
"此 pragma 不能在 _Pragma 运算符中使用(必须使用 #pragma 指令)",
"字段使用基类的末尾填充",
"GNU C++ 编译器可以使用位域填充",
"%nd 声明为已否决",
"%n 声明为弃用",
"非静态成员声明中不允许使用 asm 名称",
"已忽略无法识别格式的函数类型 %sq",
"基类 %no1 使用基类 %no2 的尾部填充",
@@ -1443,7 +1443,7 @@
"不支持复杂整型",
"__real 和 __imag 只能应用于复数值",
"__real/__imag 适用于实数值",
"%nd 声明为已否决(%sq)",
"%n 声明为弃用(%sq)",
"%nd 重新定义无效",
"dllimport/dllexport 适用于未命名命名空间的成员",
"__thiscall 只能出现在非静态成员函数声明中",
@@ -3419,8 +3419,8 @@
"当省略 lambda 参数列表时,不允许使用尾随 Requires 子句",
"已请求模块 %sq 无效分区",
"已请求模块 %sq1 未定义分区(被认为是 %sq2)",
"已请求模块 %sq1 文件位置 %d1 (相对位置 %d2),针对分区 %sq2 请求 - 为空",
"已请求模块 %sq1 文件位置 %d1 (相对位置 %d2),针对分区 %sq2 请求 - 分区开始前",
null,
null,
"已请求模块 %sq1 文件位置 %d1 (相对位置 %d2),针对分区 %sq2 请求 - 溢出其分区的末尾",
"已请求模块 %sq1 文件位置 %d1 (相对位置 %d2),针对分区 %sq2 - 与其分区元素不一致",
"从子域 %sq (相对于节点 %d 的位置)",
@@ -3440,7 +3440,7 @@
"形成显式 'this' 函数的地址需要 '&' 运算符",
"字符串文本无法用于初始化灵活数组成员",
"函数 %sq 定义的 IFC 表示形式无效",
"已进行更正以删除隐式 “this” 参数",
null,
"未将 UniLevel IFC 图表用于指定参数",
"%d1 参数由 IFC 参数定义图表指定,而 %d2 参数由 IFC 声明指定",
"%d1 参数由 IFC 参数定义图表指定,而 %d2 参数由 IFC 声明指定",
@@ -3497,5 +3497,24 @@
"必须启用 Microsoft 模式才能使用模块文件 %sq (Microsoft Visual Studio IFC 模块)",
"无法打开模块文件 %sq",
"在模块 %sq 的模块映射中找到",
"在 %sq 的标头单元映射中找到"
"在 %sq 的标头单元映射中找到",
"无法识别的输出模式(必须是文本或 sarif 格式中的一种): %s",
"\"c23_typeof\" 选项只能在编译 C 时使用",
"无效的 clang 版本号: %s",
"IFC 字符串在模块 %sq 中包含意外的 null (零) 字符",
"使用了 %d1 个字节(共 %d2 个字节)",
"来自分区 %sq 元素 %d1 (文件位置 %d2,相对位置 %d3) 中的字符串信息",
"无法计算灵活数组成员的初始值设定项",
"默认位字段初始化表达式是 C++20 的特性。",
"模块 %sq 的模板参数列表中的参数太多",
"检测到由 %sq 元素 %d1 表示的模板参数(文件位置 %d2,相对位置 %d3)",
"模块 %sq 的模板参数列表中的参数太少",
"在处理由 %sq 元素 %d1 表示的模板参数列表时检测到(文件位置 %d2,相对位置 %d3)",
"从作用域内枚举类型 %t 转换为非标准",
"解除分配与分配类型不匹配(一种用于数组,另一种不匹配)",
"比较涉及未知地址(例如弱变量的地址)",
"__make_signed 仅与非布尔整数和枚举类型兼容",
"__make_unsigned 仅与非布尔整数和枚举类型兼容",
"内部名称 %sq 将从此处视为普通标识符",
"访问索引为 %d 的未初始化的子对象"
]
+25 -6
View File
@@ -1214,7 +1214,7 @@
"這個 pragma 不能用於 _Pragma 運算子 (必須使用 #pragma 指示詞)",
"欄位使用基底類別的尾端填補",
"GNU C++ 編譯器可以使用位元欄位填補",
"%nd 宣告為已被取代",
"%n 宣告為已被取代",
"非靜態成員宣告不能有 asm 名稱",
"已忽略無法辨認的格式函式類型 %sq",
"基底類別 %no1 使用基底類別 %no2 的尾端填補字元",
@@ -1443,7 +1443,7 @@
"不支援複雜整數類資料類型",
"__real 和 __imag 只能套用至複雜值",
"__real/__imag 已套用至實數值",
"%nd 宣告為已被取代 (%sq)'",
"%nd 宣告為已被取代 (%sq)",
"%nd 的重新定義無效",
"dllimport/dllexport 已套用至未命名的命名空間的成員",
"__thiscall 只能出現在非靜態成員函式宣告上",
@@ -3419,8 +3419,8 @@
"省略 Lambda 參數清單時,不允許後置 Requires 子句",
"模組 %sq 要求的分割區無效",
"模組 %sq1 已要求未定義的分割區 (相信是 %sq)",
"模組 %sq1 檔案位置 %d1 (相對位置 %d2) 要求分割區 %sq2 - 是空的",
"模組 %sq1 檔案位置 %d1 (相對位置 %d2) 要求分割區 %sq2 - 在分割區開始之前",
null,
null,
"模組 %sq1 檔案位置 %d1 (相對位置 %d2) 要求分割區 %sq2 - 溢出其分割區的結尾",
"模組 %sq1 檔案位置 %d1 (相對位置 %d2) 要求分割區 %sq2 - 與其分割區元素對齊錯誤",
"從 subfield %sq (節點 %d 的相對位置)",
@@ -3440,7 +3440,7 @@
"形成明確 'this' 函數的位址需要 '&' 運算子",
"字串常值不能用來初始化彈性陣列成員",
"函數 %sq 定義的 IFC 表示法無效",
"已進行更正以捨棄隱含的 'this' 參數",
null,
"UniLevel IFC 圖表未用來指定參數",
"IFC 參數定義圖表指定了 %d1 個參數,而 IFC 宣告則指定了 %d2 個參數",
"IFC 參數定義圖表指定了 %d1 個參數,而 IFC 宣告則指定了 %d2 個參數",
@@ -3497,5 +3497,24 @@
"必須啟用 Microsoft 模式,才能使用模組檔案 %sq (Microsoft Visual Studio IFC 模組)",
"無法開啟模組檔案 %sq",
"在模組對應中找到模組 %sq",
"在標頭單元對應中找到 %sq"
"在標頭單元對應中找到 %sq",
"無法辨識的輸出模式 (必須是文字或 SARIF): %s",
"選項 'c23_typeof' 只能在編譯 C 時使用",
"無效的 Clang 版本編號: %s",
"IFC 字串在模組 %sq 中包含未預期的 Null (零) 字元",
"%d2 個位元組中已使用 %d1 個",
"來自分割區 %sq 元素 %d1 (檔案位置 %d2,相對位置 %d3) 中的字串資訊",
"無法評估彈性陣列成員的初始設定式",
"預設的位元欄位初始設定式為 C++20 功能",
"模組 %sq 中範本引數清單中的引數太多",
"偵測到 %sq 元素 %d1 所代表的範本引數 (檔案位置 %d2,相對位置 %d3)",
"模組 %sq 中範本引數清單中的引數太少",
"在處理 %sq 元素 %d1 所代表的範本引數清單時偵測到 (檔案位置 %d2,相對位置 %d3)",
"從範圍列舉類型 %t 轉換為非標準",
"解除配置和配置種類不相符 (一個是針對陣列,另一個則不是)",
"比較包含未知的位址 (例如弱式變數的位址)",
"__make_signed 只和非布林值整數和列舉類型相容",
"__make_unsigned 只和非布林值整數和列舉類型相容",
"在這裡會將內部名稱 %sq 視為一般識別碼",
"存取索引 %d 中未初始化的子物件"
]
+20 -20
View File
@@ -6,7 +6,7 @@
'use strict';
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const eslint = require('gulp-eslint-new');
const fs = require('fs');
const nls = require('vscode-nls-dev');
const path = require('path');
@@ -67,7 +67,7 @@ const allTypeScript = [
gulp.task('lint', function () {
return gulp.src(allTypeScript)
.pipe(eslint({ configFile: ".eslintrc.js" }))
.pipe(eslint({ overrideConfigFile: ".eslintrc.js" }))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
@@ -248,25 +248,25 @@ gulp.task("translations-export", (done) => {
// Merge files from all source streams
es.merge(jsStream, htmlStream, jsonSchemaStream)
// Filter down to only the files we need
.pipe(filter(['**/*.nls.json', '**/*.nls.metadata.json']))
// Filter down to only the files we need
.pipe(filter(['**/*.nls.json', '**/*.nls.metadata.json']))
// Consoldate them into nls.metadata.json, which the xlf is built from.
.pipe(nls.bundleMetaDataFiles('ms-vscode.cpptools', '.'))
// Consoldate them into nls.metadata.json, which the xlf is built from.
.pipe(nls.bundleMetaDataFiles('ms-vscode.cpptools', '.'))
// filter down to just the resulting metadata files
.pipe(filter(['**/nls.metadata.header.json', '**/nls.metadata.json']))
// filter down to just the resulting metadata files
.pipe(filter(['**/nls.metadata.header.json', '**/nls.metadata.json']))
// Add package.nls.json, used to localized package.json
.pipe(gulp.src(["package.nls.json"]))
// Add package.nls.json, used to localized package.json
.pipe(gulp.src(["package.nls.json"]))
// package.nls.json and nls.metadata.json are used to generate the xlf file
// Does not re-queue any files to the stream. Outputs only the XLF file
.pipe(nls.createXlfFiles(translationProjectName, translationExtensionName))
.pipe(gulp.dest(path.join("..", `${translationProjectName}-localization-export`)))
.pipe(es.wait(() => {
done();
}));
// package.nls.json and nls.metadata.json are used to generate the xlf file
// Does not re-queue any files to the stream. Outputs only the XLF file
.pipe(nls.createXlfFiles(translationProjectName, translationExtensionName))
.pipe(gulp.dest(path.join("..", `${translationProjectName}-localization-export`)))
.pipe(es.wait(() => {
done();
}));
});
@@ -290,9 +290,9 @@ gulp.task("translations-import", (done) => {
.pipe(nls.prepareJsonFiles())
.pipe(gulp.dest(path.join("./i18n", language.folderName)));
}))
.pipe(es.wait(() => {
done();
}));
.pipe(es.wait(() => {
done();
}));
});
// ****************************
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"running.tagparser.text": "分析工作区",
"paused.tagparser.text": "分析工作区: 已暂停",
"complete.tagparser.text": "分析完毕",
"initializing.tagparser.text": "正在初始化工作区",
"indexing.tagparser.text": "正在索引工作区",
"rescan.tagparse.text": "重新扫描工作区",
"c.cpp.parsing.open.files.tooltip": "正在分析打开的文件",
"click.to.preview": "单击以预览结果",
"updating.intellisense.tooltip": "正在更新 IntelliSense",
"updating.intellisense.text": "IntelliSense: 正在更新",
"idle.intellisense.text": "IntelliSense: 就绪",
"absent.intellisense.text": "IntelliSense: 未配置",
"running.analysis.text": "Code Analysis: 正在运行",
"paused.analysis.text": "Code Analysis: 已暂停",
"mode.analysis.prefix": "Code Analysis 模式:",
"c.cpp.configureIntelliSenseStatus.text": "配置 IntelliSense",
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ 配置 IntelliSense",
"select.command": "选择命令...",
"select.code.analysis.command": "选择代码分析命令...",
"c.cpp.configuration.tooltip": "C/C++ 配置",
"c.cpp.references.statusbar": "C/C++ 引用状态",
"c.cpp.intellisense.statusbar": "C/C++ IntelliSense 状态",
"c.cpp.tagparser.statusbar": "C/C++ 标记分析器状态",
"discovering.files.tooltip": "正在发现文件",
"running.analysis.tooltip": "正在运行 {0}",
"code.analysis.paused.tooltip": "已暂停 {0}",
"running.analysis.processed.tooltip": "正在运行 {0}: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "C/C++ IntelliSense 状态",
"cpptools.status.tagparser": "C/C++ 标记分析器状态",
"cpptools.detail.tagparser": "正在初始化...",
"cpptools.status.codeanalysis": "C/C++ Code Analysis 状态",
"c.cpp.codeanalysis.statusbar.runNow": "立即运行",
"tagparser.pause.text": "暂停",
"tagparser.resume.text": "继续",
"intellisense.select.text": "选择编译器",
"rescan.intellisense.text": "重新扫描",
"rescan.intellisense.tooltip": "重新扫描 IntelliSense",
"mode.codeanalysis.status.automatic": "自动",
"mode.codeanalysis.status.manual": "手动",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "选项",
"startup.codeanalysis.status": "正在启动...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "立即运行",
"running.analysis.processed.tooltip": "正在运行: {0}/{1} ({2}%)",
"select.a.configuration": "选择配置...",
"edit.configuration.ui": "编辑配置(UI)",
"edit.configuration.json": "编辑配置(JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "取消",
"resume.analysis": "继续",
"pause.analysis": "暂停",
"another.analysis": "启动另一个..."
"another.analysis": "启动另一个...",
"active.analysis": "在活动文件上运行 Code Analysis",
"all.analysis": "在所有文件上运行 Code Analysis",
"open.analysis": "在打开的文件上运行 Code Analysis"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"c.cpp.parsing.open.files.tooltip": "正在剖析開啟的檔案",
"running.tagparser.text": "剖析工作區",
"paused.tagparser.text": "剖析工作區: 已暫停",
"complete.tagparser.text": "剖析完成",
"initializing.tagparser.text": "正在初始化工作區",
"indexing.tagparser.text": "索引工作區",
"rescan.tagparse.text": "重新掃描工作區",
"c.cpp.parsing.open.files.tooltip": "剖析開啟的檔案",
"click.to.preview": "按一下以預覽結果",
"updating.intellisense.tooltip": "正在更新 IntelliSense...",
"updating.intellisense.text": "IntelliSense: 更新中",
"idle.intellisense.text": "IntelliSense: 就緒",
"absent.intellisense.text": "IntelliSense: 未設定",
"running.analysis.text": "Code Analysis: 執行中",
"paused.analysis.text": "Code Analysis: 已暫停",
"mode.analysis.prefix": "Code Analysis 模式: ",
"c.cpp.configureIntelliSenseStatus.text": "設定 IntelliSense",
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ 設定 IntelliSense",
"select.command": "選取命令...",
"select.code.analysis.command": "選取程式碼分析命令...",
"c.cpp.configuration.tooltip": "C/C++ 組態",
"c.cpp.references.statusbar": "C/C++ 參考狀態",
"c.cpp.intellisense.statusbar": "C/C++ IntelliSense 狀態",
"c.cpp.tagparser.statusbar": "C/C++ 標記剖析器狀態",
"discovering.files.tooltip": "正在探索檔案",
"running.analysis.tooltip": "正在執行 {0}",
"code.analysis.paused.tooltip": "{0} 已暫停",
"running.analysis.processed.tooltip": "正在執行 {0}: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "C/C++ IntelliSense 狀態",
"cpptools.status.tagparser": "C/C++ 標記剖析器狀態",
"cpptools.detail.tagparser": "正在初始化...",
"cpptools.status.codeanalysis": "C/C++ Code Analysis 狀態",
"c.cpp.codeanalysis.statusbar.runNow": "立即執行",
"tagparser.pause.text": "暫停",
"tagparser.resume.text": "繼續",
"intellisense.select.text": "選取編譯器",
"rescan.intellisense.text": "重新掃描",
"rescan.intellisense.tooltip": "重新掃描 IntelliSense",
"mode.codeanalysis.status.automatic": "自動",
"mode.codeanalysis.status.manual": "手動",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "選項",
"startup.codeanalysis.status": "正在啟動...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "立即執行",
"running.analysis.processed.tooltip": "正在執行: {0} / {1} ({2}%)",
"select.a.configuration": "選取組態...",
"edit.configuration.ui": "編輯組態 (UI)",
"edit.configuration.json": "編輯組態 (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "取消",
"resume.analysis": "繼續",
"pause.analysis": "暫停",
"another.analysis": "啟動另一個..."
"another.analysis": "啟動另一個...",
"active.analysis": "在使用中檔案上執行程式碼分析",
"all.analysis": "在所有檔案上執行程式碼分析",
"open.analysis": "在開啟檔案上執行程式碼分析"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"c.cpp.parsing.open.files.tooltip": "Analýza otevřených souborů.",
"running.tagparser.text": "Parsování pracovního prostoru",
"paused.tagparser.text": "Pracovní prostor analýzy: Pozastaveno",
"complete.tagparser.text": "Analýza byla dokončena.",
"initializing.tagparser.text": "Inicializuje se pracovní prostor",
"indexing.tagparser.text": "Pracovní prostor indexování",
"rescan.tagparse.text": "Znovu prohledat pracovní prostor",
"c.cpp.parsing.open.files.tooltip": "Analýza otevřených souborů",
"click.to.preview": "kliknutím si můžete zobrazit náhled výsledků",
"updating.intellisense.tooltip": "Aktualizuje se IntelliSense.",
"updating.intellisense.text": "IntelliSense: Aktualizace",
"idle.intellisense.text": "IntelliSense: Připraveno",
"absent.intellisense.text": "IntelliSense: Nenakonfigurováno",
"running.analysis.text": "Code Analysis: Spuštěno",
"paused.analysis.text": "Code Analysis: Pozastaveno",
"mode.analysis.prefix": "Režim Code Analysis: ",
"c.cpp.configureIntelliSenseStatus.text": "Konfigurovat IntelliSense",
"c.cpp.configureIntelliSenseStatus.cppText": "Konfigurovat IntelliSense v C/C++",
"select.command": "Vyberte příkaz…",
"select.code.analysis.command": "Vyberte příkaz pro analýzu kódu…",
"c.cpp.configuration.tooltip": "Konfigurace C/C++",
"c.cpp.references.statusbar": "Stav odkazů jazyka C/C++",
"c.cpp.intellisense.statusbar": "C/C++ IntelliSense Status",
"c.cpp.tagparser.statusbar": "Stav analyzátoru značky jazyka C/C++",
"discovering.files.tooltip": "Zjišťují se soubory.",
"running.analysis.tooltip": "Probíhá {0}",
"code.analysis.paused.tooltip": "{0} pozastaveno",
"running.analysis.processed.tooltip": "Spuštěno {0}: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "C/C++ IntelliSense Status",
"cpptools.status.tagparser": "Stav analyzátoru značky jazyka C/C++",
"cpptools.detail.tagparser": "Probíhá inicializace...",
"cpptools.status.codeanalysis": "Stav Code Analysis C/C++",
"c.cpp.codeanalysis.statusbar.runNow": "Spustit",
"tagparser.pause.text": "Pozastavit",
"tagparser.resume.text": "Pokračovat",
"intellisense.select.text": "Vyberte kompilátor.",
"rescan.intellisense.text": "Prohledat znovu",
"rescan.intellisense.tooltip": "Znovu prohledat IntelliSense",
"mode.codeanalysis.status.automatic": "Automaticky",
"mode.codeanalysis.status.manual": "Ručně",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Možnosti",
"startup.codeanalysis.status": "Spouštění...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Spustit",
"running.analysis.processed.tooltip": "Spuštěno: {0} / {1} ({2} %)",
"select.a.configuration": "Vybrat konfiguraci...",
"edit.configuration.ui": "Upravit konfigurace (uživatelské rozhraní)",
"edit.configuration.json": "Upravit konfigurace (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "Zrušit",
"resume.analysis": "Pokračovat",
"pause.analysis": "Pozastavit",
"another.analysis": "Spustit další…"
"another.analysis": "Spustit další…",
"active.analysis": "Spustit Code Analysis u aktivního souboru",
"all.analysis": "Spustit Code Analysis u všech souborů",
"open.analysis": "Spustit Code Analysis při otevírání souborů"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"c.cpp.parsing.open.files.tooltip": "Offene Dateien werden analysiert",
"running.tagparser.text": "Parsing-Arbeitsbereich",
"paused.tagparser.text": "Parsing-Arbeitsbereich: Angehalten",
"complete.tagparser.text": "Parsing abgeschlossen",
"initializing.tagparser.text": "Arbeitsbereich wird initialisiert",
"indexing.tagparser.text": "Arbeitsbereich für die Indizierung",
"rescan.tagparse.text": "Arbeitsbereich neu einlesen",
"c.cpp.parsing.open.files.tooltip": "Offene Dateien werden geparst",
"click.to.preview": "Klicken Sie, um eine Vorschau der Ergebnisse anzuzeigen.",
"updating.intellisense.tooltip": "IntelliSense wird aktualisiert",
"updating.intellisense.text": "IntelliSense: Aktualisieren",
"idle.intellisense.text": "IntelliSense: Bereit",
"absent.intellisense.text": "IntelliSense: Nicht konfiguriert",
"running.analysis.text": "Code Analysis: Wird ausgeführt",
"paused.analysis.text": "Code Analysis: Angehalten",
"mode.analysis.prefix": "Code Analysis-Modus: ",
"c.cpp.configureIntelliSenseStatus.text": "IntelliSense konfigurieren",
"c.cpp.configureIntelliSenseStatus.cppText": "IntelliSense in C/C++ konfigurieren",
"select.command": "Befehl auswählen...",
"select.code.analysis.command": "Codeanalysebefehl auswählen...",
"c.cpp.configuration.tooltip": "C/C++-Konfiguration",
"c.cpp.references.statusbar": "C/C++-Verweisstatus",
"c.cpp.intellisense.statusbar": "Status von C/C++-IntelliSense",
"c.cpp.tagparser.statusbar": "Status des C/C++-Tagparsers",
"discovering.files.tooltip": "Dateien werden ermittelt",
"running.analysis.tooltip": "\"{0}\" wird ausgeführt",
"code.analysis.paused.tooltip": "{0} angehalten",
"running.analysis.processed.tooltip": "Ausführen von {0}: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "Status von C/C++-IntelliSense",
"cpptools.status.tagparser": "Status des C/C++-Tagparsers",
"cpptools.detail.tagparser": "Wird initialisiert...",
"cpptools.status.codeanalysis": "C/C++-Code Analysis-Status",
"c.cpp.codeanalysis.statusbar.runNow": "Jetzt ausführen",
"tagparser.pause.text": "Anhalten",
"tagparser.resume.text": "Fortsetzen",
"intellisense.select.text": "Compiler auswählen",
"rescan.intellisense.text": "Neu einlesen",
"rescan.intellisense.tooltip": "IntelliSense neu einlesen",
"mode.codeanalysis.status.automatic": "Automatisch",
"mode.codeanalysis.status.manual": "Manuell",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Optionen",
"startup.codeanalysis.status": "Wird gestartet...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Jetzt ausführen",
"running.analysis.processed.tooltip": "Wird ausgeführt: {0} / {1} ({2}%)",
"select.a.configuration": "Konfiguration auswählen...",
"edit.configuration.ui": "Konfigurationen bearbeiten (Benutzeroberfläche)",
"edit.configuration.json": "Konfigurationen bearbeiten (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "Abbrechen",
"resume.analysis": "Fortsetzen",
"pause.analysis": "Anhalten",
"another.analysis": "Starten Sie eine weitere..."
"another.analysis": "Starten Sie eine weitere...",
"active.analysis": "Code Analysis auf \"Aktive Dateien\" ausführen",
"all.analysis": "Code Analysis auf \"Alle Dateien\" ausführen",
"open.analysis": "Code Analysis auf \"Dateien öffnen\" ausführen"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"running.tagparser.text": "Analizar área de trabajo",
"paused.tagparser.text": "Área de trabajo de análisis: en pausa",
"complete.tagparser.text": "Análisis finalizado",
"initializing.tagparser.text": "Inicializando área de trabajo",
"indexing.tagparser.text": "Área de trabajo de indexación",
"rescan.tagparse.text": "Volver a examinar el área de trabajo",
"c.cpp.parsing.open.files.tooltip": "Analizando archivos abiertos",
"click.to.preview": "hacer clic para obtener una vista previa de los resultados",
"updating.intellisense.tooltip": "Actualizando IntelliSense...",
"updating.intellisense.text": "IntelliSense: actualización",
"idle.intellisense.text": "IntelliSense: listo",
"absent.intellisense.text": "IntelliSense: no configurado",
"running.analysis.text": "Code Analysis: en ejecución",
"paused.analysis.text": "Code Analysis: en pausa",
"mode.analysis.prefix": "Modo de Code Analysis: ",
"c.cpp.configureIntelliSenseStatus.text": "Configurar IntelliSense",
"c.cpp.configureIntelliSenseStatus.cppText": "Configuración de IntelliSense en C/C++",
"select.command": "Seleccione un comando...",
"select.code.analysis.command": "Seleccione un comando de análisis de código...",
"c.cpp.configuration.tooltip": "Configuración de C/C++",
"c.cpp.references.statusbar": "Estado de referencias de C/C++",
"c.cpp.intellisense.statusbar": "Estado de IntelliSense de C/C++",
"c.cpp.tagparser.statusbar": "Estado del analizador de etiquetas de C/C++",
"discovering.files.tooltip": "Detectando archivos",
"running.analysis.tooltip": "Ejecutando {0}",
"code.analysis.paused.tooltip": "{0} en pausa",
"running.analysis.processed.tooltip": "{0} en ejecución: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "Estado de IntelliSense de C/C++",
"cpptools.status.tagparser": "Estado del analizador de etiquetas de C/C++",
"cpptools.detail.tagparser": "Inicializando...",
"cpptools.status.codeanalysis": "Estado de Code Analysis de C/C++",
"c.cpp.codeanalysis.statusbar.runNow": "Ejecutar ahora",
"tagparser.pause.text": "Pausa",
"tagparser.resume.text": "Reanudar",
"intellisense.select.text": "Seleccione un compilador",
"rescan.intellisense.text": "Volver a examinar",
"rescan.intellisense.tooltip": "Volver a examinar IntelliSense",
"mode.codeanalysis.status.automatic": "Automático",
"mode.codeanalysis.status.manual": "Manual",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Opciones",
"startup.codeanalysis.status": "Iniciando...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Ejecutar ahora",
"running.analysis.processed.tooltip": "En ejecución: {0} / {1} ({2}%)",
"select.a.configuration": "Seleccione una configuración...",
"edit.configuration.ui": "Editar configuraciones (interfaz de usuario)",
"edit.configuration.json": "Editar configuraciones (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "Cancelar",
"resume.analysis": "Reanudar",
"pause.analysis": "Pausa",
"another.analysis": "Iniciar otro..."
"another.analysis": "Iniciar otro...",
"active.analysis": "Ejecutar Code Analysis en el archivo activo",
"all.analysis": "Ejecutar análisis de código en todos los archivos",
"open.analysis": "Ejecutar análisis de código en archivos abiertos"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"running.tagparser.text": "Analyse de lespace de travail",
"paused.tagparser.text": "Analyse de lespace de travail : suspendu",
"complete.tagparser.text": "Analyse terminée",
"initializing.tagparser.text": "Initialisation de lespace de travail",
"indexing.tagparser.text": "Indexation de lespace de travail",
"rescan.tagparse.text": "Réanalyser l'espace de travail",
"c.cpp.parsing.open.files.tooltip": "Analyse des fichiers ouverts",
"click.to.preview": "cliquez pour voir un aperçu des résultats",
"updating.intellisense.tooltip": "Mise à jour d'IntelliSense",
"updating.intellisense.text": "IntelliSense : mise à jour",
"idle.intellisense.text": "IntelliSense : prêt",
"absent.intellisense.text": "IntelliSense : non configuré",
"running.analysis.text": "Code Analysis : en cours dexécution",
"paused.analysis.text": "Code Analysis : suspendu",
"mode.analysis.prefix": "Mode Code Analysis : ",
"c.cpp.configureIntelliSenseStatus.text": "Configurer IntelliSense",
"c.cpp.configureIntelliSenseStatus.cppText": "Configuration dIntelliSense en C/C++",
"select.command": "Sélectionner une commande...",
"select.code.analysis.command": "Sélectionner une commande danalyse du code...",
"c.cpp.configuration.tooltip": "Configuration C/C++",
"c.cpp.references.statusbar": "État des références C/C++",
"c.cpp.intellisense.statusbar": "État IntelliSense C/C++",
"c.cpp.tagparser.statusbar": "État de lanalyseur de balises C/C++",
"discovering.files.tooltip": "Détection de fichiers",
"running.analysis.tooltip": "Exécution de {0}",
"code.analysis.paused.tooltip": "{0} en pause",
"running.analysis.processed.tooltip": "En cours d'exécution {0}: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "État IntelliSense C/C++",
"cpptools.status.tagparser": "État de lanalyseur de balises C/C++",
"cpptools.detail.tagparser": "Initialisation en cours...",
"cpptools.status.codeanalysis": "État du Code Analysis C/C++",
"c.cpp.codeanalysis.statusbar.runNow": "Exécuter maintenant",
"tagparser.pause.text": "Pause",
"tagparser.resume.text": "Reprendre",
"intellisense.select.text": "Sélectionnez un compilateur",
"rescan.intellisense.text": "Relancer l'analyse",
"rescan.intellisense.tooltip": "Relancer l'analyse IntelliSense",
"mode.codeanalysis.status.automatic": "Automatique",
"mode.codeanalysis.status.manual": "Manuel",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Options",
"startup.codeanalysis.status": "Démarrage en cours...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Exécuter maintenant",
"running.analysis.processed.tooltip": "En cours dexécution : {0}/{1} ({2} %)",
"select.a.configuration": "Sélectionner une configuration...",
"edit.configuration.ui": "Modifier les configurations (IU)",
"edit.configuration.json": "Modifier les configurations (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "Annuler",
"resume.analysis": "Reprendre",
"pause.analysis": "Suspendre",
"another.analysis": "Démarrer une autre..."
"another.analysis": "Démarrer une autre...",
"active.analysis": "Exécuter Code Analysis sur le fichier actif",
"all.analysis": "Exécuter une analyse de code sur Tous les fichiers",
"open.analysis": "Exécuter une analyse de code sur Ouvrir les fichiers"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"running.tagparser.text": "Analisi area di lavoro",
"paused.tagparser.text": "Analisi area di lavoro: Sospesa",
"complete.tagparser.text": "Analisi completata",
"initializing.tagparser.text": "Inizializzazione dell'area di lavoro",
"indexing.tagparser.text": "Area di lavoro di indicizzazione",
"rescan.tagparse.text": "Ripeti analisi area di lavoro",
"c.cpp.parsing.open.files.tooltip": "Analisi dei file aperti",
"click.to.preview": "fare clic per visualizzare l'anteprima dei risultati",
"updating.intellisense.tooltip": "Aggiornamento di IntelliSense",
"updating.intellisense.text": "IntelliSense: aggiornamento",
"idle.intellisense.text": "IntelliSense: Pronto",
"absent.intellisense.text": "IntelliSense: Non configurato",
"running.analysis.text": "Code Analysis: In esecuzione",
"paused.analysis.text": "Code Analysis: Sospeso",
"mode.analysis.prefix": "Modalità Code Analysis: ",
"c.cpp.configureIntelliSenseStatus.text": "Configura IntelliSense",
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ - Configura IntelliSense",
"select.command": "Seleziona un comando...",
"select.code.analysis.command": "Selezionare un comando di Code Analysis...",
"c.cpp.configuration.tooltip": "Configurazione C/C++",
"c.cpp.references.statusbar": "Stato riferimenti C/C++",
"c.cpp.intellisense.statusbar": "Stato IntelliSense C/C++",
"c.cpp.tagparser.statusbar": "Stato del parser del tag C/C++",
"discovering.files.tooltip": "Individuazione dei file",
"running.analysis.tooltip": "{0} in esecuzione",
"code.analysis.paused.tooltip": "{0} in pausa",
"running.analysis.processed.tooltip": "In esecuzione {0}: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "Stato IntelliSense C/C++",
"cpptools.status.tagparser": "Stato del parser del tag C/C++",
"cpptools.detail.tagparser": "Inizializzazione...",
"cpptools.status.codeanalysis": "Stato Code Analysis C/C++",
"c.cpp.codeanalysis.statusbar.runNow": "Esegui",
"tagparser.pause.text": "Sospendi",
"tagparser.resume.text": "Riprendi",
"intellisense.select.text": "Seleziona un compilatore",
"rescan.intellisense.text": "Ripeti analisi",
"rescan.intellisense.tooltip": "Ripeti analisi di IntelliSense",
"mode.codeanalysis.status.automatic": "Automatico",
"mode.codeanalysis.status.manual": "Manuale",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Opzioni",
"startup.codeanalysis.status": "Avvio...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Esegui",
"running.analysis.processed.tooltip": "In esecuzione: {0} / {1} ({2}%)",
"select.a.configuration": "Seleziona una configurazione...",
"edit.configuration.ui": "Modifica configurazioni (interfaccia utente)",
"edit.configuration.json": "Modifica configurazioni (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "Annulla",
"resume.analysis": "Riprendi",
"pause.analysis": "Sospendi",
"another.analysis": "Avvia un'altra..."
"another.analysis": "Avvia un'altra...",
"active.analysis": "Esegui analisi del codice su File attivo",
"all.analysis": "Esegui analisi del codice su Tutti i file",
"open.analysis": "Esegui analisi del codice su Apri file"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"running.tagparser.text": "ワークスペースを解析しています",
"paused.tagparser.text": "ワークスペースを解析しています: 一時停止",
"complete.tagparser.text": "解析完了",
"initializing.tagparser.text": "ワークスペースの初期化",
"indexing.tagparser.text": "ワークスペースのインデックス作成",
"rescan.tagparse.text": "ワークスペースの再スキャン",
"c.cpp.parsing.open.files.tooltip": "開いているファイルを解析しています",
"click.to.preview": "クリックして結果をプレビューします",
"updating.intellisense.tooltip": "IntelliSense を更新しています...",
"updating.intellisense.text": "IntelliSense: 更新中",
"idle.intellisense.text": "IntelliSense: 準備完了",
"absent.intellisense.text": "IntelliSense: 未構成",
"running.analysis.text": "Code Analysis: 実行中",
"paused.analysis.text": "Code Analysis: 一時停止",
"mode.analysis.prefix": "Code Analysis モード: ",
"c.cpp.configureIntelliSenseStatus.text": "IntelliSense の構成",
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ IntelliSense の構成",
"select.command": "コマンドを選択する...",
"select.code.analysis.command": "コード分析コマンドを選択...",
"c.cpp.configuration.tooltip": "C/C++ 構成",
"c.cpp.references.statusbar": "C/C + + リファレンスの状態",
"c.cpp.intellisense.statusbar": "C/c + + IntelliSense の状態",
"c.cpp.tagparser.statusbar": "C/C + + タグ パーサーの状態",
"discovering.files.tooltip": "ファイルを検出しています",
"running.analysis.tooltip": "{0} を実行しています",
"code.analysis.paused.tooltip": "{0}一時停止",
"running.analysis.processed.tooltip": "実行中{0}: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "C/c + + IntelliSense の状態",
"cpptools.status.tagparser": "C/C + + タグ パーサーの状態",
"cpptools.detail.tagparser": "初期化しています...",
"cpptools.status.codeanalysis": "C/C++ Code Analysis の状態",
"c.cpp.codeanalysis.statusbar.runNow": "直ちに実行",
"tagparser.pause.text": "一時停止",
"tagparser.resume.text": "再開",
"intellisense.select.text": "コンパイラを選択する",
"rescan.intellisense.text": "再スキャン",
"rescan.intellisense.tooltip": "IntelliSense の再スキャン",
"mode.codeanalysis.status.automatic": "自動",
"mode.codeanalysis.status.manual": "手動",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "オプション",
"startup.codeanalysis.status": "開始しています...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "直ちに実行",
"running.analysis.processed.tooltip": "実行中: {0} / {1} ({2}%)",
"select.a.configuration": "構成を選択する...",
"edit.configuration.ui": "構成の編集 (UI)",
"edit.configuration.json": "構成の編集 (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "キャンセル",
"resume.analysis": "再開",
"pause.analysis": "一時停止",
"another.analysis": "別のファイルを開始..."
"another.analysis": "別のファイルを開始...",
"active.analysis": "アクティブ ファイルで Code Analysis を実行する",
"all.analysis": "すべてのファイルで Code Analysis を実行する",
"open.analysis": "開いているファイルで Code Analysis を実行する"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"running.tagparser.text": "작업 영역 구문 분석",
"paused.tagparser.text": "작업 영역 구문 분석: 일시 중지됨",
"complete.tagparser.text": "구문 분석이 완료되었습니다.",
"initializing.tagparser.text": "작업 영역 초기화",
"indexing.tagparser.text": "작업 영역 인덱싱",
"rescan.tagparse.text": "작업 영역 다시 검사",
"c.cpp.parsing.open.files.tooltip": "열린 파일을 구문 분석하는 중",
"click.to.preview": "결과를 미리 보려면 클릭",
"updating.intellisense.tooltip": "IntelliSense 업데이트하는 중",
"updating.intellisense.text": "IntelliSense: 업데이트 중",
"idle.intellisense.text": "IntelliSense: 준비 완료",
"absent.intellisense.text": "IntelliSense: 구성되지 않음",
"running.analysis.text": "Code Analysis: 실행 중",
"paused.analysis.text": "Code Analysis: 일시 중지됨",
"mode.analysis.prefix": "Code Analysis 모드: ",
"c.cpp.configureIntelliSenseStatus.text": "IntelliSense 구성",
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ IntelliSense 구성",
"select.command": "명령 선택...",
"select.code.analysis.command": "코드 분석 명령 선택...",
"c.cpp.configuration.tooltip": "C/C++ 구성",
"c.cpp.references.statusbar": "C/C++ 참조 상태",
"c.cpp.intellisense.statusbar": "C/C++ IntelliSense 상태",
"c.cpp.tagparser.statusbar": "C/C++ 태그 파서 상태",
"discovering.files.tooltip": "파일을 검색하는 중",
"running.analysis.tooltip": "{0} 실행 중",
"code.analysis.paused.tooltip": "{0} 일시 중지됨",
"running.analysis.processed.tooltip": "{0}: {1} / {2} 실행 중({3}%)",
"cpptools.status.intellisense": "C/C++ IntelliSense 상태",
"cpptools.status.tagparser": "C/C++ 태그 파서 상태",
"cpptools.detail.tagparser": "초기화하는 중...",
"cpptools.status.codeanalysis": "C/C++ Code Analysis 상태",
"c.cpp.codeanalysis.statusbar.runNow": "지금 실행",
"tagparser.pause.text": "일시 중지",
"tagparser.resume.text": "다시 시작",
"intellisense.select.text": "컴파일러 선택",
"rescan.intellisense.text": "다시 검사",
"rescan.intellisense.tooltip": "IntelliSense 다시 검사",
"mode.codeanalysis.status.automatic": "자동",
"mode.codeanalysis.status.manual": "수동",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "옵션",
"startup.codeanalysis.status": "시작 중...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "지금 실행",
"running.analysis.processed.tooltip": "실행 중: {0} / {1} ({2}%)",
"select.a.configuration": "구성 선택...",
"edit.configuration.ui": "구성 편집(UI)",
"edit.configuration.json": "구성 편집(JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "취소",
"resume.analysis": "다시 시작",
"pause.analysis": "일시 중지",
"another.analysis": "다른 시작..."
"another.analysis": "다른 시작...",
"active.analysis": "활성 파일에서 코드 분석 실행",
"all.analysis": "모든 파일에 대한 코드 분석 실행",
"open.analysis": "열린 파일에서 코드 분석 실행"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"running.tagparser.text": "Analizowanie obszaru roboczego",
"paused.tagparser.text": "Analizowanie obszaru roboczego: wstrzymane",
"complete.tagparser.text": "Analizowanie zakończone",
"initializing.tagparser.text": "Inicjowanie obszaru roboczego",
"indexing.tagparser.text": "Indeksowanie obszaru roboczego",
"rescan.tagparse.text": "Ponowne skanowanie obszaru roboczego",
"c.cpp.parsing.open.files.tooltip": "Analizowanie otwartych plików",
"click.to.preview": "kliknij, aby wyświetlić podgląd wyników",
"updating.intellisense.tooltip": "Aktualizowanie funkcji IntelliSense",
"updating.intellisense.text": "IntelliSense: aktualizowanie",
"idle.intellisense.text": "IntelliSense: gotowe",
"absent.intellisense.text": "IntelliSense: nieskonfigurowane",
"running.analysis.text": "Analiza kodu: uruchamianie",
"paused.analysis.text": "Analiza kodu: wstrzymano",
"mode.analysis.prefix": "Tryb analizy kodu: ",
"c.cpp.configureIntelliSenseStatus.text": "Konfigurowanie funkcji IntelliSense",
"c.cpp.configureIntelliSenseStatus.cppText": "Konfigurowanie funkcji IntelliSense (C/C++)",
"select.command": "Wybierz polecenie...",
"select.code.analysis.command": "Wybierz polecenie analizy kodu...",
"c.cpp.configuration.tooltip": "Konfiguracja języka C/C++",
"c.cpp.references.statusbar": "Stan odwołań języka C/C++",
"c.cpp.intellisense.statusbar": "Stan funkcji IntelliSense języka C/C++",
"c.cpp.tagparser.statusbar": "Stan parsera tagów języka C/C++",
"discovering.files.tooltip": "Odnajdowanie plików",
"running.analysis.tooltip": "Wykonywanie {0}",
"code.analysis.paused.tooltip": "{0} wstrzymana",
"running.analysis.processed.tooltip": "Uruchamianie {0}: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "Stan funkcji IntelliSense języka C/C++",
"cpptools.status.tagparser": "Stan parsera tagów języka C/C++",
"cpptools.detail.tagparser": "Trwa inicjowanie...",
"cpptools.status.codeanalysis": "Stan analizy kodu C/C++",
"c.cpp.codeanalysis.statusbar.runNow": "Uruchom teraz",
"tagparser.pause.text": "Wstrzymaj",
"tagparser.resume.text": "Wznów",
"intellisense.select.text": "Wybierz kompilator",
"rescan.intellisense.text": "Skanuj ponownie",
"rescan.intellisense.tooltip": "Ponowne skanowanie funkcji IntelliSense",
"mode.codeanalysis.status.automatic": "Automatycznie",
"mode.codeanalysis.status.manual": "Ręczny",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Opcje",
"startup.codeanalysis.status": "Trwa uruchamianie...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Uruchom teraz",
"running.analysis.processed.tooltip": "Uruchomione: {0} / {1} ({2}%)",
"select.a.configuration": "Wybierz konfigurację...",
"edit.configuration.ui": "Edytowanie konfiguracji (interfejs użytkownika)",
"edit.configuration.json": "Edytowanie konfiguracji (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "Anuluj",
"resume.analysis": "Wznów",
"pause.analysis": "Wstrzymaj",
"another.analysis": "Uruchom kolejną..."
"another.analysis": "Uruchom kolejną...",
"active.analysis": "Uruchom analizę kodu dla aktywnego pliku",
"all.analysis": "Uruchamianie analizy kodu dla wszystkich plików",
"open.analysis": "Uruchamianie rozszerzenia Code Analysis na otwartych plikach"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"c.cpp.parsing.open.files.tooltip": "Analisando arquivos abertos",
"running.tagparser.text": "Analisando o Workspace",
"paused.tagparser.text": "Workspace de Análise: Pausado",
"complete.tagparser.text": "Análise Concluída",
"initializing.tagparser.text": "Inicializando o Workspace",
"indexing.tagparser.text": "Workspace da Indexação",
"rescan.tagparse.text": "Examinar Novamente o Workspace",
"c.cpp.parsing.open.files.tooltip": "Analisando Arquivos Abertos",
"click.to.preview": "clique aqui para visualizar os resultados",
"updating.intellisense.tooltip": "Atualizando o IntelliSense",
"updating.intellisense.text": "IntelliSense: Atualizando",
"idle.intellisense.text": "IntelliSense: Pronto",
"absent.intellisense.text": "IntelliSense: Não Configurado",
"running.analysis.text": "Code Analysis: em Execução",
"paused.analysis.text": "Code Analysis: Pausado",
"mode.analysis.prefix": "Modo do Code Analysis: ",
"c.cpp.configureIntelliSenseStatus.text": "Configurar o IntelliSense",
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ Configurar IntelliSense",
"select.command": "Selecionar um comando...",
"select.code.analysis.command": "Selecione um comando de análise de código...",
"c.cpp.configuration.tooltip": "Configuração de C/C++",
"c.cpp.references.statusbar": "Status de Referências do C/C++",
"c.cpp.intellisense.statusbar": "Status do IntelliSense do C/C++",
"c.cpp.tagparser.statusbar": "Status do Analisador de Marcas do C/C++",
"discovering.files.tooltip": "Descobrindo arquivos",
"running.analysis.tooltip": "Executando {0}",
"code.analysis.paused.tooltip": "{0} pausado",
"running.analysis.processed.tooltip": "Executando {0}: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "Status do IntelliSense do C/C++",
"cpptools.status.tagparser": "Status do Analisador de Marcas do C/C++",
"cpptools.detail.tagparser": "Inicializando...",
"cpptools.status.codeanalysis": "Status do Code Analysis do C/C++",
"c.cpp.codeanalysis.statusbar.runNow": "Executar Agora",
"tagparser.pause.text": "Pausar",
"tagparser.resume.text": "Retomar",
"intellisense.select.text": "Selecionar um Compilador",
"rescan.intellisense.text": "Examinar novamente",
"rescan.intellisense.tooltip": "Examinar Novamente o IntelliSense",
"mode.codeanalysis.status.automatic": "Automático",
"mode.codeanalysis.status.manual": "Manual",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Opções",
"startup.codeanalysis.status": "Iniciando...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Executar Agora",
"running.analysis.processed.tooltip": "Executando: {0} / {1} ({2}%)",
"select.a.configuration": "Selecione uma Configuração...",
"edit.configuration.ui": "Editar Configurações (IU)",
"edit.configuration.json": "Editar Configurações (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "Cancelar",
"resume.analysis": "Retomar",
"pause.analysis": "Pausar",
"another.analysis": "Iniciar Outro..."
"another.analysis": "Iniciar Outro...",
"active.analysis": "Executar Code Analysis no Arquivo Ativo",
"all.analysis": "Executar Code Analysis em Todos os Arquivos",
"open.analysis": "Executar Code Analysis em Abrir Arquivos"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"running.tagparser.text": "Анализ рабочей области",
"paused.tagparser.text": "Анализ рабочей области: приостановлено",
"complete.tagparser.text": "Анализ завершен",
"initializing.tagparser.text": "Инициализация рабочей области",
"indexing.tagparser.text": "Индексация рабочей области",
"rescan.tagparse.text": "Повторное сканирование рабочей области",
"c.cpp.parsing.open.files.tooltip": "Анализ открытых файлов",
"click.to.preview": "щелкните для предварительного просмотра результатов",
"updating.intellisense.tooltip": "Обновление IntelliSense",
"updating.intellisense.text": "IntelliSense: обновление",
"idle.intellisense.text": "IntelliSense: готово",
"absent.intellisense.text": "IntelliSense: не настроено",
"running.analysis.text": "Code Analysis: запуск",
"paused.analysis.text": "Code Analysis: приостановлено",
"mode.analysis.prefix": "Режим Code Analysis: ",
"c.cpp.configureIntelliSenseStatus.text": "Настройка IntelliSense",
"c.cpp.configureIntelliSenseStatus.cppText": "Настройка IntelliSense C/C++",
"select.command": "Выберите команду...",
"select.code.analysis.command": "Выберите команду анализа кода...",
"c.cpp.configuration.tooltip": "Конфигурация C/C++",
"c.cpp.references.statusbar": "Состояние ссылок C/C++",
"c.cpp.intellisense.statusbar": "Состояние IntelliSense C/C++",
"c.cpp.tagparser.statusbar": "Состояние анализатора тегов C/C++",
"discovering.files.tooltip": "Обнаружение файлов",
"running.analysis.tooltip": "Выполняется {0}",
"code.analysis.paused.tooltip": "Выполнение {0} приостановлено",
"running.analysis.processed.tooltip": "Выполняется {0}: {1} / {2} ({3}%)",
"cpptools.status.intellisense": "Состояние IntelliSense C/C++",
"cpptools.status.tagparser": "Состояние анализатора тегов C/C++",
"cpptools.detail.tagparser": "Выполняется инициализация…",
"cpptools.status.codeanalysis": "Состояние Code Analysis C/C++",
"c.cpp.codeanalysis.statusbar.runNow": "Запустить сейчас",
"tagparser.pause.text": "Приостановить",
"tagparser.resume.text": "Возобновить",
"intellisense.select.text": "Выбор компилятора",
"rescan.intellisense.text": "Повторное сканирование",
"rescan.intellisense.tooltip": "Повторное сканирование IntelliSense",
"mode.codeanalysis.status.automatic": "Автоматически",
"mode.codeanalysis.status.manual": "Вручную",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Параметры",
"startup.codeanalysis.status": "Запуск…",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Запустить сейчас",
"running.analysis.processed.tooltip": "Выполняется: {0}/{1} ({2}%)",
"select.a.configuration": "Выберите конфигурацию...",
"edit.configuration.ui": "Изменить конфигурации (пользовательский интерфейс)",
"edit.configuration.json": "Изменить конфигурации (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "Отмена",
"resume.analysis": "Возобновить",
"pause.analysis": "Приостановить",
"another.analysis": "Запустить другой..."
"another.analysis": "Запустить другой...",
"active.analysis": "Запустить Code Analysis в активном файле",
"all.analysis": "Запустить Code Analysis во всех файлах",
"open.analysis": "Запустить Code Analysis в открытых файлах"
}
@@ -4,21 +4,42 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"c.cpp.parsing.open.files.tooltip": "Açık dosyalar ayrıştırılıyor",
"running.tagparser.text": "Çalışma Alanı Ayrıştırılıyor",
"paused.tagparser.text": "Çalışma Alanı Ayrıştırılıyor: Duraklatıldı",
"complete.tagparser.text": "Ayrıştırma Tamamlandı",
"initializing.tagparser.text": "Çalışma Alanı Başlatılıyor",
"indexing.tagparser.text": "Çalışma Alanı Dizine Ekleniyor",
"rescan.tagparse.text": "Çalışma Alanını Yeniden Tara",
"c.cpp.parsing.open.files.tooltip": "Açık Dosyalar Ayrıştırılıyor",
"click.to.preview": "sonuçların önizlemesini görüntülemek için tıklayın",
"updating.intellisense.tooltip": "IntelliSense güncelleştiriliyor",
"updating.intellisense.text": "IntelliSense: Güncelleştiriliyor",
"idle.intellisense.text": "IntelliSense: Hazır",
"absent.intellisense.text": "IntelliSense: Yapılandırılmadı",
"running.analysis.text": "Code Analysis: Çalışıyor",
"paused.analysis.text": "Code Analysis: Duraklatıldı",
"mode.analysis.prefix": "Code Analysis Modu: ",
"c.cpp.configureIntelliSenseStatus.text": "IntelliSense'i Yapılandır",
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ IntelliSense'i Yapılandır",
"select.command": "Komut seç...",
"select.code.analysis.command": "Kod analizi komutu seçin...",
"c.cpp.configuration.tooltip": "C/C++ Yapılandırması",
"c.cpp.references.statusbar": "C/C++ Başvuruları Durumu",
"c.cpp.intellisense.statusbar": "C/C++ IntelliSense Durumu",
"c.cpp.tagparser.statusbar": "C/C++ Etiket Ayrıştırıcısı Durumu",
"discovering.files.tooltip": "Dosyalar bulunuyor",
"running.analysis.tooltip": "{0} çalıştırılıyor",
"code.analysis.paused.tooltip": "{0} durduruldu",
"running.analysis.processed.tooltip": "{0} Çalışıyor: {1} / {2} (%{3})",
"cpptools.status.intellisense": "C/C++ IntelliSense Durumu",
"cpptools.status.tagparser": "C/C++ Etiket Ayrıştırıcısı Durumu",
"cpptools.detail.tagparser": "Başlatılıyor...",
"cpptools.status.codeanalysis": "C/C++ Code Analysis Durumu",
"c.cpp.codeanalysis.statusbar.runNow": "Şimdi Çalıştır",
"tagparser.pause.text": "Duraklat",
"tagparser.resume.text": "Sürdür",
"intellisense.select.text": "Derleyici seçin",
"rescan.intellisense.text": "Yeniden tara",
"rescan.intellisense.tooltip": "Rescan IntelliSense",
"mode.codeanalysis.status.automatic": "Otomatik",
"mode.codeanalysis.status.manual": "El ile",
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Seçenekler",
"startup.codeanalysis.status": "Başlatılıyor...",
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Şimdi Çalıştır",
"running.analysis.processed.tooltip": "Çalışıyor: {0}/{1} (%{2})",
"select.a.configuration": "Yapılandırma Seçin...",
"edit.configuration.ui": "Yapılandırmaları Düzenle (UI)",
"edit.configuration.json": "Yapılandırmaları Düzenle (JSON)",
@@ -33,5 +54,8 @@
"cancel.analysis": "İptal",
"resume.analysis": "Sürdür",
"pause.analysis": "Duraklat",
"another.analysis": "Başkasını Başlat..."
"another.analysis": "Başkasını Başlat...",
"active.analysis": "Aktif Dosyada Code Analysisi Çalıştır",
"all.analysis": "Tüm Dosyalarda Code Analysisi Çalıştır",
"open.analysis": "Açık Dosyalarda Code Analysisi Çalıştır"
}
+6091 -6088
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -242,6 +242,10 @@
"c_cpp.configuration.caseSensitiveFileSupport.markdownDescription": { "message": "If set to `default`, the file system of the workspace is assumed to be case insensitive on Windows and case sensitive on macOS or Linux. If set to `enabled`, the file system of the workspace is assumed to be case sensitive on Windows.", "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.enhancedColorization.markdownDescription": { "message": "If enabled, code is colorized based on IntelliSense. This setting only applies if `#C_Cpp.intelliSenseEngine#` is set to `default`.", "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.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
"c_cpp.configuration.markdownInComments.description": "Select whether markdown will be available in the hover tooltip. By default, only a subset of markdown will be applied to comments in the hover tooltip.",
"c_cpp.configuration.markdownInComments.subsetEnabled.description": "Enable all markdown features in the hover tooltip except those that include the '_' and '*' characters.",
"c_cpp.configuration.markdownInComments.enabled.description": "Enable all markdown features in the hover tooltip.",
"c_cpp.configuration.markdownInComments.disabled.description": "Disable all markdown features in the hover tooltip.",
"c_cpp.configuration.hover.description": "If disabled, hover details are no longer provided by the language server.",
"c_cpp.configuration.vcpkg.enabled.markdownDescription": { "message": "Enable integration services for the [vcpkg dependency manager](https://aka.ms/vcpkg/).", "comment": [ "Markdown text between () should not be altered: https://en.wikipedia.org/wiki/Markdown" ] },
"c_cpp.configuration.addNodeAddonIncludePaths.markdownDescription": { "message": "Add include paths from `nan` and `node-addon-api` when they are dependencies.", "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." ] },
+1 -1
View File
@@ -3,9 +3,9 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as util from '../common';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import * as util from '../common';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
+7 -6
View File
@@ -3,16 +3,16 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { PsProcessParser } from './nativeAttach';
import { AttachItem, showQuickPick } from './attachQuickPick';
import { CppSettings } from '../LanguageServer/settings';
import { AttachItem, showQuickPick } from './attachQuickPick';
import { PsProcessParser } from './nativeAttach';
import * as debugUtils from './utils';
import * as os from 'os';
import * as path from 'path';
import * as util from '../common';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import * as util from '../common';
import * as debugUtils from './utils';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -132,8 +132,9 @@ export class RemoteAttachPicker {
shPrefix = `/bin/`;
}
return `${outerQuote}${shPrefix}sh -c ${innerQuote}uname && if [ ${parameterBegin}uname${parameterEnd} = ${escapedQuote}Linux${escapedQuote} ] ; ` +
`then ${PsProcessParser.psLinuxCommand} ; elif [ ${parameterBegin}uname${parameterEnd} = ${escapedQuote}Darwin${escapedQuote} ] ; ` +
return `${outerQuote}${shPrefix}sh -c ${innerQuote}uname && if [ ${parameterBegin}uname -o${parameterEnd} = ${escapedQuote}Toybox${escapedQuote} ] ; ` +
`then ${PsProcessParser.psToyboxCommand} ; elif [ ${parameterBegin}uname${parameterEnd} = ${escapedQuote}Darwin${escapedQuote} ] ; ` +
`then ${PsProcessParser.psLinuxCommand} ; elif [ ${parameterBegin}uname${parameterEnd} = ${escapedQuote}Linux${escapedQuote} ] ; ` +
`then ${PsProcessParser.psDarwinCommand}; fi${innerQuote}${outerQuote}`;
}
+101 -106
View File
@@ -3,32 +3,29 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as debugUtils from './utils';
import * as jsonc from 'comment-json';
import * as fs from 'fs';
import * as glob from 'glob';
import * as os from 'os';
import * as path from 'path';
import * as vscode from 'vscode';
import { CppBuildTask, CppBuildTaskDefinition, cppBuildTaskProvider } from '../LanguageServer/cppBuildTaskProvider';
import * as util from '../common';
import * as fs from 'fs';
import * as Telemetry from '../telemetry';
import * as logger from '../logger';
import * as nls from 'vscode-nls';
import {
IConfiguration, IConfigurationSnippet, DebuggerType, DebuggerEvent, MIConfigurations,
WindowsConfigurations, WSLConfigurations, PipeTransportConfigurations, CppDebugConfiguration,
ConfigSource, TaskStatus, isDebugLaunchStr, ConfigMenu, ConfigMode, DebugType
} from './configurations';
import * as jsonc from 'comment-json';
import { PlatformInformation } from '../platform';
import { Environment, ParsedEnvironmentFile } from './ParsedEnvironmentFile';
import { CppSettings, OtherSettings } from '../LanguageServer/settings';
import { configPrefix } from '../LanguageServer/extension';
import { expandAllStrings, ExpansionOptions, ExpansionVars } from '../expand';
import { rsync, scp, ssh } from '../SSH/commands';
import * as glob from 'glob';
import { promisify } from 'util';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import * as util from '../common';
import { isWindows } from '../constants';
import { expandAllStrings, ExpansionOptions, ExpansionVars } from '../expand';
import { CppBuildTask, CppBuildTaskDefinition, cppBuildTaskProvider } from '../LanguageServer/cppBuildTaskProvider';
import { configPrefix } from '../LanguageServer/extension';
import { CppSettings, OtherSettings } from '../LanguageServer/settings';
import * as logger from '../logger';
import { PlatformInformation } from '../platform';
import { rsync, scp, ssh } from '../SSH/commands';
import * as Telemetry from '../telemetry';
import { AttachItemsProvider, AttachPicker, RemoteAttachPicker } from './attachToProcess';
import { ConfigMenu, ConfigMode, ConfigSource, CppDebugConfiguration, DebuggerEvent, DebuggerType, DebugType, IConfiguration, IConfigurationSnippet, isDebugLaunchStr, MIConfigurations, PipeTransportConfigurations, TaskStatus, WindowsConfigurations, WSLConfigurations } from './configurations';
import { NativeAttachItemsProviderFactory } from './nativeAttach';
import { Environment, ParsedEnvironmentFile } from './ParsedEnvironmentFile';
import * as debugUtils from './utils';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -108,7 +105,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
}
const items: ConfigMenu[] = configs.map<ConfigMenu>(config => {
const quickPickConfig: CppDebugConfiguration = {...config};
const quickPickConfig: CppDebugConfiguration = { ...config };
const menuItem: ConfigMenu = { label: config.name, configuration: quickPickConfig, description: config.detail, detail: config.taskStatus };
// Rename the menu item for the default configuration as its name is non-descriptive.
if (isDebugLaunchStr(menuItem.label)) {
@@ -117,7 +114,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
return menuItem;
});
const selection: ConfigMenu | undefined = await vscode.window.showQuickPick(this.localizeConfigDetail(items), {placeHolder: localize("select.configuration", "Select a configuration")});
const selection: ConfigMenu | undefined = await vscode.window.showQuickPick(this.localizeConfigDetail(items), { placeHolder: localize("select.configuration", "Select a configuration") });
if (!selection) {
Telemetry.logDebuggerEvent(DebuggerEvent.debugPanel, { "debugType": "debug", "configSource": ConfigSource.unknown, "configMode": ConfigMode.unknown, "cancelled": "true", "succeeded": "true" });
return []; // User canceled it.
@@ -136,12 +133,12 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
* If return "null", the debugging will be aborted and launch.json will be opened.
* resolveDebugConfigurationWithSubstitutedVariables will be automatically called after this function.
*/
async resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: CppDebugConfiguration, token?: vscode.CancellationToken): Promise<CppDebugConfiguration | null | undefined> {
async resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: CppDebugConfiguration, _token?: vscode.CancellationToken): Promise<CppDebugConfiguration | null | undefined> {
if (!config || !config.type) {
// When DebugConfigurationProviderTriggerKind is Dynamic, this function will be called with an empty config.
// Hence, providing debug configs, and start debugging should be done manually.
// resolveDebugConfiguration will be automatically called after calling provideDebugConfigurations.
const configs: CppDebugConfiguration[]= await this.provideDebugConfigurations(folder);
const configs: CppDebugConfiguration[] = await this.provideDebugConfigurations(folder);
if (!configs || configs.length === 0) {
Telemetry.logDebuggerEvent(DebuggerEvent.debugPanel, { "debugType": DebugType.debug, "configSource": folder ? ConfigSource.workspaceFolder : ConfigSource.singleFile, "configMode": ConfigMode.noLaunchConfig, "cancelled": "true", "succeeded": "true" });
return undefined; // aborts debugging silently
@@ -239,13 +236,14 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
if (config.type === DebuggerType.cppvsdbg) {
// Fail if cppvsdbg type is running on non-Windows
if (os.platform() !== 'win32') {
logger.getOutputChannelLogger().showWarningMessage(localize("debugger.not.available", "Debugger of type: '{0}' is only available on Windows. Use type: '{1}' on the current OS platform.", "cppvsdbg", "cppdbg"));
void logger.getOutputChannelLogger().showWarningMessage(localize("debugger.not.available", "Debugger of type: '{0}' is only available on Windows. Use type: '{1}' on the current OS platform.", "cppvsdbg", "cppdbg"));
return undefined; // Abort debugging silently.
}
// Handle legacy 'externalConsole' bool and convert to console: "externalTerminal"
// eslint-disable-next-line no-prototype-builtins
if (config.hasOwnProperty("externalConsole")) {
logger.getOutputChannelLogger().showWarningMessage(localize("debugger.deprecated.config", "The key '{0}' is deprecated. Please use '{1}' instead.", "externalConsole", "console"));
void logger.getOutputChannelLogger().showWarningMessage(localize("debugger.deprecated.config", "The key '{0}' is deprecated. Please use '{1}' instead.", "externalConsole", "console"));
if (config.externalConsole && !config.console) {
config.console = "externalTerminal";
}
@@ -311,11 +309,11 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
const moreInfoButton: string = localize("lldb.framework.install.xcode", "More Info");
const LLDBFrameworkMissingMessage: string = localize("lldb.framework.not.found", "Unable to locate 'LLDB.framework' for lldb-mi. Please install XCode or XCode Command Line Tools.");
vscode.window.showErrorMessage(LLDBFrameworkMissingMessage, moreInfoButton)
void vscode.window.showErrorMessage(LLDBFrameworkMissingMessage, moreInfoButton)
.then(value => {
if (value === moreInfoButton) {
const helpURL: string = "https://aka.ms/vscode-cpptools/LLDBFrameworkNotFound";
vscode.env.openExternal(vscode.Uri.parse(helpURL));
void vscode.env.openExternal(vscode.Uri.parse(helpURL));
}
});
@@ -335,7 +333,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
if (config.deploySteps && config.deploySteps.length !== 0) {
const codeVersion: number[] = vscode.version.split('.').map(num => parseInt(num, undefined));
if ((util.isNumber(codeVersion[0]) && codeVersion[0] < 1) || (util.isNumber(codeVersion[0]) && codeVersion[0] === 1 && util.isNumber(codeVersion[1]) && codeVersion[1] < 69)) {
logger.getOutputChannelLogger().showErrorMessage(localize("vs.code.1.69+.required", "'deploySteps' require VS Code 1.69+."));
void logger.getOutputChannelLogger().showErrorMessage(localize("vs.code.1.69+.required", "'deploySteps' require VS Code 1.69+."));
return undefined;
}
@@ -364,7 +362,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
if (processId) {
config.processId = processId;
} else {
logger.getOutputChannelLogger().showErrorMessage("No process was selected.");
void logger.getOutputChannelLogger().showErrorMessage("No process was selected.");
return undefined;
}
}
@@ -372,7 +370,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
return config;
}
async provideDebugConfigurationsForType(type: DebuggerType, folder?: vscode.WorkspaceFolder, token?: vscode.CancellationToken): Promise<CppDebugConfiguration[]> {
async provideDebugConfigurationsForType(type: DebuggerType, folder?: vscode.WorkspaceFolder, _token?: vscode.CancellationToken): Promise<CppDebugConfiguration[]> {
const defaultTemplateConfig: CppDebugConfiguration = this.assetProvider.getInitialConfigurations(type).find((config: any) =>
isDebugLaunchStr(config.name) && config.request === "launch");
console.assert(defaultTemplateConfig, "Could not find default debug configuration.");
@@ -434,9 +432,8 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
if (newConfig.type === DebuggerType.cppdbg) {
newConfig.externalConsole = false;
} else {
newConfig.console = "externalTerminal";
newConfig.console = "integratedTerminal";
}
const isWindows: boolean = platformInfo.platform === 'win32';
// Extract the .exe path from the defined task.
const definedExePath: string | undefined = util.findExePathInArgs(task.definition.args);
newConfig.program = definedExePath ? definedExePath : util.defaultExePath();
@@ -453,60 +450,55 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
const isCl: boolean = compilerName === "cl.exe";
newConfig.cwd = isWindows && !isCl && !process.env.PATH?.includes(path.dirname(compilerPath)) ? path.dirname(compilerPath) : "${fileDirname}";
// eslint-disable-next-line @typescript-eslint/no-misused-promises
return new Promise<CppDebugConfiguration | undefined>(async resolve => {
if (platformInfo.platform === "darwin") {
return resolve(newConfig);
} else {
let debuggerName: string;
if (compilerName.startsWith("clang")) {
newConfig.MIMode = "lldb";
if (isWindows) {
debuggerName = "lldb";
} else {
debuggerName = "lldb-mi";
// Search for clang-8, clang-10, etc.
if ((compilerName !== "clang-cl.exe") && (compilerName !== "clang-cpp.exe")) {
const suffixIndex: number = compilerName.indexOf("-");
if (suffixIndex !== -1) {
const suffix: string = compilerName.substring(suffixIndex);
debuggerName += suffix;
}
if (platformInfo.platform !== "darwin") {
let debuggerName: string;
if (compilerName.startsWith("clang")) {
newConfig.MIMode = "lldb";
if (isWindows) {
debuggerName = "lldb";
} else {
debuggerName = "lldb-mi";
// Search for clang-8, clang-10, etc.
if ((compilerName !== "clang-cl.exe") && (compilerName !== "clang-cpp.exe")) {
const suffixIndex: number = compilerName.indexOf("-");
if (suffixIndex !== -1) {
const suffix: string = compilerName.substring(suffixIndex);
debuggerName += suffix;
}
}
newConfig.type = DebuggerType.cppdbg;
} else if (compilerName === "cl.exe") {
newConfig.miDebuggerPath = undefined;
newConfig.type = DebuggerType.cppvsdbg;
return resolve(newConfig);
} else {
debuggerName = "gdb";
}
if (isWindows) {
debuggerName = debuggerName.endsWith(".exe") ? debuggerName : (debuggerName + ".exe");
}
const compilerDirname: string = path.dirname(compilerPath);
const debuggerPath: string = path.join(compilerDirname, debuggerName);
// Check if debuggerPath exists.
if (await util.checkFileExists(debuggerPath)) {
newConfig.miDebuggerPath = debuggerPath;
} else if ((await util.whichAsync(debuggerName)) !== undefined) {
// Check if debuggerName exists on $PATH
newConfig.miDebuggerPath = debuggerName;
} else {
// Try the usr path for non-windows platforms.
const usrDebuggerPath: string = path.join("/usr", "bin", debuggerName);
if (!isWindows && await util.checkFileExists(usrDebuggerPath)) {
newConfig.miDebuggerPath = usrDebuggerPath;
} else {
logger.getOutputChannelLogger().appendLine(localize('debugger.path.not.exists', "Unable to find the {0} debugger. The debug configuration for {1} is ignored.", `\"${debuggerName}\"`, compilerName));
return resolve(undefined);
}
}
return resolve(newConfig);
newConfig.type = DebuggerType.cppdbg;
} else if (compilerName === "cl.exe") {
newConfig.miDebuggerPath = undefined;
newConfig.type = DebuggerType.cppvsdbg;
return newConfig;
} else {
debuggerName = "gdb";
}
});
if (isWindows) {
debuggerName = debuggerName.endsWith(".exe") ? debuggerName : (debuggerName + ".exe");
}
const compilerDirname: string = path.dirname(compilerPath);
const debuggerPath: string = path.join(compilerDirname, debuggerName);
// Check if debuggerPath exists.
if (await util.checkFileExists(debuggerPath)) {
newConfig.miDebuggerPath = debuggerPath;
} else if ((await util.whichAsync(debuggerName)) !== undefined) {
// Check if debuggerName exists on $PATH
newConfig.miDebuggerPath = debuggerName;
} else {
// Try the usr path for non-windows platforms.
const usrDebuggerPath: string = path.join("/usr", "bin", debuggerName);
if (!isWindows && await util.checkFileExists(usrDebuggerPath)) {
newConfig.miDebuggerPath = usrDebuggerPath;
} else {
logger.getOutputChannelLogger().appendLine(localize('debugger.path.not.exists', "Unable to find the {0} debugger. The debug configuration for {1} is ignored.", `\"${debuggerName}\"`, compilerName));
return undefined;
}
}
}
return newConfig;
}))).filter((item): item is CppDebugConfiguration => !!item);
}
configs.push(defaultTemplateConfig);
@@ -547,7 +539,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
}
// Don't offer tasks for header files.
const isHeader: boolean = util.isHeaderFile (editor.document.uri);
const isHeader: boolean = util.isHeaderFile(editor.document.uri);
if (isHeader) {
DebugConfigurationProvider.detectedBuildTasks = emptyTasks;
return;
@@ -590,9 +582,9 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
return configurationLabel.startsWith("C/C++: cl.exe");
}
private showErrorIfClNotAvailable(configurationLabel: string): boolean {
private showErrorIfClNotAvailable(_configurationLabel: string): boolean {
if (!process.env.DevEnvDir || process.env.DevEnvDir.length === 0) {
vscode.window.showErrorMessage(localize("cl.exe.not.available", "{0} build and debug is only usable when VS Code is run from the Developer Command Prompt for VS.", "cl.exe"));
void vscode.window.showErrorMessage(localize("cl.exe.not.available", "{0} build and debug is only usable when VS Code is run from the Developer Command Prompt for VS.", "cl.exe"));
return true;
}
return false;
@@ -642,7 +634,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
// show error message if single lines cannot get parsed
if (parsedFile.Warning) {
DebugConfigurationProvider.showFileWarningAsync(parsedFile.Warning, config.envFile);
void DebugConfigurationProvider.showFileWarningAsync(parsedFile.Warning, config.envFile);
}
config.environment = parsedFile.Env;
@@ -715,7 +707,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
if (result && result.title === openItem.title) {
const doc: vscode.TextDocument = await vscode.workspace.openTextDocument(fileName);
if (doc) {
vscode.window.showTextDocument(doc);
void vscode.window.showTextDocument(doc);
}
}
}
@@ -723,19 +715,19 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
private localizeConfigDetail(items: ConfigMenu[]): ConfigMenu[] {
items.map((item: ConfigMenu) => {
switch (item.detail) {
case TaskStatus.recentlyUsed : {
case TaskStatus.recentlyUsed: {
item.detail = localize("recently.used.task", "Recently Used Task");
break;
}
case TaskStatus.configured : {
case TaskStatus.configured: {
item.detail = localize("configured.task", "Configured Task");
break;
}
case TaskStatus.detected : {
case TaskStatus.detected: {
item.detail = localize("detected.task", "Detected Task");
break;
}
default : {
default: {
break;
}
}
@@ -748,6 +740,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
}
private findDefaultConfig(configs: CppDebugConfiguration[]): CppDebugConfiguration[] {
// eslint-disable-next-line no-prototype-builtins
return configs.filter((config: CppDebugConfiguration) => (config.hasOwnProperty("isDefault") && config.isDefault));
}
@@ -832,14 +825,14 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
return util.getRawJson(path);
}
public async writeDebugConfig(config: vscode.DebugConfiguration, isExistingConfig: boolean, folder?: vscode.WorkspaceFolder): Promise<void> {
public async writeDebugConfig(config: vscode.DebugConfiguration, isExistingConfig: boolean, _folder?: vscode.WorkspaceFolder): Promise<void> {
const launchJsonPath: string | undefined = this.getLaunchJsonPath();
if (isExistingConfig) {
if (launchJsonPath) {
const doc: vscode.TextDocument = await vscode.workspace.openTextDocument(launchJsonPath);
if (doc) {
vscode.window.showTextDocument(doc);
void vscode.window.showTextDocument(doc);
}
}
return;
@@ -872,7 +865,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
await vscode.workspace.openTextDocument(launchJsonPath);
const doc: vscode.TextDocument = await vscode.workspace.openTextDocument(launchJsonPath);
if (doc) {
vscode.window.showTextDocument(doc);
void vscode.window.showTextDocument(doc);
}
}
@@ -932,7 +925,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
private async selectConfiguration(textEditor: vscode.TextEditor, pickDefault: boolean = true, onlyWorkspaceFolder: boolean = false): Promise<CppDebugConfiguration | undefined> {
const folder: vscode.WorkspaceFolder | undefined = vscode.workspace.getWorkspaceFolder(textEditor.document.uri);
if (!util.isCppOrCFile(textEditor.document.uri)) {
vscode.window.showErrorMessage(localize("cannot.build.non.cpp", 'Cannot build and debug because the active file is not a C or C++ source file.'));
void vscode.window.showErrorMessage(localize("cannot.build.non.cpp", 'Cannot build and debug because the active file is not a C or C++ source file.'));
return;
}
@@ -988,7 +981,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
} catch (errJS) {
const e: Error = errJS as Error;
if (e && e.message === util.failedToParseJson) {
vscode.window.showErrorMessage(util.failedToParseJson);
void vscode.window.showErrorMessage(util.failedToParseJson);
}
Telemetry.logDebuggerEvent(config.debuggerEvent || DebuggerEvent.debugPanel, { "debugType": config.debugType || DebugType.debug, "configSource": config.configSource || ConfigSource.unknown, "configMode": configMode, "cancelled": "false", "succeeded": "false" });
}
@@ -1041,7 +1034,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
case StepType.command: {
// VS Code commands are the same regardless of which extension invokes them, so just invoke them here.
if (step.args && !Array.isArray(step.args)) {
logger.getOutputChannelLogger().showErrorMessage(localize('command.args.must.be.array', '"args" in command deploy step must be an array.'));
void logger.getOutputChannelLogger().showErrorMessage(localize('command.args.must.be.array', '"args" in command deploy step must be an array.'));
return false;
}
const returnCode: unknown = await vscode.commands.executeCommand(step.command, ...step.args);
@@ -1051,7 +1044,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
case StepType.rsync: {
const isScp: boolean = stepType === StepType.scp;
if (!step.files || !step.targetDir || !step.host) {
logger.getOutputChannelLogger().showErrorMessage(localize('missing.properties.copyFile', '"host", "files", and "targetDir" are required in {0} steps.', isScp ? 'SCP' : 'rsync'));
void logger.getOutputChannelLogger().showErrorMessage(localize('missing.properties.copyFile', '"host", "files", and "targetDir" are required in {0} steps.', isScp ? 'SCP' : 'rsync'));
return false;
}
const host: util.ISshHostInfo = util.isString(step.host) ? { hostName: step.host } : { hostName: step.host.hostName, user: step.host.user, port: step.host.port };
@@ -1064,7 +1057,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
files = files.concat((await globAsync(fileGlob)).map(file => vscode.Uri.file(file)));
}
} else {
logger.getOutputChannelLogger().showErrorMessage(localize('incorrect.files.type.copyFile', '"files" must be a string or an array of strings in {0} steps.', isScp ? 'SCP' : 'rsync'));
void logger.getOutputChannelLogger().showErrorMessage(localize('incorrect.files.type.copyFile', '"files" must be a string or an array of strings in {0} steps.', isScp ? 'SCP' : 'rsync'));
return false;
}
@@ -1082,7 +1075,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
}
case StepType.ssh: {
if (!step.host || !step.command) {
logger.getOutputChannelLogger().showErrorMessage(localize('missing.properties.ssh', '"host" and "command" are required for ssh steps.'));
void logger.getOutputChannelLogger().showErrorMessage(localize('missing.properties.ssh', '"host" and "command" are required for ssh steps.'));
return false;
}
const host: util.ISshHostInfo = util.isString(step.host) ? { hostName: step.host } : { hostName: step.host.hostName, user: step.host.user, port: step.host.port };
@@ -1097,12 +1090,12 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
}
case StepType.shell: {
if (!step.command) {
logger.getOutputChannelLogger().showErrorMessage(localize('missing.properties.shell', '"command" is required for shell steps.'));
void logger.getOutputChannelLogger().showErrorMessage(localize('missing.properties.shell', '"command" is required for shell steps.'));
return false;
}
const taskResult: util.ProcessReturnType = await util.spawnChildProcess(step.command, undefined, step.continueOn);
if (!taskResult.succeeded || cancellationToken?.isCancellationRequested) {
logger.getOutputChannelLogger().showErrorMessage(taskResult.output);
void logger.getOutputChannelLogger().showErrorMessage(taskResult.output);
return false;
}
break;
@@ -1249,7 +1242,7 @@ export class ConfigurationSnippetProvider implements vscode.CompletionItemProvid
this.provider = provider;
this.snippets = this.provider.getConfigurationSnippets();
}
public resolveCompletionItem(item: vscode.CompletionItem, token: vscode.CancellationToken): Thenable<vscode.CompletionItem> {
public resolveCompletionItem(item: vscode.CompletionItem, _token: vscode.CancellationToken): Thenable<vscode.CompletionItem> {
return Promise.resolve(item);
}
@@ -1257,14 +1250,16 @@ export class ConfigurationSnippetProvider implements vscode.CompletionItemProvid
// There are two cases where the configuration array has nothing or has some items.
// 1. If it has nothing, insert a snippet the user selected.
// 2. If there are items, the Add Configuration button will append it to the start of the configuration array. This function inserts a comma at the end of the snippet.
public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, context: vscode.CompletionContext): Thenable<vscode.CompletionList> {
public provideCompletionItems(document: vscode.TextDocument, _position: vscode.Position, _token: vscode.CancellationToken, _context: vscode.CompletionContext): Thenable<vscode.CompletionList> {
let items: vscode.CompletionItem[] = this.snippets;
let hasLaunchConfigs: boolean = false;
try {
const launch: any = jsonc.parse(document.getText());
hasLaunchConfigs = launch.configurations.length !== 0;
} catch {
// ignore
}
// Check to see if the array is empty, so any additional inserted snippets will need commas.
if (hasLaunchConfigs) {
items = [];
+1 -1
View File
@@ -4,8 +4,8 @@
* ------------------------------------------------------------------------------------------ */
import * as os from 'os';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { configPrefix } from '../LanguageServer/extension';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
@@ -3,9 +3,9 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from "vscode";
import * as path from 'path';
import * as os from 'os';
import * as path from 'path';
import * as vscode from "vscode";
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
@@ -30,7 +30,7 @@ export class CppdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterDes
super(context);
}
async createDebugAdapterDescriptor(session: vscode.DebugSession, executable?: vscode.DebugAdapterExecutable): Promise<vscode.DebugAdapterDescriptor> {
async createDebugAdapterDescriptor(_session: vscode.DebugSession, _executable?: vscode.DebugAdapterExecutable): Promise<vscode.DebugAdapterDescriptor> {
const adapter: string = "./debugAdapters/bin/OpenDebugAD7" + (os.platform() === 'win32' ? ".exe" : "");
const command: string = path.join(this.context.extensionPath, adapter);
@@ -44,9 +44,9 @@ export class CppvsdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterD
super(context);
}
async createDebugAdapterDescriptor(session: vscode.DebugSession, executable?: vscode.DebugAdapterExecutable): Promise<vscode.DebugAdapterDescriptor | null> {
async createDebugAdapterDescriptor(_session: vscode.DebugSession, _executable?: vscode.DebugAdapterExecutable): Promise<vscode.DebugAdapterDescriptor | null> {
if (os.platform() !== 'win32') {
vscode.window.showErrorMessage(localize("debugger.not.available", "Debugger type '{0}' is not avaliable for non-Windows machines.", "cppvsdbg"));
void vscode.window.showErrorMessage(localize("debugger.not.available", "Debugger type '{0}' is not avaliable for non-Windows machines.", "cppvsdbg"));
return null;
} else {
return new vscode.DebugAdapterExecutable(
+22 -22
View File
@@ -3,24 +3,24 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import * as chokidar from 'chokidar';
import * as os from 'os';
import { AttachPicker, RemoteAttachPicker, AttachItemsProvider } from './attachToProcess';
import { NativeAttachItemsProviderFactory } from './nativeAttach';
import { DebugConfigurationProvider, ConfigurationAssetProviderFactory, ConfigurationSnippetProvider, IConfigurationAssetProvider } from './configurationProvider';
import { CppdbgDebugAdapterDescriptorFactory, CppvsdbgDebugAdapterDescriptorFactory } from './debugAdapterDescriptorFactory';
import { DebuggerType } from './configurations';
import { Configuration } from 'ssh-config';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { getActiveSshTarget, initializeSshTargets, selectSshTarget, SshTargetsProvider } from '../SSH/TargetsView/sshTargetsProvider';
import { addSshTargetCmd, BaseNode, refreshCppSshTargetsViewCmd } from '../SSH/TargetsView/common';
import { setActiveSshTarget, TargetLeafNode } from '../SSH/TargetsView/targetNodes';
import { pathAccessible } from '../common';
import { CppSettings } from '../LanguageServer/settings';
import { getSshChannel } from '../logger';
import { sshCommandToConfig } from '../SSH/sshCommandToConfig';
import { getSshConfiguration, getSshConfigurationFiles, parseFailures, writeSshConfiguration } from '../SSH/sshHosts';
import { Configuration } from 'ssh-config';
import { CppSettings } from '../LanguageServer/settings';
import * as chokidar from 'chokidar';
import { getSshChannel } from '../logger';
import { pathAccessible } from '../common';
import { addSshTargetCmd, BaseNode, refreshCppSshTargetsViewCmd } from '../SSH/TargetsView/common';
import { getActiveSshTarget, initializeSshTargets, selectSshTarget, SshTargetsProvider } from '../SSH/TargetsView/sshTargetsProvider';
import { setActiveSshTarget, TargetLeafNode } from '../SSH/TargetsView/targetNodes';
import { AttachItemsProvider, AttachPicker, RemoteAttachPicker } from './attachToProcess';
import { ConfigurationAssetProviderFactory, ConfigurationSnippetProvider, DebugConfigurationProvider, IConfigurationAssetProvider } from './configurationProvider';
import { DebuggerType } from './configurations';
import { CppdbgDebugAdapterDescriptorFactory, CppvsdbgDebugAdapterDescriptorFactory } from './debugAdapterDescriptorFactory';
import { NativeAttachItemsProviderFactory } from './nativeAttach';
// The extension deactivate method is asynchronous, so we handle the disposables ourselves instead of using extensionContext.subscriptions.
const disposables: vscode.Disposable[] = [];
@@ -54,14 +54,14 @@ export async function initialize(context: vscode.ExtensionContext): Promise<void
// Register DebugConfigurationProviders for "Run and Debug" play button.
const debugProvider: DebugConfigurationProvider = new DebugConfigurationProvider(assetProvider, DebuggerType.all);
// eslint-disable-next-line @typescript-eslint/no-misused-promises
disposables.push(vscode.commands.registerTextEditorCommand("C_Cpp.BuildAndDebugFile", async (textEditor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args: any[]) => { await debugProvider.buildAndDebug(textEditor); }));
disposables.push(vscode.commands.registerTextEditorCommand("C_Cpp.BuildAndDebugFile", async (textEditor: vscode.TextEditor, _edit: vscode.TextEditorEdit, ..._args: any[]) => { await debugProvider.buildAndDebug(textEditor); }));
// eslint-disable-next-line @typescript-eslint/no-misused-promises
disposables.push(vscode.commands.registerTextEditorCommand("C_Cpp.BuildAndRunFile", async (textEditor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args: any[]) => { await debugProvider.buildAndRun(textEditor); }));
disposables.push(vscode.commands.registerTextEditorCommand("C_Cpp.BuildAndRunFile", async (textEditor: vscode.TextEditor, _edit: vscode.TextEditorEdit, ..._args: any[]) => { await debugProvider.buildAndRun(textEditor); }));
// eslint-disable-next-line @typescript-eslint/no-misused-promises
disposables.push(vscode.commands.registerTextEditorCommand("C_Cpp.AddDebugConfiguration", async (textEditor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args: any[]) => {
disposables.push(vscode.commands.registerTextEditorCommand("C_Cpp.AddDebugConfiguration", async (textEditor: vscode.TextEditor, _edit: vscode.TextEditorEdit, ..._args: any[]) => {
const folder: vscode.WorkspaceFolder | undefined = vscode.workspace.getWorkspaceFolder(textEditor.document.uri);
if (!folder) {
vscode.window.showWarningMessage(localize("add.debug.configuration.not.available.for.single.file", "Add debug configuration is not available for single file."));
void vscode.window.showWarningMessage(localize("add.debug.configuration.not.available.for.single.file", "Add debug configuration is not available for single file."));
}
await debugProvider.addDebugConfiguration(textEditor);
}));
@@ -78,7 +78,7 @@ export async function initialize(context: vscode.ExtensionContext): Promise<void
disposables.push(vscode.languages.registerCompletionItemProvider(launchJsonDocumentSelector, new ConfigurationSnippetProvider(assetProvider)));
// Register Debug Adapters
disposables.push(vscode.debug.registerDebugAdapterDescriptorFactory(DebuggerType.cppvsdbg , new CppvsdbgDebugAdapterDescriptorFactory(context)));
disposables.push(vscode.debug.registerDebugAdapterDescriptorFactory(DebuggerType.cppvsdbg, new CppvsdbgDebugAdapterDescriptorFactory(context)));
disposables.push(vscode.debug.registerDebugAdapterDescriptorFactory(DebuggerType.cppdbg, new CppdbgDebugAdapterDescriptorFactory(context)));
// SSH Targets View
@@ -111,7 +111,7 @@ export async function initialize(context: vscode.ExtensionContext): Promise<void
// Active SSH Target initialized in initializeSshTargets()
if (sshTargetsViewSetting === 'enabled' || (sshTargetsViewSetting === 'default' && await getActiveSshTarget(false))) {
// Don't wait
enableSshTargetsView();
void enableSshTargetsView();
}
disposables.push(vscode.workspace.onDidChangeConfiguration(async (e: vscode.ConfigurationChangeEvent) => {
@@ -128,7 +128,7 @@ export async function initialize(context: vscode.ExtensionContext): Promise<void
export function dispose(): void {
if (sshConfigWatcher) {
sshConfigWatcher.close();
void sshConfigWatcher.close();
sshConfigWatcher = undefined;
}
disposables.forEach(d => d.dispose());
@@ -160,7 +160,7 @@ async function enableSshTargetsView(): Promise<void> {
async function disableSshTargetsView(): Promise<void> {
await vscode.commands.executeCommand('setContext', 'cpptools.enableSshTargetsView', false);
if (sshConfigWatcher) {
sshConfigWatcher.close();
void sshConfigWatcher.close();
sshConfigWatcher = undefined;
}
sshTargetsViewEnabled = false;
+4 -3
View File
@@ -5,11 +5,11 @@
import * as child_process from 'child_process';
import * as os from 'os';
import { AttachItemsProvider } from './attachToProcess';
import { AttachItem } from './attachQuickPick';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { findPowerShell } from '../common';
import * as vscode from 'vscode';
import { AttachItem } from './attachQuickPick';
import { AttachItemsProvider } from './attachToProcess';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -119,6 +119,7 @@ export class PsProcessParser {
// Since 'args' contains the full path to the executable, even if truncated, searching will work as desired.
public static get psLinuxCommand(): string { return `ps axww -o pid=,comm=${PsProcessParser.commColumnTitle},args=`; }
public static get psDarwinCommand(): string { return `ps axww -o pid=,comm=${PsProcessParser.commColumnTitle},args= -c`; }
public static get psToyboxCommand(): string { return `ps -A -o pid=,comm=${PsProcessParser.commColumnTitle},args=`; }
// Only public for tests.
public static ParseProcessFromPs(processes: string): Process[] {
@@ -2,12 +2,13 @@
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as path from 'path';
import * as vscode from 'vscode';
import * as Telemetry from '../../telemetry';
import { DefaultClient, CancelReferencesNotification, workspaceReferences } from '../client';
import { processDelayedDidOpen } from '../extension';
import { CallHierarchyResultCallback } from '../references';
import { Position, Range, RequestType, TextDocumentIdentifier } from 'vscode-languageclient';
import * as Telemetry from '../../telemetry';
import { DefaultClient, workspaceReferences } from '../client';
import { processDelayedDidOpen } from '../extension';
import { CancellationSender } from '../references';
import { makeVscodeRange } from '../utils';
interface CallHierarchyItem {
@@ -53,7 +54,7 @@ interface CallHierarchyItemResult {
/**
* If a request is cancelled, `succeeded` will be undefined to indicate no result was returned.
* Therfore, object is not defined as optional on the language server.
* Therefore, object is not defined as optional on the language server.
*/
succeeded: boolean;
}
@@ -76,17 +77,20 @@ export interface CallHierarchyCallsItemResult {
calls: CallHierarchyCallsItem[];
}
export enum CallHierarchyRequestStatus {
enum CallHierarchyRequestStatus {
Unknown,
Succeeded,
Canceled,
CaneledByUser,
CanceledByUser,
Failed
}
const CallHierarchyItemRequest: RequestType<CallHierarchyParams, CallHierarchyItemResult, void> =
new RequestType<CallHierarchyParams, CallHierarchyItemResult, void>('cpptools/prepareCallHierarchy');
const CallHierarchyCallsToRequest: RequestType<CallHierarchyParams, CallHierarchyCallsItemResult, void> =
new RequestType<CallHierarchyParams, CallHierarchyCallsItemResult, void>('cpptools/callHierarchyCallsTo');
const CallHierarchyCallsFromRequest: RequestType<CallHierarchyParams, CallHierarchyCallsItemResult, void> =
new RequestType<CallHierarchyParams, CallHierarchyCallsItemResult, void>('cpptools/callHierarchyCallsFrom');
@@ -94,26 +98,47 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
// Indicates whether a request is from an entry root node (e.g. top function in the call tree).
private isEntryRootNodeTelemetry: boolean = false;
private client: DefaultClient;
constructor(client: DefaultClient) {
this.client = client;
}
public async prepareCallHierarchy(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken):
Promise<vscode.CallHierarchyItem | undefined> {
public async prepareCallHierarchy(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise<vscode.CallHierarchyItem | undefined> {
await this.client.enqueue(() => processDelayedDidOpen(document));
workspaceReferences.cancelCurrentReferenceRequest(CancellationSender.NewRequest);
workspaceReferences.clearViews();
const range: vscode.Range | undefined = document.getWordRangeAtPosition(position);
if (range === undefined) {
return undefined;
}
await this.client.requestWhenReady(() => processDelayedDidOpen(document));
// Listen to a cancellation for this request. When this request is cancelled,
// use a local cancellation source to explicitly cancel a token.
const cancelSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
const cancellationTokenListener: vscode.Disposable = token.onCancellationRequested(() => {
cancelSource.cancel();
});
const requestCanceledListener: vscode.Disposable = workspaceReferences.onCancellationRequested(_sender => {
cancelSource.cancel();
});
const params: CallHierarchyParams = {
textDocument: { uri: document.uri.toString() },
position: Position.create(position.line, position.character)
};
const response: CallHierarchyItemResult = await this.client.languageClient.sendRequest(CallHierarchyItemRequest, params, token);
if (token.isCancellationRequested || response.succeeded === undefined) {
throw new vscode.CancellationError();
const response: CallHierarchyItemResult = await this.client.languageClient.sendRequest(CallHierarchyItemRequest, params, cancelSource.token);
cancellationTokenListener.dispose();
requestCanceledListener.dispose();
if (cancelSource.token.isCancellationRequested || response.succeeded === undefined) {
// Return undefined instead of vscode.CancellationError to avoid the following error message from VS Code:
// "MISSING provider."
// TODO: per issue https://github.com/microsoft/vscode/issues/169698 vscode.CancellationError is expected,
// so when VS Code fixes the error use vscode.CancellationError again.
return undefined;
} else if (response.item === undefined) {
return undefined;
}
@@ -123,95 +148,75 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
}
public async provideCallHierarchyIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken):
Promise<vscode.CallHierarchyIncomingCall[] | undefined | any> {
return new Promise<vscode.CallHierarchyIncomingCall[] | undefined | any>((resolve, reject) => {
const CallHierarchyCallsToEvent: string = "CallHierarchyCallsTo";
if (item === undefined) {
this.logTelemetry(CallHierarchyCallsToEvent, CallHierarchyRequestStatus.Failed);
resolve(undefined);
return;
}
Promise<vscode.CallHierarchyIncomingCall[] | undefined> {
await this.client.ready;
workspaceReferences.cancelCurrentReferenceRequest(CancellationSender.NewRequest);
const callback: () => Promise<void> = async () => {
await this.client.awaitUntilLanguageClientReady();
const params: CallHierarchyParams = {
textDocument: { uri: item.uri.toString() },
position: Position.create(item.range.start.line, item.range.start.character)
};
DefaultClient.referencesParams = params;
// The current request is represented by referencesParams. If a request detects
// referencesParams does not match the object used when creating the request, abort it.
if (params !== DefaultClient.referencesParams) {
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
resolve(undefined);
}
DefaultClient.referencesRequestPending = true;
const CallHierarchyCallsToEvent: string = "CallHierarchyCallsTo";
if (item === undefined) {
this.logTelemetry(CallHierarchyCallsToEvent, CallHierarchyRequestStatus.Failed);
return undefined;
}
// Register a single-fire handler for the reply.
const resultCallback: CallHierarchyResultCallback =
(result: CallHierarchyCallsItemResult | null, canceledByUser: boolean, progressBarDuration?: number) => {
DefaultClient.referencesRequestPending = false;
if (result === null || result?.calls === undefined) {
const requestStatus: CallHierarchyRequestStatus = canceledByUser ? CallHierarchyRequestStatus.CaneledByUser : CallHierarchyRequestStatus.Canceled;
this.logTelemetry(CallHierarchyCallsToEvent, requestStatus, progressBarDuration);
reject(new vscode.CancellationError());
} else {
this.logTelemetry(CallHierarchyCallsToEvent, CallHierarchyRequestStatus.Succeeded, progressBarDuration);
if (result?.calls.length === 0) {
resolve(undefined);
} else {
resolve(this.createIncomingCalls(result.calls));
}
}
this.client.clearPendingReferencesCancellations();
};
workspaceReferences.setCallHierarchyResultsCallback(resultCallback);
workspaceReferences.startCallHierarchyIncomingCalls(params);
token.onCancellationRequested(e => {
if (params === DefaultClient.referencesParams) {
this.client.cancelReferences();
}
});
};
if (DefaultClient.referencesRequestPending || workspaceReferences.symbolSearchInProgress) {
const cancelling: boolean = DefaultClient.referencesPendingCancellations.length > 0;
DefaultClient.referencesPendingCancellations.push({
reject: () => {
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
resolve(undefined);
}, callback
});
if (!cancelling) {
workspaceReferences.referencesCanceled = true;
this.client.languageClient.sendNotification(CancelReferencesNotification);
}
} else {
callback();
}
// Listen to a cancellation for this request. When this request is cancelled,
// use a local cancellation source to explicitly cancel a token.
let requestCanceled: CancellationSender | undefined;
const cancelSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
const cancellationTokenListener: vscode.Disposable = token.onCancellationRequested(() => {
requestCanceled = CancellationSender.ProviderToken;
cancelSource.cancel();
});
const requestCanceledListener: vscode.Disposable = workspaceReferences.onCancellationRequested(sender => {
requestCanceled = sender;
cancelSource.cancel();
});
// Send the request to the language server.
let result: vscode.CallHierarchyIncomingCall[] | undefined;
const params: CallHierarchyParams = {
textDocument: { uri: item.uri.toString() },
position: Position.create(item.range.start.line, item.range.start.character)
};
const response: CallHierarchyCallsItemResult = await this.client.languageClient.sendRequest(CallHierarchyCallsToRequest, params, cancelSource.token);
// Reset anything that can be cleared before processing the result.
const progressBarDuration: number | undefined = workspaceReferences.getCallHierarchyProgressBarDuration();
workspaceReferences.resetProgressBar();
workspaceReferences.resetReferences();
cancellationTokenListener.dispose();
requestCanceledListener.dispose();
// Process the result.
if (cancelSource.token.isCancellationRequested || response.calls === undefined || requestCanceled !== undefined) {
const requestStatus: CallHierarchyRequestStatus = requestCanceled === CancellationSender.User ?
CallHierarchyRequestStatus.CanceledByUser : CallHierarchyRequestStatus.Canceled;
this.logTelemetry(CallHierarchyCallsToEvent, requestStatus, progressBarDuration);
throw new vscode.CancellationError();
} else if (response.calls.length !== 0) {
result = this.createIncomingCalls(response.calls);
}
this.logTelemetry(CallHierarchyCallsToEvent, CallHierarchyRequestStatus.Succeeded, progressBarDuration);
return result;
}
public async provideCallHierarchyOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken):
Promise<vscode.CallHierarchyOutgoingCall[] | undefined> {
Promise<vscode.CallHierarchyOutgoingCall[] | undefined> {
const CallHierarchyCallsFromEvent: string = "CallHierarchyCallsFrom";
if (item === undefined) {
this.logTelemetry(CallHierarchyCallsFromEvent, CallHierarchyRequestStatus.Failed);
return undefined;
}
await this.client.awaitUntilLanguageClientReady();
await this.client.ready;
let result: vscode.CallHierarchyOutgoingCall[] | undefined;
const params: CallHierarchyParams = {
textDocument: { uri: item.uri.toString() },
position: Position.create(item.range.start.line, item.range.start.character)
};
const response: CallHierarchyCallsItemResult = await this.client.languageClient.sendRequest(CallHierarchyCallsFromRequest, params, token);
if (token.isCancellationRequested || response.calls === undefined) {
this.logTelemetry(CallHierarchyCallsFromEvent, CallHierarchyRequestStatus.Canceled);
throw new vscode.CancellationError();
@@ -224,8 +229,10 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
}
private makeVscodeCallHierarchyItem(item: CallHierarchyItem): vscode.CallHierarchyItem {
const containerDetail: string = (item.detail !== "") ? `${item.detail} - ` : "";
const fileDetail: string = `${path.basename(item.uri)} (${path.dirname(item.uri)})`;
return new vscode.CallHierarchyItem(
item.kind, item.name, item.detail,
item.kind, item.name, containerDetail + fileDetail,
vscode.Uri.file(item.uri),
makeVscodeRange(item.range),
makeVscodeRange(item.selectionRange));
@@ -276,7 +283,7 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
case CallHierarchyRequestStatus.Unknown: status = "Unknown"; break;
case CallHierarchyRequestStatus.Succeeded: status = "Succeeded"; break;
case CallHierarchyRequestStatus.Canceled: status = "Canceled"; break;
case CallHierarchyRequestStatus.CaneledByUser: status = "CaneledByUser"; break;
case CallHierarchyRequestStatus.CanceledByUser: status = "CanceledByUser"; break;
case CallHierarchyRequestStatus.Failed: status = "Failed"; break;
}
@@ -3,13 +3,14 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { Position, Range, RequestType, TextEdit } from 'vscode-languageclient';
import { Position, Range, RequestType, TextEdit } from 'vscode-languageclient';
import { DefaultClient } from '../client';
import { CodeActionCodeInfo, CodeActionDiagnosticInfo, codeAnalysisFileToCodeActions, codeAnalysisCodeToFixes,
codeAnalysisAllFixes } from '../codeAnalysis';
import { makeVscodeRange } from '../utils';
import {
CodeActionCodeInfo, CodeActionDiagnosticInfo, codeAnalysisAllFixes, codeAnalysisCodeToFixes, codeAnalysisFileToCodeActions
} from '../codeAnalysis';
import { LocalizeStringParams, getLocalizedString } from '../localization';
import { CppSettings } from '../settings';
import { getLocalizedString, LocalizeStringParams } from '../localization';
import { makeVscodeRange } from '../utils';
interface GetCodeActionsRequestParams {
uri: string;
@@ -22,12 +23,18 @@ interface CodeActionCommand {
arguments?: any[];
edit?: TextEdit;
uri?: string;
range?: Range;
}
interface GetCodeActionsResult {
commands: CodeActionCommand[];
}
export interface CreateDeclDefnCommandArguments {
sender: string;
range: Range;
}
export const GetCodeActionsRequest: RequestType<GetCodeActionsRequestParams, GetCodeActionsResult, void> =
new RequestType<GetCodeActionsRequestParams, GetCodeActionsResult, void>('cpptools/getCodeActions');
@@ -39,7 +46,7 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
public async provideCodeActions(document: vscode.TextDocument, range: vscode.Range | vscode.Selection,
context: vscode.CodeActionContext, token: vscode.CancellationToken): Promise<(vscode.Command | vscode.CodeAction)[]> {
await this.client.awaitUntilLanguageClientReady();
await this.client.ready;
let r: Range;
if (range instanceof vscode.Selection) {
if (range.active.isBefore(range.anchor)) {
@@ -118,7 +125,7 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
if (codeActionCodeInfo !== undefined) {
if (codeActionCodeInfo.fixAllTypeCodeAction !== undefined &&
(codeActionCodeInfo.uriToInfo.size > 1 ||
codeActionCodeInfo.uriToInfo.values().next().value.numValidWorkspaceEdits > 1)) {
codeActionCodeInfo.uriToInfo.values().next().value.numValidWorkspaceEdits > 1)) {
// Only show the "fix all type" if there is more than one fix for the type.
fixCodeActions.push(codeActionCodeInfo.fixAllTypeCodeAction);
}
@@ -135,7 +142,7 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
if (codeActionCodeInfo.removeAllTypeCodeAction !== undefined &&
codeActionCodeInfo.uriToInfo.size > 0 &&
(codeActionCodeInfo.uriToInfo.size > 1 ||
codeActionCodeInfo.uriToInfo.values().next().value.identifiers.length > 1)) {
codeActionCodeInfo.uriToInfo.values().next().value.identifiers.length > 1)) {
// Only show the "clear all type" if there is more than one fix for the type.
removeAllTypeAvailable = true;
}
@@ -179,8 +186,14 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
resultCodeActions.push(...disableCodeActions);
resultCodeActions.push(...docCodeActions);
return;
} else if (command.command === 'C_Cpp.CreateDeclarationOrDefinition' && (command.arguments ?? []).length === 0) {
command.arguments = ['codeAction']; // We report the sender of the command
} else if ((command.command === 'C_Cpp.CreateDeclarationOrDefinition' || command.command === 'C_Cpp.CopyDeclarationOrDefinition')
&& (command.arguments ?? []).length === 0 && command.range !== undefined) {
const args: CreateDeclDefnCommandArguments = {
sender: 'codeAction',
range: command.range
};
command.arguments = [];
command.arguments.push(args);
} else if (command.command === "C_Cpp.SelectIntelliSenseConfiguration") {
command.arguments = ['codeAction'];
hasSelectIntelliSenseConfiguration = true;
@@ -3,7 +3,7 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { DefaultClient, FormatParams, FormatDocumentRequest, FormatResult } from '../client';
import { DefaultClient, FormatDocumentRequest, FormatParams, FormatResult } from '../client';
import { CppSettings, getEditorConfigSettings, OtherSettings } from '../settings';
import { makeVscodeTextEdits } from '../utils';
@@ -18,7 +18,7 @@ export class DocumentFormattingEditProvider implements vscode.DocumentFormatting
if (settings.formattingEngine === "disabled") {
return [];
}
await this.client.awaitUntilLanguageClientReady();
await this.client.ready;
const filePath: string = document.uri.fsPath;
const onChanges: string | number | boolean = options.onChanges;
if (onChanges) {
@@ -18,7 +18,7 @@ export class DocumentRangeFormattingEditProvider implements vscode.DocumentRange
if (settings.formattingEngine === "disabled") {
return [];
}
await this.client.awaitUntilLanguageClientReady();
await this.client.ready;
const filePath: string = document.uri.fsPath;
const useVcFormat: boolean = settings.useVcFormat(document);
const configCallBack = async (editorConfigSettings: any | undefined) => {
@@ -57,5 +57,5 @@ export class DocumentRangeFormattingEditProvider implements vscode.DocumentRange
const editorConfigSettings: any = getEditorConfigSettings(filePath);
return configCallBack(editorConfigSettings);
}
};
}
}
@@ -3,10 +3,10 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { DefaultClient, LocalizeDocumentSymbol, GetDocumentSymbolRequestParams, GetDocumentSymbolRequest, SymbolScope, Client, GetDocumentSymbolResult } from '../client';
import { Client, DefaultClient, GetDocumentSymbolRequest, GetDocumentSymbolRequestParams, GetDocumentSymbolResult, LocalizeDocumentSymbol, SymbolScope } from '../client';
import { clients, processDelayedDidOpen } from '../extension';
import { makeVscodeRange } from '../utils';
import { getLocalizedString, getLocalizedSymbolScope } from '../localization';
import { makeVscodeRange } from '../utils';
export class DocumentSymbolProvider implements vscode.DocumentSymbolProvider {
private getChildrenSymbols(symbols: LocalizeDocumentSymbol[]): vscode.DocumentSymbol[] {
@@ -57,14 +57,14 @@ export class DocumentSymbolProvider implements vscode.DocumentSymbolProvider {
const client: Client = clients.getClientFor(document.uri);
if (client instanceof DefaultClient) {
const defaultClient: DefaultClient = <DefaultClient>client;
await client.requestWhenReady(() => processDelayedDidOpen(document));
await client.enqueue(() => processDelayedDidOpen(document));
const params: GetDocumentSymbolRequestParams = {
uri: document.uri.toString()
};
const response: GetDocumentSymbolResult = await defaultClient.languageClient.sendRequest(GetDocumentSymbolRequest, params, token);
if (token.isCancellationRequested || response.symbols === undefined) {
throw new vscode.CancellationError();
};
}
const resultSymbols: vscode.DocumentSymbol[] = this.getChildrenSymbols(response.symbols);
return resultSymbols;
}
@@ -3,98 +3,66 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { DefaultClient, workspaceReferences, FindAllReferencesParams, RequestReferencesNotification, CancelReferencesNotification } from '../client';
import { Position } from 'vscode-languageclient';
import * as refs from '../references';
import { Position, RequestType } from 'vscode-languageclient';
import { DefaultClient, workspaceReferences } from '../client';
import { CancellationSender, ReferenceInfo, ReferencesParams, ReferencesResult, ReferenceType } from '../references';
const FindAllReferencesRequest: RequestType<ReferencesParams, ReferencesResult, void> =
new RequestType<ReferencesParams, ReferencesResult, void>('cpptools/findAllReferences');
export class FindAllReferencesProvider implements vscode.ReferenceProvider {
private client: DefaultClient;
constructor(client: DefaultClient) {
this.client = client;
}
public async provideReferences(document: vscode.TextDocument, position: vscode.Position, context: vscode.ReferenceContext, token: vscode.CancellationToken): Promise<vscode.Location[] | undefined> {
return new Promise<vscode.Location[]>((resolve, reject) => {
const callback: () => Promise<void> = async () => {
const params: FindAllReferencesParams = {
position: Position.create(position.line, position.character),
textDocument: this.client.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(document)
};
DefaultClient.referencesParams = params;
await this.client.awaitUntilLanguageClientReady();
// The current request is represented by referencesParams. If a request detects
// referencesParams does not match the object used when creating the request, abort it.
if (params !== DefaultClient.referencesParams) {
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
const locations: vscode.Location[] = [];
resolve(locations);
return;
}
DefaultClient.referencesRequestPending = true;
// Register a single-fire handler for the reply.
const resultCallback: refs.ReferencesResultCallback = (result: refs.ReferencesResult | null, doResolve: boolean) => {
DefaultClient.referencesRequestPending = false;
const locations: vscode.Location[] = [];
if (result) {
result.referenceInfos.forEach((referenceInfo: refs.ReferenceInfo) => {
if (referenceInfo.type === refs.ReferenceType.Confirmed) {
const uri: vscode.Uri = vscode.Uri.file(referenceInfo.file);
const range: vscode.Range = new vscode.Range(referenceInfo.position.line, referenceInfo.position.character, referenceInfo.position.line, referenceInfo.position.character + result.text.length);
locations.push(new vscode.Location(uri, range));
}
});
}
// If references were canceled while in a preview state, there is not an outstanding promise.
if (doResolve) {
resolve(locations);
}
await this.client.ready;
workspaceReferences.cancelCurrentReferenceRequest(CancellationSender.NewRequest);
this.client.clearPendingReferencesCancellations();
};
if (!workspaceReferences.referencesRefreshPending) {
workspaceReferences.setResultsCallback(resultCallback);
workspaceReferences.startFindAllReferences(params);
} else {
// We are responding to a refresh (preview or final result)
workspaceReferences.referencesRefreshPending = false;
if (workspaceReferences.lastResults) {
// This is a final result
const lastResults: refs.ReferencesResult = workspaceReferences.lastResults;
workspaceReferences.lastResults = null;
resultCallback(lastResults, true);
} else {
// This is a preview (2nd or later preview)
workspaceReferences.referencesRequestPending = true;
workspaceReferences.setResultsCallback(resultCallback);
this.client.languageClient.sendNotification(RequestReferencesNotification);
}
}
token.onCancellationRequested(e => {
if (params === DefaultClient.referencesParams) {
this.client.cancelReferences();
}
});
};
// Listen to a cancellation for this request. When this request is cancelled,
// use a local cancellation source to explicitly cancel a token.
const cancelSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
const cancellationTokenListener: vscode.Disposable = token.onCancellationRequested(() => { cancelSource.cancel(); });
const requestCanceledListener: vscode.Disposable = workspaceReferences.onCancellationRequested(_sender => { cancelSource.cancel(); });
if (DefaultClient.referencesRequestPending || (workspaceReferences.symbolSearchInProgress && !workspaceReferences.referencesRefreshPending)) {
const cancelling: boolean = DefaultClient.referencesPendingCancellations.length > 0;
DefaultClient.referencesPendingCancellations.push({
reject: () => {
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
const locations: vscode.Location[] = [];
resolve(locations);
}, callback
});
if (!cancelling) {
DefaultClient.renamePending = false;
workspaceReferences.referencesCanceled = true;
if (!DefaultClient.referencesRequestPending) {
workspaceReferences.referencesCanceledWhilePreviewing = true;
}
this.client.languageClient.sendNotification(CancelReferencesNotification);
// Send the request to the language server.
const locationsResult: vscode.Location[] = [];
const params: ReferencesParams = {
newName: "",
position: Position.create(position.line, position.character),
textDocument: { uri: document.uri.toString() }
};
const response: ReferencesResult = await this.client.languageClient.sendRequest(FindAllReferencesRequest, params, cancelSource.token);
// Reset anything that can be cleared before processing the result.
// Note: ReferencesManager.resetReferences is called in ReferencesManager.showResultsInPanelView
workspaceReferences.resetProgressBar();
cancellationTokenListener.dispose();
requestCanceledListener.dispose();
// Process the result.
if (cancelSource.token.isCancellationRequested || response.referenceInfos === null || response.isCanceled) {
// Return undefined instead of vscode.CancellationError to avoid the following error message from VS Code:
// "Cannot destructure property 'range' of 'e.location' as it is undefined."
// TODO: per issue https://github.com/microsoft/vscode/issues/169698
// vscode.CancellationError is expected, so when VS Code fixes the error use vscode.CancellationError again.
return undefined;
} else if (response.referenceInfos.length !== 0) {
response.referenceInfos.forEach((referenceInfo: ReferenceInfo) => {
if (referenceInfo.type === ReferenceType.Confirmed) {
const uri: vscode.Uri = vscode.Uri.file(referenceInfo.file);
const range: vscode.Range = new vscode.Range(referenceInfo.position.line, referenceInfo.position.character,
referenceInfo.position.line, referenceInfo.position.character + response.text.length);
locationsResult.push(new vscode.Location(uri, range));
}
} else {
callback();
}
});
});
// Display other reference types in panel or channel view.
workspaceReferences.showResultsInPanelView(response);
}
return locationsResult;
}
}
@@ -3,7 +3,7 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { DefaultClient, GetFoldingRangesParams, GetFoldingRangesRequest, FoldingRangeKind, GetFoldingRangesResult, CppFoldingRange } from '../client';
import { CppFoldingRange, DefaultClient, FoldingRangeKind, GetFoldingRangesParams, GetFoldingRangesRequest, GetFoldingRangesResult } from '../client';
import { processDelayedDidOpen } from '../extension';
import { CppSettings } from '../settings';
@@ -23,7 +23,9 @@ export class FoldingRangeProvider implements vscode.FoldingRangeProvider {
const params: GetFoldingRangesParams = {
uri: document.uri.toString()
};
await this.client.requestWhenReady(() => processDelayedDidOpen(document));
await this.client.enqueue(() => processDelayedDidOpen(document));
const response: GetFoldingRangesResult = await this.client.languageClient.sendRequest(GetFoldingRangesRequest, params, token);
if (token.isCancellationRequested || response.ranges === undefined) {
throw new vscode.CancellationError();
@@ -3,10 +3,10 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { DefaultClient, openFileVersions } from '../client';
import { Position, RequestType } from 'vscode-languageclient';
import { CppSettings } from '../settings';
import { DefaultClient, openFileVersions } from '../client';
import { processDelayedDidOpen } from '../extension';
import { CppSettings } from '../settings';
interface GetInlayHintsParams {
uri: string;
@@ -55,7 +55,7 @@ export class InlayHintsProvider implements vscode.InlayHintsProvider {
public async provideInlayHints(document: vscode.TextDocument, range: vscode.Range,
token: vscode.CancellationToken): Promise<vscode.InlayHint[] | undefined> {
await this.client.requestWhenReady(() => processDelayedDidOpen(document));
await this.client.enqueue(() => processDelayedDidOpen(document));
const uriString: string = document.uri.toString();
// Get results from cache if available.
@@ -103,7 +103,7 @@ export class InlayHintsProvider implements vscode.InlayHintsProvider {
const showOnLeft: boolean = settings.inlayHintsAutoDeclarationTypesShowOnLeft && hint.identifierLength > 0;
const inlayHint: vscode.InlayHint = new vscode.InlayHint(
new vscode.Position(hint.position.line, hint.position.character +
(showOnLeft ? 0 : hint.identifierLength)),
(showOnLeft ? 0 : hint.identifierLength)),
(showOnLeft ? hint.label : ": " + hint.label),
vscode.InlayHintKind.Type);
inlayHint.paddingRight = showOnLeft || hint.rightPadding;
@@ -145,11 +145,11 @@ export class InlayHintsProvider implements vscode.InlayHintsProvider {
const inlayHint: vscode.InlayHint = new vscode.InlayHint(
new vscode.Position(hint.position.line, hint.position.character),
refOperatorString + paramHintLabel + ":",
refOperatorString + paramHintLabel + ":",
vscode.InlayHintKind.Parameter);
inlayHint.paddingRight = true;
resolvedHints.push(inlayHint);
};
}
return resolvedHints;
}
@@ -3,7 +3,7 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { DefaultClient, FormatParams, FormatOnTypeRequest, FormatResult } from '../client';
import { DefaultClient, FormatOnTypeRequest, FormatParams, FormatResult } from '../client';
import { CppSettings, getEditorConfigSettings } from '../settings';
import { makeVscodeTextEdits } from '../utils';
@@ -18,7 +18,7 @@ export class OnTypeFormattingEditProvider implements vscode.OnTypeFormattingEdit
if (settings.formattingEngine === "disabled") {
return [];
}
await this.client.awaitUntilLanguageClientReady();
await this.client.ready;
const filePath: string = document.uri.fsPath;
const useVcFormat: boolean = settings.useVcFormat(document);
const configCallBack = async (editorConfigSettings: any | undefined) => {
@@ -3,111 +3,76 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { DefaultClient, workspaceReferences, ReferenceParams, CancelReferencesNotification } from '../client';
import * as refs from '../references';
import { CppSettings } from '../settings';
import { Position } from 'vscode-languageclient';
import { Position, RequestType } from 'vscode-languageclient';
import * as nls from 'vscode-nls';
import * as util from '../../common';
import { DefaultClient, workspaceReferences } from '../client';
import { CancellationSender, getReferenceItemIconPath, getReferenceTagString, ReferencesParams, ReferencesResult, ReferenceType } from '../references';
import { CppSettings } from '../settings';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
const RenameRequest: RequestType<ReferencesParams, ReferencesResult, void> =
new RequestType<ReferencesParams, ReferencesResult, void>('cpptools/rename');
export class RenameProvider implements vscode.RenameProvider {
private client: DefaultClient;
constructor(client: DefaultClient) {
this.client = client;
}
public async provideRenameEdits(document: vscode.TextDocument, position: vscode.Position, newName: string, token: vscode.CancellationToken): Promise<vscode.WorkspaceEdit> {
public async provideRenameEdits(document: vscode.TextDocument, position: vscode.Position, newName: string, _token: vscode.CancellationToken): Promise<vscode.WorkspaceEdit | undefined> {
await this.client.ready;
workspaceReferences.cancelCurrentReferenceRequest(CancellationSender.NewRequest);
const settings: CppSettings = new CppSettings();
if (settings.renameRequiresIdentifier && !util.isValidIdentifier(newName)) {
vscode.window.showErrorMessage(localize("invalid.identifier.for.rename", "Invalid identifier provided for the Rename Symbol operation."));
const workspaceEdit: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
return workspaceEdit;
void vscode.window.showErrorMessage(localize("invalid.identifier.for.rename", "Invalid identifier provided for the Rename Symbol operation."));
return undefined;
}
// Normally, VS Code considers rename to be an atomic operation.
// If the user clicks anywhere in the document, it attempts to cancel it.
// Because that prevents our rename UI, we ignore cancellation requests.
// VS Code will attempt to issue new rename requests while another is still active.
// When we receive another rename request, cancel the one that is in progress.
DefaultClient.renamePending = true;
++DefaultClient.renameRequestsPending;
return new Promise<vscode.WorkspaceEdit>((resolve, reject) => {
const callback: () => Promise<void> = async () => {
const params: ReferenceParams = {
newName: newName,
position: Position.create(position.line, position.character),
textDocument: this.client.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(document)
// Listen to a cancellation for this request. When this request is cancelled,
// use a local cancellation source to explicitly cancel a token.
// Don't listen to the token from the provider, as it will cancel when the cursor is moved to a different position.
const cancelSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
const requestCanceledListener: vscode.Disposable = workspaceReferences.onCancellationRequested(_sender => { cancelSource.cancel(); });
// Send the request to the language server.
workspaceReferences.startRename();
const workspaceEditResult: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
const params: ReferencesParams = {
newName: newName,
position: Position.create(position.line, position.character),
textDocument: { uri: document.uri.toString() }
};
const response: ReferencesResult = await this.client.languageClient.sendRequest(RenameRequest, params, cancelSource.token);
// Reset anything that can be cleared before processing the result.
workspaceReferences.resetProgressBar();
workspaceReferences.resetReferences();
requestCanceledListener.dispose();
// Process the result.
if (cancelSource.token.isCancellationRequested || response.referenceInfos === null || response.isCanceled) {
throw new vscode.CancellationError();
} else if (response.referenceInfos.length === 0) {
void vscode.window.showErrorMessage(localize("unable.to.locate.selected.symbol", "A definition for the selected symbol could not be located."));
} else {
for (const reference of response.referenceInfos) {
const uri: vscode.Uri = vscode.Uri.file(reference.file);
const range: vscode.Range = new vscode.Range(reference.position.line, reference.position.character,
reference.position.line, reference.position.character + response.text.length);
const metadata: vscode.WorkspaceEditEntryMetadata = {
needsConfirmation: reference.type !== ReferenceType.Confirmed,
label: getReferenceTagString(reference.type, false, true),
iconPath: getReferenceItemIconPath(reference.type, false)
};
DefaultClient.referencesParams = params;
await this.client.awaitUntilLanguageClientReady();
// The current request is represented by referencesParams. If a request detects
// referencesParams does not match the object used when creating the request, abort it.
if (params !== DefaultClient.referencesParams) {
if (--DefaultClient.renameRequestsPending === 0) {
DefaultClient.renamePending = false;
}
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
const workspaceEdit: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
resolve(workspaceEdit);
return;
}
DefaultClient.referencesRequestPending = true;
workspaceReferences.setResultsCallback((referencesResult: refs.ReferencesResult | null, doResolve: boolean) => {
DefaultClient.referencesRequestPending = false;
--DefaultClient.renameRequestsPending;
const workspaceEdit: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
const cancelling: boolean = DefaultClient.referencesPendingCancellations.length > 0;
if (cancelling) {
this.client.clearPendingReferencesCancellations();
} else {
if (DefaultClient.renameRequestsPending === 0) {
DefaultClient.renamePending = false;
}
// If rename UI was canceled, we will get a null result.
// If null, return an empty list to avoid Rename failure dialog.
if (referencesResult) {
for (const reference of referencesResult.referenceInfos) {
const uri: vscode.Uri = vscode.Uri.file(reference.file);
const range: vscode.Range = new vscode.Range(reference.position.line, reference.position.character, reference.position.line, reference.position.character + referencesResult.text.length);
const metadata: vscode.WorkspaceEditEntryMetadata = {
needsConfirmation: reference.type !== refs.ReferenceType.Confirmed,
label: refs.getReferenceTagString(reference.type, false, true),
iconPath: refs.getReferenceItemIconPath(reference.type, false)
};
workspaceEdit.replace(uri, range, newName, metadata);
}
}
}
if (referencesResult && (referencesResult.referenceInfos === null || referencesResult.referenceInfos.length === 0)) {
vscode.window.showErrorMessage(localize("unable.to.locate.selected.symbol", "A definition for the selected symbol could not be located."));
}
resolve(workspaceEdit);
});
workspaceReferences.startRename(params);
};
if (DefaultClient.referencesRequestPending || workspaceReferences.symbolSearchInProgress) {
const cancelling: boolean = DefaultClient.referencesPendingCancellations.length > 0;
DefaultClient.referencesPendingCancellations.push({
reject: () => {
--DefaultClient.renameRequestsPending;
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
const workspaceEdit: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
resolve(workspaceEdit);
}, callback
});
if (!cancelling) {
workspaceReferences.referencesCanceled = true;
if (!DefaultClient.referencesRequestPending) {
workspaceReferences.referencesCanceledWhilePreviewing = true;
}
this.client.languageClient.sendNotification(CancelReferencesNotification);
}
} else {
callback();
workspaceEditResult.replace(uri, range, newName, metadata);
}
});
}
return workspaceEditResult;
}
}
@@ -3,7 +3,7 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { DefaultClient, GetSemanticTokensParams, GetSemanticTokensRequest, openFileVersions, GetSemanticTokensResult, semanticTokensLegend } from '../client';
import { DefaultClient, GetSemanticTokensParams, GetSemanticTokensRequest, GetSemanticTokensResult, openFileVersions, semanticTokensLegend } from '../client';
import { processDelayedDidOpen } from '../extension';
export class SemanticTokensProvider implements vscode.DocumentSemanticTokensProvider {
@@ -26,7 +26,8 @@ export class SemanticTokensProvider implements vscode.DocumentSemanticTokensProv
const tokens: vscode.SemanticTokens = builder.build();
return tokens;
}
await this.client.requestWhenReady(() => processDelayedDidOpen(document));
await this.client.enqueue(() => processDelayedDidOpen(document));
const uriString: string = document.uri.toString();
// First check the semantic token cache to see if we already have results for that file and version
const cache: [number, vscode.SemanticTokens] | undefined = this.tokenCaches.get(uriString);
@@ -3,9 +3,9 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { DefaultClient, GetSymbolInfoRequest, WorkspaceSymbolParams, LocalizeSymbolInformation, SymbolScope } from '../client';
import { makeVscodeLocation } from '../utils';
import { DefaultClient, GetSymbolInfoRequest, LocalizeSymbolInformation, SymbolScope, WorkspaceSymbolParams } from '../client';
import { getLocalizedString, getLocalizedSymbolScope } from '../localization';
import { makeVscodeLocation } from '../utils';
export class WorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider {
private client: DefaultClient;
File diff suppressed because it is too large Load Diff
@@ -5,9 +5,10 @@
'use strict';
import * as vscode from 'vscode';
import { logAndReturn } from '../Utility/Async/returns';
import * as util from '../common';
import * as cpptools from './client';
import * as telemetry from '../telemetry';
import * as cpptools from './client';
import { getCustomConfigProviders } from './customProviders';
import { TimeTelemetryCollector } from './timeTelemetryCollector';
@@ -64,7 +65,6 @@ export class ClientCollection {
this.languageClients.set(key, this.activeClient);
this.disposables.push(vscode.workspace.onDidChangeWorkspaceFolders(e => this.onDidChangeWorkspaceFolders(e)));
this.disposables.push(vscode.workspace.onDidCloseTextDocument(d => this.onDidCloseTextDocument(d)));
}
public async activeDocumentChanged(document: vscode.TextDocument): Promise<void> {
@@ -121,7 +121,7 @@ export class ClientCollection {
const client: cpptools.Client = pair[1];
const newClient: cpptools.Client = this.createClient(client.RootFolder, true);
client.TrackedDocuments.forEach(document => this.transferOwnership(document, client));
client.TrackedDocuments.forEach(document => void this.transferOwnership(document, client).catch(logAndReturn.undefined));
if (this.activeClient === client) {
// It cannot be undefined. If there is an active document, we activate it later.
@@ -158,7 +158,7 @@ export class ClientCollection {
// Transfer ownership of the client's documents to another client.
// (this includes calling textDocument/didOpen on the new client so that the server knows it's open too)
client.TrackedDocuments.forEach(document => this.transferOwnership(document, client));
client.TrackedDocuments.forEach(document => void this.transferOwnership(document, client).catch(logAndReturn.undefined));
if (this.activeClient === client) {
this.activeClient.deactivate();
@@ -205,10 +205,10 @@ export class ClientCollection {
}
}
private transferOwnership(document: vscode.TextDocument, oldOwner: cpptools.Client): void {
private async transferOwnership(document: vscode.TextDocument, oldOwner: cpptools.Client): Promise<void> {
const newOwner: cpptools.Client = this.getClientFor(document.uri);
if (newOwner !== oldOwner) {
newOwner.takeOwnership(document);
return newOwner.takeOwnership(document);
}
}
@@ -245,10 +245,6 @@ export class ClientCollection {
return newClient;
}
private onDidCloseTextDocument(document: vscode.TextDocument): void {
// Don't seem to need to do anything here since we clean up when the workspace is closed instead.
}
public dispose(): Thenable<void> {
this.disposables.forEach((d: vscode.Disposable) => d.dispose());
+47 -23
View File
@@ -5,12 +5,12 @@
'use strict';
import * as vscode from 'vscode';
import { LanguageClient, NotificationType, Range } from 'vscode-languageclient/node';
import { Location, WorkspaceEdit } from './commonTypes';
import { makeVscodeRange, makeVscodeLocation, makeVscodeTextEdits, rangeEquals } from './utils';
import {LocalizeStringParams, getLocalizedString } from './localization';
import { CppSourceStr } from './extension';
import { CppSettings } from './settings';
import * as nls from 'vscode-nls';
import { Location, WorkspaceEdit } from './commonTypes';
import { CppSourceStr } from './extension';
import { getLocalizedString, LocalizeStringParams } from './localization';
import { CppSettings } from './settings';
import { makeVscodeLocation, makeVscodeRange, makeVscodeTextEdits, rangeEquals } from './utils';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -99,11 +99,11 @@ export interface CodeAnalysisDiagnosticIdentifiersAndUri {
export interface RemoveCodeAnalysisProblemsParams {
identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[];
refreshSquigglesOnSave: boolean;
};
}
interface RemoveCodeAnalysisCodeActionFixesParams {
identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[];
};
}
interface PublishCodeAnalysisDiagnosticsParams {
uri: string;
@@ -119,8 +119,11 @@ export const codeAnalysisAllFixes: CodeActionAllInfo = {
version: 0,
fixAllCodeAction: {
title: localize("fix_all_code_analysis_problems", "Fix all code analysis problems"),
command: { title: 'FixAllCodeAnalysisProblems', command: 'C_Cpp.FixAllCodeAnalysisProblems',
arguments: [ 0, undefined, true, [] ] },
command: {
title: 'FixAllCodeAnalysisProblems',
command: 'C_Cpp.FixAllCodeAnalysisProblems',
arguments: [ 0, undefined, true, [] ]
},
kind: vscode.CodeActionKind.QuickFix
},
removeAllCodeAction: {
@@ -173,8 +176,11 @@ function rebuildCodeAnalysisCodeAndAllFixes(): void {
++numFixTypes;
codeToFixes[1].fixAllTypeCodeAction = {
title: localize("fix_all_type_problems", "Fix all {0} problems", codeToFixes[0]),
command: { title: 'FixAllTypeCodeAnalysisProblems', command: 'C_Cpp.FixAllTypeCodeAnalysisProblems',
arguments: [ codeToFixes[0], ++codeToFixes[1].version, allTypeWorkspaceEdit, true, identifiersAndUris ] },
command: {
title: 'FixAllTypeCodeAnalysisProblems',
command: 'C_Cpp.FixAllTypeCodeAnalysisProblems',
arguments: [ codeToFixes[0], ++codeToFixes[1].version, allTypeWorkspaceEdit, true, identifiersAndUris ]
},
kind: vscode.CodeActionKind.QuickFix
};
}
@@ -182,8 +188,11 @@ function rebuildCodeAnalysisCodeAndAllFixes(): void {
if (new CppSettings().clangTidyCodeActionShowDisable) {
codeToFixes[1].disableAllTypeCodeAction = {
title: localize("disable_all_type_problems", "Disable all {0} problems", codeToFixes[0]),
command: { title: 'DisableAllTypeCodeAnalysisProblems', command: 'C_Cpp.DisableAllTypeCodeAnalysisProblems',
arguments: [ codeToFixes[0], identifiersAndUris ] },
command: {
title: 'DisableAllTypeCodeAnalysisProblems',
command: 'C_Cpp.DisableAllTypeCodeAnalysisProblems',
arguments: [ codeToFixes[0], identifiersAndUris ]
},
kind: vscode.CodeActionKind.QuickFix
};
} else {
@@ -193,8 +202,11 @@ function rebuildCodeAnalysisCodeAndAllFixes(): void {
if (new CppSettings().clangTidyCodeActionShowClear !== "None") {
codeToFixes[1].removeAllTypeCodeAction = {
title: localize("clear_all_type_problems", "Clear all {0} problems", codeToFixes[0]),
command: { title: 'RemoveAllTypeCodeAnalysisProblems', command: 'C_Cpp.RemoveCodeAnalysisProblems',
arguments: [ false, identifiersAndUris ] },
command: {
title: 'RemoveAllTypeCodeAnalysisProblems',
command: 'C_Cpp.RemoveCodeAnalysisProblems',
arguments: [ false, identifiersAndUris ]
},
kind: vscode.CodeActionKind.QuickFix
};
}
@@ -254,8 +266,11 @@ export function publishCodeAnalysisDiagnostics(params: PublishCodeAnalysisDiagno
code: identifier.code,
removeCodeAction: {
title: localize("clear_this_problem", "Clear this {0} problem", d.code),
command: { title: 'RemoveCodeAnalysisProblems', command: 'C_Cpp.RemoveCodeAnalysisProblems',
arguments: [ false, [ identifiersAndUri ] ] },
command: {
title: 'RemoveCodeAnalysisProblems',
command: 'C_Cpp.RemoveCodeAnalysisProblems',
arguments: [ false, [ identifiersAndUri ] ]
},
kind: vscode.CodeActionKind.QuickFix
}
};
@@ -267,8 +282,11 @@ export function publishCodeAnalysisDiagnostics(params: PublishCodeAnalysisDiagno
}
const fixThisCodeAction: vscode.CodeAction = {
title: localize("fix_this_problem", "Fix this {0} problem", d.code),
command: { title: 'FixThisCodeAnalysisProblem', command: 'C_Cpp.FixThisCodeAnalysisProblem',
arguments: [ nextVersion, workspaceEdit.workspaceEdit, true, [ identifiersAndUri ] ] },
command: {
title: 'FixThisCodeAnalysisProblem',
command: 'C_Cpp.FixThisCodeAnalysisProblem',
arguments: [ nextVersion, workspaceEdit.workspaceEdit, true, [ identifiersAndUri ] ]
},
kind: vscode.CodeActionKind.QuickFix
};
codeAction.fixCodeAction = fixThisCodeAction;
@@ -298,8 +316,11 @@ export function publishCodeAnalysisDiagnostics(params: PublishCodeAnalysisDiagno
uri: info.location.uri, identifiers: [ relatedIdentifier ] };
const relatedCodeAction: vscode.CodeAction = {
title: localize("fix_this_problem", "Fix this {0} problem", d.code),
command: { title: 'FixThisCodeAnalysisProblem', command: 'C_Cpp.FixThisCodeAnalysisProblem',
arguments: [ nextVersion, relatedWorkspaceEdit, true, [ relatedIdentifiersAndUri ] ] },
command: {
title: 'FixThisCodeAnalysisProblem',
command: 'C_Cpp.FixThisCodeAnalysisProblem',
arguments: [ nextVersion, relatedWorkspaceEdit, true, [ relatedIdentifiersAndUri ] ]
},
kind: vscode.CodeActionKind.QuickFix
};
if (codeAction.fixCodeAction === undefined) {
@@ -364,8 +385,11 @@ export function publishCodeAnalysisDiagnostics(params: PublishCodeAnalysisDiagno
if (codeActionCodeInfo.docCodeAction === undefined) {
codeActionCodeInfo.docCodeAction = {
title: localize("show_documentation_for", "Show documentation for {0}", primaryCode),
command: { title: 'ShowDocumentation', command: 'C_Cpp.ShowCodeAnalysisDocumentation',
arguments: [ primaryDocUri ] },
command: {
title: 'ShowDocumentation',
command: 'C_Cpp.ShowCodeAnalysisDocumentation',
arguments: [ primaryDocUri ]
},
kind: vscode.CodeActionKind.QuickFix
};
}
File diff suppressed because it is too large Load Diff
@@ -2,21 +2,18 @@
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
/* eslint-disable no-unused-expressions */
import * as path from 'path';
import {
TaskDefinition, Task, TaskGroup, ShellExecution, workspace,
TaskProvider, TaskScope, CustomExecution, ProcessExecution, TextEditor, Pseudoterminal, EventEmitter, Event, TerminalDimensions, window, WorkspaceFolder, tasks, TaskExecution, TaskEndEvent, Disposable
} from 'vscode';
import * as cp from "child_process";
import * as os from 'os';
import * as path from 'path';
import { CustomExecution, Disposable, Event, EventEmitter, ProcessExecution, Pseudoterminal, ShellExecution, Task, TaskDefinition, TaskEndEvent, TaskExecution, TaskGroup, TaskProvider, tasks, TaskScope, TerminalDimensions, TextEditor, window, workspace, WorkspaceFolder } from 'vscode';
import * as nls from 'vscode-nls';
import * as util from '../common';
import * as telemetry from '../telemetry';
import { Client } from './client';
import * as configs from './configurations';
import * as ext from './extension';
import * as cp from "child_process";
import { OtherSettings } from './settings';
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -30,7 +27,6 @@ export interface CppBuildTaskDefinition extends TaskDefinition {
}
export class CppBuildTask extends Task {
detail?: string;
existing?: boolean;
isDefault?: boolean;
}
@@ -76,7 +72,7 @@ export class CppBuildTaskProvider implements TaskProvider {
}
// Don't offer tasks for header files.
const isHeader: boolean = util.isHeaderFile (editor.document.uri);
const isHeader: boolean = util.isHeaderFile(editor.document.uri);
if (isHeader) {
return emptyTasks;
}
@@ -130,7 +126,7 @@ export class CppBuildTaskProvider implements TaskProvider {
) &&
(
!isCompilerValid || (!!userCompilerPathAndArgs &&
(path.basename(info.path) !== userCompilerPathAndArgs.compilerName))
(path.basename(info.path) !== userCompilerPathAndArgs.compilerName))
) &&
(
!isWindows || !info.path.startsWith("/")
@@ -392,7 +388,7 @@ class CustomBuildTaskTerminal implements Pseudoterminal {
this.options = { "shell": true };
}
if (this.options.cwd) {
this.options.cwd = util.resolveVariables(this.options.cwd);
this.options.cwd = util.resolveVariables(this.options.cwd.toString());
} else {
const editor: TextEditor | undefined = window.activeTextEditor;
let folder: WorkspaceFolder | undefined = editor ? workspace.getWorkspaceFolder(editor.document.uri) : undefined;
@@ -5,9 +5,9 @@
'use strict';
import * as vscode from 'vscode';
import { CustomConfigurationProvider, Version, SourceFileConfigurationItem, WorkspaceBrowseConfiguration } from 'vscode-cpptools';
import { CppSettings } from './settings';
import { CustomConfigurationProvider, SourceFileConfigurationItem, Version, WorkspaceBrowseConfiguration } from 'vscode-cpptools';
import * as ext from './extension';
import { CppSettings } from './settings';
/**
* An interface that is guaranteed to be backward compatible with version 0
+124 -152
View File
@@ -4,28 +4,28 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as path from 'path';
import * as vscode from 'vscode';
import * as os from 'os';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as rd from 'readline';
import { Readable } from 'stream';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import * as yauzl from 'yauzl';
import { logAndReturn } from '../Utility/Async/returns';
import * as util from '../common';
import * as telemetry from '../telemetry';
import { TreeNode, NodeType } from './referencesModel';
import { UI, getUI } from './ui';
import { Client, DefaultClient, DoxygenCodeActionCommandArguments, openFileVersions } from './client';
import { CodeAnalysisDiagnosticIdentifiersAndUri, CodeActionDiagnosticInfo, codeAnalysisCodeToFixes,
codeAnalysisFileToCodeActions, codeAnalysisAllFixes } from './codeAnalysis';
import { makeCpptoolsRange, rangeEquals, shouldChangeFromCToCpp } from './utils';
import { ClientCollection } from './clientCollection';
import { CppSettings } from './settings';
import { PersistentState } from './persistentState';
import { getLanguageConfig } from './languageConfig';
import { getCustomConfigProviders } from './customProviders';
import * as rd from 'readline';
import * as yauzl from 'yauzl';
import { Readable } from 'stream';
import * as nls from 'vscode-nls';
import { CodeActionDiagnosticInfo, CodeAnalysisDiagnosticIdentifiersAndUri, codeAnalysisAllFixes, codeAnalysisCodeToFixes, codeAnalysisFileToCodeActions } from './codeAnalysis';
import { CppBuildTaskProvider } from './cppBuildTaskProvider';
import { getCustomConfigProviders } from './customProviders';
import { getLanguageConfig } from './languageConfig';
import { PersistentState } from './persistentState';
import { NodeType, TreeNode } from './referencesModel';
import { CppSettings } from './settings';
import { LanguageStatusUI, getUI } from './ui';
import { makeCpptoolsRange, rangeEquals, shouldChangeFromCToCpp } from './utils';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -35,7 +35,7 @@ export const configPrefix: string = "C/C++: ";
let prevCrashFile: string;
export let clients: ClientCollection;
let activeDocument: string;
let ui: UI;
let ui: LanguageStatusUI;
const disposables: vscode.Disposable[] = [];
const commandDisposables: vscode.Disposable[] = [];
let languageConfigurations: vscode.Disposable[] = [];
@@ -46,8 +46,8 @@ export const intelliSenseDisabledError: string = "Do not activate the extension
type VcpkgDatabase = { [key: string]: string[] }; // Stored as <header file entry> -> [<port name>]
let vcpkgDbPromise: Promise<VcpkgDatabase>;
function initVcpkgDatabase(): Promise<VcpkgDatabase> {
return new Promise((resolve, reject) => {
yauzl.open(util.getExtensionFilePath('VCPkgHeadersDatabase.zip'), { lazyEntries: true }, (err?: Error, zipfile?: yauzl.ZipFile) => {
return new Promise((resolve) => {
yauzl.open(util.getExtensionFilePath('VCPkgHeadersDatabase.zip'), { lazyEntries: true }, (err?: Error | null, zipfile?: yauzl.ZipFile) => {
// Resolves with an empty database instead of rejecting on failure.
const database: VcpkgDatabase = {};
if (err || !zipfile) {
@@ -63,7 +63,7 @@ function initVcpkgDatabase(): Promise<VcpkgDatabase> {
zipfile.readEntry();
return;
}
zipfile.openReadStream(entry, (err?: Error, stream?: Readable) => {
zipfile.openReadStream(entry, (err?: Error | null, stream?: Readable) => {
if (err || !stream) {
zipfile.close();
return;
@@ -165,7 +165,7 @@ export async function activate(): Promise<void> {
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 =>
const clangCommandAdapterActive: boolean = vscode.extensions.all.some((extension: vscode.Extension<any>): boolean =>
extension.isActive && extension.id === "mitaki28.vscode-clang");
if (clangCommandAdapterActive) {
telemetry.logLanguageServerEvent("conflictingExtension");
@@ -174,7 +174,7 @@ export async function activate(): Promise<void> {
console.log("starting language server");
clients = new ClientCollection();
ui = await getUI();
ui = getUI();
// There may have already been registered CustomConfigurationProviders.
// Request for configurations from those providers.
@@ -194,15 +194,11 @@ export async function activate(): Promise<void> {
vcpkgDbPromise = initVcpkgDatabase();
clients.ActiveClient.notifyWhenLanguageClientReady(() => {
intervalTimer = global.setInterval(onInterval, 2500);
});
void clients.ActiveClient.ready.then(() => intervalTimer = global.setInterval(onInterval, 2500));
registerCommands(true);
vscode.tasks.onDidStartTask(event => {
getActiveClient().PauseCodeAnalysis();
});
vscode.tasks.onDidStartTask(() => getActiveClient().PauseCodeAnalysis());
vscode.tasks.onDidEndTask(event => {
getActiveClient().ResumeCodeAnalysis();
@@ -213,14 +209,14 @@ export async function activate(): Promise<void> {
if (folder) {
const settings: CppSettings = new CppSettings(folder.uri);
if (settings.codeAnalysisRunOnBuild && settings.clangTidyEnabled) {
clients.getClientFor(folder.uri).handleRunCodeAnalysisOnAllFiles();
void clients.getClientFor(folder.uri).handleRunCodeAnalysisOnAllFiles().catch(logAndReturn.undefined);
}
return;
}
}
const settings: CppSettings = new CppSettings();
if (settings.codeAnalysisRunOnBuild && settings.clangTidyEnabled) {
clients.ActiveClient.handleRunCodeAnalysisOnAllFiles();
void clients.ActiveClient.handleRunCodeAnalysisOnAllFiles().catch(logAndReturn.undefined);
}
}
});
@@ -231,7 +227,7 @@ export async function activate(): Promise<void> {
{ scheme: 'file', language: 'cuda-cpp' }
];
codeActionProvider = vscode.languages.registerCodeActionsProvider(selector, {
provideCodeActions: async (document: vscode.TextDocument, range: vscode.Range, context: vscode.CodeActionContext, token: vscode.CancellationToken): Promise<vscode.CodeAction[]> => {
provideCodeActions: async (document: vscode.TextDocument, range: vscode.Range, context: vscode.CodeActionContext): Promise<vscode.CodeAction[]> => {
if (!await clients.ActiveClient.getVcpkgEnabled()) {
return [];
}
@@ -274,14 +270,14 @@ export function updateLanguageConfigurations(): void {
/**
* workspace events
*/
function onDidChangeSettings(event: vscode.ConfigurationChangeEvent): void {
async function onDidChangeSettings(event: vscode.ConfigurationChangeEvent): Promise<void> {
const client: Client = clients.getDefaultClient();
if (client instanceof DefaultClient) {
const defaultClient: DefaultClient = <DefaultClient>client;
const changedDefaultClientSettings: { [key: string]: string } = defaultClient.onDidChangeSettings(event);
const changedDefaultClientSettings: { [key: string]: string } = await defaultClient.onDidChangeSettings(event);
clients.forEach(client => {
if (client !== defaultClient) {
client.onDidChangeSettings(event);
void client.onDidChangeSettings(event).catch(logAndReturn.undefined);
}
});
const newUpdateChannel: string = changedDefaultClientSettings['updateChannel'];
@@ -318,7 +314,7 @@ export function onDidChangeActiveTextEditor(editor?: vscode.TextEditor): void {
if (util.isCppOrRelated(editor.document)) {
// This is required for the UI to update correctly.
clients.activeDocumentChanged(editor.document);
void clients.activeDocumentChanged(editor.document).catch(logAndReturn.undefined);
if (util.isCpp(editor.document)) {
activeDocument = editor.document.uri.toString();
clients.ActiveClient.selectionChanged(makeCpptoolsRange(editor.selection));
@@ -328,7 +324,7 @@ export function onDidChangeActiveTextEditor(editor?: vscode.TextEditor): void {
} else {
activeDocument = "";
}
ui.activeDocumentChanged();
getUI().activeDocumentChanged();
}
function onDidChangeTextEditorSelection(event: vscode.TextEditorSelectionChangeEvent): void {
@@ -341,7 +337,7 @@ function onDidChangeTextEditorSelection(event: vscode.TextEditorSelectionChangeE
if (activeDocument !== event.textEditor.document.uri.toString()) {
// For some unknown reason we don't reliably get onDidChangeActiveTextEditor callbacks.
activeDocument = event.textEditor.document.uri.toString();
clients.activeDocumentChanged(event.textEditor.document);
void clients.activeDocumentChanged(event.textEditor.document).catch(logAndReturn.undefined);
ui.activeDocumentChanged();
}
clients.ActiveClient.selectionChanged(makeCpptoolsRange(event.selections[0]));
@@ -352,14 +348,16 @@ export async function processDelayedDidOpen(document: vscode.TextDocument): Prom
if (client) {
// Log warm start.
if (clients.checkOwnership(client, document)) {
if (!client.isInitialized()) {
// This can randomly get hit when adding/removing workspace folders.
await client.ready;
}
// Do not call await between TrackedDocuments.has() and TrackedDocuments.add(),
// to avoid sending redundant didOpen notifications.
if (!client.TrackedDocuments.has(document)) {
// If not yet tracked, process as a newly opened file. (didOpen is sent to server in client.takeOwnership()).
clients.timeTelemetryCollector.setDidOpenTime(document.uri);
if (!client.isInitialized()) {
// This can randomly get hit when adding/removing workspace folders.
await client.awaitUntilLanguageClientReady();
}
client.TrackedDocuments.add(document);
clients.timeTelemetryCollector.setDidOpenTime(document.uri);
// Work around vscode treating ".C" or ".H" as c, by adding this file name to file associations as cpp
if (document.languageId === "c" && shouldChangeFromCToCpp(document)) {
const baseFileName: string = path.basename(document.fileName);
@@ -369,8 +367,9 @@ export async function processDelayedDidOpen(document: vscode.TextDocument): Prom
document = await vscode.languages.setTextDocumentLanguage(document, "cpp");
}
await client.provideCustomConfiguration(document.uri, undefined);
// client.takeOwnership() will call client.TrackedDocuments.add() again, but that's ok. It's a Set.
client.onDidOpenTextDocument(document);
await client.sendDidOpen(document);
await client.takeOwnership(document);
return true;
}
}
@@ -384,7 +383,7 @@ function onDidChangeVisibleTextEditors(editors: readonly vscode.TextEditor[]): v
editors.forEach(async (editor) => {
if (util.isCpp(editor.document)) {
const client: Client = clients.getClientFor(editor.document.uri);
await client.requestWhenReady(() => processDelayedDidOpen(editor.document));
await client.enqueue(() => processDelayedDidOpen(editor.document));
client.onDidChangeVisibleTextEditor(editor);
}
});
@@ -455,17 +454,7 @@ export function registerCommands(enabled: boolean): void {
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RescanCompilers', enabled ? onRescanCompilers : onDisabledCommand));
}
function logForUIExperiment(command: string, sender?: any): void {
const settings: CppSettings = new CppSettings();
const properties: {[key: string]: string} = {
newUI: ui.isNewUI.toString(),
uiOverride: (settings.experimentalFeatures ?? false).toString(),
sender: util.getSenderType(sender)
};
telemetry.logLanguageServerEvent(`experiment${command}`, properties);
}
function onDisabledCommand(): void {
function onDisabledCommand() {
const message: string = localize(
{
key: "on.disabled.command",
@@ -474,16 +463,15 @@ function onDisabledCommand(): void {
]
},
"IntelliSense-related commands cannot be executed when `C_Cpp.intelliSenseEngine` is set to `disabled`.");
vscode.window.showWarningMessage(message);
return vscode.window.showWarningMessage(message);
}
function onRestartIntelliSenseForFile(sender?: any): void {
logForUIExperiment("RestartIntelliSenseForFile", sender);
async function onRestartIntelliSenseForFile() {
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
if (!activeEditor || !util.isCpp(activeEditor.document)) {
return;
}
clients.ActiveClient.restartIntelliSenseForFile(activeEditor.document);
return clients.ActiveClient.restartIntelliSenseForFile(activeEditor.document);
}
async function onSwitchHeaderSource(): Promise<void> {
@@ -518,13 +506,13 @@ async function onSwitchHeaderSource(): Promise<void> {
vscode.window.visibleTextEditors.forEach(editor => {
if (editor.document === document && !foundEditor) {
foundEditor = true;
vscode.window.showTextDocument(document, editor.viewColumn);
void vscode.window.showTextDocument(document, editor.viewColumn).then(undefined, logAndReturn.undefined);
}
});
}
if (!foundEditor) {
vscode.window.showTextDocument(document);
void vscode.window.showTextDocument(document).then(undefined, logAndReturn.undefined);
}
}
@@ -549,122 +537,115 @@ async function selectClient(): Promise<Client> {
}
}
function onResetDatabase(): void {
clients.ActiveClient.notifyWhenLanguageClientReady(() => {
clients.ActiveClient.resetDatabase();
});
async function onResetDatabase(): Promise<void> {
await clients.ActiveClient.ready;
clients.ActiveClient.resetDatabase();
}
function selectDefaultCompiler(sender?: any): void {
clients.ActiveClient.notifyWhenLanguageClientReady(() => {
clients.ActiveClient.promptSelectCompiler(true, sender);
});
async function selectDefaultCompiler(sender?: any): Promise<void> {
await clients.ActiveClient.ready;
return clients.ActiveClient.promptSelectCompiler(true, sender);
}
function onRescanCompilers(sender?: any): void {
clients.ActiveClient.notifyWhenLanguageClientReady(() => {
clients.ActiveClient.rescanCompilers(sender);
});
async function onRescanCompilers(sender?: any): Promise<void> {
await clients.ActiveClient.ready;
return clients.ActiveClient.rescanCompilers(sender);
}
function selectIntelliSenseConfiguration(sender?: any): void {
clients.ActiveClient.notifyWhenLanguageClientReady(() => {
clients.ActiveClient.promptSelectIntelliSenseConfiguration(true, sender);
});
async function selectIntelliSenseConfiguration(sender?: any): Promise<void> {
await clients.ActiveClient.ready;
return clients.ActiveClient.promptSelectIntelliSenseConfiguration(true, sender);
}
function onSelectConfiguration(sender?: any): void {
logForUIExperiment("ConfigurationSelect", sender);
async function onSelectConfiguration(): Promise<void> {
if (!isFolderOpen()) {
vscode.window.showInformationMessage(localize("configuration.select.first", 'Open a folder first to select a configuration.'));
void vscode.window.showInformationMessage(localize("configuration.select.first", 'Open a folder first to select a configuration.'));
} else {
// This only applies to the active client. You cannot change the configuration for
// a client that is not active since that client's UI will not be visible.
clients.ActiveClient.handleConfigurationSelectCommand();
return clients.ActiveClient.handleConfigurationSelectCommand();
}
}
function onSelectConfigurationProvider(): void {
if (!isFolderOpen()) {
vscode.window.showInformationMessage(localize("configuration.provider.select.first", 'Open a folder first to select a configuration provider.'));
void vscode.window.showInformationMessage(localize("configuration.provider.select.first", 'Open a folder first to select a configuration provider.'));
} else {
selectClient().then(client => client.handleConfigurationProviderSelectCommand(), rejected => {});
void selectClient().then(client => client.handleConfigurationProviderSelectCommand(), logAndReturn.undefined);
}
}
function onEditConfigurationJSON(viewColumn: vscode.ViewColumn = vscode.ViewColumn.Active): void {
telemetry.logLanguageServerEvent("SettingsCommand", { "palette": "json" }, undefined);
if (!isFolderOpen()) {
vscode.window.showInformationMessage(localize('edit.configurations.open.first', 'Open a folder first to edit configurations'));
void vscode.window.showInformationMessage(localize('edit.configurations.open.first', 'Open a folder first to edit configurations'));
} else {
selectClient().then(client => client.handleConfigurationEditJSONCommand(viewColumn), rejected => {});
void selectClient().then(client => client.handleConfigurationEditJSONCommand(viewColumn), logAndReturn.undefined);
}
}
function onEditConfigurationUI(viewColumn: vscode.ViewColumn = vscode.ViewColumn.Active): void {
telemetry.logLanguageServerEvent("SettingsCommand", { "palette": "ui" }, undefined);
if (!isFolderOpen()) {
vscode.window.showInformationMessage(localize('edit.configurations.open.first', 'Open a folder first to edit configurations'));
void vscode.window.showInformationMessage(localize('edit.configurations.open.first', 'Open a folder first to edit configurations'));
} else {
selectClient().then(client => client.handleConfigurationEditUICommand(viewColumn), rejected => {});
void selectClient().then(client => client.handleConfigurationEditUICommand(viewColumn), logAndReturn.undefined);
}
}
function onEditConfiguration(viewColumn: vscode.ViewColumn = vscode.ViewColumn.Active): void {
if (!isFolderOpen()) {
vscode.window.showInformationMessage(localize('edit.configurations.open.first', 'Open a folder first to edit configurations'));
void vscode.window.showInformationMessage(localize('edit.configurations.open.first', 'Open a folder first to edit configurations'));
} else {
selectClient().then(client => client.handleConfigurationEditCommand(viewColumn), rejected => {});
void selectClient().then(client => client.handleConfigurationEditCommand(viewColumn), logAndReturn.undefined);
}
}
function onGenerateEditorConfig(): void {
if (!isFolderOpen()) {
const settings: CppSettings = new CppSettings();
settings.generateEditorConfig();
void settings.generateEditorConfig();
} else {
selectClient().then(client => {
void selectClient().then(client => {
const settings: CppSettings = new CppSettings(client.RootUri);
settings.generateEditorConfig();
});
void settings.generateEditorConfig();
}).catch(logAndReturn.undefined);
}
}
function onGoToNextDirectiveInGroup(): void {
const client: Client = getActiveClient();
client.handleGoToDirectiveInGroup(true);
async function onGoToNextDirectiveInGroup(): Promise<void> {
return getActiveClient().handleGoToDirectiveInGroup(true);
}
function onGoToPrevDirectiveInGroup(): void {
const client: Client = getActiveClient();
client.handleGoToDirectiveInGroup(false);
async function onGoToPrevDirectiveInGroup(): Promise<void> {
return getActiveClient().handleGoToDirectiveInGroup(false);
}
async function onRunCodeAnalysisOnActiveFile(): Promise<void> {
if (activeDocument !== "") {
await vscode.commands.executeCommand("workbench.action.files.saveAll");
getActiveClient().handleRunCodeAnalysisOnActiveFile();
return getActiveClient().handleRunCodeAnalysisOnActiveFile();
}
}
async function onRunCodeAnalysisOnOpenFiles(): Promise<void> {
if (openFileVersions.size > 0) {
await vscode.commands.executeCommand("workbench.action.files.saveAll");
getActiveClient().handleRunCodeAnalysisOnOpenFiles();
return getActiveClient().handleRunCodeAnalysisOnOpenFiles();
}
}
async function onRunCodeAnalysisOnAllFiles(): Promise<void> {
await vscode.commands.executeCommand("workbench.action.files.saveAll");
getActiveClient().handleRunCodeAnalysisOnAllFiles();
return getActiveClient().handleRunCodeAnalysisOnAllFiles();
}
async function onRemoveAllCodeAnalysisProblems(): Promise<void> {
getActiveClient().handleRemoveAllCodeAnalysisProblems();
return getActiveClient().handleRemoveAllCodeAnalysisProblems();
}
async function onRemoveCodeAnalysisProblems(refreshSquigglesOnSave: boolean, identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[]): Promise<void> {
getActiveClient().handleRemoveCodeAnalysisProblems(refreshSquigglesOnSave, identifiersAndUris);
return getActiveClient().handleRemoveCodeAnalysisProblems(refreshSquigglesOnSave, identifiersAndUris);
}
// Needed due to https://github.com/microsoft/vscode/issues/148723 .
@@ -681,58 +662,56 @@ async function onFixThisCodeAnalysisProblem(version: number, workspaceEdit: vsco
for (const codeAction of codeActions) {
if (codeAction.code === identifiersAndUris[0].identifiers[0].code && rangeEquals(codeAction.range, identifiersAndUris[0].identifiers[0].range)) {
if (version !== codeAction.version) {
vscode.window.showErrorMessage(codeActionAbortedString);
void vscode.window.showErrorMessage(codeActionAbortedString);
return;
}
break;
}
}
getActiveClient().handleFixCodeAnalysisProblems(workspaceEdit, refreshSquigglesOnSave, identifiersAndUris);
return getActiveClient().handleFixCodeAnalysisProblems(workspaceEdit, refreshSquigglesOnSave, identifiersAndUris);
}
async function onFixAllTypeCodeAnalysisProblems(type: string, version: number, workspaceEdit: vscode.WorkspaceEdit, refreshSquigglesOnSave: boolean, identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[]): Promise<void> {
if (version === codeAnalysisCodeToFixes.get(type)?.version) {
getActiveClient().handleFixCodeAnalysisProblems(workspaceEdit, refreshSquigglesOnSave, identifiersAndUris);
} else {
vscode.window.showErrorMessage(codeActionAbortedString);
return getActiveClient().handleFixCodeAnalysisProblems(workspaceEdit, refreshSquigglesOnSave, identifiersAndUris);
}
void vscode.window.showErrorMessage(codeActionAbortedString);
}
async function onFixAllCodeAnalysisProblems(version: number, workspaceEdit: vscode.WorkspaceEdit, refreshSquigglesOnSave: boolean, identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[]): Promise<void> {
if (version === codeAnalysisAllFixes.version) {
getActiveClient().handleFixCodeAnalysisProblems(workspaceEdit, refreshSquigglesOnSave, identifiersAndUris);
} else {
vscode.window.showErrorMessage(codeActionAbortedString);
return getActiveClient().handleFixCodeAnalysisProblems(workspaceEdit, refreshSquigglesOnSave, identifiersAndUris);
}
void vscode.window.showErrorMessage(codeActionAbortedString);
}
async function onDisableAllTypeCodeAnalysisProblems(code: string, identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[]): Promise<void> {
getActiveClient().handleDisableAllTypeCodeAnalysisProblems(code, identifiersAndUris);
return getActiveClient().handleDisableAllTypeCodeAnalysisProblems(code, identifiersAndUris);
}
async function onCopyDeclarationOrDefinition(sender?: any): Promise<void> {
async function onCopyDeclarationOrDefinition(args?: any): Promise<void> {
const sender: any | undefined = util.isString(args?.sender) ? args.sender : args;
const properties: { [key: string]: string } = {
sender: util.getSenderType(sender)
};
telemetry.logLanguageServerEvent('CopyDeclDefn', properties);
getActiveClient().handleCreateDeclarationOrDefinition(true);
return getActiveClient().handleCreateDeclarationOrDefinition(true, args?.range);
}
async function onCreateDeclarationOrDefinition(sender?: any): Promise<void> {
async function onCreateDeclarationOrDefinition(args?: any): Promise<void> {
const sender: any | undefined = util.isString(args?.sender) ? args.sender : args;
const properties: { [key: string]: string } = {
sender: util.getSenderType(sender)
};
telemetry.logLanguageServerEvent('CreateDeclDefn', properties);
getActiveClient().handleCreateDeclarationOrDefinition();
return getActiveClient().handleCreateDeclarationOrDefinition(false, args?.range);
}
function onAddToIncludePath(path: string): void {
if (!isFolderOpen()) {
vscode.window.showInformationMessage(localize('add.includepath.open.first', 'Open a folder first to add to {0}', "includePath"));
} else {
if (isFolderOpen()) {
// This only applies to the active client. It would not make sense to add the include path
// suggestion to a different workspace.
clients.ActiveClient.handleAddToIncludePathCommand(path);
return clients.ActiveClient.handleAddToIncludePathCommand(path);
}
}
@@ -760,13 +739,11 @@ function onToggleDimInactiveRegions(): void {
settings.update<boolean>("dimInactiveRegions", !settings.dimInactiveRegions);
}
function onPauseParsing(sender?: any): void {
logForUIExperiment("ParsingCommands", sender);
function onPauseParsing(): void {
clients.ActiveClient.pauseParsing();
}
function onResumeParsing(sender?: any): void {
logForUIExperiment("ParsingCommands", sender);
function onResumeParsing(): void {
clients.ActiveClient.resumeParsing();
}
@@ -782,23 +759,19 @@ function onCancelCodeAnalysis(): void {
clients.ActiveClient.CancelCodeAnalysis();
}
function onShowParsingCommands(sender?: any): void {
logForUIExperiment("ParsingCommands", sender);
clients.ActiveClient.handleShowParsingCommands();
function onShowParsingCommands(): Promise<void> {
return clients.ActiveClient.handleShowParsingCommands();
}
function onShowActiveCodeAnalysisCommands(sender?: any): void {
logForUIExperiment("ShowActiveCodeAnalysisCommands", sender);
clients.ActiveClient.handleShowActiveCodeAnalysisCommands();
function onShowActiveCodeAnalysisCommands(): Promise<void> {
return clients.ActiveClient.handleShowActiveCodeAnalysisCommands();
}
function onShowIdleCodeAnalysisCommands(sender?: any): void {
logForUIExperiment("ShowIdleCodeAnalysisCommands", sender);
clients.ActiveClient.handleShowIdleCodeAnalysisCommands();
function onShowIdleCodeAnalysisCommands(): Promise<void> {
return clients.ActiveClient.handleShowIdleCodeAnalysisCommands();
}
function onShowReferencesProgress(sender?: any): void {
logForUIExperiment("ShowReferencesProgress", sender);
function onShowReferencesProgress(): void {
clients.ActiveClient.handleReferencesIcon();
}
@@ -811,13 +784,13 @@ function onToggleRefGroupView(): void {
function onTakeSurvey(): void {
telemetry.logLanguageServerEvent("onTakeSurvey");
const uri: vscode.Uri = vscode.Uri.parse(`https://www.research.net/r/VBVV6C6?o=${os.platform()}&m=${vscode.env.machineId}`);
vscode.commands.executeCommand('vscode.open', uri);
void vscode.commands.executeCommand('vscode.open', uri);
}
function onVcpkgOnlineHelpSuggested(dummy?: any): void {
telemetry.logLanguageServerEvent('vcpkgAction', { 'source': dummy ? 'CodeAction' : 'CommandPalette', 'action': 'vcpkgOnlineHelpSuggested' });
const uri: vscode.Uri = vscode.Uri.parse(`https://aka.ms/vcpkg`);
vscode.commands.executeCommand('vscode.open', uri);
void vscode.commands.executeCommand('vscode.open', uri);
}
async function onVcpkgClipboardInstallSuggested(ports?: string[]): Promise<void> {
@@ -875,8 +848,8 @@ async function onVcpkgClipboardInstallSuggested(ports?: string[]): Promise<void>
await vscode.env.clipboard.writeText(installCommand);
}
function onGenerateDoxygenComment(arg: DoxygenCodeActionCommandArguments): void {
getActiveClient().handleGenerateDoxygenComment(arg);
function onGenerateDoxygenComment(arg: DoxygenCodeActionCommandArguments): Promise<void> {
return getActiveClient().handleGenerateDoxygenComment(arg);
}
function onSetActiveConfigName(configurationName: string): Thenable<void> {
@@ -891,13 +864,12 @@ function onGetActiveConfigCustomVariable(variableName: string): Thenable<string>
return clients.ActiveClient.getCurrentConfigCustomVariable(variableName);
}
function onLogDiagnostics(): void {
clients.ActiveClient.logDiagnostics();
function onLogDiagnostics(): Promise<void> {
return clients.ActiveClient.logDiagnostics();
}
function onRescanWorkspace(sender?: string): void {
logForUIExperiment("RescanWorkspace", sender);
clients.ActiveClient.rescanFolder();
function onRescanWorkspace(): Promise<void> {
return clients.ActiveClient.rescanFolder();
}
function onShowRefCommand(arg?: TreeNode): void {
@@ -908,14 +880,14 @@ function onShowRefCommand(arg?: TreeNode): void {
if (node === NodeType.reference) {
const { referenceLocation } = arg;
if (referenceLocation) {
vscode.window.showTextDocument(referenceLocation.uri, {
void vscode.window.showTextDocument(referenceLocation.uri, {
selection: referenceLocation.range.with({ start: referenceLocation.range.start, end: referenceLocation.range.end })
});
}).then(undefined, logAndReturn.undefined);
}
} else if (node === NodeType.fileWithPendingRef) {
const { fileUri } = arg;
if (fileUri) {
vscode.window.showTextDocument(fileUri);
void vscode.window.showTextDocument(fileUri).then(undefined, logAndReturn.undefined);
}
}
}
@@ -925,7 +897,7 @@ function reportMacCrashes(): void {
prevCrashFile = "";
const home: string = os.homedir();
const crashFolder: string = path.resolve(home, "Library/Logs/DiagnosticReports");
fs.stat(crashFolder, (err, stats) => {
fs.stat(crashFolder, (err) => {
const crashObject: { [key: string]: string } = {};
if (err?.code) {
// If the directory isn't there, we have a problem...
@@ -940,7 +912,7 @@ function reportMacCrashes(): void {
if (event !== "rename") {
return;
}
if (filename === prevCrashFile) {
if (!filename || filename === prevCrashFile) {
return;
}
prevCrashFile = filename;
@@ -1031,7 +1003,7 @@ function handleMacCrashFileRead(err: NodeJS.ErrnoException | undefined | null, d
const processNames: string[] = ["cpptools-srv", "cpptools-wordexp", "cpptools",
// Since only crash logs that start with "cpptools" are reported, the cases below would only occur
// if the crash were to happen before the new process had fully started and renamed itself.
"clang-tidy", "clang-format", "clang", "gcc" ];
"clang-tidy", "clang-format", "clang", "gcc"];
let processNameFound: boolean = false;
for (const processName of processNames) {
if (data.includes(processName)) {
@@ -1131,6 +1103,6 @@ export function UpdateInsidersAccess(): void {
}
if (installPrerelease) {
vscode.commands.executeCommand("workbench.extensions.installExtension", "ms-vscode.cpptools", { installPreReleaseVersion: true });
void vscode.commands.executeCommand("workbench.extensions.installExtension", "ms-vscode.cpptools", { installPreReleaseVersion: true }).then(undefined, logAndReturn.undefined);
}
}
@@ -5,10 +5,10 @@
'use strict';
import * as vscode from 'vscode';
import { CppSettings } from './settings';
import { getOutputChannel } from '../logger';
import * as nls from 'vscode-nls';
import { isString } from '../common';
import { getOutputChannel } from '../logger';
import { CppSettings } from './settings';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
+2 -2
View File
@@ -4,11 +4,11 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as fs from 'fs';
import * as nls from 'vscode-nls';
import { getExtensionFilePath } from '../common';
import { lookupString } from '../nativeStrings';
import * as nls from 'vscode-nls';
import path = require('path');
import * as fs from 'fs';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -4,9 +4,9 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as util from '../common';
import * as vscode from 'vscode';
import * as path from 'path';
import * as vscode from 'vscode';
import * as util from '../common';
class PersistentStateBase<T> {
private key: string;
@@ -27,7 +27,7 @@ class PersistentStateBase<T> {
public set Value(newValue: T) {
if (this.state) {
this.state.update(this.key, newValue);
void this.state.update(this.key, newValue);
}
this.curvalue = newValue;
}
@@ -38,7 +38,7 @@ class PersistentStateBase<T> {
public setDefault(): void {
if (this.state) {
this.state.update(this.key, this.defaultvalue);
void this.state.update(this.key, this.defaultvalue);
}
this.curvalue = this.defaultvalue;
}
@@ -66,7 +66,7 @@ export class PersistentFolderState<T> extends PersistentWorkspaceState<T> {
if (util.extensionContext) {
old_val = util.extensionContext.workspaceState.get(old_key);
if (old_val !== undefined) {
util.extensionContext.workspaceState.update(old_key, undefined);
void util.extensionContext.workspaceState.update(old_key, undefined);
}
}
const newKey: string = key + (folder ? `-${folder.uri.fsPath}` : "-untitled");
+30 -35
View File
@@ -4,21 +4,21 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import { Middleware } from 'vscode-languageclient';
import { Client } from './client';
import * as vscode from 'vscode';
import { clients, onDidChangeActiveTextEditor, processDelayedDidOpen } from './extension';
import { Middleware } from 'vscode-languageclient';
import * as util from '../common';
import { Client } from './client';
import { clients, onDidChangeActiveTextEditor, processDelayedDidOpen } from './extension';
export function createProtocolFilter(): Middleware {
// Disabling lint for invoke handlers
const invoke1 = (a: any, next: (a: any) => any): any => clients.ActiveClient.requestWhenReady(() => next(a));
const invoke2 = (a: any, b: any, next: (a: any, b: any) => any): any => clients.ActiveClient.requestWhenReady(() => next(a, b));
const invoke3 = (a: any, b: any, c: any, next: (a: any, b: any, c: any) => any): any => clients.ActiveClient.requestWhenReady(() => next(a, b, c));
const invoke4 = (a: any, b: any, c: any, d: any, next: (a: any, b: any, c: any, d: any) => any): any => clients.ActiveClient.requestWhenReady(() => next(a, b, c, d));
const invoke1 = (a: any, next: (a: any) => any): any => clients.ActiveClient.enqueue(() => next(a));
const invoke2 = (a: any, b: any, next: (a: any, b: any) => any): any => clients.ActiveClient.enqueue(() => next(a, b));
const invoke3 = (a: any, b: any, c: any, next: (a: any, b: any, c: any) => any): any => clients.ActiveClient.enqueue(() => next(a, b, c));
const invoke4 = (a: any, b: any, c: any, d: any, next: (a: any, b: any, c: any, d: any) => any): any => clients.ActiveClient.enqueue(() => next(a, b, c, d));
return {
didOpen: async (document, sendMessage) => {
didOpen: async (document, _sendMessage) => {
if (util.isCpp(document)) {
util.setWorkspaceIsCpp();
}
@@ -27,7 +27,7 @@ export function createProtocolFilter(): Middleware {
// If the file was visible editor when we were activated, we will not get a call to
// onDidChangeVisibleTextEditors, so immediately open any file that is visible when we receive didOpen.
// Otherwise, we defer opening the file until it's actually visible.
await clients.ActiveClient.requestWhenReady(() => processDelayedDidOpen(document));
await clients.ActiveClient.enqueue(() => processDelayedDidOpen(document));
if (editor && editor === vscode.window.activeTextEditor) {
onDidChangeActiveTextEditor(editor);
}
@@ -41,16 +41,14 @@ export function createProtocolFilter(): Middleware {
// didOpen), and first becomes visible.
}
},
didChange: async (textDocumentChangeEvent, sendMessage) => {
await clients.ActiveClient.requestWhenReady(async () => {
const me: Client = clients.getClientFor(textDocumentChangeEvent.document.uri);
me.onDidChangeTextDocument(textDocumentChangeEvent);
await sendMessage(textDocumentChangeEvent);
});
},
didChange: async (textDocumentChangeEvent, sendMessage) => clients.ActiveClient.enqueue(async () => {
const me: Client = clients.getClientFor(textDocumentChangeEvent.document.uri);
me.onDidChangeTextDocument(textDocumentChangeEvent);
await sendMessage(textDocumentChangeEvent);
}),
willSave: invoke1,
willSaveWaitUntil: async (event, sendMessage) => {
// await clients.ActiveClient.awaitUntilLanguageClientReady();
// await clients.ActiveClient.ready;
// Don't use awaitUntilLanguageClientReady.
// Otherwise, the message can be delayed too long.
const me: Client = clients.getClientFor(event.document.uri);
@@ -60,26 +58,23 @@ export function createProtocolFilter(): Middleware {
return [];
},
didSave: invoke1,
didClose: async (document, sendMessage) => {
await clients.ActiveClient.requestWhenReady(async () => {
const me: Client = clients.getClientFor(document.uri);
if (me.TrackedDocuments.has(document)) {
me.onDidCloseTextDocument(document);
me.TrackedDocuments.delete(document);
await sendMessage(document);
}
});
},
didClose: async (document, sendMessage) => clients.ActiveClient.enqueue(async () => {
const me: Client = clients.getClientFor(document.uri);
if (me.TrackedDocuments.has(document)) {
me.onDidCloseTextDocument(document);
me.TrackedDocuments.delete(document);
await sendMessage(document);
}
}),
provideCompletionItem: invoke4,
resolveCompletionItem: invoke2,
provideHover: async (document, position, token, next: (document: any, position: any, token: any) => any) =>
clients.ActiveClient.requestWhenReady(async () => {
const me: Client = clients.getClientFor(document.uri);
if (me.TrackedDocuments.has(document)) {
return next(document, position, token);
}
return null;
}),
provideHover: async (document, position, token, next: (document: any, position: any, token: any) => any) => clients.ActiveClient.enqueue(async () => {
const me: Client = clients.getClientFor(document.uri);
if (me.TrackedDocuments.has(document)) {
return next(document, position, token);
}
return null;
}),
provideSignatureHelp: invoke4,
provideDefinition: invoke3,
provideReferences: invoke4,
+96 -179
View File
@@ -3,16 +3,16 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { DefaultClient, ReferenceParams, FindAllReferencesParams } from './client';
import { FindAllRefsView } from './referencesView';
import * as telemetry from '../telemetry';
import * as nls from 'vscode-nls';
import * as logger from '../logger';
import { PersistentState } from './persistentState';
import * as util from '../common';
import { setInterval } from 'timers';
import { CallHierarchyParams, CallHierarchyCallsItemResult } from './Providers/callHierarchyProvider';
import * as vscode from 'vscode';
import { Position, TextDocumentIdentifier } from 'vscode-languageclient';
import * as nls from 'vscode-nls';
import * as util from '../common';
import * as logger from '../logger';
import * as telemetry from '../telemetry';
import { DefaultClient } from './client';
import { PersistentState } from './persistentState';
import { FindAllRefsView } from './referencesView';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -34,15 +34,20 @@ export interface ReferenceInfo {
type: ReferenceType;
}
export interface ReferencesParams {
newName: string;
position: Position;
textDocument: TextDocumentIdentifier;
}
export interface ReferencesResult {
referenceInfos: ReferenceInfo[];
text: string;
isFinished: boolean;
isCanceled: boolean;
}
export type ReferencesResultCallback = (result: ReferencesResult | null, doResolve: boolean) => void;
export type CallHierarchyResultCallback =
(result: CallHierarchyCallsItemResult | null, canceledByUser: boolean, progressBarDuration?: number) => void;
export type ReferencesResultCallback = (result: ReferencesResult | null) => void;
enum ReferencesProgress {
Started,
@@ -75,6 +80,23 @@ export enum ReferencesCommandMode {
CallHierarchy
}
export enum CancellationSender {
/* No cancellations */
None,
/* Cancellation was from a new request */
NewRequest,
/* Cancellation was from the provider cancellation token */
ProviderToken,
/* Cancellation was from the language server */
LanguageServer,
/* Cancellation was from the user selecting the cancel button in the reference search progress bar */
User
}
export function referencesCommandModeToString(referencesCommandMode: ReferencesCommandMode): string {
switch (referencesCommandMode) {
case ReferencesCommandMode.Find:
@@ -112,7 +134,6 @@ export function convertReferenceTypeToString(referenceType: ReferenceType, upper
case ReferenceType.NotAReference: return localize("not.a.reference", "Not a reference");
}
}
return "";
}
function getReferenceCanceledString(upperCase?: boolean): string {
@@ -174,19 +195,14 @@ export class ReferencesManager {
private findAllRefsView?: FindAllRefsView;
private viewsInitialized: boolean = false;
public symbolSearchInProgress: boolean = false;
public renamePending: boolean = false;
private referenceRequestCanceled = new vscode.EventEmitter<CancellationSender>();
private referencesCurrentProgress?: ReportReferencesProgressNotification;
private referencesPrevProgressIncrement: number = 0;
private referencesPrevProgressMessage: string = "";
public referencesRequestHasOccurred: boolean = false;
private referencesFinished: boolean = false;
public referencesRequestPending: boolean = false;
public referencesRefreshPending: boolean = false;
private referencesDelayProgress?: NodeJS.Timeout;
private referencesProgressOptions?: vscode.ProgressOptions;
private referencesCaneledByUser: boolean = false;
public referencesCanceled: boolean = false;
public referencesCanceledWhilePreviewing?: boolean;
private referencesStartedWhileTagParsing?: boolean;
private referencesProgressMethod?: (progress: vscode.Progress<{
message?: string;
@@ -196,20 +212,19 @@ export class ReferencesManager {
private referencesCurrentProgressUICounter: number = 0;
private readonly referencesProgressUpdateInterval: number = 1000;
private readonly referencesProgressDelayInterval: number = 2000;
private currentUpdateProgressTimer?: NodeJS.Timeout;
private currentUpdateProgressResolve?: (value: unknown) => void;
private prevVisibleRangesLength: number = 0;
private visibleRangesDecreased: boolean = false;
private visibleRangesDecreasedTicks: number = 0;
private readonly ticksForDetectingPeek: number = 1000; // TODO: Might need tweaking?
private resultsCallback?: ReferencesResultCallback;
private callHierarchyResultsCallback?: CallHierarchyResultCallback;
private currentUpdateProgressTimer?: NodeJS.Timeout;
private currentUpdateProgressResolve?: (value: unknown) => void;
public groupByFile: PersistentState<boolean> = new PersistentState<boolean>("CPP.referencesGroupByFile", false);
constructor(client: DefaultClient) {
this.client = client;
this.disposables.push(vscode.Disposable.from(this.referenceRequestCanceled));
}
initializeViews(): void {
@@ -219,6 +234,15 @@ export class ReferencesManager {
}
}
public get onCancellationRequested(): vscode.Event<CancellationSender> {
return this.referenceRequestCanceled.event;
}
public cancelCurrentReferenceRequest(sender: CancellationSender): void {
// Notify the current listener to cancel its request.
this.referenceRequestCanceled.fire(sender);
}
public dispose(): void {
this.disposables.forEach((d) => d.dispose());
this.disposables = [];
@@ -245,7 +269,7 @@ export class ReferencesManager {
this.prevVisibleRangesLength = visibleRangesLength;
}
private reportProgress(progress: vscode.Progress<{message?: string; increment?: number }>, forceUpdate: boolean, mode: ReferencesCommandMode): void {
private reportProgress(progress: vscode.Progress<{ message?: string; increment?: number }>, forceUpdate: boolean, mode: ReferencesCommandMode): void {
const helpMessage: string = (mode !== ReferencesCommandMode.Find) ? "" : ` ${localize("click.search.icon", "To preview results, click the search icon in the status bar.")}`;
if (this.referencesCurrentProgress) {
switch (this.referencesCurrentProgress.referencesProgress) {
@@ -347,15 +371,19 @@ export class ReferencesManager {
this.referencesDelayProgress = setInterval(() => {
const progressTitle: string = referencesCommandModeToString(this.client.ReferencesCommandMode);
this.referencesProgressOptions = { location: vscode.ProgressLocation.Notification, title: progressTitle, cancellable: true };
this.referencesProgressMethod = (progress: vscode.Progress<{message?: string; increment?: number }>, token: vscode.CancellationToken) =>
this.referencesProgressMethod = (progress: vscode.Progress<{ message?: string; increment?: number }>, token: vscode.CancellationToken) =>
new Promise((resolve) => {
this.currentUpdateProgressResolve = resolve;
this.reportProgress(progress, true, mode);
this.currentUpdateProgressTimer = setInterval(() => {
if (token.isCancellationRequested && !this.referencesCanceled) {
this.client.cancelReferences();
this.referencesCanceled = true;
this.referencesCaneledByUser = true;
if (token.isCancellationRequested) {
this.cancelCurrentReferenceRequest(CancellationSender.User);
if (this.currentUpdateProgressTimer) {
clearInterval(this.currentUpdateProgressTimer);
}
if (this.referencesDelayProgress) {
clearInterval(this.referencesDelayProgress);
}
}
if (this.referencesCurrentProgressUICounter !== referencePreviousProgressUICounter) {
if (this.currentUpdateProgressTimer) {
@@ -366,7 +394,7 @@ export class ReferencesManager {
referencePreviousProgressUICounter = this.referencesCurrentProgressUICounter;
this.referencesPrevProgressIncrement = 0; // Causes update bar to not reset.
if (this.referencesProgressOptions && this.referencesProgressMethod) {
vscode.window.withProgress(this.referencesProgressOptions, this.referencesProgressMethod);
void vscode.window.withProgress(this.referencesProgressOptions, this.referencesProgressMethod);
}
}
resolve(undefined);
@@ -375,7 +403,7 @@ export class ReferencesManager {
}
}, this.referencesProgressUpdateInterval);
});
vscode.window.withProgress(this.referencesProgressOptions, this.referencesProgressMethod);
void vscode.window.withProgress(this.referencesProgressOptions, this.referencesProgressMethod);
if (this.referencesDelayProgress) {
clearInterval(this.referencesDelayProgress);
}
@@ -400,58 +428,34 @@ export class ReferencesManager {
}
}
private startRequest(): void {
this.lastResults = null;
this.referencesFinished = false;
this.referencesRequestHasOccurred = false;
this.referencesRequestPending = false;
this.referencesCanceledWhilePreviewing = false;
public resetProgressBar(): void {
if (this.referencesDelayProgress) {
clearInterval(this.referencesDelayProgress);
}
if (this.currentUpdateProgressTimer) {
if (this.currentUpdateProgressTimer) {
clearInterval(this.currentUpdateProgressTimer);
}
if (this.currentUpdateProgressResolve) {
this.currentUpdateProgressResolve(undefined);
}
this.currentUpdateProgressResolve = undefined;
this.currentUpdateProgressTimer = undefined;
}
this.referencesProgressBarStartTime = 0;
}
private cancelRequests(): void {
if (this.resultsCallback) {
this.resultsCallback(null, true);
}
if (this.callHierarchyResultsCallback) {
this.callHierarchyResultsCallback(null, this.referencesCaneledByUser);
this.referencesCaneledByUser = false;
}
public startRename(): void {
this.renamePending = true;
}
public startRename(params: ReferenceParams): void {
this.startRequest();
if (this.referencesCanceled) {
this.referencesCanceled = false;
this.cancelRequests();
} else {
this.client.sendRenameNotification(params);
}
public resetReferences(): void {
this.renamePending = false;
this.initializeViews();
this.client.setReferencesCommandMode(ReferencesCommandMode.None);
}
public startFindAllReferences(params: FindAllReferencesParams): void {
this.startRequest();
if (this.referencesCanceled) {
this.referencesCanceled = false;
this.cancelRequests();
} else {
this.client.sendFindAllReferencesNotification(params);
}
}
public startCallHierarchyIncomingCalls(params: CallHierarchyParams): void {
this.startRequest();
if (this.referencesCanceled) {
this.referencesCanceled = false;
this.cancelRequests();
} else {
this.client.sendCallHierarchyCallsToNotification(params);
}
}
public processResults(referencesResult: ReferencesResult): void {
if (this.referencesFinished) {
return;
}
public showResultsInPanelView(referencesResult: ReferencesResult): void {
this.initializeViews();
this.clearViews();
@@ -477,52 +481,14 @@ export class ReferencesManager {
}
}
// Need to reset these before we call the callback, as the callback my trigger another request
// and we need to ensure these values are already reset before that happens.
const referencesRequestPending: boolean = this.referencesRequestPending;
const referencesCanceled: boolean = this.referencesCanceled;
this.referencesRequestPending = false;
this.referencesCanceled = false;
const currentReferenceCommandMode: ReferencesCommandMode = this.client.ReferencesCommandMode;
if (referencesResult.isFinished) {
this.symbolSearchInProgress = false;
if (this.referencesDelayProgress) {
clearInterval(this.referencesDelayProgress);
}
if (this.currentUpdateProgressTimer) {
if (this.currentUpdateProgressTimer) {
clearInterval(this.currentUpdateProgressTimer);
}
if (this.currentUpdateProgressResolve) {
this.currentUpdateProgressResolve(undefined);
}
this.currentUpdateProgressResolve = undefined;
this.currentUpdateProgressTimer = undefined;
}
this.client.setReferencesCommandMode(ReferencesCommandMode.None);
}
if (currentReferenceCommandMode === ReferencesCommandMode.Rename) {
if (!referencesCanceled) {
if (this.resultsCallback) {
this.resultsCallback(referencesResult, true);
}
} else {
// Do nothing when rename is canceled while searching for references was in progress.
if (this.resultsCallback) {
this.resultsCallback(null, true);
}
}
} else {
if (this.client.ReferencesCommandMode === ReferencesCommandMode.Find || this.client.ReferencesCommandMode === ReferencesCommandMode.Peek) {
if (this.findAllRefsView) {
this.findAllRefsView.setData(referencesResult, referencesCanceled, this.groupByFile.Value);
this.findAllRefsView.setData(referencesResult, this.groupByFile.Value);
}
// Display data based on command mode: peek references OR find all references
if (currentReferenceCommandMode === ReferencesCommandMode.Peek) {
const showConfirmedReferences: boolean = referencesCanceled;
// Display in "Other References" view or channel based on command mode: "peek references" OR "find all references"
if (this.client.ReferencesCommandMode === ReferencesCommandMode.Peek) {
const showConfirmedReferences: boolean = referencesResult.isCanceled;
if (this.findAllRefsView) {
const peekReferencesResults: string = this.findAllRefsView.getResultsAsText(showConfirmedReferences);
if (peekReferencesResults) {
@@ -532,76 +498,27 @@ export class ReferencesManager {
}
}
}
} else if (currentReferenceCommandMode === ReferencesCommandMode.Find) {
} else if (this.client.ReferencesCommandMode === ReferencesCommandMode.Find) {
if (this.findAllRefsView) {
this.findAllRefsView.show(true);
}
}
if (referencesResult.isFinished) {
this.lastResults = referencesResult;
this.referencesFinished = true;
}
if (!this.referencesRefreshPending) {
if (referencesResult.isFinished && this.referencesRequestHasOccurred && !referencesRequestPending && !this.referencesCanceledWhilePreviewing) {
this.referencesRefreshPending = true;
vscode.commands.executeCommand("references-view.refresh");
} else {
if (this.resultsCallback) {
this.resultsCallback(referencesResult, !this.referencesCanceledWhilePreviewing);
}
}
}
}
// If this is the final result, reset after process results.
if (referencesResult.isFinished || referencesResult.isCanceled) {
this.resetReferences();
}
}
public lastResults: ReferencesResult | null = null; // Saved for the final request after a preview occurs.
public setResultsCallback(callback: ReferencesResultCallback): void {
this.symbolSearchInProgress = true;
this.resultsCallback = callback;
}
public processCallHierarchyResults(callHierarchyResult: CallHierarchyCallsItemResult): void {
const referencesCanceled: boolean = this.referencesCanceled;
const referenceCanceledByUser: boolean = this.referencesCaneledByUser;
public getCallHierarchyProgressBarDuration(): number | undefined {
let referencesProgressBarDuration: number | undefined;
// Need to reset these before we call the callback, as the callback my trigger another request
// and we need to ensure these values are already reset before that happens.
this.referencesCaneledByUser = false;
this.referencesCanceled = false;
this.referencesRequestPending = false;
this.symbolSearchInProgress = false;
if (this.referencesProgressBarStartTime !== 0) {
referencesProgressBarDuration = Date.now() - this.referencesProgressBarStartTime;
this.referencesProgressBarStartTime = 0;
}
if (this.referencesDelayProgress) {
clearInterval(this.referencesDelayProgress);
}
if (this.currentUpdateProgressTimer) {
if (this.currentUpdateProgressTimer) {
clearInterval(this.currentUpdateProgressTimer);
}
if (this.currentUpdateProgressResolve) {
this.currentUpdateProgressResolve(undefined);
}
this.currentUpdateProgressResolve = undefined;
this.currentUpdateProgressTimer = undefined;
}
this.client.setReferencesCommandMode(ReferencesCommandMode.None);
// Execute the callback.
if (this.callHierarchyResultsCallback) {
this.callHierarchyResultsCallback(referencesCanceled ? null : callHierarchyResult,
referenceCanceledByUser, referencesProgressBarDuration);
}
}
public setCallHierarchyResultsCallback(callback: CallHierarchyResultCallback): void {
this.symbolSearchInProgress = true;
this.callHierarchyResultsCallback = callback;
return referencesProgressBarDuration;
}
public clearViews(): void {
@@ -4,7 +4,7 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { ReferenceType, ReferenceInfo, ReferencesResult } from './references';
import { ReferenceInfo, ReferencesResult, ReferenceType } from './references';
export class ReferencesModel {
readonly nodes: TreeNode[] = []; // Raw flat list of references
@@ -15,7 +15,10 @@ export class ReferencesModel {
this.originalSymbol = resultsInput.text;
this.groupByFile = groupByFile;
const results: ReferenceInfo[] = resultsInput.referenceInfos.filter(r => r.type !== ReferenceType.Confirmed);
// Only filter out confirmed references when operation has finished.
// Otherwise, show all results in the "Other References" view while previewing or if the request was canceled.
const results: ReferenceInfo[] = resultsInput.isFinished ?
resultsInput.referenceInfos.filter(r => r.type !== ReferenceType.Confirmed) : resultsInput.referenceInfos;
// Build a single flat list of all leaf nodes
// Currently, the hierarchy is built each time referencesTreeDataProvider requests nodes.
@@ -4,9 +4,9 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { ReferencesModel, TreeNode, NodeType } from './referencesModel';
import { ReferenceType, getReferenceTagString, getReferenceItemIconPath } from './references';
import * as nls from 'vscode-nls';
import { getReferenceItemIconPath, getReferenceTagString, ReferenceType } from './references';
import { NodeType, ReferencesModel, TreeNode } from './referencesModel';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -22,14 +22,14 @@ export class ReferencesTreeDataProvider implements vscode.TreeDataProvider<TreeN
refresh(): void {
if (this.referencesModel) {
vscode.commands.executeCommand('setContext', 'refView.isGroupedByFile', this.referencesModel.groupByFile);
void vscode.commands.executeCommand('setContext', 'refView.isGroupedByFile', this.referencesModel.groupByFile);
this._onDidChangeTreeData.fire();
}
}
setModel(model: ReferencesModel): void {
this.referencesModel = model;
vscode.commands.executeCommand('setContext', 'refView.isGroupedByFile', this.referencesModel.groupByFile);
void vscode.commands.executeCommand('setContext', 'refView.isGroupedByFile', this.referencesModel.groupByFile);
this._onDidChangeTreeData.fire();
}
@@ -4,9 +4,9 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { ReferencesResult, ReferenceType, getReferenceTagString } from './references';
import { ReferencesTreeDataProvider } from './referencesTreeDataProvider';
import { getReferenceTagString, ReferencesResult, ReferenceType } from './references';
import { ReferencesModel, TreeNode } from './referencesModel';
import { ReferencesTreeDataProvider } from './referencesTreeDataProvider';
export class FindAllRefsView {
private referencesModel?: ReferencesModel;
@@ -27,15 +27,16 @@ export class FindAllRefsView {
if (this.referencesModel) {
hasResults = this.referencesModel.hasResults();
}
vscode.commands.executeCommand('setContext', 'cpptools.hasReferencesResults', hasResults);
void vscode.commands.executeCommand('setContext', 'cpptools.hasReferencesResults', hasResults);
}
setData(results: ReferencesResult, isCanceled: boolean, groupByFile: boolean): void {
this.referencesModel = new ReferencesModel(results, isCanceled, groupByFile, () => { this.referenceViewProvider.refresh(); });
setData(results: ReferencesResult, groupByFile: boolean): void {
this.referencesModel = new ReferencesModel(results, results.isCanceled, groupByFile, () => { this.referenceViewProvider.refresh(); });
this.referenceViewProvider.setModel(this.referencesModel);
}
clearData(): void {
this.referencesModel = undefined;
this.referenceViewProvider.clear();
}
@@ -63,7 +64,7 @@ export class FindAllRefsView {
line += ref.filename;
if (ref.referencePosition !== null && ref.referencePosition !== undefined) {
line += ":" + (ref.referencePosition.line + 1) + ":" + (ref.referencePosition.character + 1)
+ " " + ref.referenceText;
+ " " + ref.referenceText;
}
if (includeConfirmedReferences && ref.referenceType === ReferenceType.Confirmed) {
confirmedRefs.push(line);
@@ -77,7 +78,7 @@ export class FindAllRefsView {
for (const fileRef of fileReferences) {
const line: string =
("[" + getReferenceTagString(ReferenceType.ConfirmationInProgress, this.referencesModel.isCanceled) + "] "
+ fileRef.filename);
+ fileRef.filename);
fileRefs.push(line);
}
+62 -49
View File
@@ -4,27 +4,28 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { CommentPattern } from './languageConfig';
import { getExtensionFilePath, getCachedClangFormatPath, setCachedClangFormatPath, getCachedClangTidyPath, setCachedClangTidyPath, isWindows } from '../common';
import * as os from 'os';
import * as which from 'which';
import { execSync } from 'child_process';
import * as semver from 'semver';
import * as fs from 'fs';
import * as path from 'path';
import { cachedEditorConfigLookups, cachedEditorConfigSettings, hasTrustedCompilerPaths, DefaultClient } from './client';
import * as editorConfig from 'editorconfig';
import { PersistentState } from './persistentState';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as semver from 'semver';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import * as which from 'which';
import { getCachedClangFormatPath, getCachedClangTidyPath, getExtensionFilePath, setCachedClangFormatPath, setCachedClangTidyPath } from '../common';
import { isWindows } from '../constants';
import { DefaultClient, cachedEditorConfigLookups, cachedEditorConfigSettings, hasTrustedCompilerPaths } from './client';
import { clients } from './extension';
import { CommentPattern } from './languageConfig';
import { PersistentState } from './persistentState';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
export interface Excludes {
[key: string]: boolean | { when: string };
};
}
export interface WorkspaceFolderSettingsParams {
uri: string | undefined;
@@ -62,6 +63,7 @@ export interface WorkspaceFolderSettingsParams {
clangTidyChecksEnabled: string[] | undefined;
clangTidyChecksDisabled: string[] | undefined;
hover: string | undefined;
markdownInComments: string | undefined;
vcFormatIndentBraces: boolean | undefined;
vcFormatIndentMultiLineRelativeTo: string | undefined;
vcFormatIndentWithinParentheses: string | undefined;
@@ -130,7 +132,7 @@ export interface WorkspaceFolderSettingsParams {
editorAutoClosingBrackets: string | undefined;
editorInlayHintsEnabled: boolean | undefined;
editorParameterHintsEnabled: boolean | undefined;
};
}
export interface SettingsParams {
filesAssociations: { [key: string]: string } | undefined;
@@ -154,7 +156,7 @@ export interface SettingsParams {
codeAnalysisMaxMemory: number | null | undefined;
codeAnalysisUpdateDelay: number | undefined;
workspaceFolderSettings: WorkspaceFolderSettingsParams[];
};
}
function getTarget(): vscode.ConfigurationTarget {
return (vscode.workspace.workspaceFolders) ? vscode.ConfigurationTarget.WorkspaceFolder : vscode.ConfigurationTarget.Global;
@@ -210,6 +212,11 @@ class Settings {
}
}
function changeBlankStringToUndefined(input: string | undefined): string | undefined {
// Although null is not a valid type, user could enter a null anyway.
return (input === undefined || input === null || input.trim() === "") ? undefined : input;
}
export class CppSettings extends Settings {
/**
* Create the CppSettings object.
@@ -248,19 +255,20 @@ export class CppSettings extends Settings {
}
private getClangPath(isFormat: boolean): string | undefined {
let path: string | undefined | null = super.Section.get<string>(isFormat ? "clang_format_path" : "codeAnalysis.clangTidy.path");
let path: string | undefined = changeBlankStringToUndefined(super.Section.get<string>(isFormat ? "clang_format_path" : "codeAnalysis.clangTidy.path"));
if (!path) {
const cachedClangPath: string | null | undefined = isFormat ? getCachedClangFormatPath() : getCachedClangTidyPath();
const cachedClangPath: string | undefined = isFormat ? getCachedClangFormatPath() : getCachedClangTidyPath();
if (cachedClangPath !== undefined) {
if (cachedClangPath === null) {
return undefined;
}
return cachedClangPath;
}
const clangStr: string = isFormat ? this.clangFormatStr : this.clangTidyStr;
const clangName: string = isFormat ? this.clangFormatName : this.clangTidyName;
const setCachedClangPath: (path: string | null) => void = isFormat ? setCachedClangFormatPath : setCachedClangTidyPath;
path = which.sync(clangName, { nothrow: true });
const setCachedClangPath: (path: string) => void = isFormat ? setCachedClangFormatPath : setCachedClangTidyPath;
const whichPath: string | null = which.sync(clangName, { nothrow: true });
if (whichPath === null) {
return undefined;
}
path = whichPath;
setCachedClangPath(path);
if (!path) {
return undefined;
@@ -316,8 +324,8 @@ export class CppSettings extends Settings {
public get codeAnalysisRunAutomatically(): boolean | undefined { return super.Section.get<boolean>("codeAnalysis.runAutomatically"); }
public get codeAnalysisRunOnBuild(): boolean | undefined { return false; } // super.Section.get<boolean>("codeAnalysis.runOnBuild"); }
public get clangTidyEnabled(): boolean | undefined { return super.Section.get<boolean>("codeAnalysis.clangTidy.enabled"); }
public get clangTidyConfig(): string | undefined { return super.Section.get<string>("codeAnalysis.clangTidy.config"); }
public get clangTidyFallbackConfig(): string | undefined { return super.Section.get<string>("codeAnalysis.clangTidy.fallbackConfig"); }
public get clangTidyConfig(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("codeAnalysis.clangTidy.config")); }
public get clangTidyFallbackConfig(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("codeAnalysis.clangTidy.fallbackConfig")); }
public get clangTidyFixWarnings(): boolean | undefined { return false; } // super.Section.get<boolean>("codeAnalysis.clangTidy.fix.warnings"); }
public get clangTidyFixErrors(): boolean | undefined { return false; } // super.Section.get<boolean>("codeAnalysis.clangTidy.fix.errors"); }
public get clangTidyFixNotes(): boolean | undefined { return false; } // super.Section.get<boolean>("codeAnalysis.clangTidy.fix.notes"); }
@@ -336,23 +344,23 @@ export class CppSettings extends Settings {
return;
}
checks.push(value);
super.Section.update("codeAnalysis.clangTidy.checks.disabled", checks, vscode.ConfigurationTarget.WorkspaceFolder);
void super.Section.update("codeAnalysis.clangTidy.checks.disabled", checks, vscode.ConfigurationTarget.WorkspaceFolder);
}
public get clangFormatStyle(): string | undefined { return super.Section.get<string>("clang_format_style"); }
public get clangFormatFallbackStyle(): string | undefined { return super.Section.get<string>("clang_format_fallbackStyle"); }
public get clangFormatStyle(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("clang_format_style")); }
public get clangFormatFallbackStyle(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("clang_format_fallbackStyle")); }
public get clangFormatSortIncludes(): boolean | undefined | null { return super.Section.get<boolean | null>("clang_format_sortIncludes"); }
public get experimentalFeatures(): boolean | undefined { return super.Section.get<string>("experimentalFeatures")?.toLowerCase() === "enabled"; }
public get suggestSnippets(): boolean | undefined { return super.Section.get<boolean>("suggestSnippets"); }
public get intelliSenseEngine(): string | undefined { return super.Section.get<string>("intelliSenseEngine")?.toLowerCase(); }
public get intelliSenseEngineFallback(): boolean | undefined { return super.Section.get<string>("intelliSenseEngineFallback")?.toLowerCase() === "enabled"; }
public get intelliSenseCachePath(): string | undefined { return super.Section.get<string>("intelliSenseCachePath"); }
public get intelliSenseCachePath(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("intelliSenseCachePath")); }
public get intelliSenseCacheSize(): number | undefined { return super.Section.get<number>("intelliSenseCacheSize"); }
public get intelliSenseMemoryLimit(): number | undefined { return super.Section.get<number>("intelliSenseMemoryLimit"); }
public get intelliSenseUpdateDelay(): number | undefined { return super.Section.get<number>("intelliSenseUpdateDelay"); }
public get errorSquiggles(): string | undefined { return super.Section.get<string>("errorSquiggles")?.toLowerCase(); }
public get inactiveRegionOpacity(): number | undefined { return super.Section.get<number>("inactiveRegionOpacity"); }
public get inactiveRegionForegroundColor(): string | undefined { return super.Section.get<string>("inactiveRegionForegroundColor"); }
public get inactiveRegionBackgroundColor(): string | undefined { return super.Section.get<string>("inactiveRegionBackgroundColor"); }
public get inactiveRegionForegroundColor(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("inactiveRegionForegroundColor")); }
public get inactiveRegionBackgroundColor(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("inactiveRegionBackgroundColor")); }
public get autocomplete(): string | undefined { return super.Section.get<string>("autocomplete"); }
public get autocompleteAddParentheses(): boolean | undefined { return super.Section.get<boolean>("autocompleteAddParentheses"); }
public get loggingLevel(): string | undefined { return super.Section.get<string>("loggingLevel"); }
@@ -373,10 +381,10 @@ export class CppSettings extends Settings {
public get filesExclude(): vscode.WorkspaceConfiguration | undefined { return super.Section.get<vscode.WorkspaceConfiguration>("files.exclude"); }
public get defaultIncludePath(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.includePath"); }
public get defaultDefines(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.defines"); }
public get defaultDotconfig(): string | undefined { return super.Section.get<string>("default.dotConfig"); }
public get defaultDotconfig(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("default.dotConfig")); }
public get defaultMacFrameworkPath(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.macFrameworkPath"); }
public get defaultWindowsSdkVersion(): string | undefined { return super.Section.get<string>("default.windowsSdkVersion"); }
public get defaultCompileCommands(): string | undefined { return super.Section.get<string>("default.compileCommands"); }
public get defaultWindowsSdkVersion(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("default.windowsSdkVersion")); }
public get defaultCompileCommands(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("default.compileCommands")); }
public get defaultForcedInclude(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.forcedInclude"); }
public get defaultIntelliSenseMode(): string | undefined { return super.Section.get<string>("default.intelliSenseMode"); }
public get defaultCompilerPath(): string | undefined { return super.Section.get<string | null>("default.compilerPath") ?? undefined; }
@@ -389,10 +397,10 @@ export class CppSettings extends Settings {
} else if (compilerPathInfo.workspaceValue !== undefined) {
target = vscode.ConfigurationTarget.Workspace;
}
this.Section.update(defaultCompilerPathStr, value, target);
void this.Section.update(defaultCompilerPathStr, value, target);
if (this.resource !== undefined && !hasTrustedCompilerPaths()) {
// Also set the user/remote compiler path if no other path has been trusted yet.
this.Section.update(defaultCompilerPathStr, value, vscode.ConfigurationTarget.Global);
void this.Section.update(defaultCompilerPathStr, value, vscode.ConfigurationTarget.Global);
clients.forEach(client => {
if (client instanceof DefaultClient) {
client.setShowConfigureIntelliSenseButton(false);
@@ -403,19 +411,20 @@ export class CppSettings extends Settings {
public get defaultCompilerArgs(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.compilerArgs"); }
public get defaultCStandard(): string | undefined { return super.Section.get<string>("default.cStandard"); }
public get defaultCppStandard(): string | undefined { return super.Section.get<string>("default.cppStandard"); }
public get defaultConfigurationProvider(): string | undefined { return super.Section.get<string>("default.configurationProvider"); }
public get defaultConfigurationProvider(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("default.configurationProvider")); }
public get defaultMergeConfigurations(): boolean | undefined { return super.Section.get<boolean>("default.mergeConfigurations"); }
public get defaultBrowsePath(): string[] | undefined { return super.getWithUndefinedDefault<string[] | null>("default.browse.path") ?? undefined; }
public get defaultDatabaseFilename(): string | undefined { return super.Section.get<string>("default.browse.databaseFilename"); }
public get defaultDatabaseFilename(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("default.browse.databaseFilename")); }
public get defaultLimitSymbolsToIncludedHeaders(): boolean | undefined { return super.Section.get<boolean>("default.browse.limitSymbolsToIncludedHeaders"); }
public get defaultSystemIncludePath(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.systemIncludePath"); }
public get defaultEnableConfigurationSquiggles(): boolean | undefined { return super.Section.get<boolean>("default.enableConfigurationSquiggles"); }
public get defaultCustomConfigurationVariables(): { [key: string]: string } | undefined { return super.Section.get<{ [key: string]: string }>("default.customConfigurationVariables"); }
public get useBacktickCommandSubstitution(): boolean | undefined { return super.Section.get<boolean>("debugger.useBacktickCommandSubstitution"); }
public get codeFolding(): boolean { return super.Section.get<string>("codeFolding")?.toLowerCase() === "enabled"; }
public get caseSensitiveFileSupport(): boolean { return !isWindows() || super.Section.get<string>("caseSensitiveFileSupport") === "enabled" ; }
public get caseSensitiveFileSupport(): boolean { return !isWindows || super.Section.get<string>("caseSensitiveFileSupport") === "enabled"; }
public get doxygenSectionTags(): string[] | undefined { return super.Section.get<string[]>("doxygen.sectionTags"); }
public get hover(): string | undefined { return super.Section.get<string>("hover"); }
public get markdownInComments(): string | undefined { return super.Section.get<string>("markdownInComments"); }
public get legacyCompilerArgsBehavior(): boolean | undefined { return super.Section.get<boolean>("legacyCompilerArgsBehavior"); }
public get inlayHintsAutoDeclarationTypes(): boolean {
@@ -730,11 +739,11 @@ export class CppSettings extends Settings {
public toggleSetting(name: string, value1: string, value2: string): void {
const value: string | undefined = super.Section.get<string>(name);
super.Section.update(name, value?.toLowerCase() === value1.toLowerCase() ? value2 : value1, getTarget());
void super.Section.update(name, value?.toLowerCase() === value1.toLowerCase() ? value2 : value1, getTarget());
}
public update<T>(name: string, value: T): void {
super.Section.update(name, value);
void super.Section.update(name, value);
}
public populateEditorConfig(document: vscode.TextDocument): void {
@@ -868,7 +877,7 @@ export class CppSettings extends Settings {
const lastPosition: vscode.Position = document.lineAt(document.lineCount - 1).range.end;
edits.insert(document.uri, lastPosition, remainingSettingsText);
}
vscode.workspace.applyEdit(edits).then(() => vscode.window.showTextDocument(document));
void vscode.workspace.applyEdit(edits).then(() => vscode.window.showTextDocument(document));
}
public async generateEditorConfig(): Promise<void> {
@@ -897,7 +906,7 @@ export class CppSettings extends Settings {
if (this.formattingEngine !== "default") {
return this.formattingEngine === "vcformat";
}
if (this.clangFormatStyle !== "file") {
if (this.clangFormatStyle && this.clangFormatStyle !== "file") {
// If a clang-format style other than file is specified, don't try to switch to vcFormat.
return false;
}
@@ -913,14 +922,18 @@ export class CppSettings extends Settings {
const keys: string[] = Object.keys(editorConfigSettings);
for (let i: number = 0; i < keys.length; ++i) {
if (keys[i].startsWith("cpp_")) {
foundEditorConfigWithVcFormatSettings = true;
const didEditorConfigNotice: PersistentState<boolean> = new PersistentState<boolean>("Cpp.didEditorConfigNotice", false);
if (!didEditorConfigNotice.Value) {
vscode.window.showInformationMessage(localize({ key: "editorconfig.default.behavior", comment: ["Single-quotes are used here, as this message is displayed in a context that does not render markdown. Do not change them to back-ticks. Do not change the contents of the single-quoted text."] },
"Code formatting is using settings from .editorconfig instead of .clang-format. For more information, see the documentation for the 'default' value of the 'C_Cpp.formatting' setting."));
didEditorConfigNotice.Value = true;
const cppCheck: string = keys[i].substring(4);
if (cppCheck.startsWith("indent_") || cppCheck.startsWith("new_line_") ||
cppCheck.startsWith("space_") || cppCheck.startsWith("wrap_")) {
foundEditorConfigWithVcFormatSettings = true;
const didEditorConfigNotice: PersistentState<boolean> = new PersistentState<boolean>("Cpp.didEditorConfigNotice", false);
if (!didEditorConfigNotice.Value) {
void vscode.window.showInformationMessage(localize({ key: "editorconfig.default.behavior", comment: ["Single-quotes are used here, as this message is displayed in a context that does not render markdown. Do not change them to back-ticks. Do not change the contents of the single-quoted text."] },
"Code formatting is using settings from .editorconfig instead of .clang-format. For more information, see the documentation for the 'default' value of the 'C_Cpp.formatting' setting."));
didEditorConfigNotice.Value = true;
}
return true;
}
return true;
}
}
switch (typeof editorConfigSettings.root) {
@@ -983,14 +996,14 @@ export class OtherSettings {
public get filesEncoding(): string | undefined { return vscode.workspace.getConfiguration("files", { uri: this.resource, languageId: "cpp" }).get<string>("encoding"); }
public get filesAssociations(): any { return vscode.workspace.getConfiguration("files").get("associations"); }
public set filesAssociations(value: any) {
vscode.workspace.getConfiguration("files").update("associations", value, vscode.ConfigurationTarget.Workspace);
void vscode.workspace.getConfiguration("files").update("associations", value, vscode.ConfigurationTarget.Workspace);
}
public get filesExclude(): vscode.WorkspaceConfiguration | undefined { return vscode.workspace.getConfiguration("files", this.resource).get("exclude"); }
public get filesAutoSaveAfterDelay(): boolean { return vscode.workspace.getConfiguration("files").get("autoSave") === "afterDelay"; }
public get editorInlayHintsEnabled(): boolean { return vscode.workspace.getConfiguration("editor.inlayHints").get<string>("enabled") !== "off"; }
public get editorParameterHintsEnabled(): boolean | undefined { return vscode.workspace.getConfiguration("editor.parameterHints").get<boolean>("enabled"); }
public get searchExclude(): vscode.WorkspaceConfiguration | undefined { return vscode.workspace.getConfiguration("search", this.resource).get("exclude"); }
public get workbenchSettingsEditor (): string | undefined { return vscode.workspace.getConfiguration("workbench.settings").get<string>("editor"); }
public get workbenchSettingsEditor(): string | undefined { return vscode.workspace.getConfiguration("workbench.settings").get<string>("editor"); }
public get colorTheme(): string | undefined { return vscode.workspace.getConfiguration("workbench").get<string>("colorTheme"); }
+12 -11
View File
@@ -4,20 +4,21 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as path from 'path';
import * as fs from 'fs';
import * as path from 'path';
import * as vscode from 'vscode';
import * as util from '../common';
import * as config from './configurations';
import * as telemetry from '../telemetry';
import * as nls from 'vscode-nls';
import * as util from '../common';
import * as telemetry from '../telemetry';
import * as config from './configurations';
import { getLocalizedHtmlPath } from './localization';
import _ = require('lodash');
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
const deepCopy = (obj: any) => _.cloneDeep(obj);
function deepCopy(obj: any) {
return JSON.parse(JSON.stringify(obj));
}
// TODO: share ElementId between SettingsPanel and SettingsApp. Investigate why SettingsApp cannot import/export
const elementId: { [key: string]: string } = {
@@ -195,7 +196,7 @@ export class SettingsPanel {
public updateErrors(errors: config.ConfigurationErrors): void {
if (this.panel) {
this.panel.webview.postMessage({ command: 'updateErrors', errors: errors});
void this.panel.webview.postMessage({ command: 'updateErrors', errors: errors });
}
}
@@ -230,11 +231,11 @@ export class SettingsPanel {
this.configValues = deepCopy(configuration); // Copy configuration values
this.isIntelliSenseModeDefined = (this.configValues.intelliSenseMode !== undefined);
if (this.panel && this.initialized) {
this.panel.webview.postMessage({ command: 'setKnownCompilers', compilers: this.compilerPaths });
this.panel.webview.postMessage({ command: 'updateConfigSelection', selections: configSelection, selectedIndex: this.configIndexSelected });
this.panel.webview.postMessage({ command: 'updateConfig', config: this.configValues });
void this.panel.webview.postMessage({ command: 'setKnownCompilers', compilers: this.compilerPaths });
void this.panel.webview.postMessage({ command: 'updateConfigSelection', selections: configSelection, selectedIndex: this.configIndexSelected });
void this.panel.webview.postMessage({ command: 'updateConfig', config: this.configValues });
if (errors !== null) {
this.panel.webview.postMessage({ command: 'updateErrors', errors: errors });
void this.panel.webview.postMessage({ command: 'updateErrors', errors: errors });
}
}
}
@@ -2,9 +2,9 @@
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as telemetry from '../telemetry';
import * as util from '../common';
import * as vscode from 'vscode';
import * as util from '../common';
import * as telemetry from '../telemetry';
interface TimeStampSequence {
firstFile?: number; // when the extension is activated. Defined only for "cold" start cases.
+286 -156
View File
@@ -5,37 +5,19 @@
'use strict';
import * as vscode from 'vscode';
import { Client } from './client';
import * as nls from 'vscode-nls';
import { NewUI } from './ui_new';
import { ReferencesCommandMode, referencesCommandModeToString } from './references';
import { getCustomConfigProviders, CustomConfigurationProviderCollection, isSameProviderExtensionId } from './customProviders';
import * as telemetry from '../telemetry';
import { sleep } from '../Utility/Async/sleep';
import * as util from '../common';
import * as telemetry from '../telemetry';
import { Client } from './client';
import { CustomConfigurationProviderCollection, getCustomConfigProviders, isSameProviderExtensionId } from './customProviders';
import { ReferencesCommandMode, referencesCommandModeToString } from './references';
import { CppSettings } from './settings';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
let uiPromise: Promise<UI> | undefined;
let ui: UI;
export interface UI {
isNewUI: boolean;
activeDocumentChanged(): void;
bind(client: Client): void;
showConfigurations(configurationNames: string[]): Promise<number>;
ShowConfigureIntelliSenseButton(show: boolean, client?: Client): Promise<void>;
showConfigurationProviders(currentProvider?: string): Promise<string | undefined>;
showCompileCommands(paths: string[]): Promise<number>;
showWorkspaces(workspaceNames: { name: string; key: string }[]): Promise<string>;
showParsingCommands(): Promise<number>;
showActiveCodeAnalysisCommands(): Promise<number>;
showIdleCodeAnalysisCommands(): Promise<number>;
showConfigureIncludePathMessage(prompt: () => Promise<boolean>, onSkip: () => void): void;
showConfigureCompileCommandsMessage(prompt: () => Promise<boolean>, onSkip: () => void): void;
showConfigureCustomProviderMessage(prompt: () => Promise<boolean>, onSkip: () => void): void;
dispose(): void;
}
let ui: LanguageStatusUI;
interface IndexableQuickPickItem extends vscode.QuickPickItem {
index: number;
@@ -56,32 +38,60 @@ interface ConfigurationStatus {
priority: ConfigurationPriority;
}
const commandArguments: string[] = ['oldUI']; // We report the sender of the command
enum LanguageStatusPriority {
First = 0,
High = 1,
Mid = 2,
Low = 3
}
export class OldUI implements UI {
export enum ConfigurationType {
AutoConfigProvider = "autoConfigProvider",
ConfigProvider = "configProvider",
CompileCommands = "compileCommands",
AutoCompilerPath = "autoCompilerPath",
CompilerPath = "compilerPath",
NotConfigured = "notConfigured"
}
const commandArguments: string[] = []; // We report the sender of the command
export class LanguageStatusUI {
private currentClient: Client | undefined;
private configStatusBarItem: vscode.StatusBarItem;
private browseEngineStatusBarItem: vscode.StatusBarItem;
private intelliSenseStatusBarItem: vscode.StatusBarItem;
private browseEngineStatusItem: vscode.LanguageStatusItem;
private intelliSenseStatusItem: vscode.LanguageStatusItem;
private configureIntelliSenseStatusItem: vscode.StatusBarItem;
private referencesStatusBarItem: vscode.StatusBarItem;
private codeAnalysisStatusItem: vscode.LanguageStatusItem;
/** **************************************************** */
private curConfigurationStatus?: Promise<ConfigurationStatus>;
private isParsingWorkspace: boolean = false;
private isParsingWorkspacePaused: boolean = false;
private isParsingFiles: boolean = false;
private isUpdatingIntelliSense: boolean = false;
private isRunningCodeAnalysis: boolean = false;
private isCodeAnalysisPaused: boolean = false;
private codeAnalysisProcessed: number = 0;
private codeAnalysisTotal: number = 0;
private readonly workspaceParsingRunningText: string = localize("running.tagparser.text", "Parsing Workspace");
private readonly workspaceParsingPausedText: string = localize("paused.tagparser.text", "Parsing Workspace: Paused");
private readonly workspaceParsingDoneText: string = localize("complete.tagparser.text", "Parsing Complete");
private readonly workspaceParsingInitializing: string = localize("initializing.tagparser.text", "Initializing Workspace");
private readonly workspaceParsingIndexing: string = localize("indexing.tagparser.text", "Indexing Workspace");
private workspaceParsingStatus: string = "";
private codeAnalysisProgram: string = "";
private readonly parsingFilesTooltip: string = localize("c.cpp.parsing.open.files.tooltip", "Parsing open files");
private workspaceParsingProgress: string = "";
private readonly workspaceRescanText = localize("rescan.tagparse.text", "Rescan Workspace");
private readonly parsingFilesTooltip: string = localize("c.cpp.parsing.open.files.tooltip", "Parsing Open Files");
private readonly referencesPreviewTooltip: string = ` (${localize("click.to.preview", "click to preview results")})`;
private readonly updatingIntelliSenseTooltip: string = localize("updating.intellisense.tooltip", "Updating IntelliSense");
private runningCodeAnalysisTooltip: string = "";
private codeAnalysisPausedTooltip: string = "";
get isNewUI(): boolean { return false; };
private readonly updatingIntelliSenseText: string = localize("updating.intellisense.text", "IntelliSense: Updating");
private readonly idleIntelliSenseText: string = localize("idle.intellisense.text", "IntelliSense: Ready");
private readonly missingIntelliSenseText: string = localize("absent.intellisense.text", "IntelliSense: Not configured");
private readonly codeAnalysisRunningText: string = localize("running.analysis.text", "Code Analysis: Running");
private readonly codeAnalysisPausedText: string = localize("paused.analysis.text", "Code Analysis: Paused");
private readonly codeAnalysisModePrefix: string = localize("mode.analysis.prefix", "Code Analysis Mode: ");
private codeAnalysProgress: string = "";
// Prevent icons from appearing too often and for too short of a time.
private readonly iconDelayTime: number = 1000;
private readonly configureIntelliSenseText: string = localize("c.cpp.configureIntelliSenseStatus.text", "Configure IntelliSense");
private readonly cppConfigureIntelliSenseText: string = localize("c.cpp.configureIntelliSenseStatus.cppText", "C/C++ Configure IntelliSense");
@@ -97,7 +107,7 @@ export class OldUI implements UI {
this.configStatusBarItem.tooltip = configTooltip;
this.ShowConfiguration = true;
this.referencesStatusBarItem = vscode.window.createStatusBarItem("c.cpp.references.statusbar", vscode.StatusBarAlignment.Right, 0);
this.referencesStatusBarItem = vscode.window.createStatusBarItem(`c.cpp.references.statusbar`, vscode.StatusBarAlignment.Right, 901);
this.referencesStatusBarItem.name = localize("c.cpp.references.statusbar", "C/C++ References Status");
this.referencesStatusBarItem.tooltip = "";
this.referencesStatusBarItem.command = {
@@ -107,7 +117,7 @@ export class OldUI implements UI {
};
this.ShowReferencesIcon = false;
this.configureIntelliSenseStatusItem = vscode.window.createStatusBarItem(`c.cpp.configureIntelliSenseStatus.statusbar`, vscode.StatusBarAlignment.Right, 901);
this.configureIntelliSenseStatusItem = vscode.window.createStatusBarItem(`c.cpp.configureIntelliSenseStatus.statusbar`, vscode.StatusBarAlignment.Right, 0);
this.configureIntelliSenseStatusItem.name = this.cppConfigureIntelliSenseText;
this.configureIntelliSenseStatusItem.tooltip = this.cppConfigureIntelliSenseText;
this.configureIntelliSenseStatusItem.text = `$(warning) ${this.configureIntelliSenseText}`;
@@ -117,92 +127,227 @@ export class OldUI implements UI {
title: this.configureIntelliSenseStatusItem.name,
arguments: ['statusBar']
};
this.ShowConfigureIntelliSenseButton(false, this.currentClient);
void this.ShowConfigureIntelliSenseButton(false, this.currentClient);
this.intelliSenseStatusBarItem = vscode.window.createStatusBarItem("c.cpp.intellisense.statusbar", vscode.StatusBarAlignment.Right, 903);
this.intelliSenseStatusBarItem.name = localize("c.cpp.intellisense.statusbar", "C/C++ IntelliSense Status");
this.intelliSenseStatusBarItem.tooltip = this.updatingIntelliSenseTooltip;
this.ShowFlameIcon = false;
this.intelliSenseStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.intellisense`, util.documentSelector);
this.intelliSenseStatusItem.name = localize("cpptools.status.intellisense", "C/C++ IntelliSense Status");
this.intelliSenseStatusItem.text = this.idleIntelliSenseText;
this.browseEngineStatusBarItem = vscode.window.createStatusBarItem("c.cpp.tagparser.statusbar", vscode.StatusBarAlignment.Right, 902);
this.browseEngineStatusBarItem.name = localize("c.cpp.tagparser.statusbar", "C/C++ Tag Parser Status");
this.browseEngineStatusBarItem.tooltip = localize("discovering.files.tooltip", "Discovering files");
this.ShowDBIcon = false;
this.browseEngineStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.tagparser`, util.documentSelector);
this.browseEngineStatusItem.name = localize("cpptools.status.tagparser", "C/C++ Tag Parser Status");
this.browseEngineStatusItem.detail = localize("cpptools.detail.tagparser", "Initializing...");
this.browseEngineStatusItem.text = "$(database)";
this.browseEngineStatusItem.command = {
command: "C_Cpp.RescanWorkspace",
title: this.workspaceRescanText,
arguments: commandArguments
};
this.workspaceParsingStatus = this.workspaceParsingRunningText;
this.codeAnalysisProgram = "clang-tidy";
this.runningCodeAnalysisTooltip = localize(
{ key: "running.analysis.tooltip", comment: ["{0} is a program name, such as clang-tidy"] }, "Running {0}", this.codeAnalysisProgram);
this.codeAnalysisPausedTooltip = localize(
{ key: "code.analysis.paused.tooltip", comment: ["{0} is a program name, such as clang-tidy"] }, "{0} paused", this.codeAnalysisProgram);
this.codeAnalysisStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Low}.codeanalysis`, util.documentSelector);
this.codeAnalysisStatusItem.name = localize("cpptools.status.codeanalysis", "C/C++ Code Analysis Status");
this.codeAnalysisStatusItem.text = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode();
this.codeAnalysisStatusItem.command = {
command: "C_Cpp.ShowIdleCodeAnalysisCommands",
title: localize("c.cpp.codeanalysis.statusbar.runNow", "Run Now"),
arguments: commandArguments
};
}
private set TagParseStatus(label: string) {
this.workspaceParsingProgress = label;
if (this.browseEngineStatusItem.command) {
// Currently needed in order to update hover tooltip
this.browseEngineStatusItem.command.tooltip = (this.isParsingFiles ? `${this.parsingFilesTooltip} | ` : "") + this.workspaceParsingProgress;
}
}
private setIsInitializingWorkspace(val: boolean): void {
if (val) {
this.browseEngineStatusItem.text = "$(database)";
this.browseEngineStatusItem.detail = this.workspaceParsingInitializing;
}
}
private setIsIndexingWorkspace(val: boolean): void {
if (val) {
this.browseEngineStatusItem.text = "$(database)";
this.browseEngineStatusItem.detail = this.workspaceParsingIndexing;
this.browseEngineStatusItem.busy = true;
}
}
private set ActiveConfig(label: string) {
this.configStatusBarItem.text = label;
}
private set TagParseStatus(label: string) {
this.workspaceParsingStatus = label;
this.browseEngineStatusBarItem.tooltip = (this.isParsingFiles ? `${this.parsingFilesTooltip} | ` : "") + label;
}
private dbTimeout?: NodeJS.Timeout;
private setIsParsingWorkspace(val: boolean): void {
if (!val && this.isParsingWorkspacePaused) {
// Unpause before handling the no longer parsing state.
this.setIsParsingWorkspacePaused(false);
}
this.isParsingWorkspace = val;
const showIcon: boolean = val || this.isParsingFiles;
const twoStatus: boolean = val && this.isParsingFiles;
this.ShowDBIcon = showIcon;
this.browseEngineStatusBarItem.text = showIcon ? "$(database)" : "";
this.browseEngineStatusBarItem.tooltip = (this.isParsingFiles ? this.parsingFilesTooltip : "")
+ (twoStatus ? " | " : "")
+ (val ? this.workspaceParsingStatus : "");
// Leave this outside for more real-time response
this.browseEngineStatusItem.busy = showIcon;
if (showIcon) {
this.browseEngineStatusItem.text = "$(database)";
this.browseEngineStatusItem.detail = this.tagParseText();
if (this.dbTimeout) {
clearTimeout(this.dbTimeout);
this.dbTimeout = undefined;
}
} else {
this.dbTimeout = setTimeout(() => {
this.browseEngineStatusItem.text = this.workspaceParsingDoneText;
this.browseEngineStatusItem.detail = "";
this.browseEngineStatusItem.command = {
command: "C_Cpp.RescanWorkspace",
title: this.workspaceRescanText,
arguments: commandArguments
};
}, this.iconDelayTime);
}
}
private tagParseText(): string {
if (this.isParsingWorkspacePaused) {
const twoStatus: boolean = this.isParsingFiles && this.isParsingWorkspace;
return (this.isParsingFiles ? this.parsingFilesTooltip : "")
+ (twoStatus ? " | " : "")
+ (this.isParsingWorkspace ? this.workspaceParsingStatus : "");
} else {
return this.isParsingWorkspace ? this.workspaceParsingStatus : this.parsingFilesTooltip;
}
}
private setIsParsingWorkspacePausable(val: boolean): void {
if (val) {
this.browseEngineStatusBarItem.command = {
command: "C_Cpp.ShowParsingCommands",
title: this.browseEngineStatusBarItem.name ?? '',
if (val && this.isParsingWorkspace) {
this.browseEngineStatusItem.command = {
command: "C_Cpp.PauseParsing",
title: localize("tagparser.pause.text", "Pause"),
arguments: commandArguments
};
} else {
this.browseEngineStatusBarItem.command = undefined;
}
}
private setIsParsingWorkspacePaused(val: boolean): void {
if (!this.isParsingFiles && !this.isParsingWorkspace) {
// Ignore a pause change if no parsing is actually happening.
return;
}
this.isParsingWorkspacePaused = val;
this.browseEngineStatusItem.busy = !val || this.isParsingFiles;
this.browseEngineStatusItem.text = "$(database)";
this.workspaceParsingStatus = val ? this.workspaceParsingPausedText : this.workspaceParsingRunningText;
this.browseEngineStatusItem.detail = this.tagParseText();
this.browseEngineStatusItem.command = val ? {
command: "C_Cpp.ResumeParsing",
title: localize("tagparser.resume.text", "Resume"),
arguments: commandArguments
} : {
command: "C_Cpp.PauseParsing",
title: localize("tagparser.pause.text", "Pause"),
arguments: commandArguments
};
}
private set ShowConfiguration(show: boolean) {
if (show) {
this.configStatusBarItem.show();
} else {
this.configStatusBarItem.hide();
}
}
private setIsCodeAnalysisPaused(val: boolean): void {
if (!this.isRunningCodeAnalysis) {
return;
}
this.isCodeAnalysisPaused = val;
const twoStatus: boolean = val && this.isUpdatingIntelliSense;
this.intelliSenseStatusBarItem.tooltip = (this.isUpdatingIntelliSense ? this.updatingIntelliSenseTooltip : "")
+ (twoStatus ? " | " : "")
+ (val ? this.codeAnalysisPausedTooltip : this.runningCodeAnalysisTooltip);
this.codeAnalysisStatusItem.busy = !val;
this.codeAnalysisStatusItem.text = val ? this.codeAnalysisPausedText : this.codeAnalysisRunningText;
}
private setIsParsingFiles(val: boolean): void {
this.isParsingFiles = val;
const showIcon: boolean = val || this.isParsingWorkspace;
const twoStatus: boolean = val && this.isParsingWorkspace;
this.ShowDBIcon = showIcon;
this.browseEngineStatusBarItem.text = showIcon ? "$(database)" : "";
this.browseEngineStatusBarItem.tooltip = (val ? this.parsingFilesTooltip : "")
+ (twoStatus ? " | " : "")
+ (this.isParsingWorkspace ? this.workspaceParsingStatus : "");
// Leave this outside for more real-time response
this.browseEngineStatusItem.busy = val || (!this.isParsingWorkspacePaused && this.isParsingWorkspace);
if (showIcon) {
this.browseEngineStatusItem.text = "$(database)";
this.browseEngineStatusItem.detail = this.tagParseText();
if (this.dbTimeout) {
clearTimeout(this.dbTimeout);
this.dbTimeout = undefined;
}
} else {
this.dbTimeout = setTimeout(() => {
this.browseEngineStatusItem.text = this.workspaceParsingDoneText;
this.browseEngineStatusItem.detail = "";
this.browseEngineStatusItem.command = {
command: "C_Cpp.RescanWorkspace",
title: this.workspaceRescanText,
arguments: commandArguments
};
}, this.iconDelayTime);
}
}
private flameTimeout?: NodeJS.Timeout;
private setIsUpdatingIntelliSense(val: boolean): void {
this.isUpdatingIntelliSense = val;
const showIcon: boolean = val || this.isRunningCodeAnalysis;
const twoStatus: boolean = val && this.isRunningCodeAnalysis;
this.ShowFlameIcon = showIcon;
this.intelliSenseStatusBarItem.text = showIcon ? "$(flame)" : "";
this.intelliSenseStatusBarItem.tooltip = (val ? this.updatingIntelliSenseTooltip : "")
+ (twoStatus ? " | " : "")
+ (this.isRunningCodeAnalysis ? this.runningCodeAnalysisTooltip : "");
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
if (settings.intelliSenseEngine === "disabled") {
this.intelliSenseStatusItem.text = this.missingIntelliSenseText;
this.intelliSenseStatusItem.command = {
command: "C_Cpp.SelectDefaultCompiler",
title: localize("intellisense.select.text", "Select a Compiler"),
arguments: commandArguments
};
return;
}
this.intelliSenseStatusItem.busy = val;
if (this.flameTimeout) {
clearTimeout(this.flameTimeout);
}
if (val) {
this.intelliSenseStatusItem.text = "$(flame)";
this.intelliSenseStatusItem.detail = this.updatingIntelliSenseText;
this.flameTimeout = undefined;
} else {
this.flameTimeout = setTimeout(() => {
if (this.intelliSenseStatusItem) {
this.intelliSenseStatusItem.text = this.idleIntelliSenseText;
this.intelliSenseStatusItem.detail = "";
}
}, this.iconDelayTime);
}
this.intelliSenseStatusItem.command = {
command: "C_Cpp.RestartIntelliSenseForFile",
title: localize("rescan.intellisense.text", "Rescan"),
tooltip: localize("rescan.intellisense.tooltip", "Rescan IntelliSense"),
arguments: commandArguments
};
}
private codeAnalysisCurrentMode(): string {
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
const state: string = (settings.codeAnalysisRunAutomatically && settings.clangTidyEnabled)
? localize("mode.codeanalysis.status.automatic", "Automatic")
: localize("mode.codeanalysis.status.manual", "Manual");
return state;
}
private setIsRunningCodeAnalysis(val: boolean): void {
@@ -212,23 +357,31 @@ export class OldUI implements UI {
this.isCodeAnalysisPaused = false;
}
this.isRunningCodeAnalysis = val;
const showIcon: boolean = val || this.isUpdatingIntelliSense;
const twoStatus: boolean = val && this.isUpdatingIntelliSense;
this.ShowFlameIcon = showIcon;
this.intelliSenseStatusBarItem.text = showIcon ? "$(flame)" : "";
this.intelliSenseStatusBarItem.tooltip = (this.isUpdatingIntelliSense ? this.updatingIntelliSenseTooltip : "")
+ (twoStatus ? " | " : "")
+ (val ? this.runningCodeAnalysisTooltip : "");
this.intelliSenseStatusBarItem.command = val ? {
this.codeAnalysisStatusItem.busy = val;
const activeText: string = this.isCodeAnalysisPaused ? this.codeAnalysisPausedText : this.codeAnalysisRunningText;
const idleText: string = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode();
this.codeAnalysisStatusItem.text = val ? activeText : idleText;
this.codeAnalysisStatusItem.command = val ? {
command: "C_Cpp.ShowActiveCodeAnalysisCommands",
title: this.intelliSenseStatusBarItem.name ?? '',
title: localize("c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions", "Options"),
// Make sure not to overwrite current progress
tooltip: this.codeAnalysisStatusItem.command?.tooltip ?? localize("startup.codeanalysis.status", "Starting..."),
arguments: commandArguments
} : undefined;
} : {
command: "C_Cpp.ShowIdleCodeAnalysisCommands",
title: localize("c.cpp.codeanalysis.statusbar.showRunNowOptions", "Run Now"),
arguments: commandArguments
};
}
private updateCodeAnalysisTooltip(): void {
this.runningCodeAnalysisTooltip = localize({ key: "running.analysis.processed.tooltip", comment: ["{0} is a program name, such as clang-tidy"] }, "Running {0}: {1} / {2} ({3}%)", this.codeAnalysisProgram,
this.codeAnalysProgress = localize("running.analysis.processed.tooltip", "Running: {0} / {1} ({2}%)",
this.codeAnalysisProcessed, Math.max(this.codeAnalysisTotal, 1), Math.floor(100 * this.codeAnalysisProcessed / Math.max(this.codeAnalysisTotal, 1)));
if (this.codeAnalysisStatusItem.command) {
this.codeAnalysisStatusItem.command.tooltip = this.codeAnalysProgress;
}
this.setIsRunningCodeAnalysis(true);
}
@@ -269,33 +422,6 @@ export class OldUI implements UI {
}
}
// Prevent icons from appearing too often and for too short of a time.
private readonly iconDelayTime: number = 1000;
private dbTimeout?: NodeJS.Timeout;
private set ShowDBIcon(show: boolean) {
if (this.dbTimeout) {
clearTimeout(this.dbTimeout);
}
if (show && (this.isParsingWorkspace || this.isParsingFiles)) {
this.dbTimeout = setTimeout(() => { this.browseEngineStatusBarItem.show(); }, this.iconDelayTime);
} else {
this.dbTimeout = setTimeout(() => { this.browseEngineStatusBarItem.hide(); }, this.iconDelayTime);
}
}
private flameTimeout?: NodeJS.Timeout;
private set ShowFlameIcon(show: boolean) {
if (this.flameTimeout) {
clearTimeout(this.flameTimeout);
}
if (show && (this.isUpdatingIntelliSense || this.isRunningCodeAnalysis)) {
this.flameTimeout = setTimeout(() => { this.intelliSenseStatusBarItem.show(); }, this.iconDelayTime);
} else {
this.flameTimeout = setTimeout(() => { this.intelliSenseStatusBarItem.hide(); }, this.iconDelayTime);
}
}
private set ShowReferencesIcon(show: boolean) {
if (show && this.ReferencesCommand !== ReferencesCommandMode.None) {
this.referencesStatusBarItem.show();
@@ -304,24 +430,23 @@ export class OldUI implements UI {
}
}
private set ShowConfiguration(show: boolean) {
if (show) {
this.configStatusBarItem.show();
} else {
this.configStatusBarItem.hide();
}
}
private showConfigureIntelliSenseButton: boolean = false;
private configureIntelliSenseTimeout?: NodeJS.Timeout;
public async ShowConfigureIntelliSenseButton(show: boolean, client?: Client): Promise<void> {
if (!await telemetry.showStatusBarIntelliSenseButton() || client !== this.currentClient) {
public async ShowConfigureIntelliSenseButton(show: boolean, client?: Client, configurationType?: ConfigurationType, sender?: string): Promise<void> {
if (client !== this.currentClient) {
return;
}
if (configurationType !== undefined && sender !== undefined) {
const showButton: string = show ? 'true' : 'false';
telemetry.logLanguageServerEvent('showConfigureIntelliSenseButton', { configurationType, sender, showButton });
}
if (!await telemetry.showStatusBarIntelliSenseButton()) {
return;
}
this.showConfigureIntelliSenseButton = show;
if (client) {
if (client !== undefined) {
client.setShowConfigureIntelliSenseButton(show);
}
if (show) {
@@ -355,7 +480,7 @@ export class OldUI implements UI {
} else {
const isCppPropertiesJson: boolean = util.isCppPropertiesJson(activeEditor.document);
if (isCppPropertiesJson) {
vscode.languages.setTextDocumentLanguage(activeEditor.document, "jsonc");
void vscode.languages.setTextDocumentLanguage(activeEditor.document, "jsonc");
}
const isCppOrRelated: boolean = isCppPropertiesJson || util.isCppOrRelated(activeEditor.document);
@@ -381,6 +506,8 @@ export class OldUI implements UI {
}
public bind(client: Client): void {
client.InitializingWorkspaceChanged(value => { this.setIsInitializingWorkspace(value); });
client.IndexingWorkspaceChanged(value => { this.setIsIndexingWorkspace(value); });
client.ParsingWorkspaceChanged(value => { this.setIsParsingWorkspace(value); });
client.ParsingWorkspacePausableChanged(value => { this.setIsParsingWorkspacePausable(value); });
client.ParsingWorkspacePausedChanged(value => { this.setIsParsingWorkspacePaused(value); });
@@ -395,7 +522,7 @@ export class OldUI implements UI {
client.ActiveConfigChanged(value => {
this.ActiveConfig = value;
this.currentClient = client;
this.ShowConfigureIntelliSenseButton(client.getShowConfigureIntelliSenseButton(), client);
void this.ShowConfigureIntelliSenseButton(client.getShowConfigureIntelliSenseButton(), client);
});
}
@@ -491,12 +618,21 @@ export class OldUI implements UI {
return (selection) ? selection.index : -1;
}
public async showIdleCodeAnalysisCommands(): Promise<number> { return -1; }
public async showIdleCodeAnalysisCommands(): Promise<number> {
const options: vscode.QuickPickOptions = {};
options.placeHolder = this.selectACommandString;
public showConfigureIncludePathMessage(prompt: () => Promise<boolean>, onSkip: () => void): void {
setTimeout(() => {
this.showConfigurationPrompt(ConfigurationPriority.IncludePath, prompt, onSkip);
}, 10000);
const items: IndexableQuickPickItem[] = [];
items.push({ label: localize("active.analysis", "Run Code Analysis on Active File"), description: "", index: 0 });
items.push({ label: localize("all.analysis", "Run Code Analysis on All Files"), description: "", index: 1 });
items.push({ label: localize("open.analysis", "Run Code Analysis on Open Files"), description: "", index: 2 });
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
return (selection) ? selection.index : -1;
}
public async showConfigureIncludePathMessage(prompt: () => Promise<boolean>, onSkip: () => void): Promise<void> {
await sleep(10000);
this.showConfigurationPrompt(ConfigurationPriority.IncludePath, prompt, onSkip);
}
public showConfigureCompileCommandsMessage(prompt: () => Promise<boolean>, onSkip: () => void): void {
@@ -538,23 +674,17 @@ export class OldUI implements UI {
public dispose(): void {
this.configStatusBarItem.dispose();
this.browseEngineStatusBarItem.dispose();
this.intelliSenseStatusBarItem.dispose();
this.browseEngineStatusItem.dispose();
this.intelliSenseStatusItem.dispose();
this.referencesStatusBarItem.dispose();
this.codeAnalysisStatusItem.dispose();
}
}
export async function getUI(): Promise<UI> {
if (!uiPromise) {
uiPromise = _getUI();
}
return uiPromise;
}
async function _getUI(): Promise<UI> {
export function getUI(): LanguageStatusUI {
if (!ui) {
const useNewUI: boolean = await telemetry.showLanguageStatusExperiment();
ui = useNewUI ? new NewUI() : new OldUI();
ui = new LanguageStatusUI();
}
return ui;
}
-670
View File
@@ -1,670 +0,0 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { Client } from './client';
import { ReferencesCommandMode, referencesCommandModeToString } from './references';
import { getCustomConfigProviders, CustomConfigurationProviderCollection, isSameProviderExtensionId } from './customProviders';
import * as nls from 'vscode-nls';
import { setTimeout } from 'timers';
import { CppSettings } from './settings';
import { UI } from './ui';
import * as telemetry from '../telemetry';
import * as util from '../common';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
interface IndexableQuickPickItem extends vscode.QuickPickItem {
index: number;
}
interface KeyedQuickPickItem extends vscode.QuickPickItem {
key: string;
}
// Higher numbers mean greater priority.
enum ConfigurationPriority {
IncludePath = 1,
CompileCommands = 2,
CustomProvider = 3,
}
interface ConfigurationStatus {
configured: boolean;
priority: ConfigurationPriority;
}
enum LanguageStatusPriority {
First = 0,
High = 1,
Mid = 2,
Low = 3
}
const commandArguments: string[] = ['newUI']; // We report the sender of the command
export class NewUI implements UI {
private currentClient: Client | undefined;
private configStatusBarItem: vscode.StatusBarItem;
private browseEngineStatusItem: vscode.LanguageStatusItem;
private intelliSenseStatusItem: vscode.LanguageStatusItem;
private configureIntelliSenseStatusItem: vscode.StatusBarItem;
private referencesStatusBarItem: vscode.StatusBarItem;
private codeAnalysisStatusItem: vscode.LanguageStatusItem;
/** **************************************************** */
private curConfigurationStatus?: Promise<ConfigurationStatus>;
private isParsingWorkspace: boolean = false;
private isParsingWorkspacePaused: boolean = false;
private isParsingFiles: boolean = false;
private isRunningCodeAnalysis: boolean = false;
private isCodeAnalysisPaused: boolean = false;
private codeAnalysisProcessed: number = 0;
private codeAnalysisTotal: number = 0;
private readonly workspaceParsingRunningText: string = localize("running.tagparser.text", "Parsing Workspace");
private readonly workspaceParsingPausedText: string = localize("paused.tagparser.text", "Parsing Workspace: Paused");
private readonly workspaceParsingDoneText: string = localize("complete.tagparser.text", "Parsing Complete");
private readonly workspaceParsingInitializing: string = localize("initializing.tagparser.text", "Initializing Workspace");
private readonly workspaceParsingIndexing: string = localize("indexing.tagparser.text", "Indexing Workspace");
private workspaceParsingStatus: string = "";
private workspaceParsingProgress: string = "";
private readonly workspaceRescanText = localize("rescan.tagparse.text", "Rescan Workspace");
private readonly parsingFilesTooltip: string = localize("c.cpp.parsing.open.files.tooltip", "Parsing Open Files");
private readonly referencesPreviewTooltip: string = ` (${localize("click.to.preview", "click to preview results")})`;
private readonly updatingIntelliSenseText: string = localize("updating.intellisense.text", "IntelliSense: Updating");
private readonly idleIntelliSenseText: string = localize("idle.intellisense.text", "IntelliSense: Ready");
private readonly missingIntelliSenseText: string = localize("absent.intellisense.text", "IntelliSense: Not configured");
private readonly codeAnalysisRunningText: string = localize("running.analysis.text", "Code Analysis: Running");
private readonly codeAnalysisPausedText: string = localize("paused.analysis.text", "Code Analysis: Paused");
private readonly codeAnalysisModePrefix: string = localize("mode.analysis.prefix", "Code Analysis Mode: ");
private codeAnalysProgress: string = "";
// Prevent icons from appearing too often and for too short of a time.
private readonly iconDelayTime: number = 1000;
get isNewUI(): boolean { return true; };
private readonly configureIntelliSenseText: string = localize("c.cpp.configureIntelliSenseStatus.text", "Configure IntelliSense");
private readonly cppConfigureIntelliSenseText: string = localize("c.cpp.configureIntelliSenseStatus.cppText", "C/C++ Configure IntelliSense");
constructor() {
const configTooltip: string = localize("c.cpp.configuration.tooltip", "C/C++ Configuration");
this.configStatusBarItem = vscode.window.createStatusBarItem("c.cpp.configuration.tooltip", vscode.StatusBarAlignment.Right, 0);
this.configStatusBarItem.name = configTooltip;
this.configStatusBarItem.command = {
command: "C_Cpp.ConfigurationSelect",
title: configTooltip,
arguments: commandArguments
};
this.configStatusBarItem.tooltip = configTooltip;
this.ShowConfiguration = true;
this.referencesStatusBarItem = vscode.window.createStatusBarItem(`c.cpp.references.statusbar`, vscode.StatusBarAlignment.Right, 901);
this.referencesStatusBarItem.name = localize("c.cpp.references.statusbar", "C/C++ References Status");
this.referencesStatusBarItem.tooltip = "";
this.referencesStatusBarItem.command = {
command: "C_Cpp.ShowReferencesProgress",
title: this.referencesStatusBarItem.name,
arguments: commandArguments
};
this.ShowReferencesIcon = false;
this.configureIntelliSenseStatusItem = vscode.window.createStatusBarItem(`c.cpp.configureIntelliSenseStatus.statusbar`, vscode.StatusBarAlignment.Right, 0);
this.configureIntelliSenseStatusItem.name = this.cppConfigureIntelliSenseText;
this.configureIntelliSenseStatusItem.tooltip = this.cppConfigureIntelliSenseText;
this.configureIntelliSenseStatusItem.text = `$(warning) ${this.configureIntelliSenseText}`;
this.configureIntelliSenseStatusItem.backgroundColor = new vscode.ThemeColor('statusBarItem.warningBackground');
this.configureIntelliSenseStatusItem.command = {
command: "C_Cpp.SelectIntelliSenseConfiguration",
title: this.configureIntelliSenseStatusItem.name,
arguments: ['statusBar']
};
this.ShowConfigureIntelliSenseButton(false, this.currentClient);
this.intelliSenseStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.intellisense`, util.documentSelector);
this.intelliSenseStatusItem.name = localize("cpptools.status.intellisense", "C/C++ IntelliSense Status");
this.intelliSenseStatusItem.text = this.idleIntelliSenseText;
this.browseEngineStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.tagparser`, util.documentSelector);
this.browseEngineStatusItem.name = localize("cpptools.status.tagparser", "C/C++ Tag Parser Status");
this.browseEngineStatusItem.detail = localize("cpptools.detail.tagparser", "Initializing...");
this.browseEngineStatusItem.text = "$(database)";
this.browseEngineStatusItem.command = {
command: "C_Cpp.RescanWorkspace",
title: this.workspaceRescanText,
arguments: commandArguments
};
this.workspaceParsingStatus = this.workspaceParsingRunningText;
this.codeAnalysisStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Low}.codeanalysis`, util.documentSelector);
this.codeAnalysisStatusItem.name = localize("cpptools.status.codeanalysis", "C/C++ Code Analysis Status");
this.codeAnalysisStatusItem.text = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode();
this.codeAnalysisStatusItem.command = {
command: "C_Cpp.ShowIdleCodeAnalysisCommands",
title: localize("c.cpp.codeanalysis.statusbar.runNow", "Run Now"),
arguments: commandArguments
};
}
private set TagParseStatus(label: string) {
this.workspaceParsingProgress = label;
if (this.browseEngineStatusItem.command) {
// Currently needed in order to update hover tooltip
this.browseEngineStatusItem.command.tooltip = (this.isParsingFiles ? `${this.parsingFilesTooltip} | ` : "") + this.workspaceParsingProgress;
this.browseEngineStatusItem.text = this.browseEngineStatusItem.text;
}
}
private setIsInitializingWorkspace(val: boolean): void {
if (val) {
this.browseEngineStatusItem.text = "$(database)";
this.browseEngineStatusItem.detail = this.workspaceParsingInitializing;
}
}
private setIsIndexingWorkspace(val: boolean): void {
if (val) {
this.browseEngineStatusItem.text = "$(database)";
this.browseEngineStatusItem.detail = this.workspaceParsingIndexing;
this.browseEngineStatusItem.busy = true;
}
}
private set ActiveConfig(label: string) {
this.configStatusBarItem.text = label;
}
private dbTimeout?: NodeJS.Timeout;
private setIsParsingWorkspace(val: boolean): void {
if (!val && this.isParsingWorkspacePaused) {
// Unpause before handling the no longer parsing state.
this.setIsParsingWorkspacePaused(false);
}
this.isParsingWorkspace = val;
const showIcon: boolean = val || this.isParsingFiles;
// Leave this outside for more real-time response
this.browseEngineStatusItem.busy = showIcon;
if (showIcon) {
this.browseEngineStatusItem.text = "$(database)";
this.browseEngineStatusItem.detail = this.tagParseText();
if (this.dbTimeout) {
clearTimeout(this.dbTimeout);
this.dbTimeout = undefined;
}
} else {
this.dbTimeout = setTimeout(() => {
this.browseEngineStatusItem.text = this.workspaceParsingDoneText;
this.browseEngineStatusItem.detail = "";
this.browseEngineStatusItem.command = {
command: "C_Cpp.RescanWorkspace",
title: this.workspaceRescanText,
arguments: commandArguments
};
}, this.iconDelayTime);
}
}
private tagParseText(): string {
if (this.isParsingWorkspacePaused) {
const twoStatus: boolean = this.isParsingFiles && this.isParsingWorkspace;
return (this.isParsingFiles ? this.parsingFilesTooltip : "")
+ (twoStatus ? " | " : "")
+ (this.isParsingWorkspace ? this.workspaceParsingStatus : "");
} else {
return this.isParsingWorkspace ? this.workspaceParsingStatus : this.parsingFilesTooltip;
}
}
private setIsParsingWorkspacePausable(val: boolean): void {
if (val && this.isParsingWorkspace) {
this.browseEngineStatusItem.command = {
command: "C_Cpp.PauseParsing",
title: localize("tagparser.pause.text", "Pause"),
arguments: commandArguments
};
}
}
private setIsParsingWorkspacePaused(val: boolean): void {
if (!this.isParsingFiles && !this.isParsingWorkspace) {
// Ignore a pause change if no parsing is actually happening.
return;
}
this.isParsingWorkspacePaused = val;
this.browseEngineStatusItem.busy = !val || this.isParsingFiles;
this.browseEngineStatusItem.text = "$(database)";
this.workspaceParsingStatus = val ? this.workspaceParsingPausedText : this.workspaceParsingRunningText;
this.browseEngineStatusItem.detail = this.tagParseText();
this.browseEngineStatusItem.command = val ? {
command: "C_Cpp.ResumeParsing",
title: localize("tagparser.resume.text", "Resume"),
arguments: commandArguments
} : {
command: "C_Cpp.PauseParsing",
title: localize("tagparser.pause.text", "Pause"),
arguments: commandArguments
};
}
private set ShowConfiguration(show: boolean) {
if (show) {
this.configStatusBarItem.show();
} else {
this.configStatusBarItem.hide();
}
}
private setIsCodeAnalysisPaused(val: boolean): void {
if (!this.isRunningCodeAnalysis) {
return;
}
this.isCodeAnalysisPaused = val;
this.codeAnalysisStatusItem.busy = !val;
this.codeAnalysisStatusItem.text = val ? this.codeAnalysisPausedText : this.codeAnalysisRunningText;
}
private setIsParsingFiles(val: boolean): void {
this.isParsingFiles = val;
const showIcon: boolean = val || this.isParsingWorkspace;
// Leave this outside for more real-time response
this.browseEngineStatusItem.busy = val || (!this.isParsingWorkspacePaused && this.isParsingWorkspace);
if (showIcon) {
this.browseEngineStatusItem.text = "$(database)";
this.browseEngineStatusItem.detail = this.tagParseText();
if (this.dbTimeout) {
clearTimeout(this.dbTimeout);
this.dbTimeout = undefined;
}
} else {
this.dbTimeout = setTimeout(() => {
this.browseEngineStatusItem.text = this.workspaceParsingDoneText;
this.browseEngineStatusItem.detail = "";
this.browseEngineStatusItem.command = {
command: "C_Cpp.RescanWorkspace",
title: this.workspaceRescanText,
arguments: commandArguments
};
}, this.iconDelayTime);
}
}
private flameTimeout?: NodeJS.Timeout;
private setIsUpdatingIntelliSense(val: boolean): void {
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
// TODO: Integrate with Tarik's feature to determine if compiler/bare-IntelliSense is configured
if (settings.intelliSenseEngine === "disabled") {
this.intelliSenseStatusItem.text = this.missingIntelliSenseText;
this.intelliSenseStatusItem.command = {
command: "C_Cpp.SelectDefaultCompiler",
title: localize("intellisense.select.text", "Select a Compiler"),
arguments: commandArguments
};
return;
}
this.intelliSenseStatusItem.busy = val;
if (this.flameTimeout) {
clearTimeout(this.flameTimeout);
}
if (val) {
this.intelliSenseStatusItem.text = "$(flame)";
this.intelliSenseStatusItem.detail = this.updatingIntelliSenseText;
this.flameTimeout = undefined;
} else {
this.flameTimeout = setTimeout(() => {
if (this.intelliSenseStatusItem) {
this.intelliSenseStatusItem.text = this.idleIntelliSenseText;
this.intelliSenseStatusItem.detail = "";
}
}, this.iconDelayTime);
}
this.intelliSenseStatusItem.command = {
command: "C_Cpp.RestartIntelliSenseForFile",
title: localize("rescan.intellisense.text", "Rescan"),
tooltip: localize("rescan.intellisense.tooltip", "Rescan IntelliSense"),
arguments: commandArguments
};
}
private codeAnalysisCurrentMode(): string {
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
const state: string = (settings.codeAnalysisRunAutomatically && settings.clangTidyEnabled)
? localize("mode.codeanalysis.status.automatic", "Automatic")
: localize("mode.codeanalysis.status.manual", "Manual");
return state;
}
private setIsRunningCodeAnalysis(val: boolean): void {
if (this.isRunningCodeAnalysis && !val) {
this.codeAnalysisTotal = 0;
this.codeAnalysisProcessed = 0;
this.isCodeAnalysisPaused = false;
}
this.isRunningCodeAnalysis = val;
this.codeAnalysisStatusItem.busy = val;
const activeText: string = this.isCodeAnalysisPaused ? this.codeAnalysisPausedText : this.codeAnalysisRunningText;
const idleText: string = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode();
this.codeAnalysisStatusItem.text = val ? activeText : idleText;
this.codeAnalysisStatusItem.command = val ? {
command: "C_Cpp.ShowActiveCodeAnalysisCommands",
title: localize("c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions", "Options"),
// Make sure not to overwrite current progress
tooltip: this.codeAnalysisStatusItem.command?.tooltip ?? localize("startup.codeanalysis.status", "Starting..."),
arguments: commandArguments
} : {
command: "C_Cpp.ShowIdleCodeAnalysisCommands",
title: localize("c.cpp.codeanalysis.statusbar.showRunNowOptions", "Run Now"),
arguments: commandArguments
};
}
private updateCodeAnalysisTooltip(): void {
this.codeAnalysProgress = localize("running.analysis.processed.tooltip", "Running: {0} / {1} ({2}%)",
this.codeAnalysisProcessed, Math.max(this.codeAnalysisTotal, 1), Math.floor(100 * this.codeAnalysisProcessed / Math.max(this.codeAnalysisTotal, 1)));
if (this.codeAnalysisStatusItem.command) {
this.codeAnalysisStatusItem.command.tooltip = this.codeAnalysProgress;
this.codeAnalysisStatusItem.text = this.codeAnalysisStatusItem.text;
}
this.setIsRunningCodeAnalysis(true);
}
private setCodeAnalysisProcessed(processed: number): void {
if (!this.isRunningCodeAnalysis) {
return; // Occurs when a multi-root workspace is activated.
}
this.codeAnalysisProcessed = processed;
if (this.codeAnalysisProcessed > this.codeAnalysisTotal) {
this.codeAnalysisTotal = this.codeAnalysisProcessed + 1;
}
this.updateCodeAnalysisTooltip();
}
private setCodeAnalysisTotal(total: number): void {
if (!this.isRunningCodeAnalysis) {
return; // Occurs when a multi-root workspace is activated.
}
this.codeAnalysisTotal = total;
this.updateCodeAnalysisTooltip();
}
private get ReferencesCommand(): ReferencesCommandMode {
return this.referencesStatusBarItem.tooltip === "" ? ReferencesCommandMode.None :
(this.referencesStatusBarItem.tooltip === referencesCommandModeToString(ReferencesCommandMode.Find) ? ReferencesCommandMode.Find :
(this.referencesStatusBarItem.tooltip === referencesCommandModeToString(ReferencesCommandMode.Rename) ? ReferencesCommandMode.Rename :
ReferencesCommandMode.Peek));
}
private set ReferencesCommand(val: ReferencesCommandMode) {
if (val === ReferencesCommandMode.None) {
this.referencesStatusBarItem.text = "";
this.ShowReferencesIcon = false;
} else {
this.referencesStatusBarItem.text = "$(search)";
this.referencesStatusBarItem.tooltip = referencesCommandModeToString(val) + (val !== ReferencesCommandMode.Find ? "" : this.referencesPreviewTooltip);
this.ShowReferencesIcon = true;
}
}
private set ShowReferencesIcon(show: boolean) {
if (show && this.ReferencesCommand !== ReferencesCommandMode.None) {
this.referencesStatusBarItem.show();
} else {
this.referencesStatusBarItem.hide();
}
}
private showConfigureIntelliSenseButton: boolean = false;
private configureIntelliSenseTimeout?: NodeJS.Timeout;
public async ShowConfigureIntelliSenseButton(show: boolean, client?: Client): Promise<void> {
if (!await telemetry.showStatusBarIntelliSenseButton() || client !== this.currentClient) {
return;
}
this.showConfigureIntelliSenseButton = show;
if (client) {
client.setShowConfigureIntelliSenseButton(show);
}
if (show) {
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
telemetry.logLanguageServerEvent('configureIntelliSenseStatusBar');
if (activeEditor && util.isCppOrRelated(activeEditor.document)) {
this.configureIntelliSenseStatusItem.show();
if (!this.configureIntelliSenseTimeout) {
this.configureIntelliSenseTimeout = setTimeout(() => {
this.configureIntelliSenseStatusItem.text = "$(warning)";
}, 15000);
}
}
} else {
this.configureIntelliSenseStatusItem.hide();
if (this.configureIntelliSenseTimeout) {
clearTimeout(this.configureIntelliSenseTimeout);
this.configureIntelliSenseStatusItem.text = `$(warning) ${this.configureIntelliSenseText}`;
this.configureIntelliSenseTimeout = undefined;
}
}
}
public activeDocumentChanged(): void {
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
if (!activeEditor) {
this.ShowConfiguration = false;
if (this.showConfigureIntelliSenseButton) {
this.configureIntelliSenseStatusItem.hide();
}
} else {
const isCppPropertiesJson: boolean = util.isCppPropertiesJson(activeEditor.document);
if (isCppPropertiesJson) {
vscode.languages.setTextDocumentLanguage(activeEditor.document, "jsonc");
}
const isCppOrRelated: boolean = isCppPropertiesJson || util.isCppOrRelated(activeEditor.document);
// It's sometimes desirable to see the config and icons when making changes to files with C/C++-related content.
// TODO: Check some "AlwaysShow" setting here.
this.ShowConfiguration = isCppOrRelated || (util.getWorkspaceIsCpp() &&
(activeEditor.document.fileName.endsWith("tasks.json") ||
activeEditor.document.fileName.endsWith("launch.json")));
if (this.showConfigureIntelliSenseButton) {
if (isCppOrRelated && !!this.currentClient && this.currentClient.getShowConfigureIntelliSenseButton()) {
this.configureIntelliSenseStatusItem.show();
if (!this.configureIntelliSenseTimeout) {
this.configureIntelliSenseTimeout = setTimeout(() => {
this.configureIntelliSenseStatusItem.text = "$(warning)";
}, 15000);
}
} else {
this.configureIntelliSenseStatusItem.hide();
}
}
}
}
public bind(client: Client): void {
client.InitializingWorkspaceChanged(value => { this.setIsInitializingWorkspace(value); });
client.IndexingWorkspaceChanged(value => { this.setIsIndexingWorkspace(value); });
client.ParsingWorkspaceChanged(value => { this.setIsParsingWorkspace(value); });
client.ParsingWorkspacePausableChanged(value => { this.setIsParsingWorkspacePausable(value); });
client.ParsingWorkspacePausedChanged(value => { this.setIsParsingWorkspacePaused(value); });
client.ParsingFilesChanged(value => { this.setIsParsingFiles(value); });
client.IntelliSenseParsingChanged(value => { this.setIsUpdatingIntelliSense(value); });
client.RunningCodeAnalysisChanged(value => { this.setIsRunningCodeAnalysis(value); });
client.CodeAnalysisPausedChanged(value => { this.setIsCodeAnalysisPaused(value); });
client.CodeAnalysisProcessedChanged(value => { this.setCodeAnalysisProcessed(value); });
client.CodeAnalysisTotalChanged(value => { this.setCodeAnalysisTotal(value); });
client.ReferencesCommandModeChanged(value => { this.ReferencesCommand = value; });
client.TagParserStatusChanged(value => { this.TagParseStatus = value; });
client.ActiveConfigChanged(value => {
this.ActiveConfig = value;
this.currentClient = client;
this.ShowConfigureIntelliSenseButton(client.getShowConfigureIntelliSenseButton(), client);
});
}
public async showConfigurations(configurationNames: string[]): Promise<number> {
const options: vscode.QuickPickOptions = {};
options.placeHolder = localize("select.a.configuration", "Select a Configuration...");
const items: IndexableQuickPickItem[] = [];
for (let i: number = 0; i < configurationNames.length; i++) {
items.push({ label: configurationNames[i], description: "", index: i });
}
items.push({ label: localize("edit.configuration.ui", "Edit Configurations (UI)"), description: "", index: configurationNames.length });
items.push({ label: localize("edit.configuration.json", "Edit Configurations (JSON)"), description: "", index: configurationNames.length + 1 });
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
return (selection) ? selection.index : -1;
}
public async showConfigurationProviders(currentProvider?: string): Promise<string | undefined> {
const options: vscode.QuickPickOptions = {};
options.placeHolder = localize("select.configuration.provider", "Select a Configuration Provider...");
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
const items: KeyedQuickPickItem[] = [];
providers.forEach(provider => {
let label: string = provider.name;
if (isSameProviderExtensionId(currentProvider, provider.extensionId)) {
label += ` (${localize("active", "active")})`;
}
items.push({ label: label, description: "", key: provider.extensionId });
});
items.push({ label: `(${localize("none", "none")})`, description: localize("disable.configuration.provider", "Disable the active configuration provider, if applicable."), key: "" });
const selection: KeyedQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
return (selection) ? selection.key : undefined;
}
public async showCompileCommands(paths: string[]): Promise<number> {
const options: vscode.QuickPickOptions = {};
options.placeHolder = localize("select.compile.commands", "Select a compile_commands.json...");
const items: IndexableQuickPickItem[] = [];
for (let i: number = 0; i < paths.length; i++) {
items.push({ label: paths[i], description: "", index: i });
}
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
return (selection) ? selection.index : -1;
}
public async showWorkspaces(workspaceNames: { name: string; key: string }[]): Promise<string> {
const options: vscode.QuickPickOptions = {};
options.placeHolder = localize("select.workspace", "Select a workspace folder...");
const items: KeyedQuickPickItem[] = [];
workspaceNames.forEach(name => items.push({ label: name.name, description: "", key: name.key }));
const selection: KeyedQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
return (selection) ? selection.key : "";
}
private readonly selectACommandString: string = localize("select.command", "Select a command...");
private readonly selectACodeAnalysisCommandString: string = localize("select.code.analysis.command", "Select a code analysis command...");
public async showParsingCommands(): Promise<number> {
const options: vscode.QuickPickOptions = {};
options.placeHolder = this.selectACommandString;
const items: IndexableQuickPickItem[] = [];
if (this.isParsingWorkspacePaused) {
items.push({ label: localize("resume.parsing", "Resume Workspace Parsing"), description: "", index: 1 });
} else {
items.push({ label: localize("pause.parsing", "Pause Workspace Parsing"), description: "", index: 0 });
}
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
return (selection) ? selection.index : -1;
}
public async showActiveCodeAnalysisCommands(): Promise<number> {
const options: vscode.QuickPickOptions = {};
options.placeHolder = this.selectACodeAnalysisCommandString;
const items: IndexableQuickPickItem[] = [];
items.push({ label: localize("cancel.analysis", "Cancel"), description: "", index: 0 });
if (this.isCodeAnalysisPaused) {
items.push({ label: localize("resume.analysis", "Resume"), description: "", index: 2 });
} else {
items.push({ label: localize("pause.analysis", "Pause"), description: "", index: 1 });
}
items.push({ label: localize("another.analysis", "Start Another..."), description: "", index: 3 });
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
return (selection) ? selection.index : -1;
}
public async showIdleCodeAnalysisCommands(): Promise<number> {
const options: vscode.QuickPickOptions = {};
options.placeHolder = this.selectACommandString;
const items: IndexableQuickPickItem[] = [];
items.push({ label: localize("active.analysis", "Run Code Analysis on Active File"), description: "", index: 0 });
items.push({ label: localize("all.analysis", "Run Code Analysis on All Files"), description: "", index: 1 });
items.push({ label: localize("open.analysis", "Run Code Analysis on Open Files"), description: "", index: 2 });
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
return (selection) ? selection.index : -1;
}
public showConfigureIncludePathMessage(prompt: () => Promise<boolean>, onSkip: () => void): void {
setTimeout(() => {
this.showConfigurationPrompt(ConfigurationPriority.IncludePath, prompt, onSkip);
}, 10000);
}
public showConfigureCompileCommandsMessage(prompt: () => Promise<boolean>, onSkip: () => void): void {
setTimeout(() => {
this.showConfigurationPrompt(ConfigurationPriority.CompileCommands, prompt, onSkip);
}, 5000);
}
public showConfigureCustomProviderMessage(prompt: () => Promise<boolean>, onSkip: () => void): void {
this.showConfigurationPrompt(ConfigurationPriority.CustomProvider, prompt, onSkip);
}
private showConfigurationPrompt(priority: ConfigurationPriority, prompt: () => Thenable<boolean>, onSkip: () => void): void {
const showPrompt: () => Promise<ConfigurationStatus> = async () => {
const configured: boolean = await prompt();
return Promise.resolve({
priority: priority,
configured: configured
});
};
if (this.curConfigurationStatus) {
this.curConfigurationStatus = this.curConfigurationStatus.then(result => {
if (priority > result.priority) {
return showPrompt();
} else if (!result.configured) {
return showPrompt();
}
onSkip();
return Promise.resolve({
priority: result.priority,
configured: true
});
});
} else {
this.curConfigurationStatus = showPrompt();
}
}
public dispose(): void {
this.configStatusBarItem.dispose();
this.browseEngineStatusItem.dispose();
this.intelliSenseStatusItem.dispose();
this.referencesStatusBarItem.dispose();
this.codeAnalysisStatusItem.dispose();
}
}
+4 -2
View File
@@ -9,8 +9,10 @@ import { Location, TextEdit } from './commonTypes';
import { CppSettings } from './settings';
export function makeCpptoolsRange(vscRange: vscode.Range): Range {
return { start: { line: vscRange.start.line, character: vscRange.start.character },
end: { line: vscRange.end.line, character: vscRange.end.character } };
return {
start: { line: vscRange.start.line, character: vscRange.start.character },
end: { line: vscRange.end.line, character: vscRange.end.character }
};
}
export function makeVscodeRange(cpptoolsRange: Range): vscode.Range {
@@ -3,12 +3,12 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { getSshConfigHostInfos } from '../sshHosts';
import * as vscode from 'vscode';
import { addSshTargetCmd, BaseNode, LabelLeafNode, refreshCppSshTargetsViewCmd } from './common';
import { TargetLeafNode, filesWritable, setActiveSshTarget, _activeTarget, workspaceState_activeSshTarget } from './targetNodes';
import { extensionContext, ISshConfigHostInfo } from '../../common';
import * as nls from 'vscode-nls';
import { extensionContext, ISshConfigHostInfo } from '../../common';
import { getSshConfigHostInfos } from '../sshHosts';
import { addSshTargetCmd, BaseNode, LabelLeafNode, refreshCppSshTargetsViewCmd } from './common';
import { filesWritable, setActiveSshTarget, TargetLeafNode, workspaceState_activeSshTarget, _activeTarget } from './targetNodes';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -66,7 +66,7 @@ export class SshTargetsProvider implements vscode.TreeDataProvider<BaseNode>, vs
}
}
if (activeTargetRemoved) {
setActiveSshTarget(undefined);
await setActiveSshTarget(undefined);
}
return targetNodes;
}
@@ -82,7 +82,7 @@ export async function initializeSshTargets(): Promise<void> {
}
}
if (activeTargetRemoved) {
setActiveSshTarget(undefined);
await setActiveSshTarget(undefined);
}
await setActiveSshTarget(extensionContext?.workspaceState.get(workspaceState_activeSshTarget));
}
+3 -3
View File
@@ -3,11 +3,11 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { extensionContext, ISshConfigHostInfo, pathAccessible } from "../../common";
import { TreeItem } from "vscode";
import { LabelLeafNode } from "./common";
import { constants } from 'fs';
import { TreeItem } from "vscode";
import * as nls from 'vscode-nls';
import { extensionContext, ISshConfigHostInfo, pathAccessible } from "../../common";
import { LabelLeafNode } from "./common";
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
+8 -5
View File
@@ -4,9 +4,10 @@
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { stripEscapeSequences, isWindows, escapeStringForRegex, ISshHostInfo, getFullHostAddress, extensionContext } from '../common';
import { getOutputChannelLogger } from '../logger';
import * as nls from 'vscode-nls';
import { escapeStringForRegex, extensionContext, getFullHostAddress, ISshHostInfo, stripEscapeSequences } from '../common';
import { isWindows } from '../constants';
import { getOutputChannelLogger } from '../logger';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -52,7 +53,7 @@ export class MitmInteractor implements IInteractor {
}
async onData(data: string): Promise<IInteraction> {
if (!!data.match('Port forwarding is disabled to avoid man-in-the-middle attacks.')) {
if (data.match('Port forwarding is disabled to avoid man-in-the-middle attacks.')) {
throw Error('Port forwarding is disabled to avoid man-in-the-middle attacks.');
}
@@ -92,7 +93,7 @@ export class FingerprintInteractor implements IInteractor {
result.canceled = true;
}
} else if (
isWindows() &&
isWindows &&
(data.includes('The authenticity of host ') || (data === '' && extraDetails?.detectedServerKey))
) {
// hack for #1195
@@ -120,6 +121,7 @@ export class DifferingHostKeyInteractor implements IInteractor {
get id(): string {
return DifferingHostKeyInteractor.ID;
}
async onData(data: string, cancelToken?: vscode.CancellationToken, _extraDetails?: IInteractorDataDetails): Promise<IInteraction> {
const result: IInteraction = { postAction: 'keep' };
data = data.trim();
@@ -320,6 +322,7 @@ export class ContinueOnInteractor implements IInteractor {
return ContinueOnInteractor.ID;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async onData(data: string, _cancelToken?: vscode.CancellationToken): Promise<IInteraction> {
const result: IInteraction = { postAction: 'keep' };
const pattern: string = escapeStringForRegex(this.continueOn);
@@ -344,7 +347,7 @@ export class ConnectionFailureInteractor implements IInteractor {
const result: IInteraction = { postAction: 'keep' };
if (data.includes('Connection refused') || data.includes('Could not resolve hostname')) {
result.postAction = 'consume';
getOutputChannelLogger().showErrorMessage(localize('failed.to.connect', 'Failed to connect to {0}', this.hostName));
void getOutputChannelLogger().showErrorMessage(localize('failed.to.connect', 'Failed to connect to {0}', this.hostName));
}
return result;
}
+216 -219
View File
@@ -7,24 +7,20 @@ import * as os from 'os';
import * as path from 'path';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { CppSettings } from '../LanguageServer/settings';
import { ManualPromise } from '../Utility/Async/manualPromise';
import { ISshHostInfo, ProcessReturnType, splitLines, stripEscapeSequences } from '../common';
import { isWindows } from '../constants';
import { getSshChannel } from '../logger';
import {
DifferingHostKeyInteractor,
ConnectionFailureInteractor, ContinueOnInteractor, DifferingHostKeyInteractor,
DuoTwoFacInteractor,
FingerprintInteractor,
IInteractor,
MitmInteractor,
FingerprintInteractor, IInteraction, IInteractor, ISystemInteractor, MitmInteractor,
PassphraseInteractor,
PasswordInteractor,
TwoFacInteractor,
ContinueOnInteractor,
ISystemInteractor,
IInteraction,
autoFilledPasswordForUsers,
ConnectionFailureInteractor
autoFilledPasswordForUsers
} from './commandInteractors';
import { isWindows, ISshHostInfo, splitLines, stripEscapeSequences, ProcessReturnType } from '../common';
import { getSshChannel } from '../logger';
import { CppSettings } from '../LanguageServer/settings';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -259,230 +255,231 @@ export function runInteractiveSshTerminalCommand(args: ITerminalCommandArgs): Pr
const { systemInteractor, command, interactors, nickname, token } = args;
let logIsPaused: boolean = false;
const loggingLevel: string | undefined = new CppSettings().loggingLevel;
// eslint-disable-next-line @typescript-eslint/no-misused-promises
return new Promise(async (resolve, reject) => {
let stdout: string = '';
let windowListener: vscode.Disposable | undefined;
let terminalListener: vscode.Disposable | undefined;
let terminal: vscode.Terminal | undefined;
let tokenListener: vscode.Disposable;
let continueWithoutExiting: boolean = false;
const result = new ManualPromise<ProcessReturnType>();
const clean = () => {
if (terminalListener) {
terminalListener.dispose();
terminalListener = undefined;
}
let stdout: string = '';
let windowListener: vscode.Disposable | undefined;
let terminalListener: vscode.Disposable | undefined;
let terminal: vscode.Terminal | undefined;
let tokenListener: vscode.Disposable;
let continueWithoutExiting: boolean = false;
if (terminal) {
terminal.dispose();
terminal = undefined;
}
const clean = () => {
if (terminalListener) {
terminalListener.dispose();
terminalListener = undefined;
}
if (windowListener) {
windowListener.dispose();
windowListener = undefined;
}
if (terminal) {
terminal.dispose();
terminal = undefined;
}
if (tokenListener) {
tokenListener.dispose();
}
if (windowListener) {
windowListener.dispose();
windowListener = undefined;
}
disposables.forEach(disposable => disposable.dispose());
};
if (tokenListener) {
tokenListener.dispose();
}
const done = (cancel: boolean = false, noClean: boolean = false, exitCode?: number) => {
if (!noClean) {
clean();
}
getSshChannel().appendLine(cancel ? localize('ssh.terminal.command.canceled', '"{0}" terminal command canceled.', nickname) : localize('ssh.terminal.command.done', '"{0}" terminal command done.', nickname));
disposables.forEach(disposable => disposable.dispose());
};
if (cancel) {
if (continueWithoutExiting) {
const warningMessage: string = localize('ssh.continuing.command.canceled', 'Task \'{0}\' is canceled, but the underlying command may not be terminated. Please check manually.', command);
getSshChannel().appendLine(warningMessage);
vscode.window.showWarningMessage(warningMessage);
}
return reject(new CanceledError());
}
// When using showLoginTerminal, stdout include the passphrase prompt, etc. Try to get just the command output on the last line.
const actualOutput: string | undefined = cancel ? '' : lastNonemptyLine(stdout);
resolve({ succeeded: !exitCode, exitCode, output: actualOutput || '' });
};
const failed = (error?: any) => {
const done = (cancel: boolean = false, noClean: boolean = false, exitCode?: number) => {
if (!noClean) {
clean();
const errorMessage: string = localize('ssh.process.failed', '"{0}" process failed: {1}', nickname, error);
getSshChannel().appendLine(errorMessage);
vscode.window.showErrorMessage(errorMessage);
reject(error);
};
const handleOutputLogging = (data: string): void => {
let nextPauseState: boolean | undefined;
if (args.marker) {
const pauseMarker: string = getPauseLogMarker(args.marker);
const pauseIdx: number = data.lastIndexOf(pauseMarker);
if (pauseIdx >= 0) {
data = data.substring(0, pauseIdx + pauseMarker.length);
nextPauseState = true;
}
const resumeIdx: number = data.lastIndexOf(getResumeLogMarker(args.marker));
if (resumeIdx >= 0) {
data = data.substring(resumeIdx);
nextPauseState = false;
}
}
// Log the chunk of data that includes the pause/resume markers,
// so unpause first and pause after logging
if (!logIsPaused) {
logReceivedData(data, nickname);
}
if (typeof nextPauseState === 'boolean') {
logIsPaused = nextPauseState;
}
};
const handleTerminalOutput = async (dataWrite: vscode.TerminalDataWriteEvent): Promise<void> => {
if (loggingLevel !== 'None') {
handleOutputLogging(dataWrite.data);
}
}
getSshChannel().appendLine(cancel ? localize('ssh.terminal.command.canceled', '"{0}" terminal command canceled.', nickname) : localize('ssh.terminal.command.done', '"{0}" terminal command done.', nickname));
if (cancel) {
if (continueWithoutExiting) {
// Skip the interactors after we have continued since I haven't see a use case for now.
const warningMessage: string = localize('ssh.continuing.command.canceled', 'Task \'{0}\' is canceled, but the underlying command may not be terminated. Please check manually.', command);
getSshChannel().appendLine(warningMessage);
void vscode.window.showWarningMessage(warningMessage);
}
return result.reject(new CanceledError());
}
// When using showLoginTerminal, stdout include the passphrase prompt, etc. Try to get just the command output on the last line.
const actualOutput: string | undefined = cancel ? '' : lastNonemptyLine(stdout);
result.resolve({ succeeded: !exitCode, exitCode, output: actualOutput || '' });
};
const failed = (error?: any) => {
clean();
const errorMessage: string = localize('ssh.process.failed', '"{0}" process failed: {1}', nickname, error);
getSshChannel().appendLine(errorMessage);
void vscode.window.showErrorMessage(errorMessage);
result.reject(error);
};
const handleOutputLogging = (data: string): void => {
let nextPauseState: boolean | undefined;
if (args.marker) {
const pauseMarker: string = getPauseLogMarker(args.marker);
const pauseIdx: number = data.lastIndexOf(pauseMarker);
if (pauseIdx >= 0) {
data = data.substring(0, pauseIdx + pauseMarker.length);
nextPauseState = true;
}
const resumeIdx: number = data.lastIndexOf(getResumeLogMarker(args.marker));
if (resumeIdx >= 0) {
data = data.substring(resumeIdx);
nextPauseState = false;
}
}
// Log the chunk of data that includes the pause/resume markers,
// so unpause first and pause after logging
if (!logIsPaused) {
logReceivedData(data, nickname);
}
if (typeof nextPauseState === 'boolean') {
logIsPaused = nextPauseState;
}
};
const handleTerminalOutput = async (dataWrite: vscode.TerminalDataWriteEvent): Promise<void> => {
if (loggingLevel !== 'None') {
handleOutputLogging(dataWrite.data);
}
if (continueWithoutExiting) {
// Skip the interactors after we have continued since I haven't see a use case for now.
return;
}
stdout += dataWrite.data;
if (interactors) {
for (const interactor of interactors) {
try {
const interaction: IInteraction = await interactor.onData(stdout);
if (interaction.postAction === 'consume') {
if (args.usedInteractors) {
args.usedInteractors.add(interactor.id);
}
stdout = '';
}
if (interaction.canceled) {
if (args.usedInteractors) {
args.usedInteractors.add(interactor.id);
}
done(true);
return;
}
if (interaction.continue) {
if (args.usedInteractors) {
args.usedInteractors.add(interactor.id);
}
continueWithoutExiting = true;
done(false, true);
return;
}
if (typeof interaction.response === 'string') {
if (args.usedInteractors) {
args.usedInteractors.add(interactor.id);
}
if (terminal) {
terminal.sendText(`${interaction.response}\n`);
const logOutput: string = interaction.isPassword
? interaction.response.replace(/./g, '*')
: interaction.response;
if (loggingLevel === 'Debug' || loggingLevel === 'Information') {
getSshChannel().appendLine(localize('ssh.wrote.data.to.terminal', '"{0}" wrote data to terminal: "{1}".', nickname, logOutput));
}
}
}
} catch (e) {
failed(e);
}
}
}
};
if (token) {
tokenListener = token.onCancellationRequested(() => {
done(true);
});
}
const terminalIsWindows: boolean = typeof args.terminalIsWindows === 'boolean' ? args.terminalIsWindows : isWindows;
try {
// the terminal process should not fail, but exit cleanly
let shellArgs: string | string[];
if (args.sendText) {
shellArgs = '';
} else {
shellArgs = terminalIsWindows ? `/c (${command})\nexit /b %ErrorLevel%` : ['-c', `${command}\nexit $?`];
}
const options: vscode.TerminalOptions = {
cwd:
args.cwd ||
(terminalIsWindows
? vscode.Uri.file(os.homedir() || 'c:\\')
: vscode.Uri.file(os.homedir() || '/')),
name: nickname,
shellPath: getShellPath(terminalIsWindows),
shellArgs,
hideFromUser: true
};
let terminalDataHandlingQueue: Promise<void> = Promise.resolve();
terminalListener = systemInteractor.onDidWriteTerminalData(async e => {
if (e.terminal !== terminal) {
return;
}
stdout += dataWrite.data;
terminalDataHandlingQueue = terminalDataHandlingQueue.finally(() => void handleTerminalOutput(e));
});
terminal = systemInteractor.createTerminal(options);
if (interactors) {
for (const interactor of interactors) {
try {
const interaction: IInteraction = await interactor.onData(stdout);
if (interaction.postAction === 'consume') {
if (args.usedInteractors) {
args.usedInteractors.add(interactor.id);
}
stdout = '';
}
if (interaction.canceled) {
if (args.usedInteractors) {
args.usedInteractors.add(interactor.id);
}
done(true);
return;
}
if (interaction.continue) {
if (args.usedInteractors) {
args.usedInteractors.add(interactor.id);
}
continueWithoutExiting = true;
done(false, true);
return;
}
if (typeof interaction.response === 'string') {
if (args.usedInteractors) {
args.usedInteractors.add(interactor.id);
}
if (terminal) {
terminal.sendText(`${interaction.response}\n`);
const logOutput: string = interaction.isPassword
? interaction.response.replace(/./g, '*')
: interaction.response;
if (loggingLevel === 'Debug' || loggingLevel === 'Information') {
getSshChannel().appendLine(localize('ssh.wrote.data.to.terminal', '"{0}" wrote data to terminal: "{1}".', nickname, logOutput));
}
}
}
} catch (e) {
failed(e);
if (args.revealTerminal) {
disposables.push(
args.revealTerminal(() => {
if (terminal) {
terminal.show();
}
}
}
};
if (token) {
tokenListener = token.onCancellationRequested(() => {
done(true);
});
})
);
}
const terminalIsWindows: boolean = typeof args.terminalIsWindows === 'boolean' ? args.terminalIsWindows : isWindows();
try {
// the terminal process should not fail, but exit cleanly
let shellArgs: string | string[];
if (args.sendText) {
shellArgs = '';
} else {
shellArgs = terminalIsWindows ? `/c (${command})\nexit /b %ErrorLevel%` : ['-c', `${command}\nexit $?`];
if (args.sendText) {
const sendText: string = terminalIsWindows ? `(${args.sendText})\nexit /b %ErrorLevel%` : `${args.sendText}\nexit $?`;
terminal.sendText(sendText);
if (loggingLevel === 'Debug' || loggingLevel === 'Information') {
getSshChannel().appendLine(localize('ssh.wrote.data.to.terminal', '"{0}" wrote data to terminal: "{1}".', nickname, args.sendText));
}
const options: vscode.TerminalOptions = {
cwd:
args.cwd ||
(terminalIsWindows
? vscode.Uri.file(os.homedir() || 'c:\\')
: vscode.Uri.file(os.homedir() || '/')),
name: nickname,
shellPath: getShellPath(terminalIsWindows),
shellArgs,
hideFromUser: true
};
let terminalDataHandlingQueue: Promise<void> = Promise.resolve();
terminalListener = systemInteractor.onDidWriteTerminalData(async e => {
if (e.terminal !== terminal) {
return;
}
terminalDataHandlingQueue = terminalDataHandlingQueue.finally(() => void handleTerminalOutput(e));
});
terminal = systemInteractor.createTerminal(options);
if (args.revealTerminal) {
disposables.push(
args.revealTerminal(() => {
if (terminal) {
terminal.show();
}
})
);
}
if (args.sendText) {
const sendText: string = terminalIsWindows ? `(${args.sendText})\nexit /b %ErrorLevel%` : `${args.sendText}\nexit $?`;
terminal.sendText(sendText);
if (loggingLevel === 'Debug' || loggingLevel === 'Information') {
getSshChannel().appendLine(localize('ssh.wrote.data.to.terminal', '"{0}" wrote data to terminal: "{1}".', nickname, args.sendText));
}
}
if (args.showLoginTerminal) {
terminal.show();
}
windowListener = systemInteractor.onDidCloseTerminal(t => {
if (t === terminal) {
terminal = undefined; // Is already disposed
done(false, false, t.exitStatus?.code);
}
});
} catch (error) {
failed(error);
}
});
if (args.showLoginTerminal) {
terminal.show();
}
windowListener = systemInteractor.onDidCloseTerminal(t => {
if (t === terminal) {
terminal = undefined; // Is already disposed
done(false, false, t.exitStatus?.code);
}
});
} catch (error) {
failed(error);
}
return result;
}
function getShellPath(_isWindows: boolean): string {
@@ -518,7 +515,7 @@ function logReceivedData(data: string, nickname: string): void {
function lastNonemptyLine(str: string): string | undefined {
const lines: string[] = splitLines(str);
if (isWindows()) {
if (isWindows) {
let outputContainingPipeError: string = '';
for (let i: number = lines.length - 1; i >= 0; i--) {
const strippedLine: string = stripEscapeSequences(lines[i]);
@@ -526,7 +523,7 @@ function lastNonemptyLine(str: string): string | undefined {
outputContainingPipeError = strippedLine;
continue;
}
if (!!strippedLine) {
if (strippedLine) {
return strippedLine;
}
}
+2 -1
View File
@@ -175,6 +175,7 @@ function parseFlags(input: string[], entries: { [key: string]: string }): number
// prefix with `:` to tell the library not to log anything itself
const parser: BasicParser = new BasicParser(`:${getOptDirective}`, input, 0);
// eslint-disable-next-line no-constant-condition
while (true) {
const next: void | IParsedOption = parser.getopt();
if (!next) {
@@ -226,7 +227,7 @@ function parseFlags(input: string[], entries: { [key: string]: string }): number
* 3. https://github.com/openssh/openssh-portable/blob/master///misc.c#L875-L877
*/
function parseConnectionString(str: string): { hostname: string; port?: string; username?: string } {
let url: URL | void;
let url: URL | undefined;
try {
url = new URL(str);
} catch {
+10 -11
View File
@@ -4,23 +4,22 @@
* ------------------------------------------------------------------------------------------ */
import { promises as fs } from 'fs';
import * as glob from 'glob';
import * as os from 'os';
import * as path from 'path';
import {
Configuration,
parse,
ResolvedConfiguration,
Type as ConfigurationEntryType,
ConfigurationDirective,
Configuration, ConfigurationDirective,
ConfigurationEntry,
HostConfigurationDirective
HostConfigurationDirective, parse,
ResolvedConfiguration,
Type as ConfigurationEntryType
} from 'ssh-config';
import { promisify } from 'util';
import { ISshConfigHostInfo, isWindows, resolveHome } from "../common";
import { getSshChannel } from '../logger';
import * as glob from 'glob';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { ISshConfigHostInfo, resolveHome } from "../common";
import { isWindows } from '../constants';
import { getSshChannel } from '../logger';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -30,7 +29,7 @@ const globAsync: (pattern: string, options?: glob.IOptions | undefined) => Promi
const userSshConfigurationFile: string = path.resolve(os.homedir(), '.ssh/config');
const ProgramData: string = process.env.ALLUSERSPROFILE || process.env.PROGRAMDATA || 'C:\\ProgramData';
const systemSshConfigurationFile: string = isWindows() ? `${ProgramData}\\ssh\\ssh_config` : '/etc/ssh/ssh_config';
const systemSshConfigurationFile: string = isWindows ? `${ProgramData}\\ssh\\ssh_config` : '/etc/ssh/ssh_config';
// Stores if the SSH config files are parsed successfully.
// Only store root config files' failure status since included files are not modified by our extension.
@@ -97,7 +96,7 @@ async function resolveConfigIncludes(config: Configuration, configPath: string):
for (const entry of config) {
if (isDirective(entry) && entry.param === 'Include') {
let includePath: string = resolveHome(entry.value);
if (isWindows() && !!includePath.match(/^\/[a-z]:/i)) {
if (isWindows && !!includePath.match(/^\/[a-z]:/i)) {
includePath = includePath.substr(1);
}
@@ -0,0 +1,102 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
/**
* A manually (or externally) controlled asynchronous Promise implementation
*/
export class ManualPromise<T = void> implements Promise<T> {
readonly [Symbol.toStringTag] = 'Promise';
private promise: Promise<T>;
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult1 = T, TResult2 = never>(onfulfilled?: | ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: | ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2> {
return this.promise.then(onfulfilled, onrejected);
}
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch<TResult = never>(onrejected?: | ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<T | TResult> {
return this.promise.catch(onrejected);
}
/**
* Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
* resolved value cannot be modified from the callback.
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
* @returns A Promise for the completion of the callback.
*/
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
return this.promise.finally(onfinally);
}
/**
* A method to manually resolve the Promise.
*/
public resolve: (value?: T | PromiseLike<T> | undefined) => void = (v) => {
void v; /* */
};
/**
* A method to manually reject the Promise
*/
public reject: (e: any) => void = (e) => {
void e; /* */
};
private state: 'pending' | 'resolved' | 'rejected' = 'pending';
/** Returns true if the promise has not been resolved */
public get isPending() {
return this.state === 'pending';
}
/**
* Returns true of the Promise has been Resolved or Rejected
*/
public get isCompleted(): boolean {
return this.state !== 'pending';
}
/**
* Returns true if the Promise has been Resolved.
*/
public get isResolved(): boolean {
return this.state === 'resolved';
}
/**
* Returns true if the Promise has been Rejected.
*/
public get isRejected(): boolean {
return this.state === 'rejected';
}
public constructor() {
this.promise = new Promise<T>((r, j) => {
this.resolve = (v: T | PromiseLike<T> | undefined) => {
if ((global as any).DEVMODE && this.state !== 'pending') {
throw new Error(`Can't resolve; Promise has already been resolved as ${this.state}`);
}
this.state = 'resolved';
r(v as any);
};
this.reject = (e: any) => {
if ((global as any).DEVMODE && this.state !== 'pending') {
throw new Error(`Can't reject; Promise has already been resolved as ${this.state}`);
}
this.state = 'rejected';
j(e);
};
});
}
}
+107
View File
@@ -0,0 +1,107 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { ManualPromise } from './manualPromise';
import { Resetable } from './resolvable';
/**
* A signal is an externally fulfillable promise ( @see ManualPromise )
* that once awaited, can be manually reset to the unwaited state
*
* The virtue of this vs some kind of event emitter, is that it can be used
* to arbitrarily await a change in some kind of status without the overhead
* of managinng a subscription to an event emitter.
*/
export class ManualSignal<T> implements Promise<T>, Resetable<T> {
[Symbol.toStringTag] = 'Promise';
private promise = new ManualPromise<T>();
constructor(initiallyReset = false) {
if (!initiallyReset) {
// initially not reset.
this.promise.resolve();
}
}
get isPending(): boolean {
return this.promise.isPending;
}
get isCompleted(): boolean {
return this.promise.isCompleted;
}
get isResolved(): boolean {
return this.promise.isResolved;
}
get isRejected(): boolean {
return this.promise.isRejected;
}
get isSet(): boolean {
return this.promise.isCompleted;
}
get isReset(): boolean {
return !this.promise.isCompleted;
}
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult1 = T, TResult2 = never>(onfulfilled?: | ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: | ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2> {
return this.promise.then(onfulfilled, onrejected);
}
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch<TResult = never>(onrejected?: | ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<T | TResult> {
return this.promise.catch(onrejected);
}
/**
* Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
* resolved value cannot be modified from the callback.
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
* @returns A Promise for the completion of the callback.
*/
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
return this.promise.finally(onfinally);
}
/**
* A method to manually resolve the Promise.
*
* This doesn't reset this instance to a new promise interally, call 'reset' to do that.
* @param value
*/
resolve(value: T): Resetable<T> {
if (!this.promise.isCompleted) {
this.promise.resolve(value);
}
return this as unknown as Resetable<T>;
}
/**
* A method to manually reject the Promise.
*
* This doesn't reset this instance to a new promise interally, call 'reset' to do that.
* @param value
*/
reject(reason: any): Resetable<T> {
if (!this.promise.isCompleted) {
this.promise.reject(reason);
}
return this as unknown as Resetable<T>;
}
/** Manually reset the promise to an uncompleted state. */
reset(): Resetable<T> {
if (this.promise.isCompleted) {
this.promise = new ManualPromise<T>();
}
return this as unknown as Resetable<T>;
}
}
+57
View File
@@ -0,0 +1,57 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
export interface Resolveable<T> {
/**
* A method to manually resolve the Promise.
*
* @param value the value to resolve the promise with.
*/
resolve(value: T): Resolveable<T>;
/**
* A method to manually reject the Promise.
*
* @param reason the reason to reject the promise with.
*/
reject(reason: any): Resolveable<T>;
/** Returns true if the promise has not been resolved */
readonly isPending: boolean;
/**
* Returns true of the Promise has been Resolved or Rejected
*/
readonly isCompleted: boolean;
/**
* Returns true if the Promise has been Resolved.
*/
readonly isResolved: boolean;
/**
* Returns true if the Promise has been Rejected.
*/
readonly isRejected: boolean;
}
export interface Resetable<T> extends Resolveable<T> {
/**
* A method to manually resolve the Promise.
*
* @param value the value to resolve the promise with.
*/
resolve(value: T): Resetable<T>;
/**
* A method to manually reject the Promise.
*
* @param reason the reason to reject the promise with.
*/
reject(reason: any): Resetable<T>;
/** Use this to reactivate the ManualSignal */
reset(): Resetable<T>;
}
+87
View File
@@ -0,0 +1,87 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
/** constant functions that return constant values (useful for 'catch') */
export const returns = {
/** returns undefined */
undefined: () => undefined,
/** returns an empty array */
none: () => [],
/** returns null */
null: () => null,
/** returns false */
false: () => false,
/** returns true */
true: () => true,
/** returns zero */
zero: () => 0,
/** returns an empty string */
empty: () => ''
};
export const logAndReturn = {
/** returns undefined */
undefined: (e: any) => {
if (e) {
console.log(e);
}
return undefined;
},
/** returns an empty array */
none: (e: any) => {
if (e) {
console.log(e);
}
return [];
},
/** returns null */
null: (e: any) => {
if (e) {
console.log(e);
}
return null;
},
/** returns false */
false: (e: any) => {
if (e) {
console.log(e);
}
return false;
},
/** returns true */
true: (e: any) => {
if (e) {
console.log(e);
}
return true;
},
/** returns zero */
zero: (e: any) => {
if (e) {
console.log(e);
}
return 0;
},
/** returns an empty string */
empty: (e: any) => {
if (e) {
console.log(e);
}
return '';
}
};
+92
View File
@@ -0,0 +1,92 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { ManualPromise } from './manualPromise';
import { Resolveable } from './resolvable';
/**
* A signal is an externally fulfillable promise ( @see ManualPromise )
* that once resolved, will automatically reset to the unwaited state
*
* The virtue of this vs some kind of event emitter, is that it can be used
* to arbitrarily await a change in some kind of status without the overhead
* of managinng a subscription to an event emitter.
*/
export class Signal<T> implements Promise<T>, Resolveable<T> {
[Symbol.toStringTag] = 'Promise';
private promise = new ManualPromise<T>();
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult1 = T, TResult2 = never>(onfulfilled?: | ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: | ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2> {
return this.promise.then(onfulfilled, onrejected);
}
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch<TResult = never>(onrejected?: | ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<T | TResult> {
return this.promise.catch(onrejected);
}
/**
* Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
* resolved value cannot be modified from the callback.
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
* @returns A Promise for the completion of the callback.
*/
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
return this.promise.finally(onfinally);
}
get isPending(): boolean {
return this.promise.isPending;
}
get isCompleted(): boolean {
return this.promise.isCompleted;
}
get isResolved(): boolean {
return this.promise.isResolved;
}
get isRejected(): boolean {
return this.promise.isRejected;
}
/**
* A method to manually resolve the Promise.
*
* This also resets this instance to a new promise interally, so that any new awaiters will not be instantly resolved.
* @param value
*/
resolve(value: T): Resolveable<T> {
const p = this.promise;
this.promise = new ManualPromise<T>();
p.resolve(value);
return this;
}
/**
* A method to manually reject the Promise.
*
* This also resets this instance to a new promise interally, so that any new awaiters will not be instantly resolved.
* @param value
*/
reject(reason: any) {
const p = this.promise;
this.promise = new ManualPromise<T>();
p.reject(reason);
return this;
}
dispose() {
this.promise.resolve();
}
}
+9
View File
@@ -0,0 +1,9 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { setTimeout as after } from 'timers/promises';
/** pause for a number of milliseconds */
export const sleep = after as (msec: number) => Promise<void>;
+20
View File
@@ -0,0 +1,20 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { fail } from 'node:assert';
import { returns } from './returns';
import { sleep } from './sleep';
/** wait on any of the promises to resolve, or if the timeout is reached, throw */
export async function timeout(msecs: number, ...promises: Promise<any>[]): Promise<any> {
// get a promise for the timeout
const t = sleep(msecs).then(() => fail(`Timeout expired after ${msecs}ms`));
// wait until either the timout expires or one of the promises resolves
await Promise.race([t, ...promises]);
// tag the timeout with a catch to prevent unhandled rejection
t.catch(returns.undefined);
}
+67
View File
@@ -0,0 +1,67 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { Socket } from 'node:net';
import { isPromise } from 'node:util/types';
import { AsyncConstructor, Constructor, Primitive } from './types';
// eslint-disable-next-line @typescript-eslint/naming-convention
export class is {
/** Returns true if the value is a string, number, or boolean */
static primitive(node: any): node is Primitive {
switch (typeof node) {
case 'boolean':
case 'number':
case 'string':
return true;
}
return false;
}
static object(node: any): node is Record<string, any> {
return typeof node === 'object' && node !== null && !is.array(node);
}
static nullish(value: any): value is null | undefined {
return value === null || value === undefined || value === '';
}
static promise(value: any): value is Promise<any> {
return isPromise(value) || (value && typeof (value.then) === 'function');
}
static iterable<T = unknown>(instance: any): instance is Iterable<T> {
return typeof instance !== 'string' && !!instance[Symbol.iterator];
}
static asyncIterable(instance: any): instance is AsyncIterable<unknown> {
return !!instance[Symbol.asyncIterator];
}
// eslint-disable-next-line @typescript-eslint/naming-convention
static Constructor(instance: any): instance is Constructor {
return typeof instance === 'function' && !!instance.prototype && !Object.getOwnPropertyNames(instance).includes('arguments') && instance.toString().match(/^function.*\{ \[native code\] \}|^class/g);
}
static asyncConstructor(instance: any): instance is AsyncConstructor<any> {
return typeof instance === 'function' && !!instance.class && is.Constructor(instance.class);
}
static array(instance: any): instance is any[] {
return Array.isArray(instance);
}
static string(instance: any): instance is string {
return typeof instance === 'string';
}
static socket(instance: any): instance is Socket {
return instance instanceof Socket;
}
static function(instance: any): instance is Function {
return typeof instance === 'function';
}
}
+25
View File
@@ -0,0 +1,25 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
/** @internal */
export type Resolve<T> = (value: T | PromiseLike<T>) => void;
/** @internal */
export type Reject = (reason?: any) => void;
/** @internal */
export type ConstructorReturn<T extends abstract new (...args: any) => any> = T extends abstract new (...args: any) => infer R ? R : never;
export type Primitive = string | number | boolean;
export type Constructor = new (...args: any[]) => any;
export type AribtraryObject = Record<string, any>;
export type Initializer<T> = T | (() => Promise<T>) | (() => T) | (new () => T);
export type Instance<T> = Awaited<T>;
export interface AsyncConstructor<TClass extends new (...args: ConstructorParameters<TClass>) => ConstructorReturn<TClass>> {
new(...args: ConstructorParameters<TClass>): Promise<ConstructorReturn<TClass>>;
class: TClass;
}
+88 -118
View File
@@ -3,21 +3,23 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as path from 'path';
import * as which from 'which';
import * as assert from 'assert';
import * as child_process from 'child_process';
import * as jsonc from 'comment-json';
import * as fs from 'fs';
import * as os from 'os';
import * as child_process from 'child_process';
import * as vscode from 'vscode';
import * as Telemetry from './telemetry';
import { PlatformInformation } from './platform';
import { getOutputChannelLogger, showOutputChannel } from './logger';
import * as assert from 'assert';
import * as path from 'path';
import * as tmp from 'tmp';
import * as nls from 'vscode-nls';
import * as jsonc from 'comment-json';
import { TargetPopulation } from 'vscode-tas-client';
import * as vscode from 'vscode';
import { DocumentFilter } from 'vscode-languageclient';
import * as nls from 'vscode-nls';
import { TargetPopulation } from 'vscode-tas-client';
import * as which from "which";
import { ManualPromise } from './Utility/Async/manualPromise';
import { isWindows } from './constants';
import { getOutputChannelLogger, showOutputChannel } from './logger';
import { PlatformInformation } from './platform';
import * as Telemetry from './telemetry';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -41,19 +43,19 @@ export function setExtensionPath(path: string): void {
extensionPath = path;
}
let cachedClangFormatPath: string | null | undefined;
export function getCachedClangFormatPath(): string | null | undefined {
let cachedClangFormatPath: string | undefined;
export function getCachedClangFormatPath(): string | undefined {
return cachedClangFormatPath;
}
export function setCachedClangFormatPath(path: string | null): void {
export function setCachedClangFormatPath(path: string): void {
cachedClangFormatPath = path;
}
let cachedClangTidyPath: string | null | undefined;
export function getCachedClangTidyPath(): string | null | undefined {
let cachedClangTidyPath: string | undefined;
export function getCachedClangTidyPath(): string | undefined {
return cachedClangTidyPath;
}
export function setCachedClangTidyPath(path: string | null): void {
export function setCachedClangTidyPath(path: string): void {
cachedClangTidyPath = path;
}
@@ -161,13 +163,13 @@ export function isHeaderFile(uri: vscode.Uri): boolean {
return !fileExt || [".cuh", ".hpp", ".hh", ".hxx", ".h++", ".hp", ".h", ".ii", ".inl", ".idl", ""].some(ext => fileExtLower === ext);
}
export function isCppFile (uri: vscode.Uri): boolean {
export function isCppFile(uri: vscode.Uri): boolean {
const fileExt: string = path.extname(uri.fsPath);
const fileExtLower: string = fileExt.toLowerCase();
return (fileExt === ".C") || [".cu", ".cpp", ".cc", ".cxx", ".c++", ".cp", ".ino", ".ipp", ".tcc"].some(ext => fileExtLower === ext);
}
export function isCFile (uri: vscode.Uri): boolean {
export function isCFile(uri: vscode.Uri): boolean {
const fileExt: string = path.extname(uri.fsPath);
const fileExtLower: string = fileExt.toLowerCase();
return (fileExt === ".C") || fileExtLower === ".c";
@@ -214,8 +216,8 @@ export function getWorkspaceIsCpp(): boolean {
export function isCppOrRelated(document: vscode.TextDocument): boolean {
return isCpp(document) || isCppPropertiesJson(document) || (document.uri.scheme === "output" && document.uri.fsPath.startsWith("extension-output-ms-vscode.cpptools")) ||
(isWorkspaceCpp && (document.languageId === "json" || document.languageId === "jsonc") &&
((document.fileName.endsWith("settings.json") && (document.uri.scheme === "file" || document.uri.scheme === "vscode-userdata")) ||
(document.uri.scheme === "file" && document.fileName.endsWith(".code-workspace"))));
((document.fileName.endsWith("settings.json") && (document.uri.scheme === "file" || document.uri.scheme === "vscode-userdata")) ||
(document.uri.scheme === "file" && document.fileName.endsWith(".code-workspace"))));
}
let isExtensionNotReadyPromptDisplayed: boolean = false;
@@ -259,7 +261,7 @@ export function getIntelliSenseProgress(): number {
export function setProgress(progress: number): void {
if (extensionContext && getProgress() < progress) {
extensionContext.globalState.update(installProgressStr, progress);
void extensionContext.globalState.update(installProgressStr, progress);
const telemetryProperties: { [key: string]: string } = {};
let progressName: string | undefined;
switch (progress) {
@@ -278,7 +280,7 @@ export function setProgress(progress: number): void {
export function setIntelliSenseProgress(progress: number): void {
if (extensionContext && getIntelliSenseProgress() < progress) {
extensionContext.globalState.update(intelliSenseProgressStr, progress);
void extensionContext.globalState.update(intelliSenseProgressStr, progress);
const telemetryProperties: { [key: string]: string } = {};
let progressName: string | undefined;
switch (progress) {
@@ -335,7 +337,7 @@ export function isOptionalArrayOfString(input: any): input is string[] | undefin
export function resolveCachePath(input: string | undefined, additionalEnvironment: { [key: string]: string | string[] }): string {
let resolvedPath: string = "";
if (!input) {
if (!input || input.trim() === "") {
// If no path is set, return empty string to language service process, where it will set the default path as
// Windows: %LocalAppData%/Microsoft/vscode-cpptools/
// Linux and Mac: ~/.vscode-cpptools/
@@ -346,13 +348,9 @@ export function resolveCachePath(input: string | undefined, additionalEnvironmen
return resolvedPath;
}
export function isWindows(): boolean {
return os.platform() === 'win32';
}
export function defaultExePath(): string {
const exePath: string = path.join('${fileDirname}', '${fileBasenameNoExtension}');
return isWindows() ? exePath + '.exe' : exePath;
return isWindows ? exePath + '.exe' : exePath;
}
export function findExePathInArgs(args: string[]): string | undefined {
@@ -454,7 +452,7 @@ export function resolveVariablesArray(variables: string[] | undefined, additiona
// Resolve '~' at the start of the path.
export function resolveHome(filePath: string): string {
return filePath.replace(/^\~/g, (match: string, name: string) => os.homedir());
return filePath.replace(/^\~/g, os.homedir());
}
export function asFolder(uri: vscode.Uri): string {
@@ -548,8 +546,8 @@ export function checkFileExistsSync(filePath: string): boolean {
try {
return fs.statSync(filePath).isFile();
} catch (e) {
return false;
}
return false;
}
export function checkExecutableWithoutExtensionExistsSync(filePath: string): boolean {
@@ -581,8 +579,8 @@ export function checkDirectoryExistsSync(dirPath: string): boolean {
try {
return fs.statSync(dirPath).isDirectory();
} catch (e) {
return false;
}
return false;
}
/** Test whether a relative path exists */
@@ -621,9 +619,9 @@ export function readDir(dirPath: string): Promise<string[]> {
}
/** Reads the content of a text file */
export function readFileText(filePath: string, encoding: string = "utf8"): Promise<string> {
export function readFileText(filePath: string, encoding: BufferEncoding = "utf8"): Promise<string> {
return new Promise<string>((resolve, reject) => {
fs.readFile(filePath, encoding, (err, data) => {
fs.readFile(filePath, { encoding }, (err: any, data: any) => {
if (err) {
reject(err);
} else {
@@ -763,60 +761,60 @@ interface ProcessOutput {
}
async function spawnChildProcessImpl(program: string, args: string[], continueOn?: string, cancellationToken?: vscode.CancellationToken): Promise<ProcessOutput> {
// eslint-disable-next-line @typescript-eslint/no-misused-promises
return new Promise(async (resolve, reject) => {
// Do not use CppSettings to avoid circular require()
const settings: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("C_Cpp", null);
const loggingLevel: string | undefined = settings.get<string>("loggingLevel");
const result = new ManualPromise<ProcessOutput>();
let proc: child_process.ChildProcess;
if (await isExecutable(program)) {
proc = child_process.spawn(`.${isWindows() ? '\\' : '/'}${path.basename(program)}`, args, { shell: true, cwd: path.dirname(program) });
} else {
proc = child_process.spawn(program, args, { shell: true });
}
// Do not use CppSettings to avoid circular require()
const settings: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("C_Cpp", null);
const loggingLevel: string | undefined = settings.get<string>("loggingLevel");
const cancellationTokenListener: vscode.Disposable | undefined = cancellationToken?.onCancellationRequested(() => {
getOutputChannelLogger().appendLine(localize('killing.process', 'Killing process {0}', program));
proc.kill();
});
let proc: child_process.ChildProcess;
if (await isExecutable(program)) {
proc = child_process.spawn(`.${isWindows ? '\\' : '/'}${path.basename(program)}`, args, { shell: true, cwd: path.dirname(program) });
} else {
proc = child_process.spawn(program, args, { shell: true });
}
const clean = () => {
proc.removeAllListeners();
if (cancellationTokenListener) {
cancellationTokenListener.dispose();
}
};
let stdout: string = '';
let stderr: string = '';
if (proc.stdout) {
proc.stdout.on('data', data => {
const str: string = data.toString();
if (loggingLevel !== "None") {
getOutputChannelLogger().append(str);
}
stdout += str;
if (continueOn) {
const continueOnReg: string = escapeStringForRegex(continueOn);
if (stdout.search(continueOnReg)) {
resolve({ stdout: stdout.trim(), stderr: stderr.trim() });
}
}
});
}
if (proc.stderr) {
proc.stderr.on('data', data => stderr += data.toString());
}
proc.on('close', (code, signal) => {
clean();
resolve({ exitCode: code || signal, stdout: stdout.trim(), stderr: stderr.trim() });
});
proc.on('error', error => {
clean();
reject(error);
});
const cancellationTokenListener: vscode.Disposable | undefined = cancellationToken?.onCancellationRequested(() => {
getOutputChannelLogger().appendLine(localize('killing.process', 'Killing process {0}', program));
proc.kill();
});
const clean = () => {
proc.removeAllListeners();
if (cancellationTokenListener) {
cancellationTokenListener.dispose();
}
};
let stdout: string = '';
let stderr: string = '';
if (proc.stdout) {
proc.stdout.on('data', data => {
const str: string = data.toString();
if (loggingLevel !== "None") {
getOutputChannelLogger().append(str);
}
stdout += str;
if (continueOn) {
const continueOnReg: string = escapeStringForRegex(continueOn);
if (stdout.search(continueOnReg)) {
result.resolve({ stdout: stdout.trim(), stderr: stderr.trim() });
}
}
});
}
if (proc.stderr) {
proc.stderr.on('data', data => stderr += data.toString());
}
proc.on('close', (code, signal) => {
clean();
result.resolve({ exitCode: code || signal || undefined, stdout: stdout.trim(), stderr: stderr.trim() });
});
proc.on('error', error => {
clean();
result.reject(error);
});
return result;
}
/**
@@ -908,7 +906,7 @@ export async function promptReloadWindow(message: string): Promise<void> {
const reload: string = localize("reload.string", "Reload");
const value: string | undefined = await vscode.window.showInformationMessage(message, reload);
if (value === reload) {
vscode.commands.executeCommand("workbench.action.reloadWindow");
return vscode.commands.executeCommand("workbench.action.reloadWindow");
}
}
@@ -954,7 +952,7 @@ function legacyExtractArgs(argsString: string): string[] {
}
} else if (c === '\'') {
// On Windows, a single quote string is not allowed to join multiple args into a single arg
if (!isWindows()) {
if (!isWindows) {
if (!isWithinDoubleQuote) {
isWithinSingleQuote = !isWithinSingleQuote;
}
@@ -1056,7 +1054,7 @@ function extractArgs(argsString: string): string[] {
return [];
}
const jsonText: string = wordexpResult.toString();
return jsonc.parse(jsonText, undefined, true);
return jsonc.parse(jsonText, undefined, true) as any;
} catch {
return [];
}
@@ -1174,37 +1172,6 @@ export function escapeForSquiggles(s: string): string {
return newResults;
}
export class BlockingTask<T> {
private done: boolean = false;
private promise: Thenable<T>;
constructor(task: () => Thenable<T>, dependency?: BlockingTask<any>) {
if (!dependency) {
this.promise = task();
} else {
this.promise = new Promise<T>((resolve, reject) => {
const f1: () => void = () => {
task().then(resolve, reject);
};
const f2: (err: any) => void = (err) => {
console.log(err);
task().then(resolve, reject);
};
dependency.promise.then(f1, f2);
});
}
this.promise.then(() => this.done = true, () => this.done = true);
}
public get Done(): boolean {
return this.done;
}
public getPromise(): Thenable<T> {
return this.promise;
}
}
export function getSenderType(sender?: any): string {
if (isString(sender)) {
return sender;
@@ -1403,6 +1370,7 @@ export function findPowerShell(): string | undefined {
return name;
}
} catch (e) {
return undefined;
}
}
}
@@ -1429,7 +1397,9 @@ export function isVsCodeInsiders(): boolean {
export function stripEscapeSequences(str: string): string {
return str
// eslint-disable-next-line no-control-regex
.replace(/\x1b\[\??[0-9]{0,3}(;[0-9]{1,3})?[a-zA-Z]/g, '')
// eslint-disable-next-line no-control-regex
.replace(/\u0008/g, '')
.replace(/\r/g, '');
}
+8
View File
@@ -0,0 +1,8 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { platform } from 'os';
export const isWindows = platform() === 'win32';
+6 -6
View File
@@ -6,12 +6,12 @@
import { CustomConfigurationProvider, Version } from 'vscode-cpptools';
import { CppToolsTestApi, CppToolsTestHook } from 'vscode-cpptools/out/testApi';
import { CustomConfigurationProvider1, getCustomConfigProviders, CustomConfigurationProviderCollection } from './LanguageServer/customProviders';
import { getOutputChannel } from './logger';
import * as LanguageServer from './LanguageServer/extension';
import * as test from './testHook';
import * as nls from 'vscode-nls';
import { CustomConfigurationProvider1, CustomConfigurationProviderCollection, getCustomConfigProviders } from './LanguageServer/customProviders';
import * as LanguageServer from './LanguageServer/extension';
import { CppSettings } from './LanguageServer/settings';
import { getOutputChannel } from './logger';
import * as test from './testHook';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -81,8 +81,8 @@ export class CppTools implements CppToolsTestApi {
this.removeNotifyReadyTimer(p);
p.isReady = true;
LanguageServer.getClients().forEach(client => {
client.updateCustomBrowseConfiguration(p);
client.updateCustomConfigurations(p);
void client.updateCustomBrowseConfiguration(p);
void client.updateCustomConfigurations(p);
});
} else if (this.failedRegistrations.find(p => p === provider)) {
console.warn("provider not successfully registered; 'notifyReady' ignored");
+2 -34
View File
@@ -4,8 +4,8 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import { CustomConfigurationProvider, Version, CppToolsApi, CppToolsExtension } from 'vscode-cpptools';
import { CppToolsTestApi, CppToolsTestHook, CppToolsTestExtension } from 'vscode-cpptools/out/testApi';
import { CppToolsApi, CustomConfigurationProvider, Version } from 'vscode-cpptools';
import { CppToolsTestApi, CppToolsTestExtension, CppToolsTestHook } from 'vscode-cpptools/out/testApi';
import { CppTools } from './cppTools';
/**
@@ -63,35 +63,3 @@ export class CppTools1 implements CppToolsTestApi, CppToolsTestExtension {
return this.BackupApi.getTestHook();
}
}
/**
* This is an empty implementation of the API. Used when the extension is activated on
* an unsupported platform.
*/
export class NullCppTools implements CppToolsApi, CppToolsExtension {
private version: Version = Version.v0;
getApi(version: Version): CppToolsApi {
this.version = version;
return this;
}
getVersion(): Version {
return this.version;
}
registerCustomConfigurationProvider(provider: CustomConfigurationProvider): void {
}
notifyReady(provider: CustomConfigurationProvider): void {
}
didChangeCustomConfiguration(provider: CustomConfigurationProvider): void {
}
didChangeCustomBrowseConfiguration(provider: CustomConfigurationProvider): void {
}
dispose(): void {
}
}
+5 -5
View File
@@ -54,7 +54,7 @@ export async function expandString(input: string, options: ExpansionOptions): Pr
} while (i < MAX_RECURSION && options.recursive && didReplacement);
if (i === MAX_RECURSION && didReplacement) {
getOutputChannelLogger().showErrorMessage(localize('max.recursion.reached', 'Reached max string expansion recursion. Possible circular reference.'));
void getOutputChannelLogger().showErrorMessage(localize('max.recursion.reached', 'Reached max string expansion recursion. Possible circular reference.'));
}
return replaceAll(result, '${dollar}', '$');
@@ -79,7 +79,7 @@ async function expandStringImpl(input: string, options: ExpansionOptions): Promi
// Replace dollar sign at the very end of the expanding process
const repl: string = options.vars[key];
if (!repl) {
getOutputChannelLogger().showWarningMessage(localize('invalid.var.reference', 'Invalid variable reference {0} in string: {1}.', full, input));
void getOutputChannelLogger().showWarningMessage(localize('invalid.var.reference', 'Invalid variable reference {0} in string: {1}.', full, input));
} else {
subs.set(full, repl);
}
@@ -95,7 +95,7 @@ async function expandStringImpl(input: string, options: ExpansionOptions): Promi
const full: string = match[0];
const varname: string = match[1];
if (process.env[varname] === undefined) {
getOutputChannelLogger().showWarningMessage(localize('env.var.not.found', 'Environment variable {0} not found', varname));
void getOutputChannelLogger().showWarningMessage(localize('env.var.not.found', 'Environment variable {0} not found', varname));
}
const repl: string = process.env[varname] || '';
subs.set(full, repl);
@@ -104,7 +104,7 @@ async function expandStringImpl(input: string, options: ExpansionOptions): Promi
const command_re: RegExp = RegExp(`\\$\\{command:(${varValueRegexp})\\}`, "g");
while ((match = command_re.exec(input))) {
if (options.doNotSupportCommands) {
getOutputChannelLogger().showWarningMessage(localize('commands.not.supported', 'Commands are not supported for string: {0}.', input));
void getOutputChannelLogger().showWarningMessage(localize('commands.not.supported', 'Commands are not supported for string: {0}.', input));
break;
}
const full: string = match[0];
@@ -116,7 +116,7 @@ async function expandStringImpl(input: string, options: ExpansionOptions): Promi
const command_ret: unknown = await vscode.commands.executeCommand(command, options.vars.workspaceFolder);
subs.set(full, `${command_ret}`);
} catch (e: any) {
getOutputChannelLogger().showWarningMessage(localize('exception.executing.command', 'Exception while executing command {0} for string: {1} {2}.', command, input, e));
void getOutputChannelLogger().showWarningMessage(localize('exception.executing.command', 'Exception while executing command {0} for string: {1} {2}.', command, input, e));
}
}
+2 -2
View File
@@ -4,10 +4,10 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import * as os from 'os';
import { CppSourceStr } from './LanguageServer/extension';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { CppSourceStr } from './LanguageServer/extension';
import { getLocalizedString, LocalizeStringParams } from './LanguageServer/localization';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
+25 -25
View File
@@ -4,25 +4,26 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as DebuggerExtension from './Debugger/extension';
import * as LanguageServer from './LanguageServer/extension';
import * as os from 'os';
import * as path from 'path';
import * as Telemetry from './telemetry';
import * as util from './common';
import * as vscode from 'vscode';
import * as DebuggerExtension from './Debugger/extension';
import * as LanguageServer from './LanguageServer/extension';
import * as util from './common';
import * as Telemetry from './telemetry';
import { CppToolsApi, CppToolsExtension } from 'vscode-cpptools';
import { PlatformInformation } from './platform';
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 { CppToolsApi, CppToolsExtension } from 'vscode-cpptools';
import * as nls from 'vscode-nls';
import { cppBuildTaskProvider, CppBuildTaskProvider } from './LanguageServer/cppBuildTaskProvider';
import { TargetPopulation } from 'vscode-tas-client';
import { CppBuildTaskProvider, cppBuildTaskProvider } from './LanguageServer/cppBuildTaskProvider';
import { getLocaleId, getLocalizedHtmlPath } from './LanguageServer/localization';
import { PersistentState } from './LanguageServer/persistentState';
import { CppSettings } from './LanguageServer/settings';
import { logAndReturn, returns } from './Utility/Async/returns';
import { CppTools1 } from './cppTools1';
import { disposeOutputChannels, log } from './logger';
import { PlatformInformation } from './platform';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -86,7 +87,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
if (isOldMacOs) {
languageServiceDisabled = true;
vscode.window.showErrorMessage(localize("macos.version.deprecated", "Versions of the C/C++ extension more recent than {0} require at least macOS version {1}.", "1.9.8", "10.12"));
void vscode.window.showErrorMessage(localize("macos.version.deprecated", "Versions of the C/C++ extension more recent than {0} require at least macOS version {1}.", "1.9.8", "10.12"));
} else {
if (settings.intelliSenseEngine === "disabled") {
languageServiceDisabled = true;
@@ -99,11 +100,11 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
// If switching from disabled to enabled, we can continue activation.
currentIntelliSenseEngineValue = settings.intelliSenseEngine;
languageServiceDisabled = false;
LanguageServer.activate();
return LanguageServer.activate();
} else {
// We can't deactivate or change engines on the fly, so prompt for window reload.
reloadMessageShown = true;
util.promptForReloadWindowDueToSettingsChange();
void util.promptForReloadWindowDueToSettingsChange();
}
}
}));
@@ -114,7 +115,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
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");
void vscode.languages.setTextDocumentLanguage(doc, "jsonc");
util.setWorkspaceIsCpp();
}
}
@@ -150,7 +151,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
export async function deactivate(): Promise<void> {
DebuggerExtension.dispose();
Telemetry.deactivate();
void Telemetry.deactivate().catch(returns.undefined);
disposables.forEach(d => d.dispose());
if (languageServiceDisabled) {
return;
@@ -290,15 +291,14 @@ async function checkVsixCompatibility(): Promise<void> {
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(getLocalizedHtmlPath("Reinstalling the Extension.md")));
} else if (value === ignoreButton) {
ignoreMismatchedCompatibleVsix.Value = true;
}
});
}
void promise?.then((value) => {
if (value === moreInfoButton) {
void vscode.commands.executeCommand("markdown.showPreview", vscode.Uri.file(getLocalizedHtmlPath("Reinstalling the Extension.md")));
} else if (value === ignoreButton) {
ignoreMismatchedCompatibleVsix.Value = true;
}
}, logAndReturn.undefined);
} else {
console.log("Unable to find TargetPlatform in .vsixmanifest");
}
+4 -4
View File
@@ -3,12 +3,12 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as os from 'os';
import { LinuxDistribution } from './linuxDistribution';
import * as plist from 'plist';
import * as fs from 'fs';
import * as logger from './logger';
import * as os from 'os';
import * as plist from 'plist';
import * as nls from 'vscode-nls';
import { LinuxDistribution } from './linuxDistribution';
import * as logger from './logger';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
+8 -25
View File
@@ -6,8 +6,9 @@
import TelemetryReporter from '@vscode/extension-telemetry';
import { getExperimentationServiceAsync, IExperimentationService, IExperimentationTelemetry, TargetPopulation } from 'vscode-tas-client';
import { CppSettings } from './LanguageServer/settings';
import * as util from './common';
import { CppSettings } from './LanguageServer/settings';
import { logAndReturn } from './Utility/Async/returns';
interface IPackageInfo {
name: string;
@@ -96,16 +97,8 @@ async function isExperimentEnabled(experimentName: string): Promise<boolean> {
}
export async function deactivate(): Promise<void> {
if (initializationPromise) {
try {
await initializationPromise;
} catch (e) {
// Continue even if we were not able to initialize the experimentation platform.
}
}
if (experimentationTelemetry) {
experimentationTelemetry.dispose();
}
await initializationPromise?.catch(logAndReturn.undefined);
await experimentationTelemetry?.dispose().catch(logAndReturn.undefined);
}
export function logDebuggerEvent(eventName: string, properties?: { [key: string]: string }, metrics?: { [key: string]: number }): void {
@@ -116,14 +109,10 @@ export function logDebuggerEvent(eventName: string, properties?: { [key: string]
}
};
// simpler expression of the original:
// Uses 'then' instead of 'await' because telemetry should be "fire and forget".
if (initializationPromise) {
try {
// Use 'then' instead of 'await' because telemetry should be "fire and forget".
initializationPromise.then(sendTelemetry);
return;
} catch (e) {
// Continue even if we were not able to initialize the experimentation platform.
}
return void initializationPromise.catch(logAndReturn.undefined).then(sendTelemetry).catch(logAndReturn.undefined);
}
sendTelemetry();
}
@@ -137,13 +126,7 @@ export function logLanguageServerEvent(eventName: string, properties?: { [key: s
};
if (initializationPromise) {
try {
// Use 'then' instead of 'await' because telemetry should be "fire and forget".
initializationPromise.then(sendTelemetry);
return;
} catch (e) {
// Continue even if we were not able to initialize the experimentation platform.
}
return void initializationPromise.catch(logAndReturn.undefined).then(sendTelemetry).catch(logAndReturn.undefined);
}
sendTelemetry();
}

Some files were not shown because too many files have changed in this diff Show More