Compare commits
33
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2efdb847a9 | ||
|
|
d8cdeee035 | ||
|
|
d80e04ec66 | ||
|
|
929d548419 | ||
|
|
64b949583d | ||
|
|
de4a6babef | ||
|
|
37dfc2dda4 | ||
|
|
b7cd0d9d7d | ||
|
|
7821797aae | ||
|
|
3a5a00bab4 | ||
|
|
a6df7eeaba | ||
|
|
1942a701bf | ||
|
|
1f1b2b0236 | ||
|
|
0dea2e48c2 | ||
|
|
f3c44319b3 | ||
|
|
86a81392de | ||
|
|
34457f222c | ||
|
|
e3db8a5bf4 | ||
|
|
b7488e61b0 | ||
|
|
5210e23479 | ||
|
|
64ecdb78ad | ||
|
|
8c3e10cb5e | ||
|
|
2737f46885 | ||
|
|
dfca58c539 | ||
|
|
8a2e6738eb | ||
|
|
d036a413c5 | ||
|
|
d2f9113397 | ||
|
|
881836c0e8 | ||
|
|
25022e93d3 | ||
|
|
17ddec484a | ||
|
|
a4535a9feb | ||
|
|
7b2eb67be9 | ||
|
|
1fbbd6be51 |
@@ -1,2 +1,4 @@
|
||||
gulpfile.js
|
||||
test/**/index.ts
|
||||
test/**/runTest.ts
|
||||
tools/prepublish.js
|
||||
|
||||
@@ -87,6 +87,7 @@ module.exports = {
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"prefer-const": "error",
|
||||
"prefer-object-spread": "error",
|
||||
"space-in-parens": [
|
||||
"error",
|
||||
|
||||
+62
-3
@@ -1,6 +1,66 @@
|
||||
# C/C++ for Visual Studio Code Change Log
|
||||
|
||||
## Version 0.28.0-insiders3: May 8, 2020
|
||||
## Version 0.29.0-insiders: June 24, 2020
|
||||
### New Features
|
||||
* Add Doxygen comment support (to tooltip display of hover, completion, and signature help). [#658](https://github.com/microsoft/vscode-cpptools/issues/658)
|
||||
|
||||
### Enhancements
|
||||
* Add support for the Debug Welcome Panel. [#4837](https://github.com/microsoft/vscode-cpptools/issues/4837)
|
||||
* Update to clang-format 10. [#5194](https://github.com/microsoft/vscode-cpptools/issues/5194)
|
||||
* Added system to store and query properties from the active C/C++ configuration.
|
||||
* bugengine (@bugengine) [PR #5453](https://github.com/microsoft/vscode-cpptools/pull/5453)
|
||||
* Add `quoteArgs` to `launch.json` schema. [PR #5639](https://github.com/microsoft/vscode-cpptools/pull/5639)
|
||||
* Add logs for a resolved `launch.json` if "engineLogging" is enabled. [PR #5644](https://github.com/microsoft/vscode-cpptools/pull/5644)
|
||||
* Add threadExit and processExit logging flags for 'cppvsdbg'. [PR #5652](https://github.com/microsoft/vscode-cpptools/pull/5652)
|
||||
|
||||
### Bug Fixes
|
||||
* Add localization support for autocomplete and hover text. [#5370](https://github.com/microsoft/vscode-cpptools/issues/5370)
|
||||
* Some `updateChannel` fixes. [PR #5465](https://github.com/microsoft/vscode-cpptools/pull/5465)
|
||||
* Fix wrong language standard used with compile commands. [#5498](https://github.com/microsoft/vscode-cpptools/issues/5498)
|
||||
* Fix issue with defines and includes not being handled correctly in `compilerPath` or `compilerArgs`. [#5512](https://github.com/microsoft/vscode-cpptools/issues/5512)
|
||||
* Add gcc/gcc-10 compiler detection. [#5540](https://github.com/microsoft/vscode-cpptools/issues/5540)
|
||||
* Fix `--target` compiler arg getting overridden. [#5557](https://github.com/microsoft/vscode-cpptools/issues/5557)
|
||||
* Matt Schulte (@schultetwin1)
|
||||
* Fix IntelliSense process crashes. [#5584](https://github.com/microsoft/vscode-cpptools/issues/5584), [#5629](https://github.com/microsoft/vscode-cpptools/issues/5629)
|
||||
* Fix Find All References and Rename when multiple references are on the same line. [#5568](https://github.com/microsoft/vscode-cpptools/issues/5568)
|
||||
* Fix an add/remove workspace folder crash. [#5591](https://github.com/microsoft/vscode-cpptools/issues/5591)
|
||||
* Fix default build tasks failing on Windows if the compiler isn't on the PATH. [#5604](https://github.com/microsoft/vscode-cpptools/issues/5604)
|
||||
* Fix updating `files.associations` and .C files being associated with C instead of C++. [#5618](https://github.com/microsoft/vscode-cpptools/issues/5618)
|
||||
* Fix IntelliSense malfunction when RxCpp is used. [#5619](https://github.com/microsoft/vscode-cpptools/issues/5619)
|
||||
* Ignore "screen size is bogus" error when debugging. [PR #5669](https://github.com/microsoft/vscode-cpptools/pull/5669)
|
||||
* nukoyluoglu (@nukoyluoglu)
|
||||
* Fix potential thread deadlock in cpptools.
|
||||
* Fix copying a long value from debug watch results in pasting partial value [#5470](https://github.com/microsoft/vscode-cpptools/issues/5470)
|
||||
* [PR MIEngine#1009](https://github.com/microsoft/MIEngine/pull/1009)
|
||||
* Fix Modifying conditional breakpoints [#2297](https://github.com/microsoft/vscode-cpptools/issues/2297)
|
||||
* [PR MIEngine#1010](https://github.com/microsoft/MIEngine/pull/1010)
|
||||
* Fix find <miDebuggerPath>.exe in Windows path [#3076](https://github.com/microsoft/vscode-cpptools/issues/3076)
|
||||
* [PR MIEngine#1001](https://github.com/microsoft/MIEngine/pull/1001)
|
||||
|
||||
## Version 0.28.3: June 9, 2020
|
||||
### Enhancements
|
||||
* Update version of vscode-cpptools API to 4.0.1 [PR #5624](https://github.com/microsoft/vscode-cpptools/pull/5624)
|
||||
|
||||
## Version 0.28.2: June 1, 2020
|
||||
### Regression Bug Fixes
|
||||
* Fix string arrays in `env` not being joined properly. [#5509](https://github.com/microsoft/vscode-cpptools/issues/5509)
|
||||
* Krishna Ersson (@kersson) [PR #5510](https://github.com/microsoft/vscode-cpptools/pull/5510)
|
||||
* Fix `shell` being used as the C/C++ build task source instead of `C/C++`. [vscode-docs#3724](https://github.com/microsoft/vscode-docs/issues/3724)
|
||||
|
||||
### Other Bug Fixes
|
||||
* Fix `problemMatcher` not being added to C/C++ build tasks. [#3295](https://github.com/microsoft/vscode-cpptools/issues/3295)
|
||||
* Fix `/usr/bin` being used as the default `cwd` (instead of `${workspaceFolder}`) for C/C++ build tasks. [#4761](https://github.com/microsoft/vscode-cpptools/issues/4761)
|
||||
* Fix processing of quoted arguments with spaces in `compilerPath`. [PR #5513](https://github.com/microsoft/vscode-cpptools/pull/5513)
|
||||
* Fix inconsistent task `label` and `preLaunchTask` being used for C/C++ build tasks. [#5561](https://github.com/microsoft/vscode-cpptools/issues/5561)
|
||||
|
||||
## Version 0.28.1: May 20, 2020
|
||||
### Bug Fixes
|
||||
* Fix errors not appearing after switching between a WSL and non-WSL config on Windows. [#5474](https://github.com/microsoft/vscode-cpptools/issues/5474)
|
||||
* Fix cpptools crash when gcc is not in $PATH in a Docker container. [#5484](https://github.com/microsoft/vscode-cpptools/issues/5484)
|
||||
* Fix top IntelliSense crash regression. [#5486](https://github.com/microsoft/vscode-cpptools/issues/5486)
|
||||
* Fix squiggles appearing too soon (while typing). [#5531](https://github.com/microsoft/vscode-cpptools/issues/5531)
|
||||
|
||||
## Version 0.28.0: May 12, 2020
|
||||
### New Features
|
||||
* Add C/C++ language-aware code folding. [#407](https://github.com/microsoft/vscode-cpptools/issues/407)
|
||||
* Add GNU (and C18) language standard options. [#2782](https://github.com/microsoft/vscode-cpptools/issues/2782)
|
||||
@@ -11,13 +71,12 @@
|
||||
* Add support for IntelliSense-based `Go to Definition` on `#include` statements. [#2564](https://github.com/microsoft/vscode-cpptools/issues/2564)
|
||||
* Support relative paths with `forcedInclude`. [#2780](https://github.com/microsoft/vscode-cpptools/issues/2780)
|
||||
* Make the `Visual Studio` formatting style respect the C++ standard (e.g. `> >` for C++03 or earlier). [#3578](https://github.com/microsoft/vscode-cpptools/issues/3578)
|
||||
* Add support for more C++20 features, such as concepts. [#4195](https://github.com/microsoft/vscode-cpptools/issues/4195)
|
||||
* Add support for more C++20 features, such as concepts (not 100% complete yet). [#4195](https://github.com/microsoft/vscode-cpptools/issues/4195)
|
||||
* Process the "std" and bitness (-m64/-m32) compiler args. [#4726](https://github.com/microsoft/vscode-cpptools/issues/4726)
|
||||
* Switch from our custom Rename UI to VS Code's Refactor Preview. [#4990](https://github.com/microsoft/vscode-cpptools/issues/4990)
|
||||
|
||||
### Bug Fixes
|
||||
* Fix `browse.path` not getting set correctly when `compileCommands` is used. [#1163](https://github.com/microsoft/vscode-cpptools/issues/1163)
|
||||
* Note: Some paths are still missing in certain cases. We plan to fix that in the "next" update.
|
||||
* Fix an issue with squiggle updates not occurring when a dependent file is created, deleted, or renamed. [#3670](https://github.com/microsoft/vscode-cpptools/issues/3670)
|
||||
* Fix temporary VSIX files not getting deleted after installation [#3923](https://github.com/microsoft/vscode-cpptools/issues/3923)
|
||||
* Process "$CPATH" on non-Windows OS's. [#3940](https://github.com/microsoft/vscode-cpptools/issues/3940)
|
||||
|
||||
@@ -697,7 +697,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
debug 3.2.6 - MIT
|
||||
debug 3.1.0 - MIT
|
||||
https://github.com/visionmedia/debug#readme
|
||||
Copyright (c) 2014 TJ Holowaychuk <[email protected]>
|
||||
Copyright (c) 2014-2017 TJ Holowaychuk <[email protected]>
|
||||
@@ -727,7 +727,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
debug 3.1.0 - MIT
|
||||
debug 3.2.6 - MIT
|
||||
https://github.com/visionmedia/debug#readme
|
||||
Copyright (c) 2014 TJ Holowaychuk <[email protected]>
|
||||
Copyright (c) 2014-2017 TJ Holowaychuk <[email protected]>
|
||||
@@ -981,33 +981,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
minimist 0.0.8 - MIT
|
||||
https://github.com/substack/minimist
|
||||
|
||||
This software is released under the 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:
|
||||
|
||||
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.
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
-------------------------------------------------------------------
|
||||
@@ -1282,48 +1255,6 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
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.
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
vscode-debugadapter 1.37.1 - MIT
|
||||
https://github.com/Microsoft/vscode-debugadapter-node#readme
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
All rights reserved.
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
vscode-debugprotocol 1.37.0 - MIT
|
||||
https://github.com/Microsoft/vscode-debugadapter-node#readme
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
All rights reserved.
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
-------------------------------------------------------------------
|
||||
@@ -1532,6 +1463,23 @@ SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
xmldom 0.1.31 - MIT OR LGPL-2.0-only
|
||||
https://github.com/xmldom/xmldom
|
||||
|
||||
You can choose any one of those:
|
||||
|
||||
The MIT License (MIT):
|
||||
|
||||
link:http://opensource.org/licenses/MIT
|
||||
|
||||
LGPL:
|
||||
http://www.gnu.org/licenses/lgpl.html
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"neplatná hodnota cannot-redefine",
|
||||
"duplicitní modifikátor funkce",
|
||||
"neplatný znak pro literál char16_t",
|
||||
"__LPREFIX se nedá použít u literálů char8_t, char16_t nebo char32_t.",
|
||||
null,
|
||||
"Nerozpoznaná konvence volání %s, musí být jednou z:",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"zachytávání *this je v tomto režimu nestandardní",
|
||||
"Předpona atributu using ve stylu C++17 je v tomto režimu nestandardní.",
|
||||
"Vnořené obory názvů ve stylu C++17 jsou v tomto režimu nestandardní.",
|
||||
"V deklaraci nemůžou být současně constexpr i consteval.",
|
||||
"V deklaraci se může vyskytovat jen jedna z těchto možností: constexpr, consteval a constinit",
|
||||
"funkce nemůže být v tomto režimu zároveň consteval a virtuální",
|
||||
"U explicitní direktivy vytváření instancí není povolený modifikátor consteval.",
|
||||
"Modifikátor consteval tady není platný.",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"Atribut internal_linkage se nevyskytuje v předchozí deklaraci.",
|
||||
"Pro %n se nenašel žádný vhodný kandidát pro dedukci argumentu šablony.",
|
||||
"Volání plně kvalifikovaného konstruktoru se nepovoluje.",
|
||||
"Operátor porovnání se dá nastavit na výchozí hodnotu jen v definici třídy.",
|
||||
"Operátor porovnání nastavený jako výchozí musí být členem třídy, na kterou se vztahuje, nebo pro ni musí být nastavený jako friend.",
|
||||
"Chybný typ %t pro parametr výchozího operátoru porovnání (musí to být odkaz na const X, kde X je uzavírající typ třídy)",
|
||||
"Návratový typ výchozího operátoru porovnání musí být bool.",
|
||||
"Výchozí operátor porovnání členů musí být const.",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await se může vztahovat jen na příkaz for založený na rozsahu.",
|
||||
"Typ rozsahu ve smyčce for založené na rozsahu se nedá vyvodit.",
|
||||
"Vložené proměnné jsou funkce standardu C++17.",
|
||||
"Destrukční operátor delete vyžaduje jako první parametr %t.",
|
||||
"Destrukční operátor delete nemůže mít parametry jiné než std::size_t a std::align_val_t.",
|
||||
"možnosti volné (relaxed) abstraktní třídy se dají použít jenom při kompilaci C++",
|
||||
"Neplatný začátek výrazu v klauzuli requires",
|
||||
"Výraz cast v klauzuli requires musí být v uvozovkách.",
|
||||
@@ -3242,7 +3244,7 @@
|
||||
"Atomické omezení není konstanta.",
|
||||
"Hodnota atomického omezení se vyhodnotí jako false.",
|
||||
"Omezení šablony není splněné.",
|
||||
"Definice koncepce se nemůže vyskytovat v tomto oboru.",
|
||||
"V tomto oboru se definice konceptu nemůže vyskytovat.",
|
||||
"Neplatná změna deklarace %nd",
|
||||
"Nepodařilo se nahradit argumenty pro concept-id.",
|
||||
"Koncept je false.",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"Šablona konceptu",
|
||||
"Klauzule requires není kompatibilní s %nfd.",
|
||||
"Očekával se atribut.",
|
||||
"Neplatný začátek požadavku",
|
||||
null,
|
||||
"Očekával se název typu.",
|
||||
"Parametr výpustky není ve výrazu requires povolený.",
|
||||
"Nepojmenovaný parametr ve výrazu requires nemá žádný efekt.",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"Soubor modulu",
|
||||
"Nepodařilo se najít soubor modulu pro modul %sq.",
|
||||
"Soubor modulu %sq se nepovedlo naimportovat.",
|
||||
"Očekával se soubor modulu %s1, ale našel se soubor modulu %s2.",
|
||||
"Očekávalo se %s1, ale našlo se %s2.",
|
||||
"Při otevírání souboru modulu %sq",
|
||||
"Neznámý název oddílu %sq",
|
||||
"Neznámé",
|
||||
"Importovatelné záhlaví",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"Neočekávané",
|
||||
"neznámý soubor modulu",
|
||||
"soubor modulu s importovatelnou hlavičkou",
|
||||
"soubor modulu EDG",
|
||||
"soubor modulu IFC",
|
||||
"neočekávaný soubor modulu",
|
||||
"Typ druhého operandu %t2 musí mít stejnou velikost jako %t1.",
|
||||
"Typ musí být možné triviálně kopírovat.",
|
||||
"Typ %t se pro vyhodnocování constexpr v __builtin_bit_cast v současné době nepodporuje.",
|
||||
@@ -3297,5 +3299,27 @@
|
||||
"Tento operátor se na tomto místě nepodporuje. Uzavřete předchozí výraz new do závorek.",
|
||||
"Neplatné použití konceptu",
|
||||
"Výchozí operátor porovnání členů nemůže být kvalifikovaný jako &&.",
|
||||
"Výchozí funkce pro porovnání constexpr volá funkci %nd, která constexpr není."
|
||||
"Výchozí funkce pro porovnání constexpr volá funkci %nd, která constexpr není.",
|
||||
"Porovnání paměti constexpr se podporuje jen pro celé číslo nejvyšší úrovně nebo objekty polí celých čísel.",
|
||||
"Šablona konceptu nemůže mít přidružená omezení.",
|
||||
"export se nepovoluje.",
|
||||
"Export jednotlivých členů třídy se nepodporuje.",
|
||||
"Exportovaná deklarace musí zavést název.",
|
||||
"Deklarace exportu nemůže obsahovat deklaraci exportu (předchozí deklarace %p).",
|
||||
"Deklarace exportu nemůže obsahovat deklaraci importu modulu.",
|
||||
"Deklarace exportu se může vyskytnout jen v jednotce rozhraní modulu.",
|
||||
"Deklarace exportu nemůže exportovat název s interním propojením.",
|
||||
"Deklarace using zahrnuje %nfd.",
|
||||
"Předdefinovaná funkce není dostupná, protože typy s plovoucí desetinnou čárkou __fp16 se nepodporují.",
|
||||
"Výraz requires musí určovat alespoň jeden požadavek.",
|
||||
"Modifikátor constinit tady není platný.",
|
||||
"Modifikátor constinit je platný jen pro deklarace proměnných s dobou trvání úložiště static nebo thread.",
|
||||
"Proměnná constinit vyžaduje dynamickou inicializaci.",
|
||||
"Proměnná se už dříve deklarovala s constinit %p.",
|
||||
"Použití deklarátoru funkce, která není prototyp",
|
||||
"Argument nemůže mít typ kvalifikovaný jako const.",
|
||||
"Ukazatel na člen neúplného typu %t se nepovoluje.",
|
||||
"Rozšíření balíčku v init-capture se v tomto režimu nepodporuje.",
|
||||
"Rozšíření balíčku v init-capture je funkce jazyka C++20.",
|
||||
"Operátor porovnání v definici třídy nastavený jako výchozí musí být první deklarace daného operátoru porovnání (%nd)."
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"Ungültiger Wert für Neudefinitionsfehler.",
|
||||
"Doppelter Funktionsmodifizierer.",
|
||||
"Ungültiges Zeichen für char16_t-Literal.",
|
||||
"__LPREFIX kann nicht auf char8_t-, char16_t- oder char32_t-Literale angewendet werden.",
|
||||
null,
|
||||
"Unbekannte Aufrufkonvention \"%s\", muss eine der folgenden Optionen sein:",
|
||||
null,
|
||||
null,
|
||||
@@ -2065,7 +2065,7 @@
|
||||
"ein cli::pin_ptr-Rückgabetyp ist nicht zulässig",
|
||||
"Attribut %sq wird nur im %[C++/CLI]-Modus angewendet",
|
||||
"ein einfacher (Nicht-Nachverfolgungs-)Verweis kann nicht an eine Entität im verwalteten Heap gebunden werden",
|
||||
"übertragbare Assembly",
|
||||
"portierbare Assembly",
|
||||
"'%s' nicht von Standardassemblys geladen",
|
||||
"die Listeninitialisierungssyntax ist eine C++11-Funktion",
|
||||
"der Operand von sizeof kann kein Verweisklassentyp oder Schnittstellenklassentyp sein",
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"Das Erfassen von *this ist in diesem Modus nicht standardisiert.",
|
||||
"Attributpräfix \"using\" im C++17-Stil ist in diesem Modus nicht standardisiert.",
|
||||
"Geschachtelte Namespaces im C++17-Stil sind in diesem Modus nicht standardisiert.",
|
||||
"\"constexpr\" und \"consteval\" können in einer Deklaration nicht zugleich auftreten.",
|
||||
"In einer Deklaration kann nur einer der Werte \"constexpr\", \"consteval\" und \"constinit\" verwendet werden.",
|
||||
"Eine Funktion kann in diesem Modus nicht zugleich consteval und virtual sein.",
|
||||
"\"consteval\" ist in einer expliziten Instanziierungsdirektive nicht zulässig.",
|
||||
"\"consteval\" ist hier nicht gültig.",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"Das Attribut \"internal_linkage\" war in keiner vorherigen Deklaration vorhanden.",
|
||||
"Für \"%n\" wurde kein geeigneter Kandidat für die Vorlagenargumentdeduktion gefunden.",
|
||||
"Der Aufruf eines vollqualifizierten Konstruktors ist nicht zulässig.",
|
||||
"Ein Vergleichsoperator kann nur in einer Klassendefinition standardmäßig verwendet werden.",
|
||||
"Ein auf den Standardwert festgelegter Vergleichsoperator muss ein Member oder Friend der Klasse sein, auf die er angewendet wird.",
|
||||
"Ungültiger Typ \"%t\" für den Parameter des Standardvergleichsoperators (muss \"reference to const X\" lauten, wobei X für den einschließenden Klassentyp steht).",
|
||||
"Der Rückgabetyp des Standardvergleichsoperators muss \"bool\" lauten.",
|
||||
"Ein standardmäßiger Membervergleichsoperator muss \"const\" lauten.",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await kann nur auf eine bereichsbasierte for-Anweisung angewendet werden.",
|
||||
"Der Typ des Bereichs kann in einer bereichsbasierten for-Schleife nicht abgeleitet werden.",
|
||||
"Inlinevariablen sind ein C++17-Feature.",
|
||||
"Für eine \"operator delete\"-Funktion mit Zerstörung wird \"%t\" als erster Parameter benötigt.",
|
||||
"Eine \"operator delete\"-Funktion mit Zerstörung kann nur die Parameter \"std::size_t\" und \"std::align_val_t\" aufweisen.",
|
||||
"Optionen einer lockeren abstrakten Klasse können nur beim Kompilieren von C++ verwendet werden.",
|
||||
"Ungültiger Start des Ausdrucks in requires-Klausel.",
|
||||
"Ein cast-Ausdruck in einer requires-Klausel muss in Klammern gesetzt werden.",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"Konzeptvorlage",
|
||||
"Die requires-Klausel ist nicht mit \"%nfd\" kompatibel.",
|
||||
"Es wurde ein Attribut erwartet.",
|
||||
"Ungültiger Start der Anforderung.",
|
||||
null,
|
||||
"Es wurde ein Typname erwartet.",
|
||||
"Ein ellipsis-Parameter ist in einem requires-Ausdruck nicht zulässig.",
|
||||
"Ein unbenannter Parameter in einem requires-Ausdruck hat keine Auswirkungen.",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"Moduldatei",
|
||||
"Die Moduldatei für das Modul \"%sq\" wurde nicht gefunden.",
|
||||
"Die Moduldatei \"%sq\" konnte nicht importiert werden.",
|
||||
"Es wurde die Moduldatei \"%s1\" erwartet, stattdessen wurde die Moduldatei \"%s2\" gefunden.",
|
||||
"Erwartet wurde \"%s1\", stattdessen gefunden: \"%s2\".",
|
||||
"beim Öffnen der Moduldatei \"%sq\"",
|
||||
"Unbekannter Partitionsname \"%sq\".",
|
||||
"unbekanntes Element",
|
||||
"importierbarer Header",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"unerwartetes Element",
|
||||
"Unbekannte Moduldatei",
|
||||
"Importierbare Headermoduldatei",
|
||||
"EDG-Moduldatei",
|
||||
"IFC-Moduldatei",
|
||||
"Unerwartete Moduldatei",
|
||||
"Der Typ des zweiten Operanden, \"%t2\", muss die gleiche Größe aufweisen wie \"%t1\".",
|
||||
"Der Typ muss trivial kopierbar sein.",
|
||||
"Der Typ \"%t\" wird derzeit für die constexpr-Auswertung von \"__builtin_bit_cast\" nicht unterstützt.",
|
||||
@@ -3297,5 +3299,27 @@
|
||||
"Der this-Operator ist an dieser Stelle nicht zulässig. Schließen Sie den vorangehenden new-Ausdruck in Klammern ein.",
|
||||
"Ungültige Verwendung von \"concept\".",
|
||||
"Ein standardmäßiger Membervergleichsoperator kann nicht &&-qualifiziert sein.",
|
||||
"Die constexpr-Standardvergleichsfunktion ruft die Nicht-constexpr-Funktion \"%nd\" auf."
|
||||
"Die constexpr-Standardvergleichsfunktion ruft die Nicht-constexpr-Funktion \"%nd\" auf.",
|
||||
"Der constexpr-Speichervergleich wird nur für integer-Objekte oder array-of-integer-Objekte oberster Ebene unterstützt.",
|
||||
"Einer Konzeptvorlage können keine Einschränkungen zugeordnet sein.",
|
||||
"\"export\" ist nicht zulässig.",
|
||||
"Das Exportieren einzelner Klassenmember ist nicht zulässig.",
|
||||
"Eine exportierte Deklaration muss einen Namen einführen.",
|
||||
"Eine Exportdeklaration kann keine Exportdeklaration enthalten (vorherige Deklaration: %p).",
|
||||
"Eine Exportdeklaration kann keine Modulimportdeklaration enthalten.",
|
||||
"Eine Exportdeklaration kann nur in einer Modulschnittstelleneinheit verwendet werden.",
|
||||
"Eine Exportdeklaration kann keinen Namen mit interner Verknüpfung exportieren.",
|
||||
"Die using-Deklaration enthält \"%nfd\".",
|
||||
"Die integrierte Funktion ist nicht verfügbar, weil __fp16-Gleitkommatypen nicht unterstützt werden.",
|
||||
"Für einen requires-Ausdruck muss mindestens eine Anforderung angegeben werden.",
|
||||
"\"constinit\" ist hier nicht gültig.",
|
||||
"\"constinit\" ist nur für Deklarationen von Variablen mit Speicherdauer \"static\" oder \"thread\" gültig.",
|
||||
"Die constinit-Variable erfordert eine dynamische Initialisierung.",
|
||||
"Die Variable wurde zuvor mit \"constinit\" deklariert: %p",
|
||||
"Verwendung eines Funktionsdeklarators ohne Prototyp ",
|
||||
"Das Argument darf keinen const-qualifizierten Typ aufweisen.",
|
||||
"Eine Pointer-to-Member-Funktion eines unvollständigen Typs \"%t\" ist nicht zulässig.",
|
||||
"Die Paketerweiterung in \"init-capture\" ist in diesem Modus nicht aktiviert.",
|
||||
"Die Paketerweiterung in \"init-capture\" ist ein C++ 20-Feature.",
|
||||
"Ein auf den Standardwert festgelegter Vergleichsoperator in einer Klassendefinition muss als erste Deklaration dieses Vergleichsoperators (%nd) aufgeführt sein."
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"valor que indica que no se puede definir de nuevo no válido",
|
||||
"modificador de función duplicado",
|
||||
"carácter no válido para el literal char16_t",
|
||||
"__LPREFIX no se puede aplicar a los literales char8_t, char16_t o char32_t",
|
||||
null,
|
||||
"convención de llamada %s no reconocida, debe ser una de las siguientes:",
|
||||
null,
|
||||
null,
|
||||
@@ -2065,7 +2065,7 @@
|
||||
"no se permite el tipo de valor devuelto cli::pin_ptr",
|
||||
"el atributo %sq se aplica solamente en el modo %[C++/CLI]",
|
||||
"una referencia simple (que no sea de seguimiento) no se puede enlazar a una entidad en el montón administrado",
|
||||
"ensamblado portátil",
|
||||
"ensamblado portable",
|
||||
"'%s' no se cargó de los ensamblados predeterminados",
|
||||
"la sintaxis de inicialización de la lista es una funcionalidad de C++11",
|
||||
"el operando de sizeof no puede ser un tipo de clase ref o interface",
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"la captura de *this no es estándar en este modo",
|
||||
"El prefijo del atributo \"using\" de estilo C++17 no es estándar en este modo",
|
||||
"Los espacios de nombres anidados de estilo C++17 no son estándar en este modo",
|
||||
"\"constexpr\" y \"consteval\" no pueden aparecer simultáneamente en una declaración",
|
||||
"solo puede aparecer uno de los elementos \"constexpr\", \"consteval\" y \"constinit'' en una declaración",
|
||||
"una función no puede ser consteval y virtual a la vez en este modo",
|
||||
"\"consteval\" no se permite en una directiva de creación de una instancia explícita",
|
||||
"\"consteval\" no es válido aquí",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"El atributo \"internal_linkage\" no aparecía en una declaración anterior",
|
||||
"no se ha encontrado ningún candidato de deducción de argumentos de plantilla viable para %n",
|
||||
"no se permite una llamada de constructor completa",
|
||||
"a un operador de comparación solo se le puede asignar un valor predeterminado en una definición de clase",
|
||||
"un operador de comparación predeterminado debe ser un miembro o un elemento de confianza de la clase a la que se aplica",
|
||||
"tipo %t incorrecto para el parámetro del operador de comparación con valores predeterminados (debe ser una \"referencia a const X\", donde X es el tipo de clase envolvente)",
|
||||
"el tipo de valor devuelto del operador de comparación con valores predeterminados debe ser \"bool\"",
|
||||
"un operador de comparación de miembros con valores predeterminados debe ser \"const\"",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await solo se puede aplicar a una instrucción for basada en intervalo",
|
||||
"no se puede deducir el tipo de intervalo en el bucle \"for\" basado en intervalo",
|
||||
"las variables insertadas son una característica de C++17",
|
||||
"el operador de destrucción requiere %t como primer parámetro",
|
||||
"un operador de destrucción \"delete\" no puede tener parámetros distintos de std::size_t y std::align_val_t",
|
||||
"las opciones de clase abstracta flexible solo se pueden usar al compilar C++",
|
||||
"inicio no válido de la expresión en la cláusula requires",
|
||||
"una expresión cast en una cláusula requires debe estar entre paréntesis",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"plantilla de concepto",
|
||||
"la cláusula requires es incompatible con %nfd",
|
||||
"se esperaba un atributo",
|
||||
"inicio no válido del requisito",
|
||||
null,
|
||||
"se esperaba un nombre de tipo",
|
||||
"no se permite un parámetro de puntos suspensivos en una expresión requires",
|
||||
"el parámetro sin nombre de la expresión requires no tiene ningún efecto",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"archivo de módulo",
|
||||
"no se encuentra el archivo del módulo %sq",
|
||||
"No se puede importar el archivo de módulo %sq.",
|
||||
"se esperaba el archivo de módulo %s1, pero se encontró el archivo de módulo %s2 en su lugar",
|
||||
"se esperaba %s1, pero se encontró %s2 en su lugar",
|
||||
"al abrir el archivo de módulo %sq",
|
||||
"nombre de partición %sq desconocida",
|
||||
"desconocido",
|
||||
"encabezado importable",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"inesperado",
|
||||
"nombre de partición %sq desconocido",
|
||||
"un archivo de módulo desconocido",
|
||||
"un archivo de módulo de encabezado importable",
|
||||
"un archivo de módulo EDG",
|
||||
"un archivo de módulo IFC",
|
||||
"un archivo de módulo inesperado",
|
||||
"el tipo del segundo operando %t2 debe tener el mismo tamaño que %t1",
|
||||
"el tipo debe poder copiarse de forma trivial",
|
||||
"no se admite el tipo %t para la evaluación constexpr de __builtin_bit_cast",
|
||||
@@ -3297,5 +3299,27 @@
|
||||
"este operador no está permitido en este punto; incluya la expresión \"new\" anterior entre paréntesis",
|
||||
"uso no válido del concepto",
|
||||
"un operador de comparación de miembros con valores predeterminados no puede estar calificado con \"&&\"",
|
||||
"la función de comparación constexpr predeterminada llama a una función %nd que no es constexpr"
|
||||
"la función de comparación constexpr predeterminada llama a una función %nd que no es constexpr",
|
||||
"la comparación de memoria de constexpr solo se admite para objetos de matriz de enteros o enteros de nivel superior",
|
||||
"una plantilla de concepto no puede tener restricciones asociadas",
|
||||
"no se permite \"export\"",
|
||||
"no se permite la exportación de miembros de clases individuales",
|
||||
"una declaración exportada debe introducir un nombre",
|
||||
"una declaración de exportación no puede contener otra declaración de exportación (declaración %p anterior)",
|
||||
"una declaración de exportación no puede contener una declaración de importación de módulo",
|
||||
"una declaración de exportación solo puede aparecer en una unidad de interfaz de módulo",
|
||||
"una declaración de exportación no puede exportar un nombre con vinculación interna",
|
||||
"la declaración using incluye %nfd",
|
||||
"la función builtin no está disponible porque no se admiten tipos de punto flotante __fp16",
|
||||
"una expresión requires debe especificar al menos un requisito",
|
||||
"\"constexpr\" no es válido aquí",
|
||||
"\"constinit\" solo es válido para las declaraciones de variables con duración de almacenamiento estático o de subproceso",
|
||||
"la variable constinit requiere la inicialización dinámica",
|
||||
"la variable se declaró previamente con \"constinit\" %p",
|
||||
"uso del declarador de función no prototipo",
|
||||
"el argumento no puede tener un tipo calificado constante",
|
||||
"no se permite un puntero a miembro de un tipo %t incompleto",
|
||||
"la expansión del paquete en la captura de inicialización no está habilitada en este modo",
|
||||
"la expansión del paquete en la captura de inicialización es una característica de C++20",
|
||||
"un operador de comparación con valor predeterminado en una definición de clase debe ser la primera declaración de ese operador de comparación (%nd)"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"valeur cannot-redefine non valide",
|
||||
"modificateur de fonction dupliqué",
|
||||
"caractère non valide pour le littéral char16_t",
|
||||
"Impossible d'appliquer __LPREFIX aux littéraux char8_t, char16_t ou char32_t",
|
||||
null,
|
||||
"convention d'appel inconnue %s, doit être l'une des suivantes :",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"la capture de *this n'est pas standard dans ce mode",
|
||||
"Le préfixe d'attribut 'using' de style C++17 n'est pas standard dans ce mode",
|
||||
"Les espaces de noms imbriqués de style C++17 ne sont pas standard dans ce mode",
|
||||
"'constexpr' et 'consteval' ne peuvent pas apparaître tous les deux dans une déclaration",
|
||||
"seule une instance de 'constexpr', 'consteval' et 'constinit' peut apparaître dans une déclaration",
|
||||
"une fonction ne peut pas être à la fois consteval et virtual dans ce mode",
|
||||
"'consteval' n'est pas autorisé sur une directive d'instanciation explicite",
|
||||
"'consteval' est non valide ici",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"l'attribut 'internal_linkage' n'est pas apparu dans une déclaration antérieure",
|
||||
"aucun candidat de déduction d'argument de modèle viable n'a été localisé pour %n",
|
||||
"un appel de constructeur complet n'est pas autorisé",
|
||||
"un opérateur de comparaison peut uniquement être utilisé par défaut dans une définition de classe",
|
||||
"un opérateur de comparaison par défaut doit être membre ou ami de la classe à laquelle il s'applique",
|
||||
"type %t incorrect pour le paramètre de l'opérateur de comparaison par défaut (il doit s'agir d'une 'référence à const X' où X est le type classe englobant)",
|
||||
"le type de retour de l'opérateur de comparaison par défaut doit être 'bool'",
|
||||
"un opérateur de comparaison de membres par défaut doit être 'const'",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await peut s'appliquer uniquement à une instruction for basée sur une plage",
|
||||
"impossible de déduire le type de la plage dans une boucle 'for' basée sur une plage",
|
||||
"les variables inline sont une fonctionnalité C++17",
|
||||
"l'opérateur delete de destruction nécessite %t en tant que premier paramètre",
|
||||
"un opérateur delete de destruction ne peut pas avoir d'autres paramètres que std::size_t et std::align_val_t",
|
||||
"les options de classe abstraite non limitées peuvent uniquement être utilisées durant la compilation en C++",
|
||||
"début d'expression non valide dans la clause requires",
|
||||
"une expression cast dans une clause requires doit être entre parenthèses",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"modèle de concept",
|
||||
"clause requires incompatible avec %nfd",
|
||||
"attribut attendu",
|
||||
"début d'exigence non valide",
|
||||
null,
|
||||
"nom de type attendu",
|
||||
"un paramètre ellipse n'est pas autorisé dans une expression requires",
|
||||
"un paramètre sans nom dans une expression requires n'a aucun effet",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"fichier de module",
|
||||
"fichier de module introuvable pour le module %sq",
|
||||
"impossible d'importer le fichier de module %sq",
|
||||
"fichier de module %s1 attendu, fichier de module %s2 trouvé à la place",
|
||||
"%s1 attendu, %s2 trouvé à la place",
|
||||
"à l'ouverture du fichier de module %sq",
|
||||
"nom de partition inconnu %sq",
|
||||
"inconnu",
|
||||
"en-tête importable",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"inattendu",
|
||||
"fichier de module inconnu",
|
||||
"fichier de module d'en-tête importable",
|
||||
"fichier de module EDG",
|
||||
"fichier de module IFC",
|
||||
"fichier de module inattendu",
|
||||
"le type du deuxième opérande %t2 doit avoir la même taille que %t1",
|
||||
"le type doit pouvoir être copié de façon triviale",
|
||||
"le type %t n'est pas pris en charge pour l'évaluation de constexpr de __builtin_bit_cast",
|
||||
@@ -3297,5 +3299,27 @@
|
||||
"cet opérateur n'est pas autorisé à ce stade ; mettez entre parenthèses l'expression new précédente",
|
||||
"utilisation non valide du concept",
|
||||
"un opérateur de comparaison de membres par défaut ne peut pas être qualifié en tant que '&&'",
|
||||
"la fonction de comparaison constexpr par défaut appelle la fonction non constexpr %nd"
|
||||
"la fonction de comparaison constexpr par défaut appelle la fonction non constexpr %nd",
|
||||
"la comparaison de mémoire constexpr est prise en charge uniquement pour les objets d'entiers de niveau supérieur ou les objets de tableaux d'entiers",
|
||||
"un modèle de concept ne peut pas avoir de contraintes associées",
|
||||
"'export' n'est pas autorisé",
|
||||
"l'exportation de membres de classe individuels n'est pas autorisée",
|
||||
"une déclaration exportée doit introduire un nom",
|
||||
"une déclaration export ne peut pas contenir de déclaration export (déclaration précédente %p)",
|
||||
"une déclaration export ne peut pas contenir de déclaration import de module",
|
||||
"une déclaration export ne peut apparaître que dans une unité d'interface de module",
|
||||
"une déclaration export ne peut pas exporter un nom avec une liaison interne",
|
||||
"la déclaration using inclut %nfd",
|
||||
"la fonction intégrée n'est pas disponible, car les types à virgule flottante __fp16 ne sont pas pris en charge",
|
||||
"une expression requires doit spécifier au moins une exigence",
|
||||
"'constinit' est non valide ici",
|
||||
"'constinit' est valide uniquement pour les déclarations de variables ayant une durée de stockage statique ou de thread",
|
||||
"la variable constinit nécessite une initialisation dynamique",
|
||||
"la variable a été déclarée avec 'constinit' %p",
|
||||
"utilisation d'un déclarateur de fonction non-prototype",
|
||||
"l'argument ne peut pas avoir un type qualifié const",
|
||||
"un pointeur vers membre de type incomplet %t n'est pas autorisé",
|
||||
"l'expansion de pack dans init-capture n'est pas activée dans ce mode",
|
||||
"l'expansion de pack dans init-capture est une fonctionnalité C++20",
|
||||
"un opérateur de comparaison par défaut dans une définition de classe doit être la première déclaration de cet opérateur de comparaison (%nd)"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"valore di Impossibile ridefinire non valido",
|
||||
"modificatore di funzione duplicato",
|
||||
"carattere non valido per il valore letterale char16_t",
|
||||
"non è possibile applicare __LPREFIX al valore letterale char8_t, char16_t o char32_t",
|
||||
null,
|
||||
"convenzione di chiamata %s non riconosciuta. Deve essere una delle seguenti:",
|
||||
null,
|
||||
null,
|
||||
@@ -2065,7 +2065,7 @@
|
||||
"tipo restituito cli::pin_ptr non consentito",
|
||||
"l'attributo %sq si applica solo in modalità %[C++/CLI]",
|
||||
"non è possibile associare un riferimento semplice (non di traccia) a un'entità nell'heap gestito",
|
||||
"assembly portatile",
|
||||
"assembly portabile",
|
||||
"'%s' non caricato da assembly predefiniti",
|
||||
"la sintassi di inizializzazione elenco è una funzionalità C++11",
|
||||
"l'operando di sizeof non può essere un tipo classe di interfaccia o un tipo classe di riferimento",
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"l'acquisizione di *this non è standard in questa modalità",
|
||||
"il prefisso dell'attributo di 'using' di tipo C++17 non è standard in questa modalità",
|
||||
"gli spazi dei nomi annidati di tipo C++17 non sono standard in questa modalità",
|
||||
"una dichiarazione non può contenere sia 'constexpr' che 'consteval'",
|
||||
"una dichiarazione può contenere solo una tra le variabili 'constexpr', 'consteval' e 'constinit'",
|
||||
"una funzione non può essere contemporaneamente consteval e virtual in questa modalità",
|
||||
"'consteval' non è consentito in una direttiva di creazione esplicita di un'istanza",
|
||||
"'consteval' non è valido in questo punto",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"l'attributo 'internal_linkage' non era presente in una dichiarazione precedente",
|
||||
"non è stato trovato alcun candidato di deduzione dell'argomento di modello valido per %n",
|
||||
"una chiamata al costruttore completo non è consentita",
|
||||
"un operatore di confronto può essere impostato come predefinito solo in una definizione di classe",
|
||||
"l'operatore di confronto impostato come predefinito deve essere un membro o un elemento friend della classe a cui si applica",
|
||||
"il tipo %t per il parametro dell'operatore di confronto impostato come predefinito non è valido. Deve essere 'reference to const X' dove X è il tipo della classe contenitore",
|
||||
"il tipo restituito dell'operatore di confronto impostato come predefinito deve essere 'bool'",
|
||||
"un operatore di confronto membri impostato come predefinito non può essere 'const'",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await può essere applicato solo a un'istruzione for basata su intervallo",
|
||||
"non è possibile dedurre il tipo dell'intervallo nel ciclo 'for' basato su intervallo",
|
||||
"le variabili inline sono una funzionalità di C++17",
|
||||
"per l'eliminazione dell'operatore di eliminazione definitiva è necessario specificare %t come primo parametro",
|
||||
"per l'eliminazione di un operatore di eliminazione definitiva non è possibile specificare parametri diversi da std::size_t e std::align_val_t",
|
||||
"è possibile usare le opzioni di classe astratta di tipo relaxed solo quando si esegue la compilazione nel linguaggio C++",
|
||||
"l'inizio dell'espressione non è valido nella clausola requires",
|
||||
"un'espressione cast in una clausola requires deve essere racchiusa tra parentesi",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"modello di concetto",
|
||||
"la clausola requires non è compatibile con %nfd",
|
||||
"è previsto un attributo",
|
||||
"l'inizio del requisito non è valido",
|
||||
null,
|
||||
"è previsto un nome di tipo",
|
||||
"in un'espressione requires non sono consentiti parametri con puntini di sospensione",
|
||||
"il parametro senza nome nell'espressione requires non ha alcun effetto",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"file di modulo",
|
||||
"non è stato possibile trovare il file di modulo per il modulo %sq",
|
||||
"non è stato possibile importare il file di modulo %sq",
|
||||
"è previsto il file di modulo %s1, ma è stato trovato il file di modulo %s2",
|
||||
"è previsto %s1, ma è stato trovato %s2",
|
||||
"durante l'apertura del file di modulo %sq",
|
||||
"il nome di partizione %sq è sconosciuto",
|
||||
"sconosciuto",
|
||||
"intestazione importabile",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"imprevisto",
|
||||
"un file di modulo sconosciuto",
|
||||
"un file di modulo intestazione importabile",
|
||||
"un file di modulo EDG",
|
||||
"un file di modulo IFC",
|
||||
"un file di modulo imprevisto",
|
||||
"il tipo del secondo operando %t2 deve avere le stesse dimensioni di %t1",
|
||||
"il tipo deve essere facilmente copiabile",
|
||||
"il tipo %t non è attualmente supportato per la valutazione constexpr di __builtin_bit_cast",
|
||||
@@ -3297,5 +3299,27 @@
|
||||
"questo operatore non è consentito in questo punto. Racchiudere tra parentesi l'espressione new precedente",
|
||||
"uso del concetto non valido",
|
||||
"un operatore di confronto membri impostato come predefinito non può essere qualificato con '&&'",
|
||||
"la funzione di confronto constexpr predefinita chiama la funzione non constexpr %nd"
|
||||
"la funzione di confronto constexpr predefinita chiama la funzione non constexpr %nd",
|
||||
"il confronto di memoria constexpr è supportato solo per gli oggetti intero o matrice di intero di primo livello",
|
||||
"un modello di concetto non può avere vincoli associati",
|
||||
"'export' non è consentito",
|
||||
"l'esportazione di singoli membri di classe non è consentita",
|
||||
"una dichiarazione esportata deve introdurre un nome",
|
||||
"una dichiarazione di esportazione non può contenere una dichiarazione di esportazione (dichiarazione precedente %p)",
|
||||
"una dichiarazione di esportazione non può contenere una dichiarazione di importazione del modulo",
|
||||
"una dichiarazione di esportazione può essere presente solo in un'unità di interfaccia del modulo",
|
||||
"una dichiarazione di esportazione non può esportare un nome con collegamento interno",
|
||||
"la dichiarazione using include %nfd",
|
||||
"la funzione predefinita non è disponibile perché i tipi a virgola mobile __fp16 non sono supportati",
|
||||
"un'espressione requires deve specificare almeno un requisito",
|
||||
"'constinit' non è valida in questo punto",
|
||||
"'constinit' è valida solo per dichiarazioni con durata di archiviazione del thread o statica",
|
||||
"con la variabile constinit è richiesta l'inizializzazione dinamica",
|
||||
"la variabile è stata dichiarata in precedenza con 'constinit' %p",
|
||||
"uso del dichiaratore di funzione non prototipo",
|
||||
"l'argomento non può avere un tipo qualificato da const",
|
||||
"non è consentito un puntatore a membro di un tipo incompleto %t",
|
||||
"l'espansione del pacchetto in init-capture non è abilitata in questa modalità",
|
||||
"l'espansione del pacchetto in init-capture è una funzionalità di C++20",
|
||||
"un operatore di confronto impostato come predefinito in una definizione di classe deve essere la prima dichiarazione di tale operatore di confronto (%nd)"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"再定義できない無効な値です",
|
||||
"関数修飾子が重複しています",
|
||||
"char16_t リテラルには無効な文字です",
|
||||
"__LPREFIX は char8_t、char16_t、または char32_t リテラルに適用できません",
|
||||
null,
|
||||
"呼び出し規約 %s は認識されないため、次のいずれかを使用する必要があります:",
|
||||
null,
|
||||
null,
|
||||
@@ -2065,7 +2065,7 @@
|
||||
"戻り値の型 cli::pin_ptr は使用できません",
|
||||
"属性 %sq は %[C++/CLI] モードでのみ適用されます",
|
||||
"単純 (非追跡) 参照はマネージド ヒープ上のエンティティにバインドできません",
|
||||
"ポータブル アセンブリ",
|
||||
"移植可能なアセンブリ",
|
||||
"'%s' は既定のアセンブリから読み込まれません",
|
||||
"リスト初期化構文は C++11 の機能です",
|
||||
"sizeof のオペランドは ref クラス型やインターフェイス クラス型であってはなりません",
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"*this のキャプチャはこのモードでは非標準です",
|
||||
"C++17 スタイルの 'using' 属性プレフィックスはこのモードでは非標準です",
|
||||
"C++17 スタイルの入れ子になった名前空間はこのモードでは非標準です",
|
||||
"宣言で 'constexpr' および 'consteval' の両方を使用することはできません",
|
||||
"宣言で使用できるのは、'constexpr'、'consteval'、および 'constinit'のうちの 1 つのみです",
|
||||
"このモードでは、関数に consteval と virtual の両方を指定することはできません",
|
||||
"明示的なインスタンス化ディレクティブでは 'consteval' を使用できません",
|
||||
"ここでは 'consteval' は無効です",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"'internal_linkage' 属性は、前の宣言では使用されませんでした",
|
||||
"%n の有効なテンプレート引数演繹候補が見つかりませんでした",
|
||||
"完全修飾コンストラクターの呼び出しは許可されていません",
|
||||
"比較演算子は、クラス定義でのみ既定値にすることができます",
|
||||
"既定の比較演算子は、適用先のクラスのメンバーまたはフレンドでなければなりません。",
|
||||
"既定の比較演算子のパラメーターの型 %t が正しくありません ('const X' への参照でなければなりません。X は、囲むクラスの型です)",
|
||||
"既定の比較演算子の戻り値の型は 'bool' である必要があります",
|
||||
"既定のメンバー比較演算子は 'const' である必要があります",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await は範囲ベースの for ステートメントにのみ適用できます",
|
||||
"範囲ベースの 'for' ループの範囲の種類を推測できません",
|
||||
"インライン変数は C++17 の機能です",
|
||||
"destroying operator delete には、最初のパラメーターとして %t が必要です",
|
||||
"destroying operator delete に、std::size_t および std::align_val_t 以外のパラメーターを指定することはできません",
|
||||
"緩和された抽象クラス オプションは C++ をコンパイルするときにのみ使用できます",
|
||||
"requires 句の式の先頭が無効です",
|
||||
"requires 句内のキャスト式はかっこで囲む必要があります",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"コンセプト テンプレート",
|
||||
"requires 句は %nfd と互換性がありません",
|
||||
"属性が必要です",
|
||||
"要件の開始が無効です",
|
||||
null,
|
||||
"型名が必要です",
|
||||
"requires 式では省略記号パラメーターは許可されていません",
|
||||
"requires 式に名前のないパラメーターを指定しても効果がありません",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"モジュール ファイル",
|
||||
"モジュール %sq のモジュール ファイルが見つかりませんでした",
|
||||
"モジュール ファイル %sq をインポートできませんでした",
|
||||
"%s1 モジュール ファイルが必要ですが、%s2 モジュール ファイルが見つかりました",
|
||||
"%s1 が必要ですが、%s2 が見つかりました",
|
||||
"モジュール ファイル %sq を開くとき",
|
||||
"不明なパーティション名 %sq",
|
||||
"不明",
|
||||
"インポート可能なヘッダー",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"予期しない",
|
||||
"不明なモジュール ファイル",
|
||||
"インポート可能なヘッダー モジュール ファイル",
|
||||
"EDG モジュール ファイル",
|
||||
"IFC モジュール ファイル",
|
||||
"予期しないモジュール ファイル",
|
||||
"第 2 オペランド %t2 の型は、%t1 と同じサイズである必要があります",
|
||||
"型は普通にコピー可能である必要があります",
|
||||
"型 %t は、現在、__builtin_bit_cast の constexpr 評価ではサポートされていません",
|
||||
@@ -3297,5 +3299,27 @@
|
||||
"この演算子はこの時点では許可されていません。先行する新しい式をかっこで囲んでください",
|
||||
"概念が正しく使用されていません",
|
||||
"既定のメンバー比較演算子を '&&' で修飾することはできません",
|
||||
"既定の constexpr 比較関数は、constexpr ではない関数 %nd を呼び出します"
|
||||
"既定の constexpr 比較関数は、constexpr ではない関数 %nd を呼び出します",
|
||||
"constexpr のメモリ比較は、トップレベルの整数または整数の配列オブジェクトでのみサポートされています",
|
||||
"概念テンプレートに関連する制約を持たせることはできません",
|
||||
"[エクスポート] は許可されていません",
|
||||
"個別のクラス メンバーのエクスポートは許可されていません",
|
||||
"エクスポートされた宣言は名前を導入する必要があります",
|
||||
"エクスポート宣言にエクスポート宣言を含めることはできません (前の宣言 %p)",
|
||||
"エクスポート宣言にモジュール インポート宣言を含めることはできません",
|
||||
"エクスポート宣言はモジュール インターフェイス ユニットでのみ使用できます",
|
||||
"エクスポート宣言では、内部リンケージを含む名前をエクスポートできません",
|
||||
"using 宣言には %nfd が含まれます",
|
||||
"fp16 の浮動小数点型がサポートされていないので、ビルトイン関数を使用できません(__F)",
|
||||
"requires 式には少なくとも 1 つの要件を指定する必要があります",
|
||||
"ここでは 'constinit' は無効です",
|
||||
"'constinit' は、静的またはスレッド ストレージ存続期間を持つ変数の宣言にのみ有効です",
|
||||
"constinit 変数には動的な初期化が必要です",
|
||||
"変数は、以前に 'constinit' %p で宣言されました",
|
||||
"プロトタイプ以外の関数宣言子の使用",
|
||||
"引数に const 修飾型を指定することはできません",
|
||||
"不完全な型 %t のメンバーへのポインターは使用できません",
|
||||
"初期化キャプチャのパック展開はこのモードでは有効ではありません",
|
||||
"初期化キャプチャのパック展開は C++20 の機能です",
|
||||
"クラス定義で既定値にされた比較演算子は、その比較演算子の最初の宣言でなければなりません (%nd)"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"다시 정의할 수 없는 값이 잘못되었습니다.",
|
||||
"중복된 함수 한정자",
|
||||
"char16_t 리터럴에 대한 잘못된 문자",
|
||||
"__LPREFIX를 char8_t, char16_t 또는 char32_t 리터럴에 적용할 수 없습니다.",
|
||||
null,
|
||||
"인식할 수 없는 호출 규칙 %s, 다음 중 하나여야 함:",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"*this 캡처는 이 모드에서 표준이 아닙니다.",
|
||||
"C++17 스타일 'using' 특성 접두사는 이 모드에서 표준이 아닙니다.",
|
||||
"C++17 스타일 중첩 네임스페이스는 이 모드에서 표준이 아닙니다.",
|
||||
"'constexpr' 및 'consteval'을 둘 다 한 선언에서 사용할 수는 없습니다.",
|
||||
"선언에 'constexpr', 'consteval' 및 'constinit' 중 하나만 나타날 수 있습니다.",
|
||||
"이 모드에서 함수가 동시에 consteval 및 virtual일 수는 없습니다.",
|
||||
"'consteval'은 명시적 인스턴스화 지시문에서 사용할 수 없습니다.",
|
||||
"'consteval'은 여기에 유효하지 않습니다.",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"'internal_linkage' 특성이 이전 선언에 나타나지 않았습니다.",
|
||||
"%n에 대한 실행 가능한 템플릿 인수 추론 후보를 찾을 수 없음",
|
||||
"정규화된 생성자 호출은 허용되지 않습니다.",
|
||||
"비교 연산자는 클래스 정의에서 기본값으로만 사용할 수 있습니다.",
|
||||
"기본 비교 연산자는 적용되는 클래스의 멤버 또는 friend여야 합니다.",
|
||||
"기본 비교 연산자의 매개 변수에 대한 잘못된 형식 %t('const X에 대한 참조'여야 함, 여기서 X는 바깥쪽 클래스 형식임)",
|
||||
"기본 비교 연산자의 반환 형식은 'bool'이어야 합니다.",
|
||||
"기본 멤버 비교 연산자는 'cost'여야 합니다.",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await는 범위 기반의 for 문에만 적용할 수 있습니다.",
|
||||
"범위 기반의 'for' 루프에서 범위 형식을 추론할 수 없습니다.",
|
||||
"인라인 변수는 C++17 기능입니다.",
|
||||
"destroying operator delete에는 첫 번째 매개 변수로 %t이(가) 필요합니다.",
|
||||
"destroying operator delete는 std::size_t 및 std::align_val_t 이외의 매개 변수를 가질 수 없습니다.",
|
||||
"낮은 수준의 추상 클래스 옵션은 C++를 컴파일할 경우에만 사용할 수 있습니다.",
|
||||
"requires 절에서 식의 시작이 잘못되었습니다.",
|
||||
"requires 절의 캐스트 식은 괄호로 묶어야 합니다.",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"개념 템플릿",
|
||||
"requires 절이 %nfd과(와) 호환되지 않습니다.",
|
||||
"특성이 필요합니다.",
|
||||
"요구 사항의 시작이 잘못되었습니다.",
|
||||
null,
|
||||
"형식 이름이 필요합니다.",
|
||||
"requires 식에는 가변 매개 변수(...)를 사용할 수 없습니다.",
|
||||
"requires 식의 명명되지 않은 매개 변수는 영향을 주지 않습니다.",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"모듈 파일",
|
||||
"모듈 %sq의 모듈 파일을 찾을 수 없습니다.",
|
||||
"모듈 파일 %sq을(를) 가져올 수 없습니다.",
|
||||
"%s1 모듈 파일이 필요한데 %s2 모듈 파일이 발견되었습니다.",
|
||||
"%s1이(가) 필요한데, %s2이(가) 발견되었습니다.",
|
||||
"%sq 모듈 파일을 열 때",
|
||||
"알 수 없는 파티션 이름 %sq",
|
||||
"알 수 없음",
|
||||
"가져올 수 있는 헤더",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"예기치 않음",
|
||||
"알 수 없는 모듈 파일",
|
||||
"가져올 수 있는 헤더 모듈 파일",
|
||||
"EDG 모듈 파일",
|
||||
"IFC 모듈 파일",
|
||||
"예기치 않은 모듈 파일",
|
||||
"두 번째 피연산자 %t2의 형식은 %t1과(와) 크기가 같아야 합니다.",
|
||||
"형식은 일반적으로 복사할 수 있어야 합니다.",
|
||||
"%t 형식은 현재 __builtin_bit_cast의 constexpr 평가에서 지원되지 않습니다.",
|
||||
@@ -3293,9 +3295,31 @@
|
||||
"생성자를 상속하기 위해 %t의 하위 개체를 생성할 수 없습니다. 암시적 기본 생성자가 삭제됩니다.",
|
||||
"%n은(는) void를 반환해야 합니다.",
|
||||
"잘못된 멤버 선언 시작",
|
||||
"'자동' 필요",
|
||||
"'auto'가 필요합니다.",
|
||||
"이 시점에 이 연산자를 사용할 수 없습니다. 앞의 새 식을 괄호로 묶으세요.",
|
||||
"잘못된 개념 사용",
|
||||
"기본 멤버 비교 연산자는 '&&'-qualified일 수 없습니다.",
|
||||
"기본 constexpr 비교 함수에서 비 constexpr 함수 %nd 호출"
|
||||
"기본 constexpr 비교 함수에서 비 constexpr 함수 %nd 호출",
|
||||
"constexpr 메모리 비교는 최상위 정수 또는 정수 배열 개체에 대해서만 지원됩니다.",
|
||||
"개념 템플릿에는 관련된 제약 조건이 있을 수 없습니다.",
|
||||
"'export'는 허용되지 않습니다.",
|
||||
"개별 클래스 멤버를 내보낼 수 없습니다.",
|
||||
"내보낸 선언은 이름이 있어야 합니다.",
|
||||
"내보내기 선언은 내보내기 선언(이전 선언 %p)을 포함할 수 없습니다.",
|
||||
"내보내기 선언은 모듈 가져오기 선언을 포함할 수 없습니다.",
|
||||
"내보내기 선언은 모듈 인터페이스 단위에만 나타날 수 있습니다.",
|
||||
"내보내기 선언은 내부 링크가 있는 이름을 내보낼 수 없습니다.",
|
||||
"using 선언에 %nfd가 포함되어 있습니다.",
|
||||
"__fp16 부동 소수점 형식이 지원되지 않으므로 기본 제공 함수를 사용할 수 없습니다.",
|
||||
"requires 식은 하나 이상의 요구 사항을 지정해야 합니다.",
|
||||
"'constinit'는 여기에 유효하지 않습니다.",
|
||||
"'constinit'는 정적 또는 스레드 저장 기간을 사용하는 변수 선언에만 유효합니다.",
|
||||
"constinit 변수에는 동적 초기화가 필요합니다.",
|
||||
"변수가 이전에 'constinit' %p(으)로 선언되었습니다.",
|
||||
"프로토타입 함수가 아닌 함수 선언자를 사용합니다.",
|
||||
"인수에는 const 한정 형식을 사용할 수 없습니다.",
|
||||
"불완전한 형식 %t의 멤버 포인터는 사용할 수 없습니다.",
|
||||
"init-capture의 팩 확장은 이 모드에서 사용할 수 없습니다.",
|
||||
"init-capture의 팩 확장은 C++20 기능입니다.",
|
||||
"클래스 정의의 기본 비교 연산자는 해당 비교 연산자(%nd)의 첫 번째 선언이어야 합니다."
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"nieprawidłowa wartość flagi cannot-redefine",
|
||||
"zduplikowany modyfikator funkcji",
|
||||
"nieprawidłowy znak dla literału char16_t",
|
||||
"Nie można zastosować makra __LPREFIX do literałów char8_t, char16_t ani char32_t",
|
||||
null,
|
||||
"nierozpoznana konwencja wywoływania %s. Musi ona być jedną z następujących:",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"przechwycenie wyrażenia *this jest niestandardowe w tym trybie",
|
||||
"prefiks atrybutu „using” zgodny ze specyfikacją C++17 jest niestandardowy w tym trybie",
|
||||
"zagnieżdżone przestrzenie nazw zgodne ze specyfikacją C++17 są niestandardowe w tym trybie",
|
||||
"słowa kluczowe „constexpr” i „consteval” nie mogą występować razem w deklaracji",
|
||||
"tylko jeden element „constexpr, „consteval” i „constinit” może występować w deklaracji",
|
||||
"funkcja nie może być jednocześnie zadeklarowana jako consteval i virtual w tym trybie",
|
||||
"słowo kluczowe „consteval” jest niedozwolone dla jawnej dyrektywy tworzenia wystąpienia",
|
||||
"słowo kluczowe „consteval” nie jest prawidłowe w tym miejscu",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"atrybut „internal_linkage” nie pojawił się we wcześniejszej deklaracji",
|
||||
"nie znaleziono zdatnego kandydata wnioskowania argumentu szablonu dla elementu %n",
|
||||
"wywołanie w pełni kwalifikowanego konstruktora jest niedozwolone",
|
||||
"operator porównania może być tylko domyślny w definicji klasy",
|
||||
"przyjęty domyślnie operator porównania musi być składową lub elementem zaprzyjaźnionym klasy, do której ma zastosowanie",
|
||||
"nieprawidłowy typ %t parametru domyślnego operatora porównania (wymagany jest typ „reference to const X”, gdzie X jest typem klasy otaczającej)",
|
||||
"zwracanym typem domyślnego operatora porównania musi być „bool”",
|
||||
"domyślny operator porównania elementu członkowskiego musi mieć wartość „const”",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"element co_await można zastosować tylko do instrukcji for opartej na zakresie",
|
||||
"nie można wywnioskować typu zakresu w pętli „for” opartej na zakresie.",
|
||||
"zmienne wbudowane to funkcja języka C++ 17",
|
||||
"niszczący operator delete wymaga elementu %t jako pierwszego parametru",
|
||||
"niszczący operator delete nie może mieć parametrów innych niż std::size_t i std::align_val_t",
|
||||
"opcje swobodnej klasy abstrakcyjnej mogą być używane tylko podczas kompilowania kodu C++",
|
||||
"nieprawidłowy początek wyrażenia w klauzuli requires",
|
||||
"wyrażenie rzutowania w klauzuli requires musi być ujęte w nawiasy",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"szablon koncepcji",
|
||||
"klauzula requires jest niezgodna z elementem %nfd",
|
||||
"oczekiwano atrybutu",
|
||||
"nieprawidłowy początek wymagania",
|
||||
null,
|
||||
"oczekiwano nazwy typu",
|
||||
"parametr wielokropka nie jest dozwolony w wyrażeniu requires",
|
||||
"parametr bez nazwy wyrażeniu requires nie ma żadnego wpływu",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"plik modułu",
|
||||
"nie można odnaleźć pliku modułu dla modułu %sq",
|
||||
"nie można zaimportować pliku modułu %sq",
|
||||
"oczekiwano pliku modułu %s1, a zamiast tego znaleziono plik modułu %s2",
|
||||
"oczekiwano elementu %s1, zamiast niego znaleziono element %s2",
|
||||
"podczas otwierania pliku modułu %sq",
|
||||
"nieznana nazwa partycji %sq",
|
||||
"nieznany",
|
||||
"nagłówek, który można zaimportować",
|
||||
"element EDG",
|
||||
"obiekt IFC",
|
||||
"nieoczekiwany",
|
||||
"nieznany plik modułu",
|
||||
"plik modułu z importowalnym nagłówkiem",
|
||||
"plik modułu EDG",
|
||||
"plik modułu IFC",
|
||||
"nieoczekiwany plik modułu",
|
||||
"typ drugiego operandu %t2 musi mieć taki sam rozmiar jak element %t1",
|
||||
"typ musi być możliwy do skopiowania w prosty sposób",
|
||||
"typ %t nie jest obecnie obsługiwany na potrzeby oceny wyrażenia constexpr dla elementu __builtin_bit_cast",
|
||||
@@ -3293,9 +3295,31 @@
|
||||
"nie można wykonać konstrukcji podobiektu %t na potrzeby dziedziczenia konstruktorów — niejawny konstruktor domyślny został usunięty",
|
||||
"Element %n musi zwracać wartość void",
|
||||
"nieprawidłowy początek deklaracji członkowskiej",
|
||||
"oczekiwano wartości „auto”",
|
||||
"oczekiwano elementu „auto”",
|
||||
"ten operator jest niedozwolony w tym miejscu; umieść w nawiasie poprzednie nowe wyrażenie",
|
||||
"nieprawidłowe użycie koncepcji",
|
||||
"domyślny operator porównania elementu członkowskiego nie może być kwalifikowany przez element „&&”",
|
||||
"domyślna funkcja porównywania constexpr wywołuje funkcję non-constexpr %nd"
|
||||
"domyślna funkcja porównywania constexpr wywołuje funkcję non-constexpr %nd",
|
||||
"Porównywanie pamięci constexpr jest obsługiwane tylko w przypadku obiektów najwyższego poziomu w postaci liczby całkowitej lub obiektów typu tablica liczb całkowitych",
|
||||
"z szablonem koncepcji nie mogą być skojarzone ograniczenia",
|
||||
"Polecenie „export” jest niedozwolone",
|
||||
"eksportowanie pojedynczych elementów członkowskich klasy jest niedozwolone",
|
||||
"wyeksportowana deklaracja musi wprowadzić nazwę",
|
||||
"deklaracja eksportu nie może zawierać deklaracji eksportu (poprzednia deklaracja %p)",
|
||||
"deklaracja eksportu nie może zawierać deklaracji importu modułu",
|
||||
"deklaracja eksportu może występować tylko w jednostce interfejsu modułu",
|
||||
"deklaracja eksportu nie może eksportować nazwy z powiązaniem wewnętrznym",
|
||||
"deklaracja using zawiera %nfd",
|
||||
"funkcja wbudowana jest niedostępna, ponieważ typy liczb zmiennoprzecinkowych __fp16 nie są obsługiwane",
|
||||
"wyrażenie requires musi określać co najmniej jedno wymaganie",
|
||||
"słowo kluczowe „constinit” nie jest tutaj prawidłowe",
|
||||
"element „constinit” jest prawidłowy tylko w deklaracjach zmiennych z czasem trwania magazynowania statycznym lub wątku",
|
||||
"Zmienna constinit wymaga inicjowania dynamicznego",
|
||||
"zmienna została wcześniej zadeklarowana za pomocą elementu „constinit” %p",
|
||||
"Używanie nieprototypowego deklaratora funkcji",
|
||||
"argument nie może mieć typu kwalifikowanego jako const",
|
||||
"wskaźnik do składowej niepełnego typu %t jest niedozwolony",
|
||||
"rozszerzenie pakietu w funkcji init-capture nie jest włączone w tym trybie",
|
||||
"rozszerzenie pakietu w funkcji init-capture to funkcja języka C++20",
|
||||
"operator porównania przyjęty domyślnie w definicji klasy musi być pierwszą deklaracją tego operatora porównania (%nd)"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"valor de não pode definir novamente inválido",
|
||||
"modificador de função duplicado",
|
||||
"caractere inválido para literal char16_t",
|
||||
"O __LPREFIX não pode ser aplicado aos literais char8_t, char16_t ou char32_t",
|
||||
null,
|
||||
"convenção de chamadas não reconhecida %s, deve ser um dos:",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"a captura de *this está fora do padrão neste modo",
|
||||
"O atributo 'using' de estilo C++17 está fora do padrão neste modo",
|
||||
"Os namespaces aninhados de estilo C++17 estão fora do padrão neste modo",
|
||||
"'constexpr' e 'consteval' não podem aparecer juntos em uma declaração",
|
||||
"somente uma das opções: 'constexpr', 'consteval' e 'constinit' pode aparecer em uma declaração",
|
||||
"uma função não pode ser tanto consteval quanto virtual neste modo",
|
||||
"'consteval' não é permitido em uma diretiva explícita de instanciação",
|
||||
"'consteval' não é válido aqui",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"o atributo 'internal_linkage' não apareceu em uma declaração anterior",
|
||||
"não foi encontrado nenhum candidato viável à dedução de argumento de modelo para %n",
|
||||
"uma chamada de construtor totalmente qualificada não é permitida",
|
||||
"um operador de comparação pode ser usado como padrão somente em uma definição de classe",
|
||||
"um operador de comparação usado como padrão precisa ser um membro ou um friend da classe à qual se aplica",
|
||||
"tipo incorreto %t para o parâmetro do operador de comparação usado como padrão (precisa ser 'referência à const X', em que X é o tipo de classe delimitadora)",
|
||||
"o tipo de retorno do operador de comparação usado como padrão precisa ser 'bool'",
|
||||
"um operador de comparação de membros usado como padrão precisa ser 'const'",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await pode ser aplicado somente a uma instrução 'for' baseada em intervalos",
|
||||
"não é possível deduzir o tipo de intervalo no loop 'for' com base em intervalos",
|
||||
"as variáveis embutidas são um recurso do C++17",
|
||||
"a destruição do operador de exclusão exige %t como primeiro parâmetro",
|
||||
"a destruição de um operador de exclusão não pode ter parâmetros diferentes de std::size_t e std::align_val_t",
|
||||
"opções de classe abstrata reduzidas podem ser usadas somente ao compilar C++",
|
||||
"início de expressão inválido na cláusula requires",
|
||||
"uma expressão de conversão em uma cláusula requires precisa estar entre parênteses",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"modelo de conceito",
|
||||
"cláusula requires incompatível com %nfd",
|
||||
"um atributo é esperado",
|
||||
"início de requisito inválido",
|
||||
null,
|
||||
"um nome de tipo é esperado",
|
||||
"um parâmetro de reticências não é permitido em uma expressão requires",
|
||||
"o parâmetro sem nome na expressão requires não tem efeito",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"arquivo de módulo",
|
||||
"não foi possível localizar o arquivo de módulo para o módulo %sq",
|
||||
"não foi possível importar o arquivo de módulo %sq",
|
||||
"o arquivo de módulo %s1 era esperado; em vez dele, foi encontrado o arquivo de módulo %s2",
|
||||
"era esperado %s1, foi encontrado %s2",
|
||||
"ao abrir o arquivo de módulo %sq",
|
||||
"nome de partição desconhecido %sq",
|
||||
"um desconhecido",
|
||||
"um cabeçalho importável",
|
||||
"um EDG",
|
||||
"um IFC",
|
||||
"um inesperado",
|
||||
"um arquivo de módulo desconhecido",
|
||||
"um arquivo de módulo de cabeçalho importável",
|
||||
"um arquivo de módulo EDG",
|
||||
"um arquivo de módulo IFC",
|
||||
"um arquivo de módulo inesperado",
|
||||
"o tipo do segundo operando %t2 precisa ter o mesmo tamanho que %t1",
|
||||
"o tipo precisa ser fácil de ser copiado",
|
||||
"no momento, não há suporte para o tipo %t para a avaliação constexpr de __builtin_bit_cast",
|
||||
@@ -3293,9 +3295,31 @@
|
||||
"a construção de subobjeto de %t para construtores herdados não pode ser executada. O construtor padrão implícito foi excluído",
|
||||
"%n precisa retornar nulo",
|
||||
"declaração de início de membro inválida",
|
||||
"'auto' esperado",
|
||||
"'auto' era esperado",
|
||||
"este operador não é permitido neste ponto; coloque parênteses na nova expressão anterior",
|
||||
"uso inválido do conceito",
|
||||
"um operador de comparação de membros usado como padrão não pode ser qualificado por '&&'",
|
||||
"a função de comparação constexpr padrão chama a função não constexpr %nd"
|
||||
"a função de comparação constexpr padrão chama a função não constexpr %nd",
|
||||
"só há suporte para a comparação de memória constexpr para os objetos inteiros de nível superior ou matriz de inteiro",
|
||||
"um modelo de conceito não pode ter restrições associadas",
|
||||
"'export' não é permitido",
|
||||
"a exportação de membros de classe individuais não é permitida",
|
||||
"uma declaração exportada precisa introduzir um nome",
|
||||
"uma declaração export não pode conter uma declaração export (declaração anterior %p)",
|
||||
"uma declaração de exportação não pode conter uma declaração de importação de módulo",
|
||||
"uma declaração export só pode aparecer em uma unidade de interface de módulo",
|
||||
"uma declaração export não pode exportar um nome com vínculo interno",
|
||||
"a declaração using inclui %nfd",
|
||||
"a função interna não está disponível porque não há suporte para tipos de ponto flutuante __fp16",
|
||||
"uma expressão requires precisa especificar pelo menos um requisito",
|
||||
"'constinit' não é válido aqui",
|
||||
"'constinit' só é válido para declarações de variáveis com duração de armazenamento estática ou de thread",
|
||||
"a variável constinit requer uma inicialização dinâmica",
|
||||
"a variável foi declarada anteriormente com 'constinit' %p",
|
||||
"uso de declarador de função sem protótipo",
|
||||
"o argumento não pode ter um tipo qualificado como const",
|
||||
"um ponteiro para membro de um tipo incompleto %t não é permitido",
|
||||
"a expansão de pacote em init-capture não está habilitada neste modo",
|
||||
"a expansão de pacote em init-capture é um recurso do C++20",
|
||||
"um operador de comparação usado como padrão em uma definição de classe precisa ser a primeira declaração desse operador de comparação (%nd)"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"недопустимое значение cannot-redefine",
|
||||
"повторяющийся модификатор функции",
|
||||
"недопустимый знак для литерала char16_t",
|
||||
"__LPREFIX не может применяться к литералам char8_t, char16_t или char32_t",
|
||||
null,
|
||||
"нераспознанное соглашение о вызовах %s; необходимо использовать одно из следующих:",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"захват значения *this является нестандартным в этом режиме",
|
||||
"Префикс атрибута using в стиле C++17 является нестандартным в этом режиме",
|
||||
"Вложенные пространства имен в стиле C++17 являются нестандартными в этом режиме",
|
||||
"constexpr и consteval не могут присутствовать в объявлении вместе",
|
||||
"в объявлении может использоваться только одно из ключевых слов \"constexpr\", \"consteval\" и \"constinit\"",
|
||||
"в этом режиме функция не может быть consteval и virtual одновременно",
|
||||
"consteval не допускается в директиве явного создания экземпляра",
|
||||
"consteval здесь не допускается",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"атрибут \"internal_linkage\" отсутствует в предыдущем объявлении",
|
||||
"Не найдено подходящего кандидата для дедукции аргумента шаблона для %n.",
|
||||
"полный вызов конструктора не допускается",
|
||||
"оператор сравнения можно использовать по умолчанию только в определении класса",
|
||||
"оператор сравнения по умолчанию должен быть членом или дружественным классом класса, к которому он применяется",
|
||||
"недопустимый тип %t для параметра оператора сравнения по умолчанию (необходимо указать ссылку на константу X, где X — тип включающего класса)",
|
||||
"необходимо использовать возвращаемый тип оператора сравнения по умолчанию \"bool\"",
|
||||
"необходимо использовать оператор сравнения элемента по умолчанию \"const\"",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await можно применить только к оператору for на основе диапазонов.",
|
||||
"Невозможно вывести тип диапазона в цикле for на основе диапазона.",
|
||||
"встроенные переменные — это функция C++17",
|
||||
"для оператора удаления delete необходимо указать %t в качестве первого параметра",
|
||||
"оператор удаления delete не может иметь параметров, типы которых отличаются от std::size_t и std::align_val_t",
|
||||
"Нестрогие параметры абстрактного класса можно использовать только при компиляции C++.",
|
||||
"Недопустимое начало выражения в предложении requires",
|
||||
"Выражение приведения в предложении requires должно быть заключено в круглые скобки",
|
||||
@@ -3245,12 +3247,12 @@
|
||||
"Определение концепции не может находиться в этой области",
|
||||
"Недопустимое повторное объявление %nd",
|
||||
"Не удалось подставить аргументы для идентификатора концепции",
|
||||
"Концепция имеет значение false",
|
||||
"концепция имеет значение false",
|
||||
"Использование здесь предложения requires запрещено (не шаблонная функция)",
|
||||
"Шаблон концепции",
|
||||
"шаблон концепции",
|
||||
"Предложение requires несовместимо с %nfd",
|
||||
"требуется атрибут",
|
||||
"Недопустимое начало требования",
|
||||
"ожидается атрибут",
|
||||
null,
|
||||
"Требуется имя типа",
|
||||
"Использование параметра-многоточия в выражении requires запрещено",
|
||||
"Неименованный параметр в выражении requires не оказывает никакого влияния",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"файл модуля",
|
||||
"не удалось найти файл модуля для модуля %sq",
|
||||
"не удалось импортировать файл модуля %sq",
|
||||
"Ожидался файл модуля %s1, вместо него обнаружен файл модуля %s2",
|
||||
"ожидалось \"%s1\", но было использовано \"%s2\"",
|
||||
"При открытии файла модуля %sq",
|
||||
"Неизвестное имя раздела %sq",
|
||||
"неизвестный",
|
||||
"Пригодный для импорта заголовок",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"непредвиденный",
|
||||
"неизвестный файл модуля",
|
||||
"импортируемый файл модуля заголовка",
|
||||
"файл модуля EDG",
|
||||
"файл модуля IFC",
|
||||
"непредвиденный файл модуля",
|
||||
"тип второго операнда %t2 должен иметь тот же размер, что и %t1.",
|
||||
"тип должен поддерживать элементарное копирование.",
|
||||
"тип %t сейчас не поддерживается в вычислении constexpr для __builtin_bit_cast.",
|
||||
@@ -3293,9 +3295,31 @@
|
||||
"невозможно выполнить конструирование подобъекта %t для наследования конструкторов — неявный конструктор по умолчанию удален.",
|
||||
"%n требует возврата void.",
|
||||
"недопустимое начало объявления элемента",
|
||||
"требуется \"auto\"",
|
||||
"ожидается \"auto\"",
|
||||
"этот оператор не может использоваться в этом месте; заключите предыдущее выражение new в скобки",
|
||||
"недопустимое использование концепции",
|
||||
"оператор сравнения элемента по умолчанию не может быть квалифицирован как \"&&\"",
|
||||
"функция сравнения constexpr по умолчанию вызывает функцию %nd, не являющуюся constexpr"
|
||||
"функция сравнения constexpr по умолчанию вызывает функцию %nd, не являющуюся constexpr",
|
||||
"Сравнение памяти с помощью constexpr поддерживается только для целочисленных объектов верхнего уровня или массивов целых чисел",
|
||||
"шаблон концепции не может иметь связанные ограничения",
|
||||
"использование \"export\" запрещено",
|
||||
"экспорт отдельных членов класса запрещен",
|
||||
"экспортированное объявление должно представлять имя",
|
||||
"объявление экспорта не может содержать объявление экспорта (предыдущее объявление %p)",
|
||||
"объявление экспорта не может содержать объявление импорта модуля",
|
||||
"объявление экспорта может находиться только в блоке интерфейса модуля",
|
||||
"объявление экспорта не может экспортировать имя с внутренней компоновкой",
|
||||
"объявление using включает %nfd",
|
||||
"встроенная функция недоступна, так как типы с плавающей запятой __fp16 не поддерживаются",
|
||||
"в выражении requires должно быть указано по крайней мере одно требование",
|
||||
"\"constinit\" не может использоваться здесь",
|
||||
"\"constinit\" может использоваться только для объявлений переменных со сроком хранения в статическом или потоковом хранилище",
|
||||
"для переменной constinit требуется динамическая инициализация",
|
||||
"переменная ранее была объявлена с \"constinit\" %p",
|
||||
"использование объявления функции, не являющегося прототипом",
|
||||
"аргумент не может иметь тип, квалифицированный как const",
|
||||
"недопустимый указатель на член неполного типа %t",
|
||||
"расширение пакета в init-capture не включено в этом режиме",
|
||||
"расширение пакета в init-capture — это функция C++ 20",
|
||||
"оператор сравнения по умолчанию в определении класса должен быть первым объявлением этого оператора сравнения (%nd)"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"yeniden tanımlanamaz değeri geçersiz",
|
||||
"işlev değiştiricisi yineleniyor",
|
||||
"char16_t sabit değeri için geçersiz karakter",
|
||||
"__LPREFIX, char8_t, char16_t veya char32_t sabit değerlerine uygulanamıyor",
|
||||
null,
|
||||
"çağrı kuralı %s tanınmıyor, şunlardan biri olmalıdır:",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"* yakalama bu modda standart dışı",
|
||||
"C++17 stili 'using' öznitelik ön eki bu modda standart dışı",
|
||||
"C++17 stili iç içe geçmiş ad alanları bu modda standart dışı",
|
||||
"'constexpr' ve 'consteval' bir bildirimde birlikte bulunamaz",
|
||||
"bir bildirimde yalnızca bir 'constexpr', 'consteval' ve 'constinit' görünebilir",
|
||||
"bu modda bir işlev hem consteval hem de sanal olamaz",
|
||||
"Açık örnek oluşturma yönergesinde 'consteval' öğesine izin verilmez",
|
||||
"'consteval' burada geçerli değildir",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"'internal_linkage' özniteliği önceki bir bildirimde görünmedi",
|
||||
"%n için uygun bir şablon bağımsız değişkeni çıkarsama adayı bulunamadı",
|
||||
"tam oluşturucu çağrısına izin verilmiyor",
|
||||
"karşılaştırma işleci yalnızca sınıf tanımında varsayılan olarak ayarlanabilir",
|
||||
"varsayılan olarak kullanılan karşılaştırma işleci, uygulandığı sınıfın bir üyesi veya arkadaşı olmalıdır",
|
||||
"varsayılan olarak ayarlanan karşılaştırma işlecinin parametresi için %t türü hatalı ('const X başvurusu' olmalıdır; burada X, kapsayan sınıf türüdür)",
|
||||
"varsayılan olarak ayarlanan karşılaştırma işlecinin dönüş türü 'bool' olmalıdır",
|
||||
"varsayılan olarak ayarlanan üye karşılaştırma işleci 'const' olmalıdır",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await yalnızca aralık tabanlı for deyimine uygulanabilir",
|
||||
"aralık tabanlı 'for' döngüsündeki aralık türü çıkarsanamıyor",
|
||||
"satır içi değişkenler bir C++17 özelliğidir",
|
||||
"yok etme işleci silme işlemi birinci parametre olarak %t gerektirir",
|
||||
"yok etme işleci silme, std::size_t ve std::align_val_t dışında parametrelere sahip olamaz",
|
||||
"kısıtlanmamış soyut sınıf seçenekleri yalnızca C++ derlenirken kullanılabilir",
|
||||
"requires yan tümcesindeki ifadenin başlangıcı geçersiz",
|
||||
"requires yan tümcesindeki tür dönüştürme ifadesi ayraç içine alınmalıdır",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"kavram şablonu",
|
||||
"requires yan tümcesi %nfd ile uyumsuz",
|
||||
"öznitelik bekleniyordu",
|
||||
"geçersiz gereksinim başlangıcı",
|
||||
null,
|
||||
"tür adı bekleniyordu",
|
||||
"requires ifadesinde üç nokta parametresine izin verilmez",
|
||||
"requires ifadesindeki adlandırılmamış parametrenin etkisi yok",
|
||||
@@ -3274,28 +3276,50 @@
|
||||
"modül dosyası",
|
||||
"%sq modülü için modül dosyası bulunamadı",
|
||||
"%sq modül dosyası içeri aktarılamadı",
|
||||
"%s1 modül dosyası bekleniyordu ancak bunun yerine %s2 modül dosyası bulundu",
|
||||
"%s1 bekleniyordu ancak bunun yerine %s2 bulundu",
|
||||
"%sq modül dosyası açılırken",
|
||||
"%sq bölüm adı bilinmiyor",
|
||||
"bilinmeyen",
|
||||
"İçeri aktarılabilen üst bilgi",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"beklenmeyen",
|
||||
"bilinmeyen bir modül dosyası",
|
||||
"içeri aktarılabilir üst bilgi modülü dosyası",
|
||||
"EDG modülü dosyası",
|
||||
"IFC modülü dosyası",
|
||||
"beklenmeyen bir modül dosyası",
|
||||
"%t2 ikinci işlenenin türü, %t1 ile aynı boyutta olmalıdır",
|
||||
"tür, üç yana kopyalanabilir olmalıdır",
|
||||
"%t türü şu anda __builtin_bit_cast constexpr değerlendirmesi için desteklenmiyor",
|
||||
"Bitfields %t sahip sınıf türleri, __builtin_bit_cast constexpr değerlendirmesi için şu anda desteklenmiyor",
|
||||
"başvuru türündeki statik olmayan veri üyesi __builtin_bit_cast %t constexpr değerlendirmesi yapılmasını engelliyor",
|
||||
"geçici tür %t __builtin_bit_cast constexpr değerlendirmesi yapılmasını engelliyor",
|
||||
"bir Union, işaretçi veya üye işaretçisi türü %t __builtin_bit_cast constexpr değerlendirmesine engel olur",
|
||||
"bir %t türü birleşim, işaretçi veya üye işaretçisi __builtin_bit_cast constexpr değerlendirmesine engel oluyor",
|
||||
"%npT (decl %p kullanılarak devralındı)",
|
||||
"devralma oluşturucuları için %t alt nesne oluşturma gerçekleştirilemiyor; örtük varsayılan Oluşturucu silindi",
|
||||
"%n void döndürmesi gerekir",
|
||||
"üye bildiriminin başlangıcı geçersiz",
|
||||
"'auto' bekleniyor",
|
||||
"'auto' bekleniyordu",
|
||||
"bu işlece bu noktada izin verilmiyor; önceki yeni ifadeyi parantez içine alın",
|
||||
"kavram kullanımı geçersiz",
|
||||
"varsayılan olarak ayarlanan üye karşılaştırma işleci tam '&&' ile nitelenemez",
|
||||
"varsayılan constexpr karşılaştırma işlevi constexpr olmayan %nd işlevini çağırıyor"
|
||||
"varsayılan constexpr karşılaştırma işlevi constexpr olmayan %nd işlevini çağırıyor",
|
||||
"constexpr bellek karşılaştırması yalnızca üst düzey tamsayı veya tamsayı dizisi nesneleri için desteklenir",
|
||||
"kavram şablonunda ilişkili kısıtlamalar olamaz",
|
||||
"'export'a izin verilmiyor",
|
||||
"sınıf üyelerini tek tek dışarı aktarmaya izin verilmiyor",
|
||||
"dışarı aktarılan bildirim bir ad tanıtmalıdır",
|
||||
"dışarı aktarma bildirimi, dışarı aktarma bildirimi içeremez (önceki bildirim %p)",
|
||||
"dışarı aktarma bildirimi, modül içeri aktarma bildirimi içeremez",
|
||||
"dışarı aktarma bildirimi yalnızca modül arabirim ünitesinde görünebilir",
|
||||
"dışarı aktarma bildirimi, iç bağlantıya sahip bir adı dışarı aktaramaz",
|
||||
"Kullanılan bildirim %nfd içeriyor",
|
||||
"__fp16 kayan nokta türleri desteklenmediği için yerleşik işlev kullanılamıyor",
|
||||
"requires ifadesi en az bir gereksinim belirtmelidir",
|
||||
"'constinit' burada geçerli değil",
|
||||
"'constinit' yalnızca statik veya iş parçacığı depolama süresine sahip değişkenlerin bildirimleri için geçerlidir",
|
||||
"constinit değişkeni dinamik başlatma gerektiriyor",
|
||||
"değişken daha önceden 'constinit' %p ile bildirildi",
|
||||
"prototip olmayan işlev bildiricisi kullanımı",
|
||||
"bağımsız değişken const olarak nitelenmiş bir türe sahip olamaz",
|
||||
"eksik tür %t için işaretçiden üyeye öğesine izin verilmez",
|
||||
"init-capture içinde paket genişletme bu modda etkin değil",
|
||||
"init-capture özelliğindeki paket genişletme bir C++ 20 özelliğidir",
|
||||
"sınıf tanımında varsayılan olarak kullanılan bir karşılaştırma işleci, ilgili karşılaştırma işlecinin ilk bildirimi olmalıdır (%nd)"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"cannot-redefine 值无效",
|
||||
"重复的函数修饰符",
|
||||
"char16_t 文本的无效字符",
|
||||
"__LPREFIX 不可应用于 char8_t、char16_t 或 char32_t 文本",
|
||||
null,
|
||||
"无法识别的调用约定 %s,必须为以下内容之一:",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"正在捕获 *这在此模式中是非标准的",
|
||||
"C++17 样式 \"using\" 属性前缀在此模式中是非标准的",
|
||||
"C++17 样式嵌套命名空间在此模式中是非标准的",
|
||||
"\"constexpr\" 和 \"consteval\" 不能同时出现在声明中",
|
||||
"声明中只能出现 \"constexpr\"、\"consteval\" 和 \"constinit\" 中的一个",
|
||||
"在此模式下,函数不能同时为 consteval 和 virtual",
|
||||
"不允许对显式实例化指令使用 \"consteval\"",
|
||||
"\"consteval\" 在此处无效",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"\"internal_linkage\" 属性未出现在之前的声明中",
|
||||
"未找到 %n 的可行模板参数推导候选项",
|
||||
"不允许使用完全限定的构造函数调用",
|
||||
"仅可在类定义中将比较运算符设为默认值",
|
||||
"默认比较运算符必须是它适用于的类的成员或友元",
|
||||
"默认比较运算符的参数的类型 %t 不正确(必须是“对 const X 的引用”,其中 X 是封闭类类型)",
|
||||
"默认比较运算符的返回类型必须是 \"bool\"",
|
||||
"默认成员比较运算符必须为 \"const\"",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await 只能应用到基于范围的 for 语句",
|
||||
"无法在基于范围的 \"for\" 循环中推断范围类型",
|
||||
"内联变量是 C++17 功能",
|
||||
"销毁运算符 delete 需要 %t 作为第一个参数",
|
||||
"销毁运算符 delete 不能具有 std::size_t 和 std::align_val_t 以外的参数",
|
||||
"宽松抽象类选项只能在编译 C++ 时使用",
|
||||
"requires 子句中表达式的开头无效",
|
||||
"requires 子句中的强制转换表达式必须放在括号中",
|
||||
@@ -3250,7 +3252,7 @@
|
||||
"概念模板",
|
||||
"requires 子句与 %nfd 不兼容",
|
||||
"预期特性",
|
||||
"要求的开头无效",
|
||||
null,
|
||||
"预期类型名称",
|
||||
"requires 表达式中不允许使用省略号参数",
|
||||
"requires 表达式中未命名的参数不起任何作用",
|
||||
@@ -3274,18 +3276,18 @@
|
||||
"模块文件",
|
||||
"找不到模块 %sq 的模块文件",
|
||||
"无法导入模块文件 %sq",
|
||||
"预期 %s1 模块文件,但找到 %s2 模块文件",
|
||||
"预期 %s1,但找到 %s2",
|
||||
"打开模块文件 %sq 时",
|
||||
"未知的分区名称 %sq",
|
||||
"未知",
|
||||
"可导入标头",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"非预期",
|
||||
"未知模块文件",
|
||||
"可导入标头模块文件",
|
||||
"EDG 模块文件",
|
||||
"IFC 模块文件",
|
||||
"意外的模块文件",
|
||||
"第二个操作数的类型 %t2 必须与 %t1 大小相同",
|
||||
"类型必须可轻松复制",
|
||||
"类型 %t 当前不支持对 __builtin_bit_cast 进行 constexpr 计算",
|
||||
"位域为 %t 的类类型不支持对 __builtin_bit_cast 进行 constexpr 计算",
|
||||
"位域为 %t 的类类型当前不支持对 __builtin_bit_cast 进行 constexpr 计算",
|
||||
"引用类型 %t 的非静态数据成员阻止对 __builtin_bit_cast 进行 constexpr 计算",
|
||||
"易失类型 %t 阻止对 __builtin_bit_cast 进行 constexpr 计算",
|
||||
"联合类型、指针类型或指向成员的指针类型 %t 阻止对 __builtin_bit_cast 进行 constexpr 计算",
|
||||
@@ -3297,5 +3299,27 @@
|
||||
"此位置不允许使用此运算符;请前面的新表达式括起来",
|
||||
"概念的使用无效",
|
||||
"默认成员比较运算符不能是 \"&&\" 限定",
|
||||
"默认的 constexpr 比较函数会调用非 constexpr 函数 %nd"
|
||||
"默认的 constexpr 比较函数会调用非 constexpr 函数 %nd",
|
||||
"只有顶级整数或数组整数对象支持 constexpr 内存比较",
|
||||
"概念模板不能具有关联约束",
|
||||
"不允许使用 \"export\"",
|
||||
"不允许导出单个类成员",
|
||||
"导出的声明必须引入名称",
|
||||
"导出声明不能包含导出声明(以前的声明 %p)",
|
||||
"导出声明不能包含模块导入声明",
|
||||
"导出声明只能出现在模块接口单元中",
|
||||
"导出声明无法导出具有内部链接的名称",
|
||||
"using 声明包括 %nfd",
|
||||
"内置函数不可用,因为不支持 __fp16 浮点类型",
|
||||
"requires 表达式必须指定至少一个要求",
|
||||
"\"constinit\" 在此处无效",
|
||||
"\"constinit\" 仅对具有静态或线程存储持续时间的变量的声明有效",
|
||||
"constinit 变量需要动态初始化",
|
||||
"以前使用 \"constinit\" %p 声明了变量",
|
||||
"使用非原型函数声明符",
|
||||
"参数不能具有常量限定类型",
|
||||
"不允许使用不完整类型 %t 的指向成员的指针",
|
||||
"此模式下未启用 init-capture 中的包扩展",
|
||||
"init-capture 中的包扩展是 C++ 20 功能",
|
||||
"类定义中默认的比较运算符必须是该比较运算符的第一个声明(%nd)"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"無法重新定義的值無效",
|
||||
"函式修飾元重複",
|
||||
"char16_t literal 的字元無效",
|
||||
"__LPREFIX 無法套用至 char8_t、char16_t 或 char32_t 常值",
|
||||
null,
|
||||
"無法辨認的呼叫慣例 %s,必須是下列其中一個: ",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"在此模式中擷取 *這個不是標準用法",
|
||||
"在此模式中 C++17 樣式的 'using' 屬性前置詞不是標準用法",
|
||||
"在此模式中 C++17 樣式的巢狀命名空間不是標準用法",
|
||||
"'constexpr' 和 'consteval' 不能同時出現在宣告中",
|
||||
"只有 'constexpr'、'consteval' 或 'constinit' 其中之一可以出現宣告上",
|
||||
"在此模式中函式不可同時為 consteval 和 virtual",
|
||||
"明確具現化指示詞中不允許 'consteval'",
|
||||
"'consteval' 在這裡無效",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"'internal_linkage' 屬性未出現在前一個宣告上",
|
||||
"找不到 %n 的任何可行範本引數推算候選",
|
||||
"不允許完整的建構函式呼叫",
|
||||
"比較運算子只有在類別定義中才能是預設",
|
||||
"預設比較運算子必須是其所套用之類別的成員或 Friend",
|
||||
"預設比較運算子參數的類型 %t 不正確 (必須是 'reference to const X',其中 X 是外層類別類型)",
|
||||
"預設比較運算子的傳回型別必須是 'bool'",
|
||||
"預設的成員比較運算子必須是 'const'",
|
||||
@@ -3233,6 +3233,8 @@
|
||||
"co_await 只能套用至範圍架構 for 陳述式",
|
||||
"無法推算範圍架構 'for' 迴圈中的範圍類型",
|
||||
"內嵌變數為 C++17 功能",
|
||||
"終結運算子 Delete 需要 %t 作為第一個參數",
|
||||
"終結運算子 Delete 不能有除了 std::size_t 與 std::align_val_t 的參數",
|
||||
"寬鬆抽象類別選項只有在編譯 C++ 時才能使用",
|
||||
"requires 子句中運算式的開頭無效",
|
||||
"requires 子句中的 cast 運算式必須以括號括住",
|
||||
@@ -3245,12 +3247,12 @@
|
||||
"概念定義不能出現在此範圍中",
|
||||
"%nd 的重新宣告無效",
|
||||
"概念識別碼的引數替代失敗",
|
||||
"概念為 false",
|
||||
"概念為 False",
|
||||
"此處不允許使用 requires 子句 (非樣板化函式)",
|
||||
"概念範本",
|
||||
"requires 子句與 %nfd 不相容",
|
||||
"必須為屬性名稱",
|
||||
"需求的開頭無效",
|
||||
"必須是屬性",
|
||||
null,
|
||||
"必須為類型名稱",
|
||||
"requires 運算式中不允許使用省略符號參數",
|
||||
"requires 運算式中未命名的參數沒有作用",
|
||||
@@ -3274,14 +3276,14 @@
|
||||
"模組檔案",
|
||||
"找不到模組 %sq 的模組檔案",
|
||||
"無法匯入模組檔案 %sq",
|
||||
"必須為 %s1 模組檔案,但找到 %s2 模組檔案",
|
||||
"必須為 %s1,但找到 %s2",
|
||||
"在開啟模組檔案 %sq 時",
|
||||
"未知的分割名稱 %sq",
|
||||
"未知的",
|
||||
"可匯入的標頭",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"未預期的",
|
||||
"未知的模組檔案",
|
||||
"可匯入的標頭模組檔案",
|
||||
"EDG 模組檔案",
|
||||
"IFC 模組檔案",
|
||||
"未預期的模組檔案",
|
||||
"第二個運算元 %t2 的類型必須與 %t1 的大小相同",
|
||||
"類型必須可以原樣複製",
|
||||
"__builtin_bit_cast 的 constexpr 評估目前不支援類型 %t",
|
||||
@@ -3293,9 +3295,31 @@
|
||||
"無法執行用於繼承建構函式的 %t 子物件建構 -- 已刪除隱含的預設建構函式",
|
||||
"%n 必須傳回 void",
|
||||
"成員宣告開頭無效",
|
||||
"必須為 'auto'",
|
||||
"必須是 'auto'",
|
||||
"目前不允許此運算子; 請以括號括住前面的 new 運算式",
|
||||
"概念使用無效",
|
||||
"預設的成員比較運算子不可限定為 '&&'",
|
||||
"預設 constexpr 比較函式會呼叫非 constexpr 函式 %nd"
|
||||
"預設 constexpr 比較函式會呼叫非 constexpr 函式 %nd",
|
||||
"只有最上層整數或整數陣列物件支援 constexpr 記憶體比較",
|
||||
"概念範本不能具有已建立關聯的條件約束",
|
||||
"不允許 'export'",
|
||||
"不允許匯出個別類別成員",
|
||||
"匯出的宣告必須引入名稱",
|
||||
"匯出宣告不能包含匯出宣告 (前一個宣告 %p)",
|
||||
"匯出宣告不能包含模組匯入宣告",
|
||||
"匯出宣告只能出現在模組介面單位中",
|
||||
"匯出宣告不能匯出具有內部連結的名稱",
|
||||
"using 宣告包含 %nfd",
|
||||
"因為不支援 __fp16 浮點數類型,所以無法使用內建函式",
|
||||
"Requires 運算式必須至少指定一個需求",
|
||||
"'constinit' 在這裡無效",
|
||||
"'constinit' 只對具有靜態或執行緒儲存期的變數宣告有效",
|
||||
"constinit 變數需要進行動態初始化",
|
||||
"變數先前使用 'constinit' %p 宣告",
|
||||
"使用非原型函式宣告子",
|
||||
"引數不能有常數限定類型",
|
||||
"不允許使用不完整類型 %t 的成員指標",
|
||||
"此模式未啟用 init-capture 中的參數序列展開式",
|
||||
"init-capture 中的參數序列展開式是 C++20 功能",
|
||||
"類別定義中預設的比較運算子,必須為該比較運算子的第一個宣告 (%nd)"
|
||||
]
|
||||
@@ -142,6 +142,16 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"customConfigurationVariables": {
|
||||
"type": "object",
|
||||
"description": "Custom variables that can be queried through the command ${cpptools:activeConfigCustomVariable} to use for the input variables in launch.json or tasks.json.",
|
||||
"patternProperties": {
|
||||
"(^.+$)": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
||||
+28
-13
@@ -444,36 +444,49 @@ gulp.task("generate-native-strings", (done) => {
|
||||
|
||||
let stringIndex = 1;
|
||||
for (let property in stringTable) {
|
||||
let stringName = property;
|
||||
let stringValue = stringTable[property];
|
||||
let hintValue;
|
||||
if (typeof stringValue !== "string")
|
||||
{
|
||||
hintValue = stringValue.hint;
|
||||
stringValue = stringValue.text;
|
||||
}
|
||||
|
||||
// Add to native enum
|
||||
nativeEnumContent += ` ${property} = ${stringIndex},\n`;
|
||||
|
||||
// Add to native string table
|
||||
nativeStringTableContent += ` ${JSON.stringify(stringTable[property])},\n`;
|
||||
nativeStringTableContent += ` ${JSON.stringify(stringValue)},\n`;
|
||||
|
||||
// Add to TypeScript switch
|
||||
// Skip empty strings, which can be used to prevent enum/index reordering
|
||||
if (stringTable[property] != "") {
|
||||
// It's possible that a translation may skip "{#}" entries, so check for up to 20 of them.
|
||||
if (stringValue != "") {
|
||||
// It's possible that a translation may skip "{#}" entries, so check for up to 50 of them.
|
||||
let numArgs = 0;
|
||||
for (let i = 0; i < 20; i++) {
|
||||
for (let i = 0; i < 50; i++) {
|
||||
if (stringValue.includes(`{${i}}`)) {
|
||||
numArgs = i + 1;
|
||||
}
|
||||
}
|
||||
typeScriptSwitchContent += ` case ${stringIndex}:\n`;
|
||||
if (numArgs != 0) {
|
||||
typeScriptSwitchContent += ` if (!stringArgs) {\n`;
|
||||
typeScriptSwitchContent += ` break;\n`;
|
||||
typeScriptSwitchContent += ` }\n`;
|
||||
typeScriptSwitchContent += ` if (stringArgs) {\n`;
|
||||
if (hintValue) {
|
||||
typeScriptSwitchContent += ` message = localize({ key: ${JSON.stringify(property)}, comment: [${JSON.stringify(hintValue)}] }, ${JSON.stringify(stringValue)}`;
|
||||
} else {
|
||||
typeScriptSwitchContent += ` message = localize(${JSON.stringify(property)}, ${JSON.stringify(stringValue)}`;
|
||||
}
|
||||
for (let i = 0; i < numArgs; i++) {
|
||||
typeScriptSwitchContent += `, stringArgs[${i}]`;
|
||||
}
|
||||
typeScriptSwitchContent += `);\n break;\n }\n`;
|
||||
}
|
||||
typeScriptSwitchContent += ` message = localize(${JSON.stringify(property)}, ${JSON.stringify(stringTable[property])}`;
|
||||
for (let i = 0; i < numArgs; i++) {
|
||||
typeScriptSwitchContent += `, stringArgs[${i}]`;
|
||||
if (hintValue) {
|
||||
typeScriptSwitchContent += ` message = localize({ key: ${JSON.stringify(property)}, comment: [${JSON.stringify(hintValue)}] }, ${JSON.stringify(stringValue)}`;
|
||||
} else {
|
||||
typeScriptSwitchContent += ` message = localize(${JSON.stringify(property)}, ${JSON.stringify(stringValue)}`;
|
||||
}
|
||||
typeScriptSwitchContent += ");\n break;\n";
|
||||
typeScriptSwitchContent += `);\n break;\n`;
|
||||
}
|
||||
++stringIndex;
|
||||
};
|
||||
@@ -492,6 +505,8 @@ import * as nls from 'vscode-nls';
|
||||
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
export const localizedStringCount: number = ${stringIndex};
|
||||
|
||||
export function lookupString(stringId: number, stringArgs?: string[]): string {
|
||||
let message: string = "";
|
||||
switch (stringId) {
|
||||
@@ -518,7 +533,7 @@ ${typeScriptSwitchContent}
|
||||
|
||||
#pragma once
|
||||
|
||||
enum class localized_string_id
|
||||
enum class localized_string_id : unsigned int
|
||||
{
|
||||
blank = 0,
|
||||
${nativeEnumContent}};
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "控制“实验性”功能是否可用。",
|
||||
"c_cpp.configuration.suggestSnippets.description": "如果为 true,则由语言服务器提供片段。",
|
||||
"c_cpp.configuration.enhancedColorization.description": "如果启用了 IntelliSense,则基于 IntelliSense 对代码进行着色。如果禁用了 IntelliSense 或使用默认高对比度主题,则此设置不起任何作用。",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "如果启用,则由语言服务器提供代码折叠范围。",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "为 [vcpkg 依赖关系管理器] 启用集成服务(https://aka.ms/vcpkg/)。",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "如果为 true,则“重命名符号”将需要有效的 C/C++ 标识符。",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "如果为 true,调试程序 shell 命令替换将使用过时的反引号(`)",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{
|
||||
"architecture.not.supported": "体系结构 {0} 不受支持。",
|
||||
"apline.containers.not.supported": "Alpine 容器不受支持。",
|
||||
"native.binaries.not.supported": "扩展的此 {0} 版本与你的操作系统不兼容。请下载并安装扩展的“{1}”版本。",
|
||||
"native.binaries.not.supported": "扩展的此 {0} 版本与你的 OS 不兼容。请下载并安装扩展的“{1}”版本。",
|
||||
"download.button": "转到下载页",
|
||||
"initialization.failed": "C/C++ 扩展安装失败。有关详细信息,请查看输出窗口。",
|
||||
"updating.dependencies": "正在更新 C/C++ 依赖项...",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "未能查询编译器。正在回退到 64 位 intelliSenseMode。",
|
||||
"fallback_to_no_bitness": "未能查询编译器。正在回退到无位数。",
|
||||
"intellisense_client_creation_aborted": "已中止创建 IntelliSense 客户端: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "基于 configurationProvider 设置提供的信息检测到 #include 错误。此翻译单元({0})的 IntelliSense 功能将由标记分析器提供。",
|
||||
"include_errors_config_provider_squiggles_disabled ": "基于 configurationProvider 设置提供的信息检测到 #include 错误。已针对此翻译单元({0})禁用波形曲线。"
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "控制「實驗性」功能是否可用。",
|
||||
"c_cpp.configuration.suggestSnippets.description": "若為 true,則由語言伺服器提供程式碼片段。",
|
||||
"c_cpp.configuration.enhancedColorization.description": "若已啟用,將會根據 IntelliSense 將程式碼著色。如果已停用 IntelliSense 或使用預設高對比主題,此設定就沒有效果。",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "若啟用,則由語言伺服器提供程式碼摺疊功能範圍。",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "啟用 [vcpkg 相依性管理員](https://aka.ms/vcpkg/)的整合服務。",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "若為 true,則「重新命名符號」需要有效的 C/C++ 識別碼。",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "若為 true,偵錯工具殼層命令替代將會使用已淘汰的反引號 (`)",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"find.all.references": "尋找所有參考",
|
||||
"peek.references": "預覽參考",
|
||||
"peek.references": "瞄核參考",
|
||||
"rename": "重新命名",
|
||||
"confirmed.reference.upper": "已確認參考",
|
||||
"confirmation.in.progress.upper": "正在確認",
|
||||
@@ -29,6 +29,6 @@
|
||||
"searching.files": "正在搜尋檔案。",
|
||||
"files.searched": "已搜尋 {0}/{1} 個檔案。{2}",
|
||||
"files.confirmed": "已確認 {0}/{1} 個檔案。{2}",
|
||||
"c.cpp.peek.references": "C/C++ 查看參考",
|
||||
"c.cpp.peek.references": "C/C++ 瞄核參考",
|
||||
"some.references.may.be.missing": "[警告] 因為啟動 {0} 時工作區處於未完成狀態,所以可能缺少部分參考。"
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
{
|
||||
"architecture.not.supported": "不支援架構 {0}。 ",
|
||||
"apline.containers.not.supported": "不支援 Alpine 容器。",
|
||||
"native.binaries.not.supported": "此 {0} 版本的延伸模組與您的 OS 不相容。請下載並安裝 \"{1}\" 版本的延伸模組。",
|
||||
"native.binaries.not.supported": "此 {0} 版延伸模組與您的 OS 不相容。請下載並安裝 \"{1}\" 版本的延伸模組。",
|
||||
"download.button": "前往 [下載\ 頁面",
|
||||
"initialization.failed": "C/C + + 延伸模組安裝失敗。如需詳細資訊,請查看 [輸出] 視窗。",
|
||||
"updating.dependencies": "正在更新 C/C + + 相依性...",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "無法查詢編譯器。請回復成 64 位元 intelliSenseMode。",
|
||||
"fallback_to_no_bitness": "無法查詢編譯器。請回復成沒有位元。",
|
||||
"intellisense_client_creation_aborted": "已中止建立 IntelliSense 用戶端: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "根據 configurationProvider 設定提供的資訊,偵測到 #include 錯誤。此編譯單位 ({0}) 的 IntelliSense 功能將由標籤剖析器提供。",
|
||||
"include_errors_config_provider_squiggles_disabled ": "根據 configurationProvider 設定提供的資訊,偵測到 #include 錯誤。已停用此編譯單位 ({0}) 的波浪線。"
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "Určuje, jestli je možné použít experimentální funkce.",
|
||||
"c_cpp.configuration.suggestSnippets.description": "Pokud se nastaví na true, jazykový server poskytne fragmenty kódu.",
|
||||
"c_cpp.configuration.enhancedColorization.description": "Pokud se tato možnost povolí, kód se bude barvit podle IntelliSense. Toto nastavení nemá žádný vliv, pokud se zakáže IntelliSense nebo pokud se použije výchozí motiv Vysoký kontrast.",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "Když se tato možnost povolí, rozsahy sbalování kódu bude poskytovat jazykový server.",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "Povolte integrační služby pro [správce závislostí vcpkg](https://aka.ms/vcpkg/).",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "Když se tato hodnota nastaví na true, operace Přejmenovat symbol bude vyžadovat platný identifikátor C/C++.",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "Když se nastaví na true, nahrazování příkazů shellu ladicího programu bude používat starou verzi obrácené čárky (`).",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "Nepovedlo se poslat dotaz na kompilátor. Probíhá návrat k 64bitovému režimu intelliSenseMode.",
|
||||
"fallback_to_no_bitness": "Nepovedlo se poslat dotaz na kompilátor. Probíhá návrat k režimu bez bitové verze.",
|
||||
"intellisense_client_creation_aborted": "Vytváření klienta IntelliSense se přerušilo: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "Na základě informací z nastavení configurationProvider se zjistily chyby direktivy #include. Funkce IntelliSense pro tuto jednotku překladu ({0}) bude poskytovat Tag Parser.",
|
||||
"include_errors_config_provider_squiggles_disabled ": "Na základě informací z nastavení configurationProvider se zjistily chyby direktivy #include. Pro tuto jednotku překladu ({0}) se zakázaly vlnovky."
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "Hiermit wird gesteuert, ob experimentelle Features verwendet werden können.",
|
||||
"c_cpp.configuration.suggestSnippets.description": "Wenn dieser Wert auf TRUE festgelegt ist, werden Codeausschnitte vom Sprachserver bereitgestellt.",
|
||||
"c_cpp.configuration.enhancedColorization.description": "Wenn diese Option aktiviert ist, wird der Code basierend auf IntelliSense eingefärbt. Diese Einstellung hat keine Auswirkungen, wenn IntelliSense deaktiviert ist oder wenn das standardmäßige Design mit hohem Kontrast verwendet wird.",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "Wenn diese Option aktiviert ist, werden Codefaltbereiche vom Sprachserver bereitgestellt.",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "Hiermit aktivieren Sie Integrationsdienste für den [vcpkg-Abhängigkeits-Manager](https://aka.ms/vcpkg/).",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "Bei TRUE ist für \"Symbol umbenennen\" ein gültiger C-/C++-Bezeichner erforderlich.",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "Bei Festlegung auf TRUE verwendet die Befehlsersetzung der Debugger-Shell obsolete Backtick-Zeichen (`).",
|
||||
|
||||
@@ -29,6 +29,6 @@
|
||||
"searching.files": "Dateien werden gesucht.",
|
||||
"files.searched": "{0}/{1} Dateien durchsucht.{2}",
|
||||
"files.confirmed": "{0}/{1} Dateien bestätigt.{2}",
|
||||
"c.cpp.peek.references": "C/C++-Vorschauverweise",
|
||||
"c.cpp.peek.references": "C/C++-Verweisvorschau",
|
||||
"some.references.may.be.missing": "[Warnung] Einige Verweise fehlen möglicherweise, da die Arbeitsbereichsanalyse beim Starten von {0} unvollständig war."
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
{
|
||||
"architecture.not.supported": "Die Architektur \"{0}\" wird nicht unterstützt. ",
|
||||
"apline.containers.not.supported": "Alpine-Container werden nicht unterstützt.",
|
||||
"native.binaries.not.supported": "Diese Version ({0}) der Erweiterung ist nicht mit Ihrem Betriebssystem kompatibel. Laden Sie Version {1} der Erweiterung herunter, und installieren Sie sie.",
|
||||
"native.binaries.not.supported": "Diese Version für {0} der Erweiterung ist nicht mit Ihrem Betriebssystem kompatibel. Laden Sie Version {1} der Erweiterung herunter, und installieren Sie sie.",
|
||||
"download.button": "Gehe zu Downloadseite",
|
||||
"initialization.failed": "Fehler bei der Installation der C/C++-Erweiterung. Weitere Informationen finden Sie im Ausgabefenster.",
|
||||
"updating.dependencies": "C/C++-Abhängigkeiten werden aktualisiert...",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "Fehler beim Abfragen des Compilers. Es wird ein Fallback auf den 64-Bit-intelliSenseMode durchgeführt.",
|
||||
"fallback_to_no_bitness": "Fehler beim Abfragen des Compilers. Es wird ein Fallback auf keine Bitanzahl durchgeführt.",
|
||||
"intellisense_client_creation_aborted": "IntelliSense-Clienterstellung abgebrochen: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "Basierend auf den von der configurationProvider-Einstellung bereitgestellten Informationen wurden #include-Fehler festgestellt. IntelliSense-Features für diese Übersetzungseinheit ({0}) werden vom Tagparser bereitgestellt.",
|
||||
"include_errors_config_provider_squiggles_disabled ": "Basierend auf den von der configurationProvider-Einstellung bereitgestellten Informationen wurden #include-Fehler festgestellt. Wellenlinien sind für diese Übersetzungseinheit deaktiviert ({0})."
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "Controla si se pueden usar las características \"experimentales\".",
|
||||
"c_cpp.configuration.suggestSnippets.description": "Si se establece en true, el servidor de lenguaje proporciona los fragmentos de código.",
|
||||
"c_cpp.configuration.enhancedColorization.description": "Si se habilita esta opción, el código se colorea de acuerdo con IntelliSense. Esta configuración no tiene efecto si IntelliSense está deshabilitado o si se utiliza el tema de contraste alto predeterminado.",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "Si está habilitada, el servidor de lenguaje proporciona intervalos de plegado de código.",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "Habilita los servicios de integración para el [administrador de dependencias de vcpkg] (https://aka.ms/vcpkg/).",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "Si es true, \"Cambiar el nombre del símbolo\" requerirá un identificador de C/C++ válido.",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "Si es true, la sustitución de comandos del shell del depurador usará la marca de comilla simple (') obsoleta.",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{
|
||||
"architecture.not.supported": "La arquitectura {0} no se admite. ",
|
||||
"apline.containers.not.supported": "Los contenedores de Alpine no se admiten.",
|
||||
"native.binaries.not.supported": "Esta versión {0} de la extensión no es compatible con el sistema operativo. Descargue la versión \"{1}\" de la extensión e instálela.",
|
||||
"native.binaries.not.supported": "La versión para {0} de la extensión no es compatible con el sistema operativo. Descargue la versión \"{1}\" de la extensión e instálela.",
|
||||
"download.button": "Ir a la página de descarga",
|
||||
"initialization.failed": "No se pudo instalar la extensión de C/C++. Para obtener más información, consulte la ventana de salida.",
|
||||
"updating.dependencies": "Actualizando las dependencias de C/C++...",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "No se pudo consultar el compilador. Revirtiendo a intelliSenseMode de 64 bits.",
|
||||
"fallback_to_no_bitness": "No se pudo consultar el compilador. Revirtiendo para no establecer ningún valor de bits.",
|
||||
"intellisense_client_creation_aborted": "Se anuló la creación del cliente de IntelliSense: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "Se han detectado errores de #include basados en la información proporcionada por configurationProvider. El analizador de etiquetas proporcionará las características de IntelliSense para esta unidad de traducción ({0}).",
|
||||
"include_errors_config_provider_squiggles_disabled ": "Se han detectado errores de #include basados en la información proporcionada por configurationProvider. El subrayado ondulado está deshabilitado para esta unidad de traducción ({0})."
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "Contrôle si les fonctionnalités \"expérimentales\" sont utilisables.",
|
||||
"c_cpp.configuration.suggestSnippets.description": "Si la valeur est true, des extraits de code sont fournis par le serveur de langage.",
|
||||
"c_cpp.configuration.enhancedColorization.description": "Si cette option est activée, la couleur du code est déterminée par IntelliSense. Ce paramètre n'a pas d'effet si IntelliSense est désactivé ou utilise le thème Contraste élevé par défaut.",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "Si cette fonctionnalité est activée, les plages de pliage de code sont fournies par le serveur de langage.",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "Activez les services d'intégration pour le [gestionnaire de dépendances vcpkg] (https://aka.ms/vcpkg/).",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "Si la valeur est true, l'opération Renommer le symbole nécessite un identificateur C/C++ valide.",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "Si la valeur est true, le remplacement de la commande shell du débogueur utilise un accent grave (`) obsolète",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "Échec de l'interrogation du compilateur. Retour au intelliSenseMode 64 bits.",
|
||||
"fallback_to_no_bitness": "Échec de l'interrogation du compilateur. Retour au mode sans nombre de bits.",
|
||||
"intellisense_client_creation_aborted": "Abandon de la création du client IntelliSense : {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "Erreurs #include détectées d'après les informations fournies par le paramètre configurationProvider. Les fonctionnalités IntelliSense de cette unité de traduction ({0}) sont fournies par l'analyseur de balises.",
|
||||
"include_errors_config_provider_squiggles_disabled ": "Erreurs #include détectées d'après les informations fournies par le paramètre configurationProvider. Les tildes sont désactivés pour cette unité de traduction ({0})."
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "Controlla se le funzionalità \"sperimentali\" sono utilizzabili.",
|
||||
"c_cpp.configuration.suggestSnippets.description": "Se è true, i frammenti vengono forniti dal server di linguaggio.",
|
||||
"c_cpp.configuration.enhancedColorization.description": "Se questa opzione è abilitata, il codice viene colorato in base a IntelliSense. Questa impostazione non ha alcun effetto se IntelliSense è disabilitato o se si usa il tema Contrasto elevato predefinito.",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "Se è abilitata, gli intervalli di riduzione del codice vengono fornite dal server di linguaggio.",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "Abilita i servizi di integrazione per l'[utilità di gestione dipendenze di vcpkg] (https://aka.ms/vcpkg/).",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "Se è true, con 'Rinomina simbolo' sarà richiesto un identificatore C/C++ valido.",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "Se è true, per la sostituzione del comando della shell del debugger verrà usato il carattere backtick obsoleto (`)",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"find.all.references": "Trova tutti i riferimenti",
|
||||
"peek.references": "Visualizza riferimenti",
|
||||
"peek.references": "Visualizza in anteprima riferimenti",
|
||||
"rename": "Rinomina",
|
||||
"confirmed.reference.upper": "RIFERIMENTO CONFERMATO",
|
||||
"confirmation.in.progress.upper": "CONFERMA IN CORSO",
|
||||
@@ -29,6 +29,6 @@
|
||||
"searching.files": "Ricerca dei file.",
|
||||
"files.searched": "{0}/{1} file cercati.{2}",
|
||||
"files.confirmed": "{0}/{1} file confermati.{2}",
|
||||
"c.cpp.peek.references": "Visualizza riferimenti C/C++",
|
||||
"c.cpp.peek.references": "Visualizza in anteprima riferimenti C/C++",
|
||||
"some.references.may.be.missing": "[Avviso] Alcuni riferimenti potrebbero essere mancanti perché l'analisi dell'area di lavoro è stata incompleta quando è stato avviato {0}."
|
||||
}
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "Non è stato possibile eseguire una query sul compilatore. Verrà eseguito il fallback a intelliSenseMode a 64 bit.",
|
||||
"fallback_to_no_bitness": "Non è stato possibile eseguire una query sul compilatore. Verrà eseguito il fallback alla modalità senza numero di bit.",
|
||||
"intellisense_client_creation_aborted": "La creazione del client IntelliSense è stata interrotta: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "Sono stati rilevati errori #include sulla base delle informazioni fornite dall'impostazione configurationProvider. Le funzionalità IntelliSense per questa unità di conversione ({0}) verranno fornite dal parser di tag.",
|
||||
"include_errors_config_provider_squiggles_disabled ": "Sono stati rilevati errori #include sulla base delle informazioni fornite dall'impostazione configurationProvider. I segni di revisione sono disabilitati per questa unità di conversione ({0})."
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "\"experimental\" の機能を使用できるかどうかを制御します。",
|
||||
"c_cpp.configuration.suggestSnippets.description": "true の場合、スニペットは言語サーバーによって提供されます。",
|
||||
"c_cpp.configuration.enhancedColorization.description": "有効にすると、IntelliSense に基づいてコードが色分けされます。この設定は、IntelliSense が無効になっている場合、または既定のハイ コントラスト テーマを使用している場合は効果がありません。",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "有効にした場合、コードの折りたたみの範囲は言語サーバーによって指定されます。",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "[vcpkg 依存関係マネージャー](https://aka.ms/vcpkg/) の統合サービスを有効にします。",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "true の場合、'シンボルの名前変更' には有効な C/C++ 識別子が必要です。",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "True の場合、デバッガー シェルのコマンド置換では古い backtick (') が使用されます",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"find.all.references": "すべての参照を検索",
|
||||
"peek.references": "参照のプレビュー",
|
||||
"peek.references": "参照のクイック表示",
|
||||
"rename": "名前の変更",
|
||||
"confirmed.reference.upper": "参照が確認されました",
|
||||
"confirmation.in.progress.upper": "確認が進行中です",
|
||||
@@ -29,6 +29,6 @@
|
||||
"searching.files": "ファイルを検索しています。",
|
||||
"files.searched": "{0}/{1} 個のファイルが検索されました。{2}",
|
||||
"files.confirmed": "{0}/{1} 個のファイルを確認しました。{2}",
|
||||
"c.cpp.peek.references": "C/C++ の参照のプレビュー",
|
||||
"c.cpp.peek.references": "C/C++ の参照のクイック表示",
|
||||
"some.references.may.be.missing": "[警告] {0} が開始されたときにワークスペースの解析が不完全だったため、参照の一部がない可能性があります。"
|
||||
}
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "コンパイラを照会できませんでした。64 ビットの intelliSenseMode に戻しています。",
|
||||
"fallback_to_no_bitness": "コンパイラを照会できませんでした。ビットなしに戻ります。",
|
||||
"intellisense_client_creation_aborted": "IntelliSense クライアントの作成が中止されました: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "configurationProvider 設定によって提供された情報に基づいて、#include エラーが検出されました。この翻訳単位 ({0}) の IntelliSense 機能は、タグ パーサーによって提供されます。",
|
||||
"include_errors_config_provider_squiggles_disabled ": "configurationProvider 設定によって提供された情報に基づいて、#include エラーが検出されました。この翻訳単位 ({0}) では、波線が無効になっています。"
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "\"실험적\" 기능을 사용할 수 있는지 여부를 제어합니다.",
|
||||
"c_cpp.configuration.suggestSnippets.description": "True이면 언어 서버에서 코드 조각을 제공합니다.",
|
||||
"c_cpp.configuration.enhancedColorization.description": "사용하도록 설정된 경우 IntelliSense를 기반으로 코드 색이 지정됩니다. 이 설정은 기본 고대비 테마를 사용하거나 IntelliSense가 사용하지 않도록 설정된 경우 아무런 영향을 주지 않습니다.",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "사용하도록 설정하면 언어 서버에서 코드 접기 범위를 제공합니다.",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "[vcpkg 종속성 관리자](https://aka.ms/vcpkg/)에 통합 서비스를 사용하도록 설정합니다.",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "true이면 '기호 이름 바꾸기'에 유효한 C/C++ 식별자가 필요합니다.",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "true인 경우 디버거 셸 명령 대체가 사용되지 않는 백틱(`)을 사용합니다.",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "컴파일러를 쿼리하지 못했습니다. 64비트 intelliSenseMode로 대체하는 중입니다.",
|
||||
"fallback_to_no_bitness": "컴파일러를 쿼리하지 못했습니다. 0비트로 대체하는 중입니다.",
|
||||
"intellisense_client_creation_aborted": "IntelliSense 클라이언트 만들기가 중단되었습니다. {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "configurationProvider 설정에서 제공하는 정보를 기준으로 #include 오류가 검색되었습니다. 태그 파서가 이 변환 단위({0})에 적합한 IntelliSense 기능을 제공합니다.",
|
||||
"include_errors_config_provider_squiggles_disabled ": "configurationProvider 설정에서 제공하는 정보를 기준으로 #include 오류가 검색되었습니다. 이 변환 단위({0})에서 물결선을 사용할 수 없습니다."
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "Określa, czy można używać funkcji „eksperymentalnych”.",
|
||||
"c_cpp.configuration.suggestSnippets.description": "Jeśli wartość to true, fragmenty kodu są udostępniane przez serwer języka.",
|
||||
"c_cpp.configuration.enhancedColorization.description": "Jeśli to ustawienie jest włączone, kod jest kolorowany na podstawie funkcji IntelliSense. To ustawienie nie ma żadnego efektu, jeśli funkcja IntelliSense jest wyłączona lub jest używana domyślna kompozycja z dużym kontrastem.",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "Jeśli ta opcja jest włączona, zakresy składania kodu są dostarczane przez serwer języka.",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "Włącz usługi integracji dla elementu [vcpkg dependency manager](https://aka.ms/vcpkg/).",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "Jeśli ma wartość true, operacja „Zmień nazwę symbolu” będzie wymagać prawidłowego identyfikatora C/C++.",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "Jeśli wartość będzie równa true, podstawianie poleceń powłoki debugera będzie używać przestarzałego grawisa (`)",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "Nie można wykonać zapytania dotyczącego kompilatora. Powrót do 64-bitowego trybu intelliSenseMode.",
|
||||
"fallback_to_no_bitness": "Nie można wykonać zapytania dotyczącego kompilatora. Powrót do braku liczby bitów.",
|
||||
"intellisense_client_creation_aborted": "Przerwano tworzenie klienta IntelliSense: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "Wykryto błędy #include na podstawie informacji podanych przez ustawienie configurationProvider. Funkcje IntelliSense dla tej jednostki tłumaczeniowej ({0}) będą udostępniane przez analizator tagów.",
|
||||
"include_errors_config_provider_squiggles_disabled ": "Wykryto błędy #include na podstawie informacji podanych przez ustawienie configurationProvider. Zygzaki dla tej jednostki tłumaczeniowej ({0}) są wyłączone."
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "Controla se os recursos \"experimentais\" podem ser usados.",
|
||||
"c_cpp.configuration.suggestSnippets.description": "Se for true, os snippets serão fornecidos pelo servidor de idiomas.",
|
||||
"c_cpp.configuration.enhancedColorization.description": "Se habilitado, o código é colorizado com base no IntelliSense. Essa configuração não terá efeito se o IntelliSense estiver desabilitado ou se você estiver usando o tema de Alto Contraste Padrão.",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "Se habilitado, os intervalos de dobramento de código serão fornecidos pelo servidor de idiomas.",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "Habilitar os serviços de integração para o [gerenciador de dependências vcpkg](https://aka.ms/vcpkg/).",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "Se for true, 'Renomear Símbolo' exigirá um identificador C/C++ válido.",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "Se for true, a substituição do comando do shell do depurador usará o acento grave obsoleto (`)",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"find.all.references": "Localizar Todas as Referências",
|
||||
"peek.references": "Inspecionar Referências",
|
||||
"peek.references": "Espiar Referências",
|
||||
"rename": "Renomear",
|
||||
"confirmed.reference.upper": "REFERÊNCIA CONFIRMADA",
|
||||
"confirmation.in.progress.upper": "CONFIRMAÇÃO EM ANDAMENTO",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "Falha ao consultar o compilador. Voltando para o intelliSenseMode de 64 bits.",
|
||||
"fallback_to_no_bitness": "Falha ao consultar o compilador. Voltando para nenhum número de bit.",
|
||||
"intellisense_client_creation_aborted": "Criação de cliente do IntelliSense anulada: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "#inclui erros detectados com base nas informações fornecidas pela configuração configurationProvider. Os recursos do IntelliSense para essa unidade de conversão ({0}) serão fornecidos pelo Analisador de Marca.",
|
||||
"include_errors_config_provider_squiggles_disabled ": "#inclui erros detectados com base nas informações fornecidas pela configuração configurationProvider. Os rabiscos estão desabilitados para esta unidade de tradução ({0})."
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "Определяет, можно ли использовать \"экспериментальные\" функции.",
|
||||
"c_cpp.configuration.suggestSnippets.description": "Если задано значение true, фрагменты кода предоставляются языковым сервером.",
|
||||
"c_cpp.configuration.enhancedColorization.description": "Если этот параметр включен, код выделяется цветом на основе IntelliSense. Этот параметр не работает, если функция IntelliSense отключена или используется тема с высокой контрастностью по умолчанию.",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "Если этот параметр включен, то диапазоны свертывания кода предоставляются языковым сервером.",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "Включите службы интеграции для [диспетчера зависимостей vcpkg](https://aka.ms/vcpkg/).",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "Если этот параметр имеет значение true, для операции \"Переименование символов\" потребуется указать допустимый идентификатор C/C++.",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "Если задано значение true, для подстановки команд оболочки отладчика будет использоваться устаревший обратный апостроф (`)",
|
||||
|
||||
@@ -29,6 +29,6 @@
|
||||
"searching.files": "Выполняется поиск файлов.",
|
||||
"files.searched": "Просмотрено файлов: {0}/{1}. {2}",
|
||||
"files.confirmed": "Подтверждено файлов: {0}/{1}. {2}",
|
||||
"c.cpp.peek.references": "Ссылки для просмотра кода C/C++",
|
||||
"c.cpp.peek.references": "Ссылки для быстрого редактирования кода C/C++",
|
||||
"some.references.may.be.missing": "[Предупреждение] Некоторые ссылки могут отсутствовать, так как при запуске {0} анализ рабочей области не был завершен."
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
{
|
||||
"architecture.not.supported": "Архитектура {0} не поддерживается. ",
|
||||
"apline.containers.not.supported": "Контейнеры Alpine не поддерживаются.",
|
||||
"native.binaries.not.supported": "Версия расширения {0} не совместима с вашей ОС. Скачайте и установите версию расширения \"{1}\".",
|
||||
"native.binaries.not.supported": "Версия расширения для {0} не совместима с вашей ОС. Скачайте и установите версию расширения \"{1}\".",
|
||||
"download.button": "Перейти к странице скачивания",
|
||||
"initialization.failed": "Не удалось установить расширение C/C++. Дополнительные сведения см. в окне вывода.",
|
||||
"updating.dependencies": "Обновление зависимостей C/C++...",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "Не удалось запросить сведения от компилятора. Возврат к 64-разрядному режиму IntelliSenseMode.",
|
||||
"fallback_to_no_bitness": "Не удалось запросить сведения от компилятора. Возврат к режиму без использования разрядности.",
|
||||
"intellisense_client_creation_aborted": "Создание клиента IntelliSense прервано: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "обнаружены ошибки #include на основе сведений, предоставленных параметром configurationProvider. Функции IntelliSense для этой записи преобразования ({0}) будут предоставлены анализатором тегов.",
|
||||
"include_errors_config_provider_squiggles_disabled ": "Обнаружены ошибки #include на основе сведений, предоставленных параметром configurationProvider. Волнистые линии для этой записи преобразования ({0}) отключены."
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"c_cpp.configuration.experimentalFeatures.description": "\"Deneysel\" özelliklerin kullanılabilir olup olmadığını denetler.",
|
||||
"c_cpp.configuration.suggestSnippets.description": "Değer true ise, kod parçacıkları dil sunucusu tarafından sağlanır.",
|
||||
"c_cpp.configuration.enhancedColorization.description": "Etkinleştirilirse, kod IntelliSense'e göre renklendirilir. IntelliSense devre dışı bırakılmışsa veya Varsayılan Yüksek Karşıtlık teması kullanılıyorsa bu ayarın bir etkisi olmaz.",
|
||||
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
|
||||
"c_cpp.configuration.codeFolding.description": "Etkinleştirilirse, kod katlama aralıkları dil sunucusu tarafından sağlanır.",
|
||||
"c_cpp.configuration.vcpkg.enabled.markdownDescription": "[vcpkg bağımlılık yöneticisi](https://aka.ms/vcpkg/) için tümleştirme hizmetlerini etkinleştirin.",
|
||||
"c_cpp.configuration.renameRequiresIdentifier.description": "True ise, 'Sembolü Yeniden Adlandır' işlemi için geçerli bir C/C++ tanımlayıcısı gerekir.",
|
||||
"c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "True ise, hata ayıklayıcı kabuk komut değiştirme eski kesme işaretini (`) kullanır",
|
||||
|
||||
@@ -161,6 +161,6 @@
|
||||
"fallback_to_64_bit_mode2": "Derleyici sorgulanamadı. 64 bit intelliSenseMode'a geri dönülüyor.",
|
||||
"fallback_to_no_bitness": "Derleyici sorgulanamadı. Bit genişliği yok durumuna geri dönülüyor.",
|
||||
"intellisense_client_creation_aborted": "IntelliSense istemcisi oluşturma işlemi durduruldu: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "configurationProvider ayarı tarafından sağlanan bilgilere göre #include hataları saptandı. Bu çeviri birimi ({0}) için IntelliSense özellikleri Etiket Ayrıştırıcısı tarafından sağlanır.",
|
||||
"include_errors_config_provider_squiggles_disabled ": "configurationProvider ayarı tarafından sağlanan bilgilere göre #include hataları saptandı. Bu çeviri birimi ({0}) için dalgalı çizgiler devre dışı bırakıldı."
|
||||
}
|
||||
+58
-5
@@ -2,7 +2,7 @@
|
||||
"name": "cpptools",
|
||||
"displayName": "C/C++",
|
||||
"description": "C/C++ IntelliSense, debugging, and code browsing.",
|
||||
"version": "0.28.0-master",
|
||||
"version": "0.29.0-master",
|
||||
"publisher": "ms-vscode",
|
||||
"preview": true,
|
||||
"icon": "LanguageCCPP_color_128x.png",
|
||||
@@ -52,6 +52,13 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"viewsWelcome": [
|
||||
{
|
||||
"view": "debug",
|
||||
"contents": "To learn more about launch.json, see [Configuring C/C++ debugging](https://code.visualstudio.com/docs/cpp/launch-json-reference).",
|
||||
"when": "debugStartLanguage == cpp || debugStartLanguage == c"
|
||||
}
|
||||
],
|
||||
"problemMatchers": [
|
||||
{
|
||||
"name": "gcc",
|
||||
@@ -470,6 +477,20 @@
|
||||
"description": "%c_cpp.configuration.default.systemIncludePath.description%",
|
||||
"scope": "machine-overridable"
|
||||
},
|
||||
"C_Cpp.default.customConfigurationVariables": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"default": null,
|
||||
"patternProperties": {
|
||||
"(^.+$)": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"description": "%c_cpp.configuration.default.customConfigurationVariables.description%",
|
||||
"scope": "machine-overridable"
|
||||
},
|
||||
"C_Cpp.default.enableConfigurationSquiggles": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
@@ -658,6 +679,10 @@
|
||||
{
|
||||
"type": "cppdbg",
|
||||
"label": "C++ (GDB/LLDB)",
|
||||
"languages": [
|
||||
"c",
|
||||
"cpp"
|
||||
],
|
||||
"variables": {
|
||||
"pickProcess": "extension.pickNativeProcess",
|
||||
"pickRemoteProcess": "extension.pickRemoteNativeProcess"
|
||||
@@ -950,6 +975,13 @@
|
||||
},
|
||||
"description": "%c_cpp.debuggers.pipeTransport.pipeEnv.description%",
|
||||
"default": {}
|
||||
},
|
||||
"quoteArgs": {
|
||||
"exceptions": {
|
||||
"type": "boolean",
|
||||
"description": "%c_cpp.debuggers.pipeTransport.quoteArgs.description%",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1136,6 +1168,13 @@
|
||||
},
|
||||
"description": "%c_cpp.debuggers.pipeTransport.pipeEnv.description%",
|
||||
"default": {}
|
||||
},
|
||||
"quoteArgs": {
|
||||
"exceptions": {
|
||||
"type": "boolean",
|
||||
"description": "%c_cpp.debuggers.pipeTransport.quoteArgs.description%",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1192,6 +1231,10 @@
|
||||
{
|
||||
"type": "cppvsdbg",
|
||||
"label": "C++ (Windows)",
|
||||
"languages": [
|
||||
"c",
|
||||
"cpp"
|
||||
],
|
||||
"variables": {
|
||||
"pickProcess": "extension.pickNativeProcess"
|
||||
},
|
||||
@@ -1310,6 +1353,16 @@
|
||||
"type": "boolean",
|
||||
"description": "%c_cpp.debuggers.logging.engineLogging.description%",
|
||||
"default": false
|
||||
},
|
||||
"threadExit": {
|
||||
"type": "boolean",
|
||||
"description": "%c_cpp.debuggers.cppvsdbg.logging.threadExit.description%",
|
||||
"default": false
|
||||
},
|
||||
"processExit": {
|
||||
"type": "boolean",
|
||||
"description": "%c_cpp.debuggers.cppvsdbg.logging.processExit.description%",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1563,7 +1616,7 @@
|
||||
"ts-loader": "^6.0.4",
|
||||
"tslint": "^5.19.0",
|
||||
"typescript": "^3.5.3",
|
||||
"vscode-cpptools": "^3.1.0",
|
||||
"vscode-cpptools": "^4.0.1",
|
||||
"vscode-debugadapter": "^1.35.0",
|
||||
"vscode-debugprotocol": "^1.35.0",
|
||||
"vscode-extension-telemetry": "^0.1.2",
|
||||
@@ -1590,7 +1643,7 @@
|
||||
"runtimeDependencies": [
|
||||
{
|
||||
"description": "C/C++ language components (Linux / x86_64)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2125055",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2131982",
|
||||
"platforms": [
|
||||
"linux"
|
||||
],
|
||||
@@ -1604,7 +1657,7 @@
|
||||
},
|
||||
{
|
||||
"description": "C/C++ language components (OS X)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2125057",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2132316",
|
||||
"platforms": [
|
||||
"darwin"
|
||||
],
|
||||
@@ -1615,7 +1668,7 @@
|
||||
},
|
||||
{
|
||||
"description": "C/C++ language components (Windows)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2125056",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2132317",
|
||||
"platforms": [
|
||||
"win32"
|
||||
],
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
"c_cpp.configuration.default.browse.limitSymbolsToIncludedHeaders.description": "The value to use in a configuration if \"browse.limitSymbolsToIncludedHeaders\" is either not specified or set to \"${default}\".",
|
||||
"c_cpp.configuration.default.systemIncludePath.description": "The value to use for the system include path. If set, it overrides the system include path acquired via \"compilerPath\" and \"compileCommands\" settings.",
|
||||
"c_cpp.configuration.default.enableConfigurationSquiggles.description": "Controls whether the extension will report errors detected in c_cpp_properties.json.",
|
||||
"c_cpp.configuration.default.customConfigurationVariables.description": "The value to use in a configuration if \"customConfigurationVariables\" is not set, or the values to insert if \"${default}\" is present as a key in \"customConfigurationVariables\".",
|
||||
"c_cpp.configuration.updateChannel.description": "Set to \"Insiders\" to automatically download and install the latest Insiders builds of the extension, which include upcoming features and bug fixes.",
|
||||
"c_cpp.configuration.experimentalFeatures.description": "Controls whether \"experimental\" features are usable.",
|
||||
"c_cpp.configuration.suggestSnippets.description": "If true, snippets are provided by the language server.",
|
||||
@@ -77,6 +78,7 @@
|
||||
"c_cpp.debuggers.pipeTransport.pipeProgram.description": "The fully qualified pipe command to execute.",
|
||||
"c_cpp.debuggers.pipeTransport.pipeArgs.description": "Command line arguments passed to the pipe program to configure the connection.",
|
||||
"c_cpp.debuggers.pipeTransport.pipeEnv.description": "Environment variables passed to the pipe program.",
|
||||
"c_cpp.debuggers.pipeTransport.quoteArgs.description": "If the pipeProgram's individual arguments contain characters (such as spaces or tabs), should it be quoted? If 'false', the debugger command will no longer be automatically quoted. \nDefault is 'true'.",
|
||||
"c_cpp.debuggers.logging.description": "Optional flags to determine what types of messages should be logged to the Debug Console.",
|
||||
"c_cpp.debuggers.logging.exceptions.description": "Optional flag to determine whether exception messages should be logged to the Debug Console. Defaults to true.",
|
||||
"c_cpp.debuggers.logging.moduleLoad.description": "Optional flag to determine whether module load events should be logged to the Debug Console. Defaults to true.",
|
||||
@@ -84,6 +86,8 @@
|
||||
"c_cpp.debuggers.logging.engineLogging.description": "Optional flag to determine whether diagnostic debug engine messages should be logged to the Debug Console. Defaults to false.",
|
||||
"c_cpp.debuggers.logging.trace.description": "Optional flag to determine whether diagnostic adapter command tracing should be logged to the Debug Console. Defaults to false.",
|
||||
"c_cpp.debuggers.logging.traceResponse.description": "Optional flag to determine whether diagnostic adapter command and response tracing should be logged to the Debug Console. Defaults to false.",
|
||||
"c_cpp.debuggers.cppvsdbg.logging.threadExit.description": "Optional flag to determine whether thread exits messages should be logged to the Debug Console. Default: `false`.",
|
||||
"c_cpp.debuggers.cppvsdbg.logging.processExit.description": "Optional flag to determine whether target process exits messages should be logged to the Debug Console., or debugging is stopped. Default: `true`.",
|
||||
"c_cpp.debuggers.text.description": "The debugger command to execute.",
|
||||
"c_cpp.debuggers.description.description": "Optional description for the command.",
|
||||
"c_cpp.debuggers.ignoreFailures.description": "If true, failures from the command should be ignored. Default value is false.",
|
||||
|
||||
@@ -24,7 +24,7 @@ export class ParsedEnvironmentFile {
|
||||
}
|
||||
|
||||
public static CreateFromFile(envFile: string, initialEnv?: Environment[]): ParsedEnvironmentFile {
|
||||
let content: string = fs.readFileSync(envFile, "utf8");
|
||||
const content: string = fs.readFileSync(envFile, "utf8");
|
||||
return this.CreateFromContent(content, envFile, initialEnv);
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ export class ParsedEnvironmentFile {
|
||||
content = content.substr(1);
|
||||
}
|
||||
|
||||
let parseErrors: string[] = [];
|
||||
let env: Map<string, any> = new Map();
|
||||
const parseErrors: string[] = [];
|
||||
const env: Map<string, any> = new Map();
|
||||
|
||||
if (initialEnv) {
|
||||
// Convert array to map to prevent duplicate keys being created.
|
||||
@@ -80,7 +80,7 @@ export class ParsedEnvironmentFile {
|
||||
|
||||
// Convert env map back to array.
|
||||
const arrayEnv: Environment[] = [];
|
||||
for (let key of env.keys()) {
|
||||
for (const key of env.keys()) {
|
||||
arrayEnv.push({name: key, value: env.get(key)});
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface AttachItem extends vscode.QuickPickItem {
|
||||
export function showQuickPick(getAttachItems: () => Promise<AttachItem[]>): Promise<string | undefined> {
|
||||
return getAttachItems().then(processEntries =>
|
||||
new Promise<string>((resolve, reject) => {
|
||||
let quickPick: vscode.QuickPick<AttachItem> = vscode.window.createQuickPick<AttachItem>();
|
||||
const quickPick: vscode.QuickPick<AttachItem> = vscode.window.createQuickPick<AttachItem>();
|
||||
quickPick.title = localize("attach.to.process", "Attach to process");
|
||||
quickPick.canSelectMany = false;
|
||||
quickPick.matchOnDescription = true;
|
||||
@@ -42,7 +42,7 @@ export function showQuickPick(getAttachItems: () => Promise<AttachItem[]>): Prom
|
||||
quickPick.items = processEntries;
|
||||
quickPick.buttons = [new RefreshButton()];
|
||||
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
|
||||
quickPick.onDidTriggerButton(button => {
|
||||
getAttachItems().then(processEntries => quickPick.items = processEntries);
|
||||
@@ -53,7 +53,7 @@ export function showQuickPick(getAttachItems: () => Promise<AttachItem[]>): Prom
|
||||
reject(new Error(localize("process.not.selected", "Process not selected.")));
|
||||
}
|
||||
|
||||
let selectedId: string | undefined = quickPick.selectedItems[0].id;
|
||||
const selectedId: string | undefined = quickPick.selectedItems[0].id;
|
||||
|
||||
disposables.forEach(item => item.dispose());
|
||||
quickPick.dispose();
|
||||
|
||||
@@ -50,7 +50,7 @@ export class RemoteAttachPicker {
|
||||
} else {
|
||||
this._channel.clear();
|
||||
|
||||
let pipeTransport: any = config ? config.pipeTransport : undefined;
|
||||
const pipeTransport: any = config ? config.pipeTransport : undefined;
|
||||
|
||||
if (!pipeTransport) {
|
||||
return Promise.reject<string>(new Error(localize("no.pipetransport", "Chosen debug configuration does not contain {0}", "pipeTransport")));
|
||||
@@ -84,15 +84,15 @@ export class RemoteAttachPicker {
|
||||
pipeProgram = pipeTransport.pipeProgram;
|
||||
}
|
||||
|
||||
let pipeArgs: string[] = pipeTransport.pipeArgs;
|
||||
const pipeArgs: string[] = pipeTransport.pipeArgs;
|
||||
|
||||
let argList: string = RemoteAttachPicker.createArgumentList(pipeArgs);
|
||||
const argList: string = RemoteAttachPicker.createArgumentList(pipeArgs);
|
||||
|
||||
let pipeCmd: string = `"${pipeProgram}" ${argList}`;
|
||||
const pipeCmd: string = `"${pipeProgram}" ${argList}`;
|
||||
|
||||
return this.getRemoteOSAndProcesses(pipeCmd)
|
||||
.then(processes => {
|
||||
let attachPickOptions: vscode.QuickPickOptions = {
|
||||
const attachPickOptions: vscode.QuickPickOptions = {
|
||||
matchOnDetail: true,
|
||||
matchOnDescription: true,
|
||||
placeHolder: localize("select.process.attach", "Select the process to attach to")
|
||||
@@ -113,7 +113,7 @@ export class RemoteAttachPicker {
|
||||
let parameterEnd: string = `)`;
|
||||
let escapedQuote: string = `\\\"`;
|
||||
|
||||
let settings: CppSettings = new CppSettings();
|
||||
const settings: CppSettings = new CppSettings();
|
||||
if (settings.useBacktickCommandSubstitution) {
|
||||
parameterBegin = `\``;
|
||||
parameterEnd = `\``;
|
||||
@@ -139,12 +139,12 @@ export class RemoteAttachPicker {
|
||||
return util.execChildProcess(execCommand, undefined, this._channel).then(output => {
|
||||
// OS will be on first line
|
||||
// Processes will follow if listed
|
||||
let lines: string[] = output.split(/\r?\n/);
|
||||
const lines: string[] = output.split(/\r?\n/);
|
||||
|
||||
if (lines.length === 0) {
|
||||
return Promise.reject<AttachItem[]>(new Error(localize("pipe.failed", "Pipe transport failed to get OS and processes.")));
|
||||
} else {
|
||||
let remoteOS: string = lines[0].replace(/[\r\n]+/g, '');
|
||||
const remoteOS: string = lines[0].replace(/[\r\n]+/g, '');
|
||||
|
||||
if (remoteOS !== "Linux" && remoteOS !== "Darwin") {
|
||||
return Promise.reject<AttachItem[]>(new Error(`Operating system "${remoteOS}" not supported.`));
|
||||
@@ -154,7 +154,7 @@ export class RemoteAttachPicker {
|
||||
if (lines.length === 1) {
|
||||
return Promise.reject<AttachItem[]>(new Error(localize("no.process.list", "Transport attach could not obtain processes list.")));
|
||||
} else {
|
||||
let processes: string[] = lines.slice(1);
|
||||
const processes: string[] = lines.slice(1);
|
||||
return PsProcessParser.ParseProcessFromPsArray(processes)
|
||||
.sort((a, b) => {
|
||||
if (a.name === undefined) {
|
||||
@@ -166,8 +166,8 @@ export class RemoteAttachPicker {
|
||||
if (b.name === undefined) {
|
||||
return -1;
|
||||
}
|
||||
let aLower: string = a.name.toLowerCase();
|
||||
let bLower: string = b.name.toLowerCase();
|
||||
const aLower: string = a.name.toLowerCase();
|
||||
const bLower: string = b.name.toLowerCase();
|
||||
if (aLower === bLower) {
|
||||
return 0;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ export class RemoteAttachPicker {
|
||||
private static createArgumentList(args: string[]): string {
|
||||
let argsString: string = "";
|
||||
|
||||
for (let arg of args) {
|
||||
for (const arg of args) {
|
||||
if (argsString) {
|
||||
argsString += " ";
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export class QuickPickConfigurationProvider implements vscode.DebugConfiguration
|
||||
}
|
||||
|
||||
const items: MenuItem[] = configs.map<MenuItem>(config => {
|
||||
let menuItem: MenuItem = {label: config.name, configuration: config};
|
||||
const menuItem: MenuItem = {label: config.name, configuration: config};
|
||||
// Rename the menu item for the default configuration as its name is non-descriptive.
|
||||
if (isDebugLaunchStr(menuItem.label)) {
|
||||
menuItem.label = localize("default.configuration.menuitem", "Default Configuration");
|
||||
@@ -105,7 +105,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
* Returns a list of initial debug configurations based on contextual information, e.g. package.json or folder.
|
||||
*/
|
||||
async provideDebugConfigurations(folder?: vscode.WorkspaceFolder, token?: vscode.CancellationToken): Promise<vscode.DebugConfiguration[]> {
|
||||
let buildTasks: vscode.Task[] = await getBuildTasks(true);
|
||||
let buildTasks: vscode.Task[] = await getBuildTasks(true, true);
|
||||
if (buildTasks.length === 0) {
|
||||
return Promise.resolve(this.provider.getInitialConfigurations(this.type));
|
||||
}
|
||||
@@ -119,11 +119,11 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
// Filter out build tasks that don't match the currently selected debug configuration type.
|
||||
buildTasks = buildTasks.filter((task: vscode.Task) => {
|
||||
if (defaultConfig.name.startsWith("(Windows) ")) {
|
||||
if (task.name.startsWith("cl.exe")) {
|
||||
if (task.name.startsWith("C/C++: cl.exe")) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (!task.name.startsWith("cl.exe")) {
|
||||
if (!task.name.startsWith("C/C++: cl.exe")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -132,11 +132,11 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
|
||||
// Generate new configurations for each build task.
|
||||
// Generating a task is async, therefore we must *await* *all* map(task => config) Promises to resolve.
|
||||
let configs: vscode.DebugConfiguration[] = await Promise.all(buildTasks.map<Promise<vscode.DebugConfiguration>>(async task => {
|
||||
const configs: vscode.DebugConfiguration[] = await Promise.all(buildTasks.map<Promise<vscode.DebugConfiguration>>(async task => {
|
||||
const definition: BuildTaskDefinition = task.definition as BuildTaskDefinition;
|
||||
const compilerName: string = path.basename(definition.compilerPath);
|
||||
|
||||
let newConfig: vscode.DebugConfiguration = {...defaultConfig}; // Copy enumerables and properties
|
||||
const newConfig: vscode.DebugConfiguration = {...defaultConfig}; // Copy enumerables and properties
|
||||
|
||||
newConfig.name = compilerName + buildAndDebugActiveFileStr();
|
||||
newConfig.preLaunchTask = task.name;
|
||||
@@ -188,91 +188,101 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
* Try to add all missing attributes to the debug configuration being launched.
|
||||
*/
|
||||
resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
|
||||
if (config) {
|
||||
if (config.type === '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"));
|
||||
return undefined;
|
||||
}
|
||||
// [Microsoft/vscode#54213] If config or type is not specified, return null to trigger VS Code to open a configuration file.
|
||||
if (!config || !config.type) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Disable debug heap by default, enable if 'enableDebugHeap' is set.
|
||||
if (!config.enableDebugHeap) {
|
||||
const disableDebugHeapEnvSetting: Environment = {"name" : "_NO_DEBUG_HEAP", "value" : "1"};
|
||||
|
||||
if (config.environment && util.isArray(config.environment)) {
|
||||
config.environment.push(disableDebugHeapEnvSetting);
|
||||
} else {
|
||||
config.environment = [disableDebugHeapEnvSetting];
|
||||
}
|
||||
}
|
||||
if (config.type === '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"));
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Add environment variables from .env file
|
||||
this.resolveEnvFile(config, folder);
|
||||
// Disable debug heap by default, enable if 'enableDebugHeap' is set.
|
||||
if (!config.enableDebugHeap) {
|
||||
const disableDebugHeapEnvSetting: Environment = {"name" : "_NO_DEBUG_HEAP", "value" : "1"};
|
||||
|
||||
this.resolveSourceFileMapVariables(config);
|
||||
|
||||
// Modify WSL config for OpenDebugAD7
|
||||
if (os.platform() === 'win32' &&
|
||||
config.pipeTransport &&
|
||||
config.pipeTransport.pipeProgram) {
|
||||
let replacedPipeProgram: string | undefined;
|
||||
const pipeProgramStr: string = config.pipeTransport.pipeProgram.toLowerCase().trim();
|
||||
|
||||
// OpenDebugAD7 is a 32-bit process. Make sure the WSL pipe transport is using the correct program.
|
||||
replacedPipeProgram = debugUtils.ArchitectureReplacer.checkAndReplaceWSLPipeProgram(pipeProgramStr, debugUtils.ArchType.ia32);
|
||||
|
||||
// If pipeProgram does not get replaced and there is a pipeCwd, concatenate with pipeProgramStr and attempt to replace.
|
||||
if (!replacedPipeProgram && !path.isAbsolute(pipeProgramStr) && config.pipeTransport.pipeCwd) {
|
||||
const pipeCwdStr: string = config.pipeTransport.pipeCwd.toLowerCase().trim();
|
||||
const newPipeProgramStr: string = path.join(pipeCwdStr, pipeProgramStr);
|
||||
|
||||
replacedPipeProgram = debugUtils.ArchitectureReplacer.checkAndReplaceWSLPipeProgram(newPipeProgramStr, debugUtils.ArchType.ia32);
|
||||
}
|
||||
|
||||
if (replacedPipeProgram) {
|
||||
config.pipeTransport.pipeProgram = replacedPipeProgram;
|
||||
}
|
||||
}
|
||||
|
||||
const macOSMIMode: string = config.osx?.MIMode ?? config.MIMode;
|
||||
const macOSMIDebuggerPath: string = config.osx?.miDebuggerPath ?? config.miDebuggerPath;
|
||||
|
||||
const lldb_mi_10_x_path: string = path.join(util.extensionPath, "debugAdapters", "lldb-mi", "bin", "lldb-mi");
|
||||
|
||||
// Validate LLDB-MI
|
||||
if (os.platform() === 'darwin' && // Check for macOS
|
||||
fs.existsSync(lldb_mi_10_x_path) && // lldb-mi 10.x exists
|
||||
(!macOSMIMode || macOSMIMode === 'lldb') &&
|
||||
!macOSMIDebuggerPath // User did not provide custom lldb-mi
|
||||
) {
|
||||
const frameworkPath: string | undefined = this.getLLDBFrameworkPath();
|
||||
|
||||
if (!frameworkPath) {
|
||||
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)
|
||||
.then(value => {
|
||||
if (value === moreInfoButton) {
|
||||
let helpURL: string = "https://aka.ms/vscode-cpptools/LLDBFrameworkNotFound";
|
||||
vscode.env.openExternal(vscode.Uri.parse(helpURL));
|
||||
}
|
||||
});
|
||||
|
||||
return undefined;
|
||||
if (config.environment && util.isArray(config.environment)) {
|
||||
config.environment.push(disableDebugHeapEnvSetting);
|
||||
} else {
|
||||
config.environment = [disableDebugHeapEnvSetting];
|
||||
}
|
||||
}
|
||||
}
|
||||
// if config or type is not specified, return null to trigger VS Code to open a configuration file https://github.com/Microsoft/vscode/issues/54213
|
||||
return config && config.type ? config : null;
|
||||
|
||||
// Add environment variables from .env file
|
||||
this.resolveEnvFile(config, folder);
|
||||
|
||||
this.resolveSourceFileMapVariables(config);
|
||||
|
||||
// Modify WSL config for OpenDebugAD7
|
||||
if (os.platform() === 'win32' &&
|
||||
config.pipeTransport &&
|
||||
config.pipeTransport.pipeProgram) {
|
||||
let replacedPipeProgram: string | undefined;
|
||||
const pipeProgramStr: string = config.pipeTransport.pipeProgram.toLowerCase().trim();
|
||||
|
||||
// OpenDebugAD7 is a 32-bit process. Make sure the WSL pipe transport is using the correct program.
|
||||
replacedPipeProgram = debugUtils.ArchitectureReplacer.checkAndReplaceWSLPipeProgram(pipeProgramStr, debugUtils.ArchType.ia32);
|
||||
|
||||
// If pipeProgram does not get replaced and there is a pipeCwd, concatenate with pipeProgramStr and attempt to replace.
|
||||
if (!replacedPipeProgram && !path.isAbsolute(pipeProgramStr) && config.pipeTransport.pipeCwd) {
|
||||
const pipeCwdStr: string = config.pipeTransport.pipeCwd.toLowerCase().trim();
|
||||
const newPipeProgramStr: string = path.join(pipeCwdStr, pipeProgramStr);
|
||||
|
||||
replacedPipeProgram = debugUtils.ArchitectureReplacer.checkAndReplaceWSLPipeProgram(newPipeProgramStr, debugUtils.ArchType.ia32);
|
||||
}
|
||||
|
||||
if (replacedPipeProgram) {
|
||||
config.pipeTransport.pipeProgram = replacedPipeProgram;
|
||||
}
|
||||
}
|
||||
|
||||
const macOSMIMode: string = config.osx?.MIMode ?? config.MIMode;
|
||||
const macOSMIDebuggerPath: string = config.osx?.miDebuggerPath ?? config.miDebuggerPath;
|
||||
|
||||
const lldb_mi_10_x_path: string = path.join(util.extensionPath, "debugAdapters", "lldb-mi", "bin", "lldb-mi");
|
||||
|
||||
// Validate LLDB-MI
|
||||
if (os.platform() === 'darwin' && // Check for macOS
|
||||
fs.existsSync(lldb_mi_10_x_path) && // lldb-mi 10.x exists
|
||||
(!macOSMIMode || macOSMIMode === 'lldb') &&
|
||||
!macOSMIDebuggerPath // User did not provide custom lldb-mi
|
||||
) {
|
||||
const frameworkPath: string | undefined = this.getLLDBFrameworkPath();
|
||||
|
||||
if (!frameworkPath) {
|
||||
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)
|
||||
.then(value => {
|
||||
if (value === moreInfoButton) {
|
||||
const helpURL: string = "https://aka.ms/vscode-cpptools/LLDBFrameworkNotFound";
|
||||
vscode.env.openExternal(vscode.Uri.parse(helpURL));
|
||||
}
|
||||
});
|
||||
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
if (config.logging?.engineLogging) {
|
||||
const outputChannel: logger.Logger = logger.getOutputChannelLogger();
|
||||
outputChannel.appendLine(localize("debugger.launchConfig", "Launch configuration:"));
|
||||
outputChannel.appendLine(JSON.stringify(config, undefined, 2));
|
||||
logger.showOutputChannel();
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
private getLLDBFrameworkPath(): string | undefined {
|
||||
const LLDBFramework: string = "LLDB.framework";
|
||||
// Note: When adding more search paths, make sure the shipped lldb-mi also has it. See Build/lldb-mi.yml and 'install_name_tool' commands.
|
||||
let searchPaths: string[] = [
|
||||
const searchPaths: string[] = [
|
||||
"/Library/Developer/CommandLineTools/Library/PrivateFrameworks", // XCode CLI
|
||||
"/Applications/Xcode.app/Contents/SharedFrameworks" // App Store XCode
|
||||
];
|
||||
@@ -326,7 +336,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
}
|
||||
|
||||
private resolveSourceFileMapVariables(config: vscode.DebugConfiguration): void {
|
||||
let messages: string[] = [];
|
||||
const messages: string[] = [];
|
||||
if (config.sourceFileMap) {
|
||||
for (const sourceFileMapSource of Object.keys(config.sourceFileMap)) {
|
||||
let message: string = "";
|
||||
@@ -370,9 +380,9 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
|
||||
private static async showFileWarningAsync(message: string, fileName: string): Promise<void> {
|
||||
const openItem: vscode.MessageItem = { title: localize("open.envfile", "Open {0}", "envFile") };
|
||||
let result: vscode.MessageItem | undefined = await vscode.window.showWarningMessage(message, openItem);
|
||||
const result: vscode.MessageItem | undefined = await vscode.window.showWarningMessage(message, openItem);
|
||||
if (result && result.title === openItem.title) {
|
||||
let doc: vscode.TextDocument = await vscode.workspace.openTextDocument(fileName);
|
||||
const doc: vscode.TextDocument = await vscode.workspace.openTextDocument(fileName);
|
||||
if (doc) {
|
||||
vscode.window.showTextDocument(doc);
|
||||
}
|
||||
@@ -416,14 +426,14 @@ abstract class DefaultConfigurationProvider implements IConfigurationAssetProvid
|
||||
configurations: IConfiguration[] = [];
|
||||
|
||||
public getInitialConfigurations(debuggerType: DebuggerType): any {
|
||||
let configurationSnippet: IConfigurationSnippet[] = [];
|
||||
const configurationSnippet: IConfigurationSnippet[] = [];
|
||||
|
||||
// Only launch configurations are initial configurations
|
||||
this.configurations.forEach(configuration => {
|
||||
configurationSnippet.push(configuration.GetLaunchConfiguration());
|
||||
});
|
||||
|
||||
let initialConfigurations: any = configurationSnippet.filter(snippet => snippet.debuggerType === debuggerType && snippet.isInitialConfiguration)
|
||||
const initialConfigurations: any = configurationSnippet.filter(snippet => snippet.debuggerType === debuggerType && snippet.isInitialConfiguration)
|
||||
.map(snippet => JSON.parse(snippet.bodyText));
|
||||
|
||||
// If configurations is empty, then it will only have an empty configurations array in launch.json. Users can still add snippets.
|
||||
@@ -431,7 +441,7 @@ abstract class DefaultConfigurationProvider implements IConfigurationAssetProvid
|
||||
}
|
||||
|
||||
public getConfigurationSnippets(): vscode.CompletionItem[] {
|
||||
let completionItems: vscode.CompletionItem[] = [];
|
||||
const completionItems: vscode.CompletionItem[] = [];
|
||||
|
||||
this.configurations.forEach(configuration => {
|
||||
completionItems.push(convertConfigurationSnippetToCompetionItem(configuration.GetLaunchConfiguration()));
|
||||
@@ -500,7 +510,7 @@ class LinuxConfigurationProvider extends DefaultConfigurationProvider {
|
||||
}
|
||||
|
||||
function convertConfigurationSnippetToCompetionItem(snippet: IConfigurationSnippet): vscode.CompletionItem {
|
||||
let item: vscode.CompletionItem = new vscode.CompletionItem(snippet.label, vscode.CompletionItemKind.Snippet);
|
||||
const item: vscode.CompletionItem = new vscode.CompletionItem(snippet.label, vscode.CompletionItemKind.Snippet);
|
||||
|
||||
item.insertText = snippet.bodyText;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export function indentJsonString(json: string, numTabs: number = 1): string {
|
||||
}
|
||||
|
||||
function formatString(format: string, args: string[]): string {
|
||||
for (let arg in args) {
|
||||
for (const arg in args) {
|
||||
format = format.replace("{" + arg + "}", args[arg]);
|
||||
}
|
||||
return format;
|
||||
@@ -107,9 +107,9 @@ abstract class Configuration implements IConfiguration {
|
||||
export class MIConfigurations extends Configuration {
|
||||
|
||||
public GetLaunchConfiguration(): IConfigurationSnippet {
|
||||
let name: string = `(${this.MIMode}) ${localize("launch.string", "Launch").replace(/\"/g, "\\\"")}`;
|
||||
const name: string = `(${this.MIMode}) ${localize("launch.string", "Launch").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
let body: string = formatString(`{
|
||||
const body: string = formatString(`{
|
||||
\t${indentJsonString(createLaunchString(name, this.miDebugger, this.executable))},
|
||||
\t"MIMode": "${this.MIMode}"{0}{1}
|
||||
}`, [this.miDebugger === "cppdbg" && os.platform() === "win32" ? `,${os.EOL}\t"miDebuggerPath": "/path/to/gdb"` : "",
|
||||
@@ -125,9 +125,9 @@ export class MIConfigurations extends Configuration {
|
||||
}
|
||||
|
||||
public GetAttachConfiguration(): IConfigurationSnippet {
|
||||
let name: string = `(${this.MIMode}) ${localize("attach.string", "Attach").replace(/\"/g, "\\\"")}`;
|
||||
const name: string = `(${this.MIMode}) ${localize("attach.string", "Attach").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
let body: string = formatString(`{
|
||||
const body: string = formatString(`{
|
||||
\t${indentJsonString(createAttachString(name, this.miDebugger, this.executable))},
|
||||
\t"MIMode": "${this.MIMode}"{0}{1}
|
||||
}`, [this.miDebugger === "cppdbg" && os.platform() === "win32" ? `,${os.EOL}\t"miDebuggerPath": "/path/to/gdb"` : "",
|
||||
@@ -146,9 +146,9 @@ export class MIConfigurations extends Configuration {
|
||||
export class PipeTransportConfigurations extends Configuration {
|
||||
|
||||
public GetLaunchConfiguration(): IConfigurationSnippet {
|
||||
let name: string = `(${this.MIMode}) ${localize("pipe.launch", "Pipe Launch").replace(/\"/g, "\\\"")}`;
|
||||
const name: string = `(${this.MIMode}) ${localize("pipe.launch", "Pipe Launch").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
let body: string = formatString(`
|
||||
const body: string = formatString(`
|
||||
{
|
||||
\t${indentJsonString(createLaunchString(name, this.miDebugger, this.executable))},
|
||||
\t${indentJsonString(createPipeTransportString(this.pipeProgram, this.MIMode))},
|
||||
@@ -165,9 +165,9 @@ export class PipeTransportConfigurations extends Configuration {
|
||||
}
|
||||
|
||||
public GetAttachConfiguration(): IConfigurationSnippet {
|
||||
let name: string = `(${this.MIMode}) ${localize("pipe.attach", "Pipe Attach").replace(/\"/g, "\\\"")}`;
|
||||
const name: string = `(${this.MIMode}) ${localize("pipe.attach", "Pipe Attach").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
let body: string = formatString(`
|
||||
const body: string = formatString(`
|
||||
{
|
||||
\t${indentJsonString(createRemoteAttachString(name, this.miDebugger, this.executable))},
|
||||
\t${indentJsonString(createPipeTransportString(this.pipeProgram, this.MIMode))},
|
||||
@@ -186,9 +186,9 @@ export class PipeTransportConfigurations extends Configuration {
|
||||
export class WindowsConfigurations extends Configuration {
|
||||
|
||||
public GetLaunchConfiguration(): IConfigurationSnippet {
|
||||
let name: string = `(Windows) ${localize("launch.string", "Launch").replace(/\"/g, "\\\"")}`;
|
||||
const name: string = `(Windows) ${localize("launch.string", "Launch").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
let body: string = `
|
||||
const body: string = `
|
||||
{
|
||||
\t${indentJsonString(createLaunchString(name, this.windowsDebugger, this.executable))}
|
||||
}`;
|
||||
@@ -204,9 +204,9 @@ export class WindowsConfigurations extends Configuration {
|
||||
}
|
||||
|
||||
public GetAttachConfiguration(): IConfigurationSnippet {
|
||||
let name: string = `(Windows) ${localize("attach.string", "Attach").replace(/\"/g, "\\\"")}`;
|
||||
const name: string = `(Windows) ${localize("attach.string", "Attach").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
let body: string = `
|
||||
const body: string = `
|
||||
{
|
||||
\t${indentJsonString(createAttachString(name, this.windowsDebugger, this.executable))}
|
||||
}`;
|
||||
@@ -226,9 +226,9 @@ export class WSLConfigurations extends Configuration {
|
||||
public bashPipeProgram = process.arch === 'ia32' ? "${env:windir}\\\\sysnative\\\\bash.exe" : "${env:windir}\\\\system32\\\\bash.exe";
|
||||
|
||||
public GetLaunchConfiguration(): IConfigurationSnippet {
|
||||
let name: string = `(${this.MIMode}) ${localize("bash.on.windows.launch", "Bash on Windows Launch").replace(/\"/g, "\\\"")}`;
|
||||
const name: string = `(${this.MIMode}) ${localize("bash.on.windows.launch", "Bash on Windows Launch").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
let body: string = formatString(`
|
||||
const body: string = formatString(`
|
||||
{
|
||||
\t${indentJsonString(createLaunchString(name, this.miDebugger, this.executable))},
|
||||
\t${indentJsonString(createPipeTransportString(this.bashPipeProgram, this.MIMode, ["-c"]))}{0}
|
||||
@@ -243,9 +243,9 @@ export class WSLConfigurations extends Configuration {
|
||||
}
|
||||
|
||||
public GetAttachConfiguration(): IConfigurationSnippet {
|
||||
let name: string = `(${this.MIMode}) ${localize("bash.on.windows.attach", "Bash on Windows Attach").replace(/\"/g, "\\\"")}`;
|
||||
const name: string = `(${this.MIMode}) ${localize("bash.on.windows.attach", "Bash on Windows Attach").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
let body: string = formatString(`
|
||||
const body: string = formatString(`
|
||||
{
|
||||
\t${indentJsonString(createRemoteAttachString(name, this.miDebugger, this.executable))},
|
||||
\t${indentJsonString(createPipeTransportString(this.bashPipeProgram, this.MIMode, ["-c"]))}{0}
|
||||
|
||||
@@ -17,7 +17,7 @@ nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFo
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
// The extension deactivate method is asynchronous, so we handle the disposables ourselves instead of using extensonContext.subscriptions.
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
|
||||
export function buildAndDebugActiveFileStr(): string {
|
||||
return ` - ${localize("build.and.debug.active.file", 'Build and debug active file')}`;
|
||||
@@ -25,14 +25,14 @@ export function buildAndDebugActiveFileStr(): string {
|
||||
|
||||
export function initialize(context: vscode.ExtensionContext): void {
|
||||
// Activate Process Picker Commands
|
||||
let attachItemsProvider: AttachItemsProvider = NativeAttachItemsProviderFactory.Get();
|
||||
let attacher: AttachPicker = new AttachPicker(attachItemsProvider);
|
||||
const attachItemsProvider: AttachItemsProvider = NativeAttachItemsProviderFactory.Get();
|
||||
const attacher: AttachPicker = new AttachPicker(attachItemsProvider);
|
||||
disposables.push(vscode.commands.registerCommand('extension.pickNativeProcess', () => attacher.ShowAttachEntries()));
|
||||
let remoteAttacher: RemoteAttachPicker = new RemoteAttachPicker();
|
||||
const remoteAttacher: RemoteAttachPicker = new RemoteAttachPicker();
|
||||
disposables.push(vscode.commands.registerCommand('extension.pickRemoteNativeProcess', (any) => remoteAttacher.ShowAttachEntries(any)));
|
||||
|
||||
// Activate ConfigurationProvider
|
||||
let configurationProvider: IConfigurationAssetProvider = ConfigurationAssetProviderFactory.getConfigurationProvider();
|
||||
const configurationProvider: IConfigurationAssetProvider = ConfigurationAssetProviderFactory.getConfigurationProvider();
|
||||
// On non-windows platforms, the cppvsdbg debugger will not be registered for initial configurations.
|
||||
// This will cause it to not show up on the dropdown list.
|
||||
let vsdbgProvider: CppVsDbgConfigurationProvider | null = null;
|
||||
@@ -58,11 +58,11 @@ export function initialize(context: vscode.ExtensionContext): void {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
let configs: vscode.DebugConfiguration[] = (await provider.provideDebugConfigurations(folder)).filter(config =>
|
||||
const configs: vscode.DebugConfiguration[] = (await provider.provideDebugConfigurations(folder)).filter(config =>
|
||||
config.name.indexOf(buildAndDebugActiveFileStr()) !== -1);
|
||||
|
||||
if (vsdbgProvider) {
|
||||
let vsdbgConfigs: vscode.DebugConfiguration[] = (await vsdbgProvider.provideDebugConfigurations(folder)).filter(config =>
|
||||
const vsdbgConfigs: vscode.DebugConfiguration[] = (await vsdbgProvider.provideDebugConfigurations(folder)).filter(config =>
|
||||
config.name.indexOf(buildAndDebugActiveFileStr()) !== -1);
|
||||
if (vsdbgConfigs) {
|
||||
configs.push(...vsdbgConfigs);
|
||||
|
||||
@@ -52,14 +52,14 @@ abstract class NativeAttachItemsProvider implements AttachItemsProvider {
|
||||
if (b.name === undefined) {
|
||||
return -1;
|
||||
}
|
||||
let aLower: string = a.name.toLowerCase();
|
||||
let bLower: string = b.name.toLowerCase();
|
||||
const aLower: string = a.name.toLowerCase();
|
||||
const bLower: string = b.name.toLowerCase();
|
||||
if (aLower === bLower) {
|
||||
return 0;
|
||||
}
|
||||
return aLower < bLower ? -1 : 1;
|
||||
});
|
||||
let attachItems: AttachItem[] = processEntries.map(p => p.toAttachItem());
|
||||
const attachItems: AttachItem[] = processEntries.map(p => p.toAttachItem());
|
||||
return attachItems;
|
||||
});
|
||||
}
|
||||
@@ -119,21 +119,21 @@ export class PsProcessParser {
|
||||
|
||||
// Only public for tests.
|
||||
public static ParseProcessFromPs(processes: string): Process[] {
|
||||
let lines: string[] = processes.split(os.EOL);
|
||||
const lines: string[] = processes.split(os.EOL);
|
||||
return PsProcessParser.ParseProcessFromPsArray(lines);
|
||||
}
|
||||
|
||||
public static ParseProcessFromPsArray(processArray: string[]): Process[] {
|
||||
let processEntries: Process[] = [];
|
||||
const processEntries: Process[] = [];
|
||||
|
||||
// lines[0] is the header of the table
|
||||
for (let i: number = 1; i < processArray.length; i++) {
|
||||
let line: string = processArray[i];
|
||||
const line: string = processArray[i];
|
||||
if (!line) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let processEntry: Process | undefined = PsProcessParser.parseLineFromPs(line);
|
||||
const processEntry: Process | undefined = PsProcessParser.parseLineFromPs(line);
|
||||
if (processEntry) {
|
||||
processEntries.push(processEntry);
|
||||
}
|
||||
@@ -206,12 +206,12 @@ export class WmicProcessParser {
|
||||
|
||||
// Only public for tests.
|
||||
public static ParseProcessFromWmic(processes: string): Process[] {
|
||||
let lines: string[] = processes.split(os.EOL);
|
||||
const lines: string[] = processes.split(os.EOL);
|
||||
let currentProcess: Process = new Process("current process", undefined, undefined);
|
||||
let processEntries: Process[] = [];
|
||||
const processEntries: Process[] = [];
|
||||
|
||||
for (let i: number = 0; i < lines.length; i++) {
|
||||
let line: string = lines[i];
|
||||
const line: string = lines[i];
|
||||
if (!line) {
|
||||
continue;
|
||||
}
|
||||
@@ -229,9 +229,9 @@ export class WmicProcessParser {
|
||||
}
|
||||
|
||||
private static parseLineFromWmic(line: string, process: Process): void {
|
||||
let splitter: number = line.indexOf('=');
|
||||
const splitter: number = line.indexOf('=');
|
||||
if (splitter >= 0) {
|
||||
let key: string = line.slice(0, line.indexOf('=')).trim();
|
||||
const key: string = line.slice(0, line.indexOf('=')).trim();
|
||||
let value: string = line.slice(line.indexOf('=') + 1).trim();
|
||||
if (key === WmicProcessParser.wmicNameTitle) {
|
||||
process.name = value;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ export class ClientCollection {
|
||||
|
||||
public get ActiveClient(): cpptools.Client { return this.activeClient; }
|
||||
public get Names(): ClientKey[] {
|
||||
let result: ClientKey[] = [];
|
||||
const result: ClientKey[] = [];
|
||||
this.languageClients.forEach((client, key) => {
|
||||
result.push({ name: client.Name, key: key });
|
||||
});
|
||||
@@ -38,7 +38,7 @@ export class ClientCollection {
|
||||
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
|
||||
let isFirstWorkspaceFolder: boolean = true;
|
||||
vscode.workspace.workspaceFolders.forEach(folder => {
|
||||
let newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
const newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
this.languageClients.set(util.asFolder(folder.uri), newClient);
|
||||
if (isFirstWorkspaceFolder) {
|
||||
isFirstWorkspaceFolder = false;
|
||||
@@ -47,7 +47,7 @@ export class ClientCollection {
|
||||
}
|
||||
});
|
||||
key = util.asFolder(vscode.workspace.workspaceFolders[0].uri);
|
||||
let client: cpptools.Client | undefined = this.languageClients.get(key);
|
||||
const client: cpptools.Client | undefined = this.languageClients.get(key);
|
||||
if (!client) {
|
||||
throw new Error("Failed to construct default client");
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export class ClientCollection {
|
||||
|
||||
public activeDocumentChanged(document: vscode.TextDocument): void {
|
||||
this.activeDocument = document;
|
||||
let activeClient: cpptools.Client = this.getClientFor(document.uri);
|
||||
const activeClient: cpptools.Client = this.getClientFor(document.uri);
|
||||
|
||||
// Notify the active client that the document has changed.
|
||||
activeClient.activeDocumentChanged(document);
|
||||
@@ -81,7 +81,7 @@ export class ClientCollection {
|
||||
* get a handle to a language client. returns undefined if the client was not found.
|
||||
*/
|
||||
public get(key: string): cpptools.Client | undefined {
|
||||
let client: cpptools.Client | undefined = this.languageClients.get(key);
|
||||
const client: cpptools.Client | undefined = this.languageClients.get(key);
|
||||
console.assert(client, "key not found");
|
||||
return client;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ export class ClientCollection {
|
||||
*/
|
||||
public replace(client: cpptools.Client, transferFileOwnership: boolean): cpptools.Client | undefined {
|
||||
let key: string | undefined;
|
||||
for (let pair of this.languageClients) {
|
||||
for (const pair of this.languageClients) {
|
||||
if (pair[1] === client) {
|
||||
key = pair[0];
|
||||
break;
|
||||
@@ -133,14 +133,14 @@ export class ClientCollection {
|
||||
}
|
||||
|
||||
private onDidChangeWorkspaceFolders(e?: vscode.WorkspaceFoldersChangeEvent): void {
|
||||
let folderCount: number = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders.length : 0;
|
||||
const folderCount: number = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders.length : 0;
|
||||
if (folderCount > 1) {
|
||||
telemetry.logLanguageServerEvent("workspaceFoldersChange", { "count": folderCount.toString() });
|
||||
}
|
||||
|
||||
if (e !== undefined) {
|
||||
e.removed.forEach(folder => {
|
||||
let path: string = util.asFolder(folder.uri);
|
||||
const path: string = util.asFolder(folder.uri);
|
||||
const client: cpptools.Client | undefined = this.languageClients.get(path);
|
||||
if (client) {
|
||||
this.languageClients.delete(path); // Do this first so that we don't iterate on it during the ownership transfer process.
|
||||
@@ -162,41 +162,41 @@ export class ClientCollection {
|
||||
}
|
||||
});
|
||||
e.added.forEach(folder => {
|
||||
let path: string = util.asFolder(folder.uri);
|
||||
let client: cpptools.Client | undefined = this.languageClients.get(path);
|
||||
const path: string = util.asFolder(folder.uri);
|
||||
const client: cpptools.Client | undefined = this.languageClients.get(path);
|
||||
if (!client) {
|
||||
let newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
const newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
this.languageClients.set(path, newClient);
|
||||
newClient.deactivate(); // e.g. prevent the current config from switching.
|
||||
let defaultClient: cpptools.DefaultClient = <cpptools.DefaultClient>newClient;
|
||||
defaultClient.sendDidChangeSettings();
|
||||
const defaultClient: cpptools.DefaultClient = <cpptools.DefaultClient>newClient;
|
||||
defaultClient.sendAllSettings();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private transferOwnership(document: vscode.TextDocument, oldOwner: cpptools.Client): void {
|
||||
let newOwner: cpptools.Client = this.getClientFor(document.uri);
|
||||
const newOwner: cpptools.Client = this.getClientFor(document.uri);
|
||||
if (newOwner !== oldOwner) {
|
||||
newOwner.takeOwnership(document);
|
||||
}
|
||||
}
|
||||
|
||||
public getClientFor(uri: vscode.Uri): cpptools.Client {
|
||||
let folder: vscode.WorkspaceFolder | undefined = uri ? vscode.workspace.getWorkspaceFolder(uri) : undefined;
|
||||
const folder: vscode.WorkspaceFolder | undefined = uri ? vscode.workspace.getWorkspaceFolder(uri) : undefined;
|
||||
if (!folder) {
|
||||
return this.defaultClient;
|
||||
} else {
|
||||
let key: string = util.asFolder(folder.uri);
|
||||
let client: cpptools.Client | undefined = this.languageClients.get(key);
|
||||
const key: string = util.asFolder(folder.uri);
|
||||
const client: cpptools.Client | undefined = this.languageClients.get(key);
|
||||
if (client) {
|
||||
return client;
|
||||
}
|
||||
let newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
const newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
this.languageClients.set(key, newClient);
|
||||
getCustomConfigProviders().forEach(provider => newClient.onRegisterCustomConfigurationProvider(provider));
|
||||
let defaultClient: cpptools.DefaultClient = <cpptools.DefaultClient>newClient;
|
||||
defaultClient.sendDidChangeSettings();
|
||||
const defaultClient: cpptools.DefaultClient = <cpptools.DefaultClient>newClient;
|
||||
defaultClient.sendAllSettings();
|
||||
return newClient;
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ export class ClientCollection {
|
||||
}
|
||||
|
||||
public dispose(): Thenable<void> {
|
||||
let promises: Thenable<void>[] = [];
|
||||
const promises: Thenable<void>[] = [];
|
||||
this.disposables.forEach((d: vscode.Disposable) => d.dispose());
|
||||
|
||||
// this.defaultClient is already in this.languageClients, so do not call dispose() on it.
|
||||
|
||||
@@ -142,12 +142,12 @@ export class ColorizationSettings {
|
||||
this.findThemeStyleForScope(baseCStyle, baseCppStyle, scope, rules);
|
||||
});
|
||||
|
||||
let otherSettings: OtherSettings = new OtherSettings(this.uri);
|
||||
const otherSettings: OtherSettings = new OtherSettings(this.uri);
|
||||
|
||||
// Next in priority would be a global user override of token color of the equivilent scope
|
||||
let colorTokenName: string | undefined = ColorizationSettings.scopeToTokenColorNameMap.get(scope);
|
||||
const colorTokenName: string | undefined = ColorizationSettings.scopeToTokenColorNameMap.get(scope);
|
||||
if (colorTokenName) {
|
||||
let settingValue: string | undefined = otherSettings.getCustomColorToken(colorTokenName);
|
||||
const settingValue: string | undefined = otherSettings.getCustomColorToken(colorTokenName);
|
||||
if (settingValue) {
|
||||
if (baseCStyle) {
|
||||
baseCStyle.foreground = settingValue;
|
||||
@@ -163,7 +163,7 @@ export class ColorizationSettings {
|
||||
|
||||
// Next in priority would be a theme-specific user override of token color of the equivilent scope
|
||||
if (colorTokenName) {
|
||||
let settingValue: string | undefined = otherSettings.getCustomThemeSpecificColorToken(colorTokenName, themeName);
|
||||
const settingValue: string | undefined = otherSettings.getCustomThemeSpecificColorToken(colorTokenName, themeName);
|
||||
if (settingValue) {
|
||||
if (baseCStyle) {
|
||||
baseCStyle.foreground = settingValue;
|
||||
@@ -175,14 +175,14 @@ export class ColorizationSettings {
|
||||
}
|
||||
|
||||
// Next in priority would be a theme-specific user override of this scope in textMateRules
|
||||
let textMateRules: TextMateRule[] | undefined = otherSettings.getCustomThemeSpecificTextMateRules(themeName);
|
||||
const textMateRules: TextMateRule[] | undefined = otherSettings.getCustomThemeSpecificTextMateRules(themeName);
|
||||
this.findThemeStyleForScope(baseCStyle, baseCppStyle, scope, textMateRules);
|
||||
}
|
||||
|
||||
// For each level of the scope, look of style information
|
||||
private calculateStyleForToken(tokenKind: TokenKind, scope: string, themeName: string, themeTextMateRules: TextMateRule[][]): void {
|
||||
// Try scopes, from most general to most specific, apply style in cascading manner
|
||||
let parts: string[] = scope.split(".");
|
||||
const parts: string[] = scope.split(".");
|
||||
let accumulatedScope: string = "";
|
||||
for (let i: number = 0; i < parts.length; i++) {
|
||||
accumulatedScope += parts[i];
|
||||
@@ -238,7 +238,7 @@ export class ColorizationSettings {
|
||||
public async loadTheme(themePath: string, defaultStyle: ThemeStyle): Promise<TextMateRule[][]> {
|
||||
let rules: TextMateRule[][] = [];
|
||||
if (await util.checkFileExists(themePath)) {
|
||||
let themeContentText: string = await util.readFileText(themePath);
|
||||
const themeContentText: string = await util.readFileText(themePath);
|
||||
let themeContent: any;
|
||||
let textMateRules: TextMateRule[] | undefined;
|
||||
if (themePath.endsWith("tmTheme")) {
|
||||
@@ -252,7 +252,7 @@ export class ColorizationSettings {
|
||||
textMateRules = themeContent.tokenColors;
|
||||
if (themeContent.include) {
|
||||
// parse included theme file
|
||||
let includedThemePath: string = path.join(path.dirname(themePath), themeContent.include);
|
||||
const includedThemePath: string = path.join(path.dirname(themePath), themeContent.include);
|
||||
rules = await this.loadTheme(includedThemePath, defaultStyle);
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ export class ColorizationSettings {
|
||||
}
|
||||
});
|
||||
|
||||
let scopelessSetting: any = textMateRules.find(e => e.settings && !e.scope);
|
||||
const scopelessSetting: any = textMateRules.find(e => e.settings && !e.scope);
|
||||
if (scopelessSetting) {
|
||||
if (scopelessSetting.settings.background) {
|
||||
this.editorBackground = scopelessSetting.settings.background;
|
||||
@@ -285,27 +285,27 @@ export class ColorizationSettings {
|
||||
}
|
||||
|
||||
public reload(): void {
|
||||
let f: () => void = async () => {
|
||||
let otherSettings: OtherSettings = new OtherSettings(this.uri);
|
||||
let themeName: string | undefined = otherSettings.colorTheme;
|
||||
const f: () => void = async () => {
|
||||
const otherSettings: OtherSettings = new OtherSettings(this.uri);
|
||||
const themeName: string | undefined = otherSettings.colorTheme;
|
||||
if (themeName) {
|
||||
// Enumerate through all extensions, looking for this theme. (Themes are implemented as extensions - even the default ones)
|
||||
// Open each package.json to check for a theme path
|
||||
for (let i: number = 0; i < vscode.extensions.all.length; i++) {
|
||||
let extensionPath: string = vscode.extensions.all[i].extensionPath;
|
||||
let extensionPackageJsonPath: string = path.join(extensionPath, "package.json");
|
||||
const extensionPath: string = vscode.extensions.all[i].extensionPath;
|
||||
const extensionPackageJsonPath: string = path.join(extensionPath, "package.json");
|
||||
if (!await util.checkFileExists(extensionPackageJsonPath)) {
|
||||
continue;
|
||||
}
|
||||
let packageJsonText: string = await util.readFileText(extensionPackageJsonPath);
|
||||
let packageJson: any = jsonc.parse(packageJsonText);
|
||||
const packageJsonText: string = await util.readFileText(extensionPackageJsonPath);
|
||||
const packageJson: any = jsonc.parse(packageJsonText);
|
||||
if (packageJson.contributes && packageJson.contributes.themes) {
|
||||
let foundTheme: any = packageJson.contributes.themes.find((e: any) => e.id === themeName || e.label === themeName);
|
||||
const foundTheme: any = packageJson.contributes.themes.find((e: any) => e.id === themeName || e.label === themeName);
|
||||
if (foundTheme) {
|
||||
let themeRelativePath: string = foundTheme.path;
|
||||
let themeFullPath: string = path.join(extensionPath, themeRelativePath);
|
||||
let defaultStyle: ThemeStyle = new ThemeStyle();
|
||||
let rulesSet: TextMateRule[][] = await this.loadTheme(themeFullPath, defaultStyle);
|
||||
const themeRelativePath: string = foundTheme.path;
|
||||
const themeFullPath: string = path.join(extensionPath, themeRelativePath);
|
||||
const defaultStyle: ThemeStyle = new ThemeStyle();
|
||||
const rulesSet: TextMateRule[][] = await this.loadTheme(themeFullPath, defaultStyle);
|
||||
this.updateStyles(themeName, defaultStyle, rulesSet);
|
||||
return;
|
||||
}
|
||||
@@ -318,7 +318,7 @@ export class ColorizationSettings {
|
||||
|
||||
public static createDecorationFromThemeStyle(themeStyle: ThemeStyle): vscode.TextEditorDecorationType | undefined {
|
||||
if (themeStyle && (themeStyle.foreground || themeStyle.background || themeStyle.fontStyle)) {
|
||||
let options: vscode.DecorationRenderOptions = {};
|
||||
const options: vscode.DecorationRenderOptions = {};
|
||||
options.rangeBehavior = vscode.DecorationRangeBehavior.OpenOpen;
|
||||
if (themeStyle.foreground) {
|
||||
options.color = themeStyle.foreground;
|
||||
@@ -327,7 +327,7 @@ export class ColorizationSettings {
|
||||
options.backgroundColor = themeStyle.background;
|
||||
}
|
||||
if (themeStyle.fontStyle) {
|
||||
let parts: string[] = themeStyle.fontStyle.split(" ");
|
||||
const parts: string[] = themeStyle.fontStyle.split(" ");
|
||||
parts.forEach((part) => {
|
||||
switch (part) {
|
||||
case "italic":
|
||||
@@ -368,7 +368,7 @@ export class ColorizationState {
|
||||
}
|
||||
|
||||
private createColorizationDecorations(isCpp: boolean): void {
|
||||
let settings: CppSettings = new CppSettings(this.uri);
|
||||
const settings: CppSettings = new CppSettings(this.uri);
|
||||
if (settings.enhancedColorization) {
|
||||
// Create new decorators
|
||||
// The first decorator created takes precedence, so these need to be created in reverse order
|
||||
@@ -384,7 +384,7 @@ export class ColorizationState {
|
||||
}
|
||||
}
|
||||
if (settings.dimInactiveRegions) {
|
||||
let opacity: number | undefined = settings.inactiveRegionOpacity;
|
||||
const opacity: number | undefined = settings.inactiveRegionOpacity;
|
||||
if (opacity !== null && opacity !== undefined) {
|
||||
let backgroundColor: string | undefined = settings.inactiveRegionBackgroundColor;
|
||||
if (backgroundColor === "") {
|
||||
@@ -411,7 +411,7 @@ export class ColorizationState {
|
||||
this.inactiveDecoration = undefined;
|
||||
}
|
||||
for (let i: number = 0; i < TokenKind.Count; i++) {
|
||||
let decoration: vscode.TextEditorDecorationType | undefined = this.decorations[i];
|
||||
const decoration: vscode.TextEditorDecorationType | undefined = this.decorations[i];
|
||||
if (decoration) {
|
||||
decoration.dispose();
|
||||
this.decorations[i] = undefined;
|
||||
@@ -424,12 +424,12 @@ export class ColorizationState {
|
||||
}
|
||||
|
||||
private refreshInner(e: vscode.TextEditor): void {
|
||||
let settings: CppSettings = new CppSettings(this.uri);
|
||||
const settings: CppSettings = new CppSettings(this.uri);
|
||||
if (settings.enhancedColorization) {
|
||||
for (let i: number = 0; i < TokenKind.Count; i++) {
|
||||
let decoration: vscode.TextEditorDecorationType | undefined = this.decorations[i];
|
||||
const decoration: vscode.TextEditorDecorationType | undefined = this.decorations[i];
|
||||
if (decoration) {
|
||||
let ranges: vscode.Range[] = this.semanticRanges[i];
|
||||
const ranges: vscode.Range[] = this.semanticRanges[i];
|
||||
if (ranges && ranges.length > 0) {
|
||||
e.setDecorations(decoration, ranges);
|
||||
}
|
||||
@@ -448,20 +448,20 @@ export class ColorizationState {
|
||||
|
||||
public refresh(e: vscode.TextEditor): void {
|
||||
this.applyEdits();
|
||||
let f: () => void = async () => {
|
||||
const f: () => void = async () => {
|
||||
this.refreshInner(e);
|
||||
};
|
||||
this.colorizationSettings.syncWithLoadingSettings(f);
|
||||
}
|
||||
|
||||
public onSettingsChanged(uri: vscode.Uri): void {
|
||||
let f: () => void = async () => {
|
||||
const f: () => void = async () => {
|
||||
this.applyEdits();
|
||||
this.disposeColorizationDecorations();
|
||||
let isCpp: boolean = util.isEditorFileCpp(uri.toString());
|
||||
const isCpp: boolean = util.isEditorFileCpp(uri.toString());
|
||||
this.createColorizationDecorations(isCpp);
|
||||
let editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri === uri);
|
||||
for (let e of editors) {
|
||||
const editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri === uri);
|
||||
for (const e of editors) {
|
||||
this.refreshInner(e);
|
||||
}
|
||||
};
|
||||
@@ -470,11 +470,11 @@ export class ColorizationState {
|
||||
|
||||
// Utility function to convert a string and a start Position into a Range
|
||||
private textToRange(text: string, startPosition: vscode.Position): vscode.Range {
|
||||
let parts: string[] = text.split("\n");
|
||||
let addedLines: number = parts.length - 1;
|
||||
let newStartLine: number = startPosition.line;
|
||||
let newStartCharacter: number = startPosition.character;
|
||||
let newEndLine: number = newStartLine + addedLines;
|
||||
const parts: string[] = text.split("\n");
|
||||
const addedLines: number = parts.length - 1;
|
||||
const newStartLine: number = startPosition.line;
|
||||
const newStartCharacter: number = startPosition.character;
|
||||
const newEndLine: number = newStartLine + addedLines;
|
||||
let newEndCharacter: number = parts[parts.length - 1].length;
|
||||
if (newStartLine === newEndLine) {
|
||||
newEndCharacter += newStartCharacter;
|
||||
@@ -484,7 +484,7 @@ export class ColorizationState {
|
||||
|
||||
// Utility function to shift a range back after removing content before it
|
||||
private shiftRangeAfterRemove(range: vscode.Range, removeStartPosition: vscode.Position, removeEndPosition: vscode.Position): vscode.Range {
|
||||
let lineDelta: number = removeStartPosition.line - removeEndPosition.line;
|
||||
const lineDelta: number = removeStartPosition.line - removeEndPosition.line;
|
||||
let startCharacterDelta: number = 0;
|
||||
let endCharacterDelta: number = 0;
|
||||
if (range.start.line === removeEndPosition.line) {
|
||||
@@ -493,16 +493,16 @@ export class ColorizationState {
|
||||
endCharacterDelta = startCharacterDelta;
|
||||
}
|
||||
}
|
||||
let newStart: vscode.Position = range.start.translate(lineDelta, startCharacterDelta);
|
||||
let newEnd: vscode.Position = range.end.translate(lineDelta, endCharacterDelta);
|
||||
const newStart: vscode.Position = range.start.translate(lineDelta, startCharacterDelta);
|
||||
const newEnd: vscode.Position = range.end.translate(lineDelta, endCharacterDelta);
|
||||
return new vscode.Range(newStart, newEnd);
|
||||
}
|
||||
|
||||
// Utility function to shift a range forward after inserting content before it
|
||||
private shiftRangeAfterInsert(range: vscode.Range, insertStartPosition: vscode.Position, insertEndPosition: vscode.Position): vscode.Range {
|
||||
let addedLines: number = insertEndPosition.line - insertStartPosition.line;
|
||||
let newStartLine: number = range.start.line + addedLines;
|
||||
let newEndLine: number = range.end.line + addedLines;
|
||||
const addedLines: number = insertEndPosition.line - insertStartPosition.line;
|
||||
const newStartLine: number = range.start.line + addedLines;
|
||||
const newEndLine: number = range.end.line + addedLines;
|
||||
let newStartCharacter: number = range.start.character;
|
||||
let newEndCharacter: number = range.end.character;
|
||||
// If starts on the same line as replacement ended
|
||||
@@ -561,9 +561,9 @@ export class ColorizationState {
|
||||
return new vscode.Range(range.start.line, range.start.character, insertEndPosition.line, insertEndPosition.character + (range.end.character - removeEndPosition.character));
|
||||
}
|
||||
// Else, the trailing segment ends on another line, so the character position should remain the same. Just adjust based on added/removed lined.
|
||||
let removedLines: number = removeEndPosition.line - removeInsertStartPosition.line;
|
||||
let addedLines: number = insertEndPosition.line - removeInsertStartPosition.line;
|
||||
let deltaLines: number = addedLines - removedLines;
|
||||
const removedLines: number = removeEndPosition.line - removeInsertStartPosition.line;
|
||||
const addedLines: number = insertEndPosition.line - removeInsertStartPosition.line;
|
||||
const deltaLines: number = addedLines - removedLines;
|
||||
return new vscode.Range(range.start.line, range.start.character, range.end.line + deltaLines, range.end.character);
|
||||
}
|
||||
|
||||
@@ -572,10 +572,10 @@ export class ColorizationState {
|
||||
let ranges: vscode.Range[] = originalRanges;
|
||||
if (ranges && ranges.length > 0) {
|
||||
changes.forEach((change) => {
|
||||
let newRanges: vscode.Range[] = [];
|
||||
let insertRange: vscode.Range = this.textToRange(change.text, change.range.start);
|
||||
const newRanges: vscode.Range[] = [];
|
||||
const insertRange: vscode.Range = this.textToRange(change.text, change.range.start);
|
||||
for (let i: number = 0; i < ranges.length; i++) {
|
||||
let newRange: vscode.Range | undefined = this.fixRange(ranges[i], change.range.start, change.range.end, insertRange.end);
|
||||
const newRange: vscode.Range | undefined = this.fixRange(ranges[i], change.range.start, change.range.end, insertRange.end);
|
||||
if (newRange) {
|
||||
newRanges.push(newRange);
|
||||
}
|
||||
@@ -588,7 +588,7 @@ export class ColorizationState {
|
||||
|
||||
// Add edits to be applied when/if cached tokens need to be reapplied.
|
||||
public addEdits(changes: readonly vscode.TextDocumentContentChangeEvent[], editVersion: number): void {
|
||||
let edits: VersionedEdits = {
|
||||
const edits: VersionedEdits = {
|
||||
editVersion: editVersion,
|
||||
changes: changes
|
||||
};
|
||||
@@ -610,8 +610,8 @@ export class ColorizationState {
|
||||
|
||||
// Remove any edits from the list if we will never receive tokens that old.
|
||||
private purgeOldVersionedEdits(): void {
|
||||
let minVersion: number = this.lastReceivedSemanticVersion;
|
||||
let index: number = this.versionedEdits.findIndex((edit) => edit.editVersion > minVersion);
|
||||
const minVersion: number = this.lastReceivedSemanticVersion;
|
||||
const index: number = this.versionedEdits.findIndex((edit) => edit.editVersion > minVersion);
|
||||
if (index === -1) {
|
||||
this.versionedEdits = [];
|
||||
} else if (index > 0) {
|
||||
@@ -620,7 +620,7 @@ export class ColorizationState {
|
||||
}
|
||||
|
||||
private updateColorizationRanges(uri: string): void {
|
||||
let f: () => void = async () => {
|
||||
const f: () => void = async () => {
|
||||
this.applyEdits();
|
||||
this.purgeOldVersionedEdits();
|
||||
|
||||
@@ -629,17 +629,17 @@ export class ColorizationState {
|
||||
// likely due to a race with UI updates. Here we set aside the existing decorators to be
|
||||
// disposed of after the new decorators have been applied, so there is not a gap
|
||||
// in which decorators are not applied.
|
||||
let oldInactiveDecoration: vscode.TextEditorDecorationType | undefined = this.inactiveDecoration;
|
||||
let oldDecorations: (vscode.TextEditorDecorationType | undefined)[] = this.decorations;
|
||||
const oldInactiveDecoration: vscode.TextEditorDecorationType | undefined = this.inactiveDecoration;
|
||||
const oldDecorations: (vscode.TextEditorDecorationType | undefined)[] = this.decorations;
|
||||
this.inactiveDecoration = undefined;
|
||||
this.decorations = new Array<vscode.TextEditorDecorationType>(TokenKind.Count);
|
||||
|
||||
let isCpp: boolean = util.isEditorFileCpp(uri);
|
||||
const isCpp: boolean = util.isEditorFileCpp(uri);
|
||||
this.createColorizationDecorations(isCpp);
|
||||
|
||||
// Apply the decorations to all *visible* text editors
|
||||
let editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri.toString() === uri);
|
||||
for (let e of editors) {
|
||||
const editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri.toString() === uri);
|
||||
for (const e of editors) {
|
||||
this.refreshInner(e);
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ export class ColorizationState {
|
||||
}
|
||||
if (oldDecorations) {
|
||||
for (let i: number = 0; i < TokenKind.Count; i++) {
|
||||
let oldDecoration: vscode.TextEditorDecorationType | undefined = oldDecorations[i];
|
||||
const oldDecoration: vscode.TextEditorDecorationType | undefined = oldDecorations[i];
|
||||
if (oldDecoration) {
|
||||
oldDecoration.dispose();
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ export interface Configuration {
|
||||
forcedInclude?: string[];
|
||||
configurationProvider?: string;
|
||||
browse?: Browse;
|
||||
customConfigurationVariables?: {[key: string]: string};
|
||||
}
|
||||
|
||||
export interface ConfigurationErrors {
|
||||
@@ -123,6 +124,7 @@ export class CppProperties {
|
||||
private vcpkgIncludes: string[] = [];
|
||||
private vcpkgPathReady: boolean = false;
|
||||
private defaultIntelliSenseMode?: string;
|
||||
private defaultCustomConfigurationVariables?: { [key: string]: string };
|
||||
private readonly configurationGlobPattern: string = "c_cpp_properties.json";
|
||||
private disposables: vscode.Disposable[] = [];
|
||||
private configurationsChanged = new vscode.EventEmitter<Configuration[]>();
|
||||
@@ -139,7 +141,7 @@ export class CppProperties {
|
||||
|
||||
constructor(rootUri?: vscode.Uri, workspaceFolder?: vscode.WorkspaceFolder) {
|
||||
this.rootUri = rootUri;
|
||||
let rootPath: string = rootUri ? rootUri.fsPath : "";
|
||||
const rootPath: string = rootUri ? rootUri.fsPath : "";
|
||||
if (workspaceFolder) {
|
||||
this.currentConfigurationIndex = new PersistentFolderState<number>("CppProperties.currentConfigurationIndex", -1, workspaceFolder);
|
||||
}
|
||||
@@ -165,7 +167,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
public get ConfigurationNames(): string[] | undefined {
|
||||
let result: string[] = [];
|
||||
const result: string[] = [];
|
||||
if (this.configurationJson) {
|
||||
this.configurationJson.configurations.forEach((config: Configuration) => {
|
||||
result.push(config.name);
|
||||
@@ -187,14 +189,14 @@ export class CppProperties {
|
||||
|
||||
// defaultPaths is only used when there isn't a c_cpp_properties.json, but we don't send the configuration changed event
|
||||
// to the language server until the default include paths and frameworks have been sent.
|
||||
let configFilePath: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
const configFilePath: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
if (this.rootUri !== null && fs.existsSync(configFilePath)) {
|
||||
this.propertiesFile = vscode.Uri.file(configFilePath);
|
||||
} else {
|
||||
this.propertiesFile = null;
|
||||
}
|
||||
|
||||
let settingsPath: string = path.join(this.configFolder, this.configurationGlobPattern);
|
||||
const settingsPath: string = path.join(this.configFolder, this.configurationGlobPattern);
|
||||
this.configFileWatcher = vscode.workspace.createFileSystemWatcher(settingsPath);
|
||||
this.disposables.push(this.configFileWatcher);
|
||||
this.configFileWatcher.onDidCreate((uri) => {
|
||||
@@ -264,7 +266,7 @@ export class CppProperties {
|
||||
this.configurationJson = getDefaultCppProperties();
|
||||
if (resetIndex || this.CurrentConfigurationIndex < 0 ||
|
||||
this.CurrentConfigurationIndex >= this.configurationJson.configurations.length) {
|
||||
let index: number | undefined = this.getConfigIndexForPlatform(this.configurationJson);
|
||||
const index: number | undefined = this.getConfigIndexForPlatform(this.configurationJson);
|
||||
if (this.currentConfigurationIndex !== undefined) {
|
||||
if (index === undefined) {
|
||||
this.currentConfigurationIndex.setDefault();
|
||||
@@ -278,7 +280,7 @@ export class CppProperties {
|
||||
|
||||
private applyDefaultIncludePathsAndFrameworks(): void {
|
||||
if (this.configurationIncomplete && this.defaultIncludes && this.defaultFrameworks && this.vcpkgPathReady) {
|
||||
let configuration: Configuration | undefined = this.CurrentConfiguration;
|
||||
const configuration: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (configuration) {
|
||||
this.applyDefaultConfigurationValues(configuration);
|
||||
this.configurationIncomplete = false;
|
||||
@@ -287,9 +289,9 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
private applyDefaultConfigurationValues(configuration: Configuration): void {
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
// default values for "default" config settings is null.
|
||||
let isUnset: (input: any) => boolean = (input: any) => input === null || input === undefined;
|
||||
const isUnset: (input: any) => boolean = (input: any) => input === null || input === undefined;
|
||||
|
||||
// Anything that has a vscode setting for it will be resolved in updateServerOnFolderSettingsChange.
|
||||
// So if a property is currently unset, but has a vscode setting, don't set it yet, otherwise the linkage
|
||||
@@ -299,8 +301,8 @@ export class CppProperties {
|
||||
|
||||
if (isUnset(settings.defaultIncludePath)) {
|
||||
// We don't add system includes to the includePath anymore. The language server has this information.
|
||||
let abTestSettings: ABTestSettings = getABTestSettings();
|
||||
let rootFolder: string = abTestSettings.UseRecursiveIncludes ? "${workspaceFolder}/**" : "${workspaceFolder}";
|
||||
const abTestSettings: ABTestSettings = getABTestSettings();
|
||||
const rootFolder: string = abTestSettings.UseRecursiveIncludes ? "${workspaceFolder}/**" : "${workspaceFolder}";
|
||||
configuration.includePath = [rootFolder].concat(this.vcpkgIncludes);
|
||||
}
|
||||
// browse.path is not set by default anymore. When it is not set, the includePath will be used instead.
|
||||
@@ -328,10 +330,13 @@ export class CppProperties {
|
||||
if (isUnset(settings.defaultIntelliSenseMode) || settings.defaultIntelliSenseMode === "") {
|
||||
configuration.intelliSenseMode = this.defaultIntelliSenseMode;
|
||||
}
|
||||
if (isUnset(settings.defaultCustomConfigurationVariables) || settings.defaultCustomConfigurationVariables === {}) {
|
||||
configuration.customConfigurationVariables = this.defaultCustomConfigurationVariables;
|
||||
}
|
||||
}
|
||||
|
||||
private get ExtendedEnvironment(): Environment {
|
||||
let result: Environment = {};
|
||||
const result: Environment = {};
|
||||
if (this.configurationJson?.env) {
|
||||
Object.assign(result, this.configurationJson.env);
|
||||
}
|
||||
@@ -343,14 +348,14 @@ export class CppProperties {
|
||||
private async buildVcpkgIncludePath(): Promise<void> {
|
||||
try {
|
||||
// Check for vcpkgRoot and include relevent paths if found.
|
||||
let vcpkgRoot: string = util.getVcpkgRoot();
|
||||
const vcpkgRoot: string = util.getVcpkgRoot();
|
||||
if (vcpkgRoot) {
|
||||
let list: string[] = await util.readDir(vcpkgRoot);
|
||||
const list: string[] = await util.readDir(vcpkgRoot);
|
||||
if (list !== undefined) {
|
||||
// For every *directory* in the list (non-recursive). Each directory is basically a platform.
|
||||
list.forEach((entry) => {
|
||||
if (entry !== "vcpkg") {
|
||||
let pathToCheck: string = path.join(vcpkgRoot, entry);
|
||||
const pathToCheck: string = path.join(vcpkgRoot, entry);
|
||||
if (fs.existsSync(pathToCheck)) {
|
||||
let p: string = path.join(pathToCheck, "include");
|
||||
if (fs.existsSync(p)) {
|
||||
@@ -418,13 +423,13 @@ export class CppProperties {
|
||||
configuration.intelliSenseMode === "${default}") {
|
||||
return "";
|
||||
}
|
||||
let resolvedCompilerPath: string = this.resolvePath(configuration.compilerPath, true);
|
||||
let compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(resolvedCompilerPath);
|
||||
const resolvedCompilerPath: string = this.resolvePath(configuration.compilerPath, true);
|
||||
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(resolvedCompilerPath);
|
||||
|
||||
// Valid compiler + IntelliSenseMode combinations:
|
||||
// 1. compiler is cl/clang-cl and IntelliSenseMode is MSVC
|
||||
// 2. compiler is not cl/clang-cl and IntelliSenseMode is not MSVC
|
||||
let isValid: boolean = compilerPathAndArgs.compilerName.endsWith("cl.exe") === configuration.intelliSenseMode.startsWith("msvc");
|
||||
const isValid: boolean = compilerPathAndArgs.compilerName.endsWith("cl.exe") === configuration.intelliSenseMode.startsWith("msvc");
|
||||
if (isValid) {
|
||||
return "";
|
||||
} else {
|
||||
@@ -435,7 +440,7 @@ export class CppProperties {
|
||||
public addToIncludePathCommand(path: string): void {
|
||||
this.handleConfigurationEditCommand(() => {
|
||||
this.parsePropertiesFile(); // Clear out any modifications we may have made internally.
|
||||
let config: Configuration | undefined = this.CurrentConfiguration;
|
||||
const config: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (config) {
|
||||
telemetry.logLanguageServerEvent("addToIncludePath");
|
||||
if (config.includePath === undefined) {
|
||||
@@ -453,7 +458,7 @@ export class CppProperties {
|
||||
if (this.propertiesFile) {
|
||||
this.handleConfigurationEditJSONCommand(() => {
|
||||
this.parsePropertiesFile(); // Clear out any modifications we may have made internally.
|
||||
let config: Configuration | undefined = this.CurrentConfiguration;
|
||||
const config: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (config) {
|
||||
if (providerId) {
|
||||
config.configurationProvider = providerId;
|
||||
@@ -466,13 +471,13 @@ export class CppProperties {
|
||||
resolve();
|
||||
}, () => {});
|
||||
} else {
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
if (providerId) {
|
||||
settings.update("default.configurationProvider", providerId);
|
||||
} else {
|
||||
settings.update("default.configurationProvider", undefined); // delete the setting
|
||||
}
|
||||
let config: Configuration | undefined = this.CurrentConfiguration;
|
||||
const config: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (config) {
|
||||
config.configurationProvider = providerId;
|
||||
}
|
||||
@@ -484,7 +489,7 @@ export class CppProperties {
|
||||
public setCompileCommands(path: string): void {
|
||||
this.handleConfigurationEditJSONCommand(() => {
|
||||
this.parsePropertiesFile(); // Clear out any modifications we may have made internally.
|
||||
let config: Configuration | undefined = this.CurrentConfiguration;
|
||||
const config: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (config) {
|
||||
config.compileCommands = path;
|
||||
this.writeToJson();
|
||||
@@ -527,13 +532,30 @@ export class CppProperties {
|
||||
return result;
|
||||
}
|
||||
|
||||
private resolveDefaultsDictionary(entries: { [key: string]: string }, defaultValue: { [key: string]: string } | undefined, env: Environment): { [key: string]: string } {
|
||||
const result: { [key: string]: string } = {};
|
||||
for (const property in entries) {
|
||||
if (property === "${default}") {
|
||||
if (defaultValue) {
|
||||
for (const defaultProperty in defaultValue) {
|
||||
if (!(defaultProperty in entries)) {
|
||||
result[defaultProperty] = util.resolveVariables(defaultValue[defaultProperty], env);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result[property] = util.resolveVariables(entries[property], env);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private resolveAndSplit(paths: string[] | undefined, defaultValue: string[] | undefined, env: Environment): string[] {
|
||||
let result: string[] = [];
|
||||
if (paths) {
|
||||
paths = this.resolveDefaults(paths, defaultValue);
|
||||
let delimiter: string = (process.platform === 'win32') ? ";" : ":";
|
||||
paths.forEach(entry => {
|
||||
let entries: string[] = util.resolveVariables(entry, env).split(delimiter).filter(e => e);
|
||||
const entries: string[] = util.resolveVariables(entry, env).split(util.envDelimiter).filter(e => e);
|
||||
result = result.concat(entries);
|
||||
});
|
||||
}
|
||||
@@ -573,14 +595,24 @@ export class CppProperties {
|
||||
return util.resolveVariables(property, env);
|
||||
}
|
||||
|
||||
private updateConfigurationStringDictionary(property: { [key: string]: string } | undefined, defaultValue: { [key: string]: string } | undefined, env: Environment): { [key: string]: string } | undefined {
|
||||
if (!property || property === {}) {
|
||||
property = defaultValue;
|
||||
}
|
||||
if (!property || property === {}) {
|
||||
return undefined;
|
||||
}
|
||||
return this.resolveDefaultsDictionary(property, defaultValue, env);
|
||||
}
|
||||
|
||||
private updateServerOnFolderSettingsChange(): void {
|
||||
if (!this.configurationJson) {
|
||||
return;
|
||||
}
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
let env: Environment = this.ExtendedEnvironment;
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
const env: Environment = this.ExtendedEnvironment;
|
||||
for (let i: number = 0; i < this.configurationJson.configurations.length; i++) {
|
||||
let configuration: Configuration = this.configurationJson.configurations[i];
|
||||
const configuration: Configuration = this.configurationJson.configurations[i];
|
||||
|
||||
configuration.includePath = this.updateConfigurationStringArray(configuration.includePath, settings.defaultIncludePath, env);
|
||||
configuration.defines = this.updateConfigurationStringArray(configuration.defines, settings.defaultDefines, env);
|
||||
@@ -593,6 +625,7 @@ export class CppProperties {
|
||||
configuration.cStandard = this.updateConfigurationString(configuration.cStandard, settings.defaultCStandard, env);
|
||||
configuration.cppStandard = this.updateConfigurationString(configuration.cppStandard, settings.defaultCppStandard, env);
|
||||
configuration.intelliSenseMode = this.updateConfigurationString(configuration.intelliSenseMode, settings.defaultIntelliSenseMode, env);
|
||||
configuration.customConfigurationVariables = this.updateConfigurationStringDictionary(configuration.customConfigurationVariables, settings.defaultCustomConfigurationVariables, env);
|
||||
configuration.configurationProvider = this.updateConfigurationString(configuration.configurationProvider, settings.defaultConfigurationProvider, env);
|
||||
|
||||
if (!configuration.browse) {
|
||||
@@ -634,10 +667,10 @@ export class CppProperties {
|
||||
if (this.configurationJson) {
|
||||
this.compileCommandFileWatchers.forEach((watcher: fs.FSWatcher) => watcher.close());
|
||||
this.compileCommandFileWatchers = []; // reset it
|
||||
let filePaths: Set<string> = new Set<string>();
|
||||
const filePaths: Set<string> = new Set<string>();
|
||||
this.configurationJson.configurations.forEach(c => {
|
||||
if (c.compileCommands) {
|
||||
let fileSystemCompileCommandsPath: string = this.resolvePath(c.compileCommands, os.platform() === "win32");
|
||||
const fileSystemCompileCommandsPath: string = this.resolvePath(c.compileCommands, os.platform() === "win32");
|
||||
if (fs.existsSync(fileSystemCompileCommandsPath)) {
|
||||
filePaths.add(fileSystemCompileCommandsPath);
|
||||
}
|
||||
@@ -675,7 +708,7 @@ export class CppProperties {
|
||||
|
||||
// onBeforeOpen will be called after c_cpp_properties.json have been created (if it did not exist), but before the document is opened.
|
||||
public handleConfigurationEditCommand(onBeforeOpen: (() => void) | undefined, showDocument: (document: vscode.TextDocument) => void): void {
|
||||
let otherSettings: OtherSettings = new OtherSettings(this.rootUri);
|
||||
const otherSettings: OtherSettings = new OtherSettings(this.rootUri);
|
||||
if (otherSettings.settingsEditor === "ui") {
|
||||
this.handleConfigurationEditUICommand(onBeforeOpen, showDocument);
|
||||
} else {
|
||||
@@ -703,7 +736,7 @@ export class CppProperties {
|
||||
|
||||
private ensureSettingsPanelInitlialized(): void {
|
||||
if (this.settingsPanel === undefined) {
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
this.settingsPanel = new SettingsPanel();
|
||||
this.settingsPanel.setKnownCompilers(this.knownCompilers, settings.preferredPathSeparator);
|
||||
this.settingsPanel.SettingsPanelActivated(() => this.onSettingsPanelActivated());
|
||||
@@ -724,7 +757,7 @@ export class CppProperties {
|
||||
if (this.parsePropertiesFile()) {
|
||||
this.ensureSettingsPanelInitlialized();
|
||||
if (this.settingsPanel) {
|
||||
let configNames: string[] | undefined = this.ConfigurationNames;
|
||||
const configNames: string[] | undefined = this.ConfigurationNames;
|
||||
if (configNames && this.configurationJson) {
|
||||
// Use the active configuration as the default selected configuration to load on UI editor
|
||||
this.settingsPanel.selectedConfigIndex = this.CurrentConfigurationIndex;
|
||||
@@ -750,7 +783,7 @@ export class CppProperties {
|
||||
this.ensurePropertiesFile().then(() => {
|
||||
if (this.propertiesFile) {
|
||||
if (this.parsePropertiesFile()) {
|
||||
let configNames: string[] | undefined = this.ConfigurationNames;
|
||||
const configNames: string[] | undefined = this.ConfigurationNames;
|
||||
if (configNames && this.settingsPanel && this.configurationJson) {
|
||||
// The settings UI became visible or active.
|
||||
// Ensure settingsPanel has copy of latest current configuration
|
||||
@@ -773,7 +806,7 @@ export class CppProperties {
|
||||
private saveConfigurationUI(): void {
|
||||
this.parsePropertiesFile(); // Clear out any modifications we may have made internally.
|
||||
if (this.settingsPanel && this.configurationJson) {
|
||||
let config: Configuration = this.settingsPanel.getLastValuesFromConfigUI();
|
||||
const config: Configuration = this.settingsPanel.getLastValuesFromConfigUI();
|
||||
this.configurationJson.configurations[this.settingsPanel.selectedConfigIndex] = config;
|
||||
this.settingsPanel.updateErrors(this.getErrorsForConfigUI(this.settingsPanel.selectedConfigIndex));
|
||||
this.writeToJson();
|
||||
@@ -781,7 +814,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
private onConfigSelectionChanged(): void {
|
||||
let configNames: string[] | undefined = this.ConfigurationNames;
|
||||
const configNames: string[] | undefined = this.ConfigurationNames;
|
||||
if (configNames && this.settingsPanel && this.configurationJson) {
|
||||
this.settingsPanel.updateConfigUI(configNames,
|
||||
this.configurationJson.configurations[this.settingsPanel.selectedConfigIndex],
|
||||
@@ -793,9 +826,9 @@ export class CppProperties {
|
||||
this.parsePropertiesFile(); // Clear out any modifications we may have made internally.
|
||||
|
||||
// Create default config and add to list of configurations
|
||||
let newConfig: Configuration = { name: configName };
|
||||
const newConfig: Configuration = { name: configName };
|
||||
this.applyDefaultConfigurationValues(newConfig);
|
||||
let configNames: string[] | undefined = this.ConfigurationNames;
|
||||
const configNames: string[] | undefined = this.ConfigurationNames;
|
||||
if (configNames && this.settingsPanel && this.configurationJson) {
|
||||
this.configurationJson.configurations.push(newConfig);
|
||||
|
||||
@@ -823,7 +856,7 @@ export class CppProperties {
|
||||
if (this.CurrentConfigurationIndex < 0 ||
|
||||
this.CurrentConfigurationIndex >= this.configurationJson.configurations.length) {
|
||||
// If the index is out of bounds (during initialization or due to removal of configs), fix it.
|
||||
let index: number | undefined = this.getConfigIndexForPlatform(this.configurationJson);
|
||||
const index: number | undefined = this.getConfigIndexForPlatform(this.configurationJson);
|
||||
if (this.currentConfigurationIndex !== undefined) {
|
||||
if (!index) {
|
||||
this.currentConfigurationIndex.setDefault();
|
||||
@@ -852,12 +885,12 @@ export class CppProperties {
|
||||
fs.mkdirSync(this.configFolder);
|
||||
}
|
||||
|
||||
let fullPathToFile: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
const fullPathToFile: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
if (this.configurationJson) {
|
||||
this.resetToDefaultSettings(true);
|
||||
}
|
||||
this.applyDefaultIncludePathsAndFrameworks();
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
if (settings.defaultConfigurationProvider) {
|
||||
if (this.configurationJson) {
|
||||
this.configurationJson.configurations.forEach(config => {
|
||||
@@ -872,7 +905,7 @@ export class CppProperties {
|
||||
this.propertiesFile = vscode.Uri.file(path.join(this.configFolder, "c_cpp_properties.json"));
|
||||
|
||||
} catch (err) {
|
||||
let failedToCreate: string = localize("failed.to.create.config.folder", 'Failed to create "{0}"', this.configFolder);
|
||||
const failedToCreate: string = localize("failed.to.create.config.folder", 'Failed to create "{0}"', this.configFolder);
|
||||
vscode.window.showErrorMessage(`${failedToCreate}: ${err.message}`);
|
||||
}
|
||||
}
|
||||
@@ -885,13 +918,13 @@ export class CppProperties {
|
||||
}
|
||||
let success: boolean = true;
|
||||
try {
|
||||
let readResults: string = fs.readFileSync(this.propertiesFile.fsPath, 'utf8');
|
||||
const readResults: string = fs.readFileSync(this.propertiesFile.fsPath, 'utf8');
|
||||
if (readResults === "") {
|
||||
return false; // Repros randomly when the file is initially created. The parse will get called again after the file is written.
|
||||
}
|
||||
|
||||
// Try to use the same configuration as before the change.
|
||||
let newJson: ConfigurationJson = JSON.parse(readResults);
|
||||
const newJson: ConfigurationJson = JSON.parse(readResults);
|
||||
if (!newJson || !newJson.configurations || newJson.configurations.length === 0) {
|
||||
throw { message: localize("invalid.configuration.file", "Invalid configuration file. There must be at least one configuration present in the array.") };
|
||||
}
|
||||
@@ -908,7 +941,7 @@ export class CppProperties {
|
||||
}
|
||||
this.configurationJson = newJson;
|
||||
if (this.CurrentConfigurationIndex < 0 || this.CurrentConfigurationIndex >= newJson.configurations.length) {
|
||||
let index: number | undefined = this.getConfigIndexForPlatform(newJson);
|
||||
const index: number | undefined = this.getConfigIndexForPlatform(newJson);
|
||||
if (this.currentConfigurationIndex !== undefined) {
|
||||
if (index === undefined) {
|
||||
this.currentConfigurationIndex.setDefault();
|
||||
@@ -920,7 +953,7 @@ export class CppProperties {
|
||||
|
||||
let dirty: boolean = false;
|
||||
for (let i: number = 0; i < this.configurationJson.configurations.length; i++) {
|
||||
let newId: string | undefined = getCustomConfigProviders().checkId(this.configurationJson.configurations[i].configurationProvider);
|
||||
const newId: string | undefined = getCustomConfigProviders().checkId(this.configurationJson.configurations[i].configurationProvider);
|
||||
if (newId !== this.configurationJson.configurations[i].configurationProvider) {
|
||||
dirty = true;
|
||||
this.configurationJson.configurations[i].configurationProvider = newId;
|
||||
@@ -975,7 +1008,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
let failedToParse: string = localize("failed.to.parse.properties", 'Failed to parse "{0}"', this.propertiesFile.fsPath);
|
||||
const failedToParse: string = localize("failed.to.parse.properties", 'Failed to parse "{0}"', this.propertiesFile.fsPath);
|
||||
vscode.window.showErrorMessage(`${failedToParse}: ${err.message}`);
|
||||
success = false;
|
||||
}
|
||||
@@ -1027,16 +1060,16 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
private getErrorsForConfigUI(configIndex: number): ConfigurationErrors {
|
||||
let errors: ConfigurationErrors = {};
|
||||
const errors: ConfigurationErrors = {};
|
||||
if (!this.configurationJson) {
|
||||
return errors;
|
||||
}
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
let config: Configuration = this.configurationJson.configurations[configIndex];
|
||||
const config: Configuration = this.configurationJson.configurations[configIndex];
|
||||
|
||||
// Validate compilerPath
|
||||
let resolvedCompilerPath: string | undefined = this.resolvePath(config.compilerPath, isWindows);
|
||||
let compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(resolvedCompilerPath);
|
||||
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(resolvedCompilerPath);
|
||||
if (resolvedCompilerPath &&
|
||||
// Don't error cl.exe paths because it could be for an older preview build.
|
||||
!(isWindows && compilerPathAndArgs.compilerName === "cl.exe")) {
|
||||
@@ -1044,13 +1077,13 @@ export class CppProperties {
|
||||
|
||||
// Error when the compiler's path has spaces without quotes but args are used.
|
||||
// Except, exclude cl.exe paths because it could be for an older preview build.
|
||||
let compilerPathNeedsQuotes: boolean =
|
||||
const compilerPathNeedsQuotes: boolean =
|
||||
(compilerPathAndArgs.additionalArgs && compilerPathAndArgs.additionalArgs.length > 0) &&
|
||||
!resolvedCompilerPath.startsWith('"') &&
|
||||
compilerPathAndArgs.compilerPath !== undefined &&
|
||||
compilerPathAndArgs.compilerPath.includes(" ");
|
||||
|
||||
let compilerPathErrors: string[] = [];
|
||||
const compilerPathErrors: string[] = [];
|
||||
if (compilerPathNeedsQuotes) {
|
||||
compilerPathErrors.push(localize("path.with.spaces", 'Compiler path with spaces and arguments is missing double quotes " around the path.'));
|
||||
}
|
||||
@@ -1059,7 +1092,7 @@ export class CppProperties {
|
||||
resolvedCompilerPath = compilerPathAndArgs.compilerPath;
|
||||
if (resolvedCompilerPath) {
|
||||
let pathExists: boolean = true;
|
||||
let existsWithExeAdded: (path: string) => boolean = (path: string) => isWindows && !path.startsWith("/") && fs.existsSync(path + ".exe");
|
||||
const existsWithExeAdded: (path: string) => boolean = (path: string) => isWindows && !path.startsWith("/") && fs.existsSync(path + ".exe");
|
||||
if (!fs.existsSync(resolvedCompilerPath)) {
|
||||
if (existsWithExeAdded(resolvedCompilerPath)) {
|
||||
resolvedCompilerPath += ".exe";
|
||||
@@ -1081,13 +1114,13 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
if (!pathExists) {
|
||||
let message: string = localize('cannot.find', "Cannot find: {0}", resolvedCompilerPath);
|
||||
const message: string = localize('cannot.find', "Cannot find: {0}", resolvedCompilerPath);
|
||||
compilerPathErrors.push(message);
|
||||
} else if (compilerPathAndArgs.compilerPath === "") {
|
||||
let message: string = localize("cannot.resolve.compiler.path", "Invalid input, cannot resolve compiler path");
|
||||
const message: string = localize("cannot.resolve.compiler.path", "Invalid input, cannot resolve compiler path");
|
||||
compilerPathErrors.push(message);
|
||||
} else if (!util.checkFileExistsSync(resolvedCompilerPath)) {
|
||||
let message: string = localize("path.is.not.a.file", "Path is not a file: {0}", resolvedCompilerPath);
|
||||
const message: string = localize("path.is.not.a.file", "Path is not a file: {0}", resolvedCompilerPath);
|
||||
compilerPathErrors.push(message);
|
||||
}
|
||||
|
||||
@@ -1109,7 +1142,7 @@ export class CppProperties {
|
||||
|
||||
// Validate intelliSenseMode
|
||||
if (isWindows) {
|
||||
let intelliSenesModeError: string = this.validateIntelliSenseMode(config);
|
||||
const intelliSenesModeError: string = this.validateIntelliSenseMode(config);
|
||||
if (intelliSenesModeError.length > 0) {
|
||||
errors.intelliSenseMode = intelliSenesModeError;
|
||||
}
|
||||
@@ -1125,7 +1158,7 @@ export class CppProperties {
|
||||
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
let errorMsg: string | undefined;
|
||||
let errors: string[] = [];
|
||||
const errors: string[] = [];
|
||||
let paths: string[] = [];
|
||||
|
||||
if (util.isString(input)) {
|
||||
@@ -1137,7 +1170,7 @@ export class CppProperties {
|
||||
// Resolve and split any environment variables
|
||||
paths = this.resolveAndSplit(paths, undefined, this.ExtendedEnvironment);
|
||||
|
||||
for (let p of paths) {
|
||||
for (const p of paths) {
|
||||
let pathExists: boolean = true;
|
||||
let resolvedPath: string = this.resolvePath(p, isWindows);
|
||||
if (!resolvedPath) {
|
||||
@@ -1160,17 +1193,17 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
if (!pathExists) {
|
||||
let message: string = localize('cannot.find', "Cannot find: {0}", resolvedPath);
|
||||
const message: string = localize('cannot.find', "Cannot find: {0}", resolvedPath);
|
||||
errors.push(message);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if path is a directory or file
|
||||
if (isDirectory && !util.checkDirectoryExistsSync(resolvedPath)) {
|
||||
let message: string = localize("path.is.not.a.directory", "Path is not a directory: {0}", resolvedPath);
|
||||
const message: string = localize("path.is.not.a.directory", "Path is not a directory: {0}", resolvedPath);
|
||||
errors.push(message);
|
||||
} else if (!isDirectory && !util.checkFileExistsSync(resolvedPath)) {
|
||||
let message: string = localize("path.is.not.a.file", "Path is not a file: {0}", resolvedPath);
|
||||
const message: string = localize("path.is.not.a.file", "Path is not a file: {0}", resolvedPath);
|
||||
errors.push(message);
|
||||
}
|
||||
}
|
||||
@@ -1200,16 +1233,16 @@ export class CppProperties {
|
||||
return;
|
||||
}
|
||||
vscode.workspace.openTextDocument(this.propertiesFile).then((document: vscode.TextDocument) => {
|
||||
let diagnostics: vscode.Diagnostic[] = new Array<vscode.Diagnostic>();
|
||||
const diagnostics: vscode.Diagnostic[] = new Array<vscode.Diagnostic>();
|
||||
|
||||
// Get the text of the current configuration.
|
||||
let curText: string = document.getText();
|
||||
|
||||
// Replace all \<escape character> with \\<character>, except for \"
|
||||
// Otherwise, the JSON.parse result will have the \<escape character> missing.
|
||||
let configurationsText: string = util.escapeForSquiggles(curText);
|
||||
let configurations: ConfigurationJson = JSON.parse(configurationsText);
|
||||
let currentConfiguration: Configuration = configurations.configurations[this.CurrentConfigurationIndex];
|
||||
const configurationsText: string = util.escapeForSquiggles(curText);
|
||||
const configurations: ConfigurationJson = JSON.parse(configurationsText);
|
||||
const currentConfiguration: Configuration = configurations.configurations[this.CurrentConfigurationIndex];
|
||||
|
||||
let curTextStartOffset: number = 0;
|
||||
if (!currentConfiguration.name) {
|
||||
@@ -1217,7 +1250,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
// Get env text
|
||||
let envText: string;
|
||||
let envText: string = "";
|
||||
const envStart: number = curText.search(/\"env\"\s*:\s*\{/);
|
||||
const envEnd: number = envStart === -1 ? -1 : curText.indexOf("},", envStart);
|
||||
envText = curText.substr(envStart, envEnd);
|
||||
@@ -1247,7 +1280,7 @@ export class CppProperties {
|
||||
if (this.prevSquiggleMetrics.get(currentConfiguration.name) === undefined) {
|
||||
this.prevSquiggleMetrics.set(currentConfiguration.name, { PathNonExistent: 0, PathNotAFile: 0, PathNotADirectory: 0, CompilerPathMissingQuotes: 0, CompilerModeMismatch: 0 });
|
||||
}
|
||||
let newSquiggleMetrics: { [key: string]: number } = { PathNonExistent: 0, PathNotAFile: 0, PathNotADirectory: 0, CompilerPathMissingQuotes: 0, CompilerModeMismatch: 0 };
|
||||
const newSquiggleMetrics: { [key: string]: number } = { PathNonExistent: 0, PathNotAFile: 0, PathNotADirectory: 0, CompilerPathMissingQuotes: 0, CompilerModeMismatch: 0 };
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
|
||||
// TODO: Add other squiggles.
|
||||
@@ -1260,10 +1293,10 @@ export class CppProperties {
|
||||
const intelliSenseModeValueStart: number = curText.indexOf('"', curText.indexOf(":", intelliSenseModeStart));
|
||||
const intelliSenseModeValueEnd: number = intelliSenseModeStart === -1 ? -1 : curText.indexOf('"', intelliSenseModeValueStart + 1) + 1;
|
||||
|
||||
let intelliSenseModeError: string = this.validateIntelliSenseMode(currentConfiguration);
|
||||
const intelliSenseModeError: string = this.validateIntelliSenseMode(currentConfiguration);
|
||||
if (intelliSenseModeError.length > 0) {
|
||||
let message: string = intelliSenseModeError;
|
||||
let diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
const message: string = intelliSenseModeError;
|
||||
const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
new vscode.Range(document.positionAt(curTextStartOffset + intelliSenseModeValueStart),
|
||||
document.positionAt(curTextStartOffset + intelliSenseModeValueEnd)),
|
||||
message, vscode.DiagnosticSeverity.Warning);
|
||||
@@ -1275,10 +1308,10 @@ export class CppProperties {
|
||||
|
||||
// Check for path-related squiggles.
|
||||
let paths: string[] = [];
|
||||
for (let pathArray of [ (currentConfiguration.browse ? currentConfiguration.browse.path : undefined),
|
||||
for (const pathArray of [ (currentConfiguration.browse ? currentConfiguration.browse.path : undefined),
|
||||
currentConfiguration.includePath, currentConfiguration.macFrameworkPath, currentConfiguration.forcedInclude ]) {
|
||||
if (pathArray) {
|
||||
for (let curPath of pathArray) {
|
||||
for (const curPath of pathArray) {
|
||||
paths.push(`${curPath}`);
|
||||
}
|
||||
}
|
||||
@@ -1303,10 +1336,10 @@ export class CppProperties {
|
||||
const compilerPathStart: number = curText.search(/\s*\"compilerPath\"\s*:\s*\"/);
|
||||
const compilerPathEnd: number = compilerPathStart === -1 ? -1 : curText.indexOf('"', curText.indexOf('"', curText.indexOf(":", compilerPathStart)) + 1) + 1;
|
||||
|
||||
let processedPaths: Set<string> = new Set<string>();
|
||||
const processedPaths: Set<string> = new Set<string>();
|
||||
|
||||
// Validate paths
|
||||
for (let curPath of paths) {
|
||||
for (const curPath of paths) {
|
||||
if (processedPaths.has(curPath)) {
|
||||
// Avoid duplicate squiggles for the same line.
|
||||
// Squiggles for the same path on different lines are already handled below.
|
||||
@@ -1328,7 +1361,7 @@ export class CppProperties {
|
||||
let compilerPathNeedsQuotes: boolean = false;
|
||||
if (isCompilerPath) {
|
||||
resolvedPath = resolvedPath.trim();
|
||||
let compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(resolvedPath);
|
||||
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(resolvedPath);
|
||||
if (isWindows && compilerPathAndArgs.compilerName === "cl.exe") {
|
||||
continue; // Don't squiggle invalid cl.exe paths because it could be for an older preview build.
|
||||
}
|
||||
@@ -1344,7 +1377,7 @@ export class CppProperties {
|
||||
|
||||
const isWSL: boolean = isWindows && resolvedPath.startsWith("/");
|
||||
let pathExists: boolean = true;
|
||||
let existsWithExeAdded: (path: string) => boolean = (path: string) => isCompilerPath && isWindows && !isWSL && fs.existsSync(path + ".exe");
|
||||
const existsWithExeAdded: (path: string) => boolean = (path: string) => isCompilerPath && isWindows && !isWSL && fs.existsSync(path + ".exe");
|
||||
if (!fs.existsSync(resolvedPath)) {
|
||||
if (existsWithExeAdded(resolvedPath)) {
|
||||
resolvedPath += ".exe";
|
||||
@@ -1381,12 +1414,12 @@ export class CppProperties {
|
||||
|
||||
// Create a pattern to search for the path with either a quote or semicolon immediately before and after,
|
||||
// and extend that pattern to the next quote before and next quote after it.
|
||||
let pattern: RegExp = new RegExp(`"[^"]*?(?<="|;)${escapedPath}(?="|;).*?"`, "g");
|
||||
let configMatches: string[] | null = curText.match(pattern);
|
||||
const pattern: RegExp = new RegExp(`"[^"]*?(?<="|;)${escapedPath}(?="|;).*?"`, "g");
|
||||
const configMatches: string[] | null = curText.match(pattern);
|
||||
if (configMatches) {
|
||||
let curOffset: number = 0;
|
||||
let endOffset: number = 0;
|
||||
for (let curMatch of configMatches) {
|
||||
for (const curMatch of configMatches) {
|
||||
curOffset = curText.substr(endOffset).search(pattern) + endOffset;
|
||||
endOffset = curOffset + curMatch.length;
|
||||
let message: string;
|
||||
@@ -1416,25 +1449,25 @@ export class CppProperties {
|
||||
newSquiggleMetrics.PathNotADirectory++;
|
||||
}
|
||||
}
|
||||
let diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
new vscode.Range(document.positionAt(curTextStartOffset + curOffset),
|
||||
document.positionAt(curTextStartOffset + endOffset)),
|
||||
message, vscode.DiagnosticSeverity.Warning);
|
||||
diagnostics.push(diagnostic);
|
||||
}
|
||||
} else if (envText) {
|
||||
let envMatches: string[] | null = envText.match(pattern);
|
||||
const envMatches: string[] | null = envText.match(pattern);
|
||||
if (envMatches) {
|
||||
let curOffset: number = 0;
|
||||
let endOffset: number = 0;
|
||||
for (let curMatch of envMatches) {
|
||||
for (const curMatch of envMatches) {
|
||||
curOffset = envText.substr(endOffset).search(pattern) + endOffset;
|
||||
endOffset = curOffset + curMatch.length;
|
||||
let message: string;
|
||||
if (!pathExists) {
|
||||
message = localize('cannot.find2', "Cannot find \"{0}\".", resolvedPath);
|
||||
newSquiggleMetrics.PathNonExistent++;
|
||||
let diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
new vscode.Range(document.positionAt(envTextStartOffSet + curOffset),
|
||||
document.positionAt(envTextStartOffSet + endOffset)),
|
||||
message, vscode.DiagnosticSeverity.Warning);
|
||||
@@ -1452,7 +1485,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
// Send telemetry on squiggle changes.
|
||||
let changedSquiggleMetrics: { [key: string]: number } = {};
|
||||
const changedSquiggleMetrics: { [key: string]: number } = {};
|
||||
if (newSquiggleMetrics.PathNonExistent !== this.prevSquiggleMetrics.get(currentConfiguration.name)?.PathNonExistent) {
|
||||
changedSquiggleMetrics.PathNonExistent = newSquiggleMetrics.PathNonExistent;
|
||||
}
|
||||
@@ -1487,7 +1520,7 @@ export class CppProperties {
|
||||
if (this.configurationJson) {
|
||||
this.configurationJson.version = 3;
|
||||
for (let i: number = 0; i < this.configurationJson.configurations.length; i++) {
|
||||
let config: Configuration = this.configurationJson.configurations[i];
|
||||
const config: Configuration = this.configurationJson.configurations[i];
|
||||
// Look for Mac configs and extra configs on Mac systems
|
||||
if (config.name === "Mac" || (process.platform === 'darwin' && config.name !== "Win32" && config.name !== "Linux")) {
|
||||
if (config.macFrameworkPath === undefined) {
|
||||
@@ -1506,9 +1539,9 @@ export class CppProperties {
|
||||
this.configurationJson.version = 4;
|
||||
// Update intelliSenseMode, compilerPath, cStandard, and cppStandard with the defaults if they're missing.
|
||||
// If VS Code settings exist for these properties, don't add them to c_cpp_properties.json
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
for (let i: number = 0; i < this.configurationJson.configurations.length; i++) {
|
||||
let config: Configuration = this.configurationJson.configurations[i];
|
||||
const config: Configuration = this.configurationJson.configurations[i];
|
||||
|
||||
if (config.intelliSenseMode === undefined && !settings.defaultIntelliSenseMode) {
|
||||
config.intelliSenseMode = this.getIntelliSenseModeForPlatform(config.name);
|
||||
@@ -1536,7 +1569,7 @@ export class CppProperties {
|
||||
|
||||
public checkCppProperties(): void {
|
||||
// Check for change properties in case of file watcher failure.
|
||||
let propertiesFile: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
const propertiesFile: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
fs.stat(propertiesFile, (err, stats) => {
|
||||
if (err) {
|
||||
if (err.code === "ENOENT" && this.propertiesFile) {
|
||||
|
||||
@@ -108,7 +108,7 @@ export class CustomConfigurationProviderCollection {
|
||||
private providers: Map<string, CustomProviderWrapper> = new Map<string, CustomProviderWrapper>();
|
||||
|
||||
private logProblems(provider: CustomConfigurationProvider, version: Version): void {
|
||||
let missing: string[] = [];
|
||||
const missing: string[] = [];
|
||||
if (!provider.name) {
|
||||
missing.push("'name'");
|
||||
}
|
||||
@@ -162,14 +162,14 @@ export class CustomConfigurationProviderCollection {
|
||||
return false;
|
||||
}
|
||||
|
||||
let wrapper: CustomProviderWrapper = new CustomProviderWrapper(provider, version);
|
||||
const wrapper: CustomProviderWrapper = new CustomProviderWrapper(provider, version);
|
||||
if (!wrapper.isValid) {
|
||||
this.logProblems(provider, version);
|
||||
return false;
|
||||
}
|
||||
|
||||
let exists: boolean = false;
|
||||
let existing: CustomProviderWrapper | undefined = this.providers.get(wrapper.extensionId);
|
||||
const existing: CustomProviderWrapper | undefined = this.providers.get(wrapper.extensionId);
|
||||
if (existing) {
|
||||
exists = (existing.version === Version.v0 && wrapper.version === Version.v0);
|
||||
}
|
||||
@@ -208,7 +208,7 @@ export class CustomConfigurationProviderCollection {
|
||||
}
|
||||
|
||||
public remove(provider: CustomConfigurationProvider): void {
|
||||
let id: string = this.getId(provider);
|
||||
const id: string = this.getId(provider);
|
||||
if (this.providers.has(id)) {
|
||||
this.providers.delete(id);
|
||||
} else {
|
||||
@@ -220,7 +220,7 @@ export class CustomConfigurationProviderCollection {
|
||||
if (!providerId) {
|
||||
return undefined;
|
||||
}
|
||||
let found: CustomConfigurationProvider1[] = [];
|
||||
const found: CustomConfigurationProvider1[] = [];
|
||||
let noUpdate: boolean = false;
|
||||
this.forEach(provider => {
|
||||
if (provider.extensionId === providerId) {
|
||||
@@ -241,7 +241,7 @@ export class CustomConfigurationProviderCollection {
|
||||
}
|
||||
}
|
||||
|
||||
let providerCollection: CustomConfigurationProviderCollection = new CustomConfigurationProviderCollection();
|
||||
const providerCollection: CustomConfigurationProviderCollection = new CustomConfigurationProviderCollection();
|
||||
|
||||
export function getCustomConfigProviders(): CustomConfigurationProviderCollection {
|
||||
return providerCollection;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { TreeNode, NodeType } from './referencesModel';
|
||||
import { UI, getUI } from './ui';
|
||||
import { Client } from './client';
|
||||
import { ClientCollection } from './clientCollection';
|
||||
import { CppSettings } from './settings';
|
||||
import { CppSettings, OtherSettings } from './settings';
|
||||
import { PersistentWorkspaceState, PersistentState } from './persistentState';
|
||||
import { getLanguageConfig } from './languageConfig';
|
||||
import { getCustomConfigProviders } from './customProviders';
|
||||
@@ -37,7 +37,7 @@ let prevCrashFile: string;
|
||||
let clients: ClientCollection;
|
||||
let activeDocument: string;
|
||||
let ui: UI;
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
let languageConfigurations: vscode.Disposable[] = [];
|
||||
let intervalTimer: NodeJS.Timer;
|
||||
let insiderUpdateEnabled: boolean = false;
|
||||
@@ -47,7 +47,8 @@ let realActivationOccurred: boolean = false;
|
||||
let tempCommands: vscode.Disposable[] = [];
|
||||
let activatedPreviously: PersistentWorkspaceState<boolean>;
|
||||
let buildInfoCache: BuildInfo | undefined;
|
||||
const taskSourceStr: string = "shell";
|
||||
const taskTypeStr: string = "shell";
|
||||
const taskSourceStr: string = "C/C++";
|
||||
const cppInstallVsixStr: string = 'C/C++: Install vsix -- ';
|
||||
let taskProvider: vscode.Disposable;
|
||||
let codeActionProvider: vscode.Disposable;
|
||||
@@ -74,10 +75,10 @@ function initVcpkgDatabase(): Promise<vcpkgDatabase> {
|
||||
resolve({});
|
||||
return;
|
||||
}
|
||||
let database: vcpkgDatabase = {};
|
||||
let reader: rd.ReadLine = rd.createInterface(stream);
|
||||
const database: vcpkgDatabase = {};
|
||||
const reader: rd.ReadLine = rd.createInterface(stream);
|
||||
reader.on('line', (lineText: string) => {
|
||||
let portFilePair: string[] = lineText.split(':');
|
||||
const portFilePair: string[] = lineText.split(':');
|
||||
if (portFilePair.length !== 2) {
|
||||
return;
|
||||
}
|
||||
@@ -171,8 +172,8 @@ export function activate(activationEventOccurred: boolean): void {
|
||||
return;
|
||||
}
|
||||
|
||||
taskProvider = vscode.tasks.registerTaskProvider(taskSourceStr, {
|
||||
provideTasks: () => getBuildTasks(false),
|
||||
taskProvider = vscode.tasks.registerTaskProvider(taskTypeStr, {
|
||||
provideTasks: () => getBuildTasks(false, false),
|
||||
resolveTask(task: vscode.Task): vscode.Task | undefined {
|
||||
// Currently cannot implement because VS Code does not call this. Can implement custom output file directory when enabled.
|
||||
return undefined;
|
||||
@@ -214,7 +215,7 @@ export function activate(activationEventOccurred: boolean): void {
|
||||
// handle "workspaceContains:/.vscode/c_cpp_properties.json" activation event.
|
||||
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
|
||||
for (let i: number = 0; i < vscode.workspace.workspaceFolders.length; ++i) {
|
||||
let config: string = path.join(vscode.workspace.workspaceFolders[i].uri.fsPath, ".vscode/c_cpp_properties.json");
|
||||
const config: string = path.join(vscode.workspace.workspaceFolders[i].uri.fsPath, ".vscode/c_cpp_properties.json");
|
||||
if (fs.existsSync(config)) {
|
||||
onActivationEvent();
|
||||
return;
|
||||
@@ -225,7 +226,7 @@ export function activate(activationEventOccurred: boolean): void {
|
||||
// handle "onLanguage:cpp" and "onLanguage:c" activation events.
|
||||
if (vscode.workspace.textDocuments !== undefined && vscode.workspace.textDocuments.length > 0) {
|
||||
for (let i: number = 0; i < vscode.workspace.textDocuments.length; ++i) {
|
||||
let document: vscode.TextDocument = vscode.workspace.textDocuments[i];
|
||||
const document: vscode.TextDocument = vscode.workspace.textDocuments[i];
|
||||
if (document.uri.scheme === "file") {
|
||||
if (document.languageId === "cpp" || document.languageId === "c") {
|
||||
onActivationEvent();
|
||||
@@ -243,7 +244,7 @@ export interface BuildTaskDefinition extends vscode.TaskDefinition {
|
||||
/**
|
||||
* Generate tasks to build the current file based on the user's detected compilers, the user's compilerPath setting, and the current file's extension.
|
||||
*/
|
||||
export async function getBuildTasks(returnCompilerPath: boolean): Promise<vscode.Task[]> {
|
||||
export async function getBuildTasks(returnCompilerPath: boolean, appendSourceToName: boolean): Promise<vscode.Task[]> {
|
||||
const editor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return [];
|
||||
@@ -342,23 +343,24 @@ export async function getBuildTasks(returnCompilerPath: boolean): Promise<vscode
|
||||
return [];
|
||||
}
|
||||
|
||||
let createTask: (compilerPath: string, compilerArgs?: string []) => vscode.Task = (compilerPath: string, compilerArgs?: string []) => {
|
||||
const createTask: (compilerPath: string, compilerArgs?: string []) => vscode.Task = (compilerPath: string, compilerArgs?: string []) => {
|
||||
const filePath: string = path.join('${fileDirname}', '${fileBasenameNoExtension}');
|
||||
const compilerPathBase: string = path.basename(compilerPath);
|
||||
const taskName: string = compilerPathBase + " build active file";
|
||||
const compilerPathDir: string = path.dirname(compilerPath);
|
||||
const taskName: string = (appendSourceToName ? taskSourceStr + ": " : "") + compilerPathBase + " build active file";
|
||||
const isCl: boolean = compilerPathBase === "cl.exe";
|
||||
const cwd: string = isCl ? "" : path.dirname(compilerPath);
|
||||
const cwd: string = isWindows && !isCl && !process.env.PATH?.includes(compilerPathDir) ? compilerPathDir : "${workspaceFolder}";
|
||||
let args: string[] = isCl ? ['/Zi', '/EHsc', '/Fe:', filePath + '.exe', '${file}'] : ['-g', '${file}', '-o', filePath + (isWindows ? '.exe' : '')];
|
||||
if (compilerArgs && compilerArgs.length > 0) {
|
||||
args = args.concat(compilerArgs);
|
||||
}
|
||||
|
||||
let kind: vscode.TaskDefinition = {
|
||||
type: 'shell',
|
||||
type: taskTypeStr,
|
||||
label: taskName,
|
||||
command: isCl ? compilerPathBase : compilerPath,
|
||||
args: args,
|
||||
options: isCl ? undefined : {"cwd": cwd}
|
||||
options: { "cwd": cwd }
|
||||
};
|
||||
|
||||
if (returnCompilerPath) {
|
||||
@@ -367,7 +369,7 @@ export async function getBuildTasks(returnCompilerPath: boolean): Promise<vscode
|
||||
}
|
||||
|
||||
const command: vscode.ShellExecution = new vscode.ShellExecution(compilerPath, [...args], { cwd: cwd });
|
||||
let uri: vscode.Uri | undefined = clients.ActiveClient.RootUri;
|
||||
const uri: vscode.Uri | undefined = clients.ActiveClient.RootUri;
|
||||
if (!uri) {
|
||||
throw new Error("No client URI found in getBuildTasks()");
|
||||
}
|
||||
@@ -375,7 +377,7 @@ export async function getBuildTasks(returnCompilerPath: boolean): Promise<vscode
|
||||
if (!target) {
|
||||
throw new Error("No target WorkspaceFolder found in getBuildTasks()");
|
||||
}
|
||||
let task: vscode.Task = new vscode.Task(kind, target, taskName, taskSourceStr, command, isCl ? '$msCompile' : '$gcc');
|
||||
const task: vscode.Task = new vscode.Task(kind, target, taskName, taskSourceStr, command, isCl ? '$msCompile' : '$gcc');
|
||||
task.definition = kind; // The constructor for vscode.Task will consume the definition. Reset it by reassigning.
|
||||
task.group = vscode.TaskGroup.Build;
|
||||
|
||||
@@ -392,7 +394,7 @@ export async function getBuildTasks(returnCompilerPath: boolean): Promise<vscode
|
||||
|
||||
// Task for user compiler path setting
|
||||
if (userCompilerPath) {
|
||||
let task: vscode.Task = createTask(userCompilerPath, userCompilerPathAndArgs?.additionalArgs);
|
||||
const task: vscode.Task = createTask(userCompilerPath, userCompilerPathAndArgs?.additionalArgs);
|
||||
buildTasks.push(task);
|
||||
}
|
||||
|
||||
@@ -426,10 +428,10 @@ function realActivation(): void {
|
||||
throw new Error(intelliSenseDisabledError);
|
||||
} else {
|
||||
console.log("activating extension");
|
||||
let checkForConflictingExtensions: PersistentState<boolean> = new PersistentState<boolean>("CPP." + util.packageJson.version + ".checkForConflictingExtensions", true);
|
||||
const checkForConflictingExtensions: PersistentState<boolean> = new PersistentState<boolean>("CPP." + util.packageJson.version + ".checkForConflictingExtensions", true);
|
||||
if (checkForConflictingExtensions.Value) {
|
||||
checkForConflictingExtensions.Value = false;
|
||||
let 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>, index: number, array: Readonly<vscode.Extension<any>[]>): boolean =>
|
||||
extension.isActive && extension.id === "mitaki28.vscode-clang");
|
||||
if (clangCommandAdapterActive) {
|
||||
telemetry.logLanguageServerEvent("conflictingExtension");
|
||||
@@ -467,15 +469,20 @@ function realActivation(): void {
|
||||
if (info.platform !== "linux" || info.architecture === "x86_64") {
|
||||
// Skip Insiders processing for unsupported VS Code versions.
|
||||
// TODO: Change this to not require the hardcoded version to be updated.
|
||||
let vscodeVersion: PackageVersion = new PackageVersion(vscode.version);
|
||||
let minimumSupportedVersionForInsidersUpgrades: PackageVersion = new PackageVersion("1.42.1");
|
||||
const vscodeVersion: PackageVersion = new PackageVersion(vscode.version);
|
||||
const minimumSupportedVersionForInsidersUpgrades: PackageVersion = new PackageVersion("1.43.2");
|
||||
if (vscodeVersion.isGreaterThan(minimumSupportedVersionForInsidersUpgrades, "insider")) {
|
||||
insiderUpdateEnabled = true;
|
||||
if (settings.updateChannel === 'Default') {
|
||||
suggestInsidersChannel();
|
||||
const userVersion: PackageVersion = new PackageVersion(util.packageJson.version);
|
||||
if (userVersion.suffix === "insiders") {
|
||||
checkAndApplyUpdate(settings.updateChannel, false);
|
||||
} else {
|
||||
suggestInsidersChannel();
|
||||
}
|
||||
} else if (settings.updateChannel === 'Insiders') {
|
||||
insiderUpdateTimer = global.setInterval(checkAndApplyUpdate, insiderUpdateTimerInterval, settings.updateChannel);
|
||||
checkAndApplyUpdate(settings.updateChannel);
|
||||
insiderUpdateTimer = global.setInterval(checkAndApplyUpdateOnTimer, insiderUpdateTimerInterval);
|
||||
checkAndApplyUpdate(settings.updateChannel, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -498,7 +505,7 @@ export function updateLanguageConfigurations(): void {
|
||||
* workspace events
|
||||
*/
|
||||
function onDidChangeSettings(event: vscode.ConfigurationChangeEvent): void {
|
||||
let activeClient: Client = clients.ActiveClient;
|
||||
const activeClient: Client = clients.ActiveClient;
|
||||
const changedActiveClientSettings: { [key: string]: string } = activeClient.onDidChangeSettings(event, true);
|
||||
clients.forEach(client => {
|
||||
if (client !== activeClient) {
|
||||
@@ -512,10 +519,10 @@ function onDidChangeSettings(event: vscode.ConfigurationChangeEvent): void {
|
||||
if (newUpdateChannel === 'Default') {
|
||||
clearInterval(insiderUpdateTimer);
|
||||
} else if (newUpdateChannel === 'Insiders') {
|
||||
insiderUpdateTimer = global.setInterval(checkAndApplyUpdate, insiderUpdateTimerInterval);
|
||||
insiderUpdateTimer = global.setInterval(checkAndApplyUpdateOnTimer, insiderUpdateTimerInterval);
|
||||
}
|
||||
|
||||
checkAndApplyUpdate(newUpdateChannel);
|
||||
checkAndApplyUpdate(newUpdateChannel, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -527,7 +534,7 @@ export function onDidChangeActiveTextEditor(editor?: vscode.TextEditor): void {
|
||||
return;
|
||||
}
|
||||
|
||||
let activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
if (!editor || !activeEditor || activeEditor.document.uri.scheme !== "file" || (activeEditor.document.languageId !== "cpp" && activeEditor.document.languageId !== "c")) {
|
||||
activeDocument = "";
|
||||
} else {
|
||||
@@ -556,26 +563,37 @@ function onDidChangeTextEditorSelection(event: vscode.TextEditorSelectionChangeE
|
||||
}
|
||||
|
||||
export function processDelayedDidOpen(document: vscode.TextDocument): void {
|
||||
let client: Client = clients.getClientFor(document.uri);
|
||||
const client: Client = clients.getClientFor(document.uri);
|
||||
if (client) {
|
||||
if (clients.checkOwnership(client, document)) {
|
||||
if (!client.TrackedDocuments.has(document)) {
|
||||
// If not yet tracked, process as a newly opened file. (didOpen is sent to server in client.takeOwnership()).
|
||||
client.TrackedDocuments.add(document);
|
||||
const finishDidOpen = (doc: vscode.TextDocument) => {
|
||||
client.provideCustomConfiguration(doc.uri, undefined);
|
||||
client.notifyWhenReady(() => {
|
||||
client.takeOwnership(doc);
|
||||
client.onDidOpenTextDocument(doc);
|
||||
});
|
||||
};
|
||||
let languageChanged: boolean = false;
|
||||
// Work around vscode treating ".C" or ".H" as c, by adding this file name to file associations as cpp
|
||||
if ((document.uri.path.endsWith(".C") || document.uri.path.endsWith(".H")) && document.languageId === "c") {
|
||||
let cppSettings: CppSettings = new CppSettings();
|
||||
const cppSettings: CppSettings = new CppSettings();
|
||||
if (cppSettings.autoAddFileAssociations) {
|
||||
const fileName: string = path.basename(document.uri.fsPath);
|
||||
const mappingString: string = fileName + "@" + document.uri.fsPath;
|
||||
client.addFileAssociations(mappingString, false);
|
||||
client.sendDidChangeSettings({ files: { associations: new OtherSettings().filesAssociations }});
|
||||
vscode.languages.setTextDocumentLanguage(document, "cpp").then((newDoc: vscode.TextDocument) => {
|
||||
finishDidOpen(newDoc);
|
||||
});
|
||||
languageChanged = true;
|
||||
}
|
||||
}
|
||||
client.provideCustomConfiguration(document.uri, undefined);
|
||||
client.notifyWhenReady(() => {
|
||||
client.takeOwnership(document);
|
||||
client.onDidOpenTextDocument(document);
|
||||
});
|
||||
if (!languageChanged) {
|
||||
finishDidOpen(document);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -590,7 +608,7 @@ function onDidChangeVisibleTextEditors(editors: vscode.TextEditor[]): void {
|
||||
});
|
||||
|
||||
clients.forEach(client => {
|
||||
let editorsForThisClient: vscode.TextEditor[] = [];
|
||||
const editorsForThisClient: vscode.TextEditor[] = [];
|
||||
editors.forEach(editor => {
|
||||
if (editor.document.languageId === "c" || editor.document.languageId === "cpp"
|
||||
|| editor.document.languageId === "json" && editor.document.uri.fsPath.endsWith("c_cpp_properties.json")) {
|
||||
@@ -606,7 +624,7 @@ function onDidChangeVisibleTextEditors(editors: vscode.TextEditor[]): void {
|
||||
}
|
||||
|
||||
function onDidChangeTextEditorVisibleRanges(textEditorVisibleRangesChangeEvent: vscode.TextEditorVisibleRangesChangeEvent): void {
|
||||
let languageId: String = textEditorVisibleRangesChangeEvent.textEditor.document.languageId;
|
||||
const languageId: String = textEditorVisibleRangesChangeEvent.textEditor.document.languageId;
|
||||
if (languageId === "c" || languageId === "cpp") {
|
||||
clients.forEach(client => {
|
||||
if (clients.checkOwnership(client, textEditorVisibleRangesChangeEvent.textEditor.document)) {
|
||||
@@ -626,10 +644,10 @@ function onInterval(): void {
|
||||
* @param updateChannel The user's updateChannel setting.
|
||||
*/
|
||||
function installVsix(vsixLocation: string): Thenable<void> {
|
||||
let userVersion: PackageVersion = new PackageVersion(vscode.version);
|
||||
const userVersion: PackageVersion = new PackageVersion(vscode.version);
|
||||
|
||||
// 1.33.0 introduces workbench.extensions.installExtension. 1.32.3 was immediately prior.
|
||||
let lastVersionWithoutInstallExtensionCommand: PackageVersion = new PackageVersion('1.32.3');
|
||||
const lastVersionWithoutInstallExtensionCommand: PackageVersion = new PackageVersion('1.32.3');
|
||||
if (userVersion.isGreaterThan(lastVersionWithoutInstallExtensionCommand, "insider")) {
|
||||
return vscode.commands.executeCommand('workbench.extensions.installExtension', vscode.Uri.file(vsixLocation));
|
||||
}
|
||||
@@ -668,7 +686,7 @@ function installVsix(vsixLocation: string): Thenable<void> {
|
||||
}
|
||||
|
||||
// 1.28.0 changes the CLI for making installations. 1.27.2 was immediately prior.
|
||||
let oldVersion: PackageVersion = new PackageVersion('1.27.2');
|
||||
const oldVersion: PackageVersion = new PackageVersion('1.27.2');
|
||||
if (userVersion.isGreaterThan(oldVersion, "insider")) {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let process: ChildProcess;
|
||||
@@ -720,7 +738,7 @@ function installVsix(vsixLocation: string): Thenable<void> {
|
||||
// If downgrading, the VS Code CLI will prompt whether the user is sure they would like to downgrade.
|
||||
// Respond to this by writing 0 to stdin (the option to override and install the VSIX package)
|
||||
let sentOverride: boolean = false;
|
||||
let stdout: Readable | null = process.stdout;
|
||||
const stdout: Readable | null = process.stdout;
|
||||
if (!stdout) {
|
||||
reject(new Error("Failed to communicate with VS Code script process for installation"));
|
||||
return;
|
||||
@@ -729,7 +747,7 @@ function installVsix(vsixLocation: string): Thenable<void> {
|
||||
if (sentOverride) {
|
||||
return;
|
||||
}
|
||||
let stdin: Writable | null = process.stdin;
|
||||
const stdin: Writable | null = process.stdin;
|
||||
if (!stdin) {
|
||||
reject(new Error("Failed to communicate with VS Code script process for installation"));
|
||||
return;
|
||||
@@ -744,14 +762,14 @@ function installVsix(vsixLocation: string): Thenable<void> {
|
||||
}
|
||||
|
||||
async function suggestInsidersChannel(): Promise<void> {
|
||||
let suggestInsiders: PersistentState<boolean> = new PersistentState<boolean>("CPP.suggestInsiders", true);
|
||||
const suggestInsiders: PersistentState<boolean> = new PersistentState<boolean>("CPP.suggestInsiders", true);
|
||||
|
||||
if (!suggestInsiders.Value) {
|
||||
return;
|
||||
}
|
||||
let buildInfo: BuildInfo | undefined;
|
||||
try {
|
||||
buildInfo = await getTargetBuildInfo("Insiders");
|
||||
buildInfo = await getTargetBuildInfo("Insiders", false);
|
||||
} catch (error) {
|
||||
console.log(`${cppInstallVsixStr}${error.message}`);
|
||||
if (error.message.indexOf('/') !== -1 || error.message.indexOf('\\') !== -1) {
|
||||
@@ -766,7 +784,7 @@ async function suggestInsidersChannel(): Promise<void> {
|
||||
const yes: string = localize("yes.button", "Yes");
|
||||
const askLater: string = localize("ask.me.later.button", "Ask Me Later");
|
||||
const dontShowAgain: string = localize("dont.show.again.button", "Don't Show Again");
|
||||
let selection: string | undefined = await vscode.window.showInformationMessage(message, yes, askLater, dontShowAgain);
|
||||
const selection: string | undefined = await vscode.window.showInformationMessage(message, yes, askLater, dontShowAgain);
|
||||
switch (selection) {
|
||||
case yes:
|
||||
// Cache buildInfo.
|
||||
@@ -790,8 +808,8 @@ async function applyUpdate(buildInfo: BuildInfo): Promise<void> {
|
||||
tempVSIX = await util.createTempFileWithPostfix('.vsix');
|
||||
|
||||
// Try to download VSIX
|
||||
let config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration();
|
||||
let originalProxySupport: string | undefined = config.inspect<string>('http.proxySupport')?.globalValue;
|
||||
const config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration();
|
||||
const originalProxySupport: string | undefined = config.inspect<string>('http.proxySupport')?.globalValue;
|
||||
while (true) { // Might need to try again with a different http.proxySupport setting.
|
||||
try {
|
||||
await util.downloadFileToDestination(buildInfo.downloadUrl, tempVSIX.name);
|
||||
@@ -843,12 +861,17 @@ async function applyUpdate(buildInfo: BuildInfo): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
async function checkAndApplyUpdateOnTimer(): Promise<void> {
|
||||
return checkAndApplyUpdate('Insiders', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query package.json and the GitHub API to determine whether the user should update, if so then install the update.
|
||||
* The update can be an upgrade or downgrade depending on the the updateChannel setting.
|
||||
* @param updateChannel The user's updateChannel setting.
|
||||
* @param isFromSettingsChange True if the invocation is the result of a settings change.
|
||||
*/
|
||||
async function checkAndApplyUpdate(updateChannel: string): Promise<void> {
|
||||
async function checkAndApplyUpdate(updateChannel: string, isFromSettingsChange: boolean): Promise<void> {
|
||||
// If we have buildInfo cache, we should use it.
|
||||
let buildInfo: BuildInfo | undefined = buildInfoCache;
|
||||
// clear buildInfo cache.
|
||||
@@ -856,7 +879,7 @@ async function checkAndApplyUpdate(updateChannel: string): Promise<void> {
|
||||
|
||||
if (!buildInfo) {
|
||||
try {
|
||||
buildInfo = await getTargetBuildInfo(updateChannel);
|
||||
buildInfo = await getTargetBuildInfo(updateChannel, isFromSettingsChange);
|
||||
} catch (error) {
|
||||
telemetry.logLanguageServerEvent('installVsix', { 'error': error.message, 'success': 'false' });
|
||||
}
|
||||
@@ -904,13 +927,14 @@ export function registerCommands(): void {
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.VcpkgClipboardInstallSuggested', onVcpkgClipboardInstallSuggested));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.VcpkgOnlineHelpSuggested', onVcpkgOnlineHelpSuggested));
|
||||
disposables.push(vscode.commands.registerCommand('cpptools.activeConfigName', onGetActiveConfigName));
|
||||
disposables.push(vscode.commands.registerCommand('cpptools.activeConfigCustomVariable', onGetActiveConfigCustomVariable));
|
||||
disposables.push(vscode.commands.registerCommand('cpptools.setActiveConfigName', onSetActiveConfigName));
|
||||
getTemporaryCommandRegistrarInstance().executeDelayedCommands();
|
||||
}
|
||||
|
||||
function onSwitchHeaderSource(): void {
|
||||
onActivationEvent();
|
||||
let activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
if (!activeEditor || !activeEditor.document) {
|
||||
return;
|
||||
}
|
||||
@@ -920,7 +944,7 @@ function onSwitchHeaderSource(): void {
|
||||
}
|
||||
|
||||
let rootPath: string = clients.ActiveClient.RootPath;
|
||||
let fileName: string = activeEditor.document.fileName;
|
||||
const fileName: string = activeEditor.document.fileName;
|
||||
|
||||
if (!rootPath) {
|
||||
rootPath = path.dirname(fileName); // When switching without a folder open.
|
||||
@@ -959,7 +983,7 @@ function selectClient(): Thenable<Client> {
|
||||
} else {
|
||||
return ui.showWorkspaces(clients.Names).then(key => {
|
||||
if (key !== "") {
|
||||
let client: Client | undefined = clients.get(key);
|
||||
const client: Client | undefined = clients.get(key);
|
||||
if (client) {
|
||||
return client;
|
||||
} else {
|
||||
@@ -1038,28 +1062,28 @@ function onAddToIncludePath(path: string): void {
|
||||
function onEnableSquiggles(): void {
|
||||
onActivationEvent();
|
||||
// This only applies to the active client.
|
||||
let settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
settings.update<string>("errorSquiggles", "Enabled");
|
||||
}
|
||||
|
||||
function onDisableSquiggles(): void {
|
||||
onActivationEvent();
|
||||
// This only applies to the active client.
|
||||
let settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
settings.update<string>("errorSquiggles", "Disabled");
|
||||
}
|
||||
|
||||
function onToggleIncludeFallback(): void {
|
||||
onActivationEvent();
|
||||
// This only applies to the active client.
|
||||
let settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
settings.toggleSetting("intelliSenseEngineFallback", "Enabled", "Disabled");
|
||||
}
|
||||
|
||||
function onToggleDimInactiveRegions(): void {
|
||||
onActivationEvent();
|
||||
// This only applies to the active client.
|
||||
let settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
settings.update<boolean>("dimInactiveRegions", !settings.dimInactiveRegions);
|
||||
}
|
||||
|
||||
@@ -1085,14 +1109,14 @@ function onShowReferencesProgress(): void {
|
||||
|
||||
function onToggleRefGroupView(): void {
|
||||
// Set context to switch icons
|
||||
let client: Client = getActiveClient();
|
||||
const client: Client = getActiveClient();
|
||||
client.toggleReferenceResultsView();
|
||||
}
|
||||
|
||||
function onTakeSurvey(): void {
|
||||
onActivationEvent();
|
||||
telemetry.logLanguageServerEvent("onTakeSurvey");
|
||||
let uri: vscode.Uri = vscode.Uri.parse(`https://www.research.net/r/VBVV6C6?o=${os.platform()}&m=${vscode.env.machineId}`);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1137,7 +1161,7 @@ async function onVcpkgClipboardInstallSuggested(ports?: string[]): Promise<void>
|
||||
}
|
||||
|
||||
// Queue look ups in the vcpkg database for missing ports; filter out duplicate results
|
||||
let portsPromises: Promise<string[]>[] = [];
|
||||
const portsPromises: Promise<string[]>[] = [];
|
||||
missingIncludeLocations.forEach(docAndLineNumbers => {
|
||||
docAndLineNumbers[1].forEach(async line => {
|
||||
portsPromises.push(lookupIncludeInVcpkg(docAndLineNumbers[0], line));
|
||||
@@ -1147,7 +1171,7 @@ async function onVcpkgClipboardInstallSuggested(ports?: string[]): Promise<void>
|
||||
if (!ports.length) {
|
||||
return;
|
||||
}
|
||||
let ports2: string[] = ports;
|
||||
const ports2: string[] = ports;
|
||||
ports = ports2.filter((port: string, index: number) => ports2.indexOf(port) === index);
|
||||
}
|
||||
|
||||
@@ -1166,6 +1190,10 @@ function onGetActiveConfigName(): Thenable<string | undefined> {
|
||||
return clients.ActiveClient.getCurrentConfigName();
|
||||
}
|
||||
|
||||
function onGetActiveConfigCustomVariable(variableName: string): Thenable<string> {
|
||||
return clients.ActiveClient.getCurrentConfigCustomVariable(variableName);
|
||||
}
|
||||
|
||||
function onLogDiagnostics(): void {
|
||||
onActivationEvent();
|
||||
clients.ActiveClient.logDiagnostics();
|
||||
@@ -1203,9 +1231,9 @@ function reportMacCrashes(): void {
|
||||
if (!home) {
|
||||
return;
|
||||
}
|
||||
let crashFolder: string = path.resolve(home, "Library/Logs/DiagnosticReports");
|
||||
const crashFolder: string = path.resolve(home, "Library/Logs/DiagnosticReports");
|
||||
fs.stat(crashFolder, (err, stats) => {
|
||||
let crashObject: { [key: string]: string } = {};
|
||||
const crashObject: { [key: string]: string } = {};
|
||||
if (err?.code) {
|
||||
// If the directory isn't there, we have a problem...
|
||||
crashObject["fs.stat: err.code"] = err.code;
|
||||
@@ -1246,7 +1274,7 @@ function reportMacCrashes(): void {
|
||||
}
|
||||
|
||||
function logCrashTelemetry(data: string): void {
|
||||
let crashObject: { [key: string]: string } = {};
|
||||
const crashObject: { [key: string]: string } = {};
|
||||
crashObject["CrashingThreadCallStack"] = data;
|
||||
telemetry.logLanguageServerEvent("MacCrash", crashObject, undefined);
|
||||
}
|
||||
@@ -1259,7 +1287,7 @@ function handleCrashFileRead(err: NodeJS.ErrnoException | undefined | null, data
|
||||
// Extract the crashing process version, because the version might not match
|
||||
// if multiple VS Codes are running with different extension versions.
|
||||
let binaryVersion: string = "";
|
||||
let startVersion: number = data.indexOf("Version:");
|
||||
const startVersion: number = data.indexOf("Version:");
|
||||
if (startVersion >= 0) {
|
||||
data = data.substr(startVersion);
|
||||
const binaryVersionMatches: string[] | null = data.match(/^Version:\s*(\d*\.\d*\.\d*\.\d*|\d)/);
|
||||
@@ -1301,7 +1329,7 @@ function handleCrashFileRead(err: NodeJS.ErrnoException | undefined | null, data
|
||||
}
|
||||
|
||||
// Remove runtime lines because they can be different on different machines.
|
||||
let lines: string[] = data.split("\n");
|
||||
const lines: string[] = data.split("\n");
|
||||
data = "";
|
||||
lines.forEach((line: string) => {
|
||||
if (!line.includes(".dylib") && !line.includes("???")) {
|
||||
|
||||
@@ -23,7 +23,7 @@ const escapeChars: RegExp = /[\\\^\$\*\+\?\{\}\(\)\.\!\=\|\[\]\ \/]/; // charac
|
||||
// Insert '\\' in front of regexp escape chars.
|
||||
function escape(chars: string): string {
|
||||
let result: string = "";
|
||||
for (let char of chars) {
|
||||
for (const char of chars) {
|
||||
if (char.match(escapeChars)) {
|
||||
result += `\\${char}`;
|
||||
} else {
|
||||
@@ -37,7 +37,7 @@ function escape(chars: string): string {
|
||||
|
||||
function getMLBeginPattern(insert: string): string | undefined {
|
||||
if (insert.startsWith("/*")) {
|
||||
let match: string = escape(insert.substr(2)); // trim the leading '/*' and escape any troublesome characters.
|
||||
const match: string = escape(insert.substr(2)); // trim the leading '/*' and escape any troublesome characters.
|
||||
return `^\\s*\\/\\*${match}(?!\\/)([^\\*]|\\*(?!\\/))*$`;
|
||||
}
|
||||
return undefined;
|
||||
@@ -49,9 +49,9 @@ function getMLSplitAfterPattern(): string {
|
||||
|
||||
function getMLContinuePattern(insert: string): string | undefined {
|
||||
if (insert) {
|
||||
let match: string = escape(insert.trimRight());
|
||||
const match: string = escape(insert.trimRight());
|
||||
if (match) {
|
||||
let right: string = escape(insert.substr(insert.trimRight().length));
|
||||
const right: string = escape(insert.substr(insert.trimRight().length));
|
||||
return `^\\s*${match}(${right}([^\\*]|\\*(?!\\/))*)?$`;
|
||||
}
|
||||
// else: if the continuation is just whitespace, vscode already does indentation preservation.
|
||||
@@ -60,7 +60,7 @@ function getMLContinuePattern(insert: string): string | undefined {
|
||||
}
|
||||
|
||||
function getMLEndPattern(insert: string): string | undefined {
|
||||
let match: string = escape(insert.trimRight().trimLeft());
|
||||
const match: string = escape(insert.trimRight().trimLeft());
|
||||
if (match) {
|
||||
return `^\\s*${match}[^/]*\\*\\/\\s*$`;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ function getMLEmptyEndPattern(insert: string): string | undefined {
|
||||
if (insert.endsWith('*')) {
|
||||
insert = insert.substr(0, insert.length - 1);
|
||||
}
|
||||
let match: string = escape(insert.trimRight());
|
||||
const match: string = escape(insert.trimRight());
|
||||
return `^\\s*${match}\\*\\/\\s*$`;
|
||||
}
|
||||
// else: if the continuation is just whitespace, don't mess with indentation
|
||||
@@ -84,18 +84,18 @@ function getMLEmptyEndPattern(insert: string): string | undefined {
|
||||
}
|
||||
|
||||
function getSLBeginPattern(insert: string): string {
|
||||
let match: string = escape(insert.trimRight());
|
||||
const match: string = escape(insert.trimRight());
|
||||
return `^\\s*${match}.*$`;
|
||||
}
|
||||
|
||||
function getSLContinuePattern(insert: string): string {
|
||||
let match: string = escape(insert.trimRight());
|
||||
const match: string = escape(insert.trimRight());
|
||||
return `^\\s*${match}.+$`;
|
||||
}
|
||||
|
||||
function getSLEndPattern(insert: string): string {
|
||||
let match: string = escape(insert);
|
||||
let trimmed: string = escape(insert.trimRight());
|
||||
const trimmed: string = escape(insert.trimRight());
|
||||
if (match !== trimmed) {
|
||||
match = `(${match}|${trimmed})`;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ function getSLEndPattern(insert: string): string {
|
||||
|
||||
// When Enter is pressed while the cursor is between '/**' and '*/' on the same line.
|
||||
function getMLSplitRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
|
||||
let beforePattern: string | undefined = getMLBeginPattern(comment.begin);
|
||||
const beforePattern: string | undefined = getMLBeginPattern(comment.begin);
|
||||
if (beforePattern) {
|
||||
return {
|
||||
beforeText: new RegExp(beforePattern),
|
||||
@@ -120,7 +120,7 @@ function getMLSplitRule(comment: CommentPattern): vscode.OnEnterRule | undefined
|
||||
|
||||
// When Enter is pressed while the cursor is after '/**' and there is no '*/' on the same line after the cursor
|
||||
function getMLFirstLineRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
|
||||
let beforePattern: string | undefined = getMLBeginPattern(comment.begin);
|
||||
const beforePattern: string | undefined = getMLBeginPattern(comment.begin);
|
||||
if (beforePattern) {
|
||||
return {
|
||||
beforeText: new RegExp(beforePattern),
|
||||
@@ -135,7 +135,7 @@ function getMLFirstLineRule(comment: CommentPattern): vscode.OnEnterRule | undef
|
||||
|
||||
// When Enter is pressed while the cursor is after the continuation pattern
|
||||
function getMLContinuationRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
|
||||
let continuePattern: string | undefined = getMLContinuePattern(comment.continue);
|
||||
const continuePattern: string | undefined = getMLContinuePattern(comment.continue);
|
||||
if (continuePattern) {
|
||||
return {
|
||||
beforeText: new RegExp(continuePattern),
|
||||
@@ -150,7 +150,7 @@ function getMLContinuationRule(comment: CommentPattern): vscode.OnEnterRule | un
|
||||
|
||||
// When Enter is pressed while the cursor is after '*/' (and '*/' plus leading whitespace is all that is on the line)
|
||||
function getMLEndRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
|
||||
let endPattern: string | undefined = getMLEndPattern(comment.continue);
|
||||
const endPattern: string | undefined = getMLEndPattern(comment.continue);
|
||||
if (endPattern) {
|
||||
return {
|
||||
beforeText: new RegExp(endPattern),
|
||||
@@ -165,7 +165,7 @@ function getMLEndRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
|
||||
|
||||
// When Enter is pressed while the cursor is after the continuation pattern and '*/'
|
||||
function getMLEmptyEndRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
|
||||
let endPattern: string | undefined = getMLEmptyEndPattern(comment.continue);
|
||||
const endPattern: string | undefined = getMLEmptyEndPattern(comment.continue);
|
||||
if (endPattern) {
|
||||
return {
|
||||
beforeText: new RegExp(endPattern),
|
||||
@@ -180,7 +180,7 @@ function getMLEmptyEndRule(comment: CommentPattern): vscode.OnEnterRule | undefi
|
||||
|
||||
// When the continue rule is different than the begin rule for single line comments
|
||||
function getSLFirstLineRule(comment: CommentPattern): vscode.OnEnterRule {
|
||||
let continuePattern: string = getSLBeginPattern(comment.begin);
|
||||
const continuePattern: string = getSLBeginPattern(comment.begin);
|
||||
return {
|
||||
beforeText: new RegExp(continuePattern),
|
||||
action: {
|
||||
@@ -192,7 +192,7 @@ function getSLFirstLineRule(comment: CommentPattern): vscode.OnEnterRule {
|
||||
|
||||
// When Enter is pressed while the cursor is after the continuation pattern plus at least one other character.
|
||||
function getSLContinuationRule(comment: CommentPattern): vscode.OnEnterRule {
|
||||
let continuePattern: string = getSLContinuePattern(comment.continue);
|
||||
const continuePattern: string = getSLContinuePattern(comment.continue);
|
||||
return {
|
||||
beforeText: new RegExp(continuePattern),
|
||||
action: {
|
||||
@@ -204,7 +204,7 @@ function getSLContinuationRule(comment: CommentPattern): vscode.OnEnterRule {
|
||||
|
||||
// When Enter is pressed while the cursor is immediately after the continuation pattern
|
||||
function getSLEndRule(comment: CommentPattern): vscode.OnEnterRule {
|
||||
let endPattern: string = getSLEndPattern(comment.continue);
|
||||
const endPattern: string = getSLEndPattern(comment.continue);
|
||||
return {
|
||||
beforeText: new RegExp(endPattern),
|
||||
action: {
|
||||
@@ -221,14 +221,14 @@ interface Rules {
|
||||
}
|
||||
|
||||
export function getLanguageConfig(languageId: string, resource?: vscode.Uri): vscode.LanguageConfiguration {
|
||||
let settings: CppSettings = new CppSettings(resource);
|
||||
let patterns: (string | CommentPattern)[] | undefined = settings.commentContinuationPatterns;
|
||||
const settings: CppSettings = new CppSettings(resource);
|
||||
const patterns: (string | CommentPattern)[] | undefined = settings.commentContinuationPatterns;
|
||||
return getLanguageConfigFromPatterns(languageId, patterns);
|
||||
}
|
||||
|
||||
export function getLanguageConfigFromPatterns(languageId: string, patterns?: (string | CommentPattern)[]): vscode.LanguageConfiguration {
|
||||
let beginPatterns: string[] = []; // avoid duplicate rules
|
||||
let continuePatterns: string[] = []; // avoid duplicate rules
|
||||
const beginPatterns: string[] = []; // avoid duplicate rules
|
||||
const continuePatterns: string[] = []; // avoid duplicate rules
|
||||
let duplicates: boolean = false;
|
||||
let beginRules: vscode.OnEnterRule[] = [];
|
||||
let continueRules: vscode.OnEnterRule[] = [];
|
||||
@@ -237,8 +237,8 @@ export function getLanguageConfigFromPatterns(languageId: string, patterns?: (st
|
||||
patterns = [ "/**" ];
|
||||
}
|
||||
patterns.forEach(pattern => {
|
||||
let c: CommentPattern = isString(pattern) ? { begin: pattern, continue: pattern.startsWith('/*') ? " * " : pattern } : <CommentPattern>pattern;
|
||||
let r: Rules = constructCommentRules(c, languageId);
|
||||
const c: CommentPattern = isString(pattern) ? { begin: pattern, continue: pattern.startsWith('/*') ? " * " : pattern } : <CommentPattern>pattern;
|
||||
const r: Rules = constructCommentRules(c, languageId);
|
||||
if (beginPatterns.indexOf(c.begin) < 0) {
|
||||
if (r.begin && r.begin.length > 0) {
|
||||
beginRules = beginRules.concat(r.begin);
|
||||
@@ -265,23 +265,23 @@ export function getLanguageConfigFromPatterns(languageId: string, patterns?: (st
|
||||
|
||||
function constructCommentRules(comment: CommentPattern, languageId: string): Rules {
|
||||
if (comment?.begin?.startsWith('/*') && (languageId === 'c' || languageId === 'cpp')) {
|
||||
let mlBegin1: vscode.OnEnterRule | undefined = getMLSplitRule(comment);
|
||||
const mlBegin1: vscode.OnEnterRule | undefined = getMLSplitRule(comment);
|
||||
if (!mlBegin1) {
|
||||
throw new Error("Failure in constructCommentRules() - mlBegin1");
|
||||
}
|
||||
let mlBegin2: vscode.OnEnterRule | undefined = getMLFirstLineRule(comment);
|
||||
const mlBegin2: vscode.OnEnterRule | undefined = getMLFirstLineRule(comment);
|
||||
if (!mlBegin2) {
|
||||
throw new Error("Failure in constructCommentRules() - mlBegin2");
|
||||
}
|
||||
let mlContinue: vscode.OnEnterRule | undefined = getMLContinuationRule(comment);
|
||||
const mlContinue: vscode.OnEnterRule | undefined = getMLContinuationRule(comment);
|
||||
if (!mlContinue) {
|
||||
throw new Error("Failure in constructCommentRules() - mlContinue");
|
||||
}
|
||||
let mlEnd1: vscode.OnEnterRule | undefined = getMLEmptyEndRule(comment);
|
||||
const mlEnd1: vscode.OnEnterRule | undefined = getMLEmptyEndRule(comment);
|
||||
if (!mlEnd1) {
|
||||
throw new Error("Failure in constructCommentRules() - mlEnd1");
|
||||
}
|
||||
let mlEnd2: vscode.OnEnterRule | undefined = getMLEndRule(comment);
|
||||
const mlEnd2: vscode.OnEnterRule | undefined = getMLEndRule(comment);
|
||||
if (!mlEnd2) {
|
||||
throw new Error("Failure in constructCommentRules() = mlEnd2");
|
||||
}
|
||||
@@ -291,10 +291,10 @@ function constructCommentRules(comment: CommentPattern, languageId: string): Rul
|
||||
end: [ mlEnd1, mlEnd2 ]
|
||||
};
|
||||
} else if (comment?.begin?.startsWith('//') && languageId === 'cpp') {
|
||||
let slContinue: vscode.OnEnterRule = getSLContinuationRule(comment);
|
||||
let slEnd: vscode.OnEnterRule = getSLEndRule(comment);
|
||||
const slContinue: vscode.OnEnterRule = getSLContinuationRule(comment);
|
||||
const slEnd: vscode.OnEnterRule = getSLEndRule(comment);
|
||||
if (comment.begin !== comment.continue) {
|
||||
let slBegin: vscode.OnEnterRule = getSLFirstLineRule(comment);
|
||||
const slBegin: vscode.OnEnterRule = getSLFirstLineRule(comment);
|
||||
return {
|
||||
begin: (comment.begin === comment.continue) ? [] : [ slBegin ],
|
||||
continue: [ slContinue ],
|
||||
|
||||
@@ -61,7 +61,7 @@ export class PersistentWorkspaceState<T> extends PersistentStateBase<T> {
|
||||
export class PersistentFolderState<T> extends PersistentWorkspaceState<T> {
|
||||
constructor(key: string, defaultValue: T, folder: vscode.WorkspaceFolder) {
|
||||
// Check for the old key. If found, remove it and update the new key with the old value.
|
||||
let old_key: string = key + (folder ? `-${path.basename(folder.uri.fsPath)}` : "-untitled");
|
||||
const old_key: string = key + (folder ? `-${path.basename(folder.uri.fsPath)}` : "-untitled");
|
||||
let old_val: T | undefined;
|
||||
if (util.extensionContext) {
|
||||
old_val = util.extensionContext.workspaceState.get(old_key);
|
||||
@@ -69,7 +69,7 @@ export class PersistentFolderState<T> extends PersistentWorkspaceState<T> {
|
||||
util.extensionContext.workspaceState.update(old_key, undefined);
|
||||
}
|
||||
}
|
||||
let newKey: string = key + (folder ? `-${folder.uri.fsPath}` : "-untitled");
|
||||
const newKey: string = key + (folder ? `-${folder.uri.fsPath}` : "-untitled");
|
||||
super(newKey, defaultValue);
|
||||
if (old_val !== undefined) {
|
||||
this.Value = old_val;
|
||||
|
||||
@@ -9,45 +9,56 @@ import { Middleware } from 'vscode-languageclient';
|
||||
import { ClientCollection } from './clientCollection';
|
||||
import { Client } from './client';
|
||||
import * as vscode from 'vscode';
|
||||
import { CppSettings } from './settings';
|
||||
import { CppSettings, OtherSettings } from './settings';
|
||||
import { onDidChangeActiveTextEditor, processDelayedDidOpen } from './extension';
|
||||
|
||||
export function createProtocolFilter(clients: ClientCollection): Middleware {
|
||||
// Disabling lint for invoke handlers
|
||||
let defaultHandler: (data: any, callback: (data: any) => void) => void = (data, callback: (data: any) => void) => { clients.ActiveClient.notifyWhenReady(() => callback(data)); };
|
||||
const defaultHandler: (data: any, callback: (data: any) => void) => void = (data, callback: (data: any) => void) => { clients.ActiveClient.notifyWhenReady(() => callback(data)); };
|
||||
// let invoke1 = (a, callback: (a) => any) => { if (clients.ActiveClient === me) { return me.requestWhenReady(() => callback(a)); } return null; };
|
||||
let invoke2 = (a: any, b: any, callback: (a: any, b: any) => any) => clients.ActiveClient.requestWhenReady<any>(() => callback(a, b));
|
||||
let invoke3 = (a: any, b: any, c: any, callback: (a: any, b: any, c: any) => any) => clients.ActiveClient.requestWhenReady<any>(() => callback(a, b, c));
|
||||
let invoke4 = (a: any, b: any, c: any, d: any, callback: (a: any, b: any, c: any, d: any) => any) => clients.ActiveClient.requestWhenReady<any>(() => callback(a, b, c, d));
|
||||
let invoke5 = (a: any, b: any, c: any, d: any, e: any, callback: (a: any, b: any, c: any, d: any, e: any) => any) => clients.ActiveClient.requestWhenReady<any>(() => callback(a, b, c, d, e));
|
||||
const invoke2 = (a: any, b: any, callback: (a: any, b: any) => any) => clients.ActiveClient.requestWhenReady<any>(() => callback(a, b));
|
||||
const invoke3 = (a: any, b: any, c: any, callback: (a: any, b: any, c: any) => any) => clients.ActiveClient.requestWhenReady<any>(() => callback(a, b, c));
|
||||
const invoke4 = (a: any, b: any, c: any, d: any, callback: (a: any, b: any, c: any, d: any) => any) => clients.ActiveClient.requestWhenReady<any>(() => callback(a, b, c, d));
|
||||
const invoke5 = (a: any, b: any, c: any, d: any, e: any, callback: (a: any, b: any, c: any, d: any, e: any) => any) => clients.ActiveClient.requestWhenReady<any>(() => callback(a, b, c, d, e));
|
||||
/* tslint:enable */
|
||||
|
||||
return {
|
||||
didOpen: (document, sendMessage) => {
|
||||
let editor: vscode.TextEditor | undefined = vscode.window.visibleTextEditors.find(e => e.document === document);
|
||||
const editor: vscode.TextEditor | undefined = vscode.window.visibleTextEditors.find(e => e.document === document);
|
||||
if (editor) {
|
||||
// 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.
|
||||
let me: Client = clients.getClientFor(document.uri);
|
||||
const me: Client = clients.getClientFor(document.uri);
|
||||
if (clients.checkOwnership(me, document)) {
|
||||
me.TrackedDocuments.add(document);
|
||||
const finishDidOpen = (doc: vscode.TextDocument) => {
|
||||
me.provideCustomConfiguration(doc.uri, undefined);
|
||||
me.notifyWhenReady(() => {
|
||||
sendMessage(doc);
|
||||
me.onDidOpenTextDocument(doc);
|
||||
if (editor && editor === vscode.window.activeTextEditor) {
|
||||
onDidChangeActiveTextEditor(editor);
|
||||
}
|
||||
});
|
||||
};
|
||||
let languageChanged: boolean = false;
|
||||
if ((document.uri.path.endsWith(".C") || document.uri.path.endsWith(".H")) && document.languageId === "c") {
|
||||
let cppSettings: CppSettings = new CppSettings();
|
||||
const cppSettings: CppSettings = new CppSettings();
|
||||
if (cppSettings.autoAddFileAssociations) {
|
||||
const fileName: string = path.basename(document.uri.fsPath);
|
||||
const mappingString: string = fileName + "@" + document.uri.fsPath;
|
||||
me.addFileAssociations(mappingString, false);
|
||||
me.sendDidChangeSettings({ files: { associations: new OtherSettings().filesAssociations }});
|
||||
vscode.languages.setTextDocumentLanguage(document, "cpp").then((newDoc: vscode.TextDocument) => {
|
||||
finishDidOpen(newDoc);
|
||||
});
|
||||
languageChanged = true;
|
||||
}
|
||||
}
|
||||
me.provideCustomConfiguration(document.uri, undefined);
|
||||
me.notifyWhenReady(() => {
|
||||
sendMessage(document);
|
||||
me.onDidOpenTextDocument(document);
|
||||
if (editor && editor === vscode.window.activeTextEditor) {
|
||||
onDidChangeActiveTextEditor(editor);
|
||||
}
|
||||
});
|
||||
if (!languageChanged) {
|
||||
finishDidOpen(document);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// NO-OP
|
||||
@@ -60,7 +71,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware {
|
||||
}
|
||||
},
|
||||
didChange: (textDocumentChangeEvent, sendMessage) => {
|
||||
let me: Client = clients.getClientFor(textDocumentChangeEvent.document.uri);
|
||||
const me: Client = clients.getClientFor(textDocumentChangeEvent.document.uri);
|
||||
if (!me.TrackedDocuments.has(textDocumentChangeEvent.document)) {
|
||||
processDelayedDidOpen(textDocumentChangeEvent.document);
|
||||
}
|
||||
@@ -69,7 +80,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware {
|
||||
},
|
||||
willSave: defaultHandler,
|
||||
willSaveWaitUntil: (event, sendMessage) => {
|
||||
let me: Client = clients.getClientFor(event.document.uri);
|
||||
const me: Client = clients.getClientFor(event.document.uri);
|
||||
if (me.TrackedDocuments.has(event.document)) {
|
||||
return me.requestWhenReady(() => sendMessage(event));
|
||||
}
|
||||
@@ -77,7 +88,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware {
|
||||
},
|
||||
didSave: defaultHandler,
|
||||
didClose: (document, sendMessage) => {
|
||||
let me: Client = clients.getClientFor(document.uri);
|
||||
const me: Client = clients.getClientFor(document.uri);
|
||||
if (me.TrackedDocuments.has(document)) {
|
||||
me.onDidCloseTextDocument(document);
|
||||
me.TrackedDocuments.delete(document);
|
||||
@@ -88,7 +99,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware {
|
||||
provideCompletionItem: invoke4,
|
||||
resolveCompletionItem: invoke2,
|
||||
provideHover: (document, position, token, next: (document: any, position: any, token: any) => any) => {
|
||||
let me: Client = clients.getClientFor(document.uri);
|
||||
const me: Client = clients.getClientFor(document.uri);
|
||||
if (clients.checkOwnership(me, document)) {
|
||||
return clients.ActiveClient.requestWhenReady(() => next(document, position, token));
|
||||
}
|
||||
|
||||
@@ -137,10 +137,10 @@ export function getReferenceTypeIconPath(referenceType: ReferenceType): { light:
|
||||
case ReferenceType.ConfirmationInProgress: basePath = "ref-confirmation-in-progress"; break;
|
||||
}
|
||||
|
||||
let lightPath: string = util.getExtensionFilePath(assetsFolder + basePath + postFixLight);
|
||||
let lightPathUri: vscode.Uri = vscode.Uri.file(lightPath);
|
||||
let darkPath: string = util.getExtensionFilePath(assetsFolder + basePath + postFixDark);
|
||||
let darkPathUri: vscode.Uri = vscode.Uri.file(darkPath);
|
||||
const lightPath: string = util.getExtensionFilePath(assetsFolder + basePath + postFixLight);
|
||||
const lightPathUri: vscode.Uri = vscode.Uri.file(lightPath);
|
||||
const darkPath: string = util.getExtensionFilePath(assetsFolder + basePath + postFixDark);
|
||||
const darkPathUri: vscode.Uri = vscode.Uri.file(darkPath);
|
||||
return {
|
||||
light: lightPathUri,
|
||||
dark: darkPathUri
|
||||
@@ -148,10 +148,10 @@ export function getReferenceTypeIconPath(referenceType: ReferenceType): { light:
|
||||
}
|
||||
|
||||
function getReferenceCanceledIconPath(): { light: vscode.Uri; dark: vscode.Uri } {
|
||||
let lightPath: string = util.getExtensionFilePath("assets/ref-canceled-light.svg");
|
||||
let lightPathUri: vscode.Uri = vscode.Uri.file(lightPath);
|
||||
let darkPath: string = util.getExtensionFilePath("assets/ref-canceled-dark.svg");
|
||||
let darkPathUri: vscode.Uri = vscode.Uri.file(darkPath);
|
||||
const lightPath: string = util.getExtensionFilePath("assets/ref-canceled-light.svg");
|
||||
const lightPathUri: vscode.Uri = vscode.Uri.file(lightPath);
|
||||
const darkPath: string = util.getExtensionFilePath("assets/ref-canceled-dark.svg");
|
||||
const darkPathUri: vscode.Uri = vscode.Uri.file(darkPath);
|
||||
return {
|
||||
light: lightPathUri,
|
||||
dark: darkPathUri
|
||||
@@ -256,7 +256,7 @@ export class ReferencesManager {
|
||||
let numConfirmingReferences: number = 0;
|
||||
let numFinishedWithoutConfirming: number = 0;
|
||||
let numFinishedConfirming: number = 0;
|
||||
for (let targetLocationProgress of this.referencesCurrentProgress.targetReferencesProgress) {
|
||||
for (const targetLocationProgress of this.referencesCurrentProgress.targetReferencesProgress) {
|
||||
switch (targetLocationProgress) {
|
||||
case TargetReferencesProgress.WaitingToLex:
|
||||
++numWaitingToLex;
|
||||
@@ -315,7 +315,7 @@ export class ReferencesManager {
|
||||
private handleProgressStarted(referencesProgress: ReferencesProgress): void {
|
||||
this.referencesStartedWhileTagParsing = this.client.IsTagParsing;
|
||||
|
||||
let mode: ReferencesCommandMode =
|
||||
const mode: ReferencesCommandMode =
|
||||
(referencesProgress === ReferencesProgress.StartedRename) ? ReferencesCommandMode.Rename :
|
||||
(this.visibleRangesDecreased && (Date.now() - this.visibleRangesDecreasedTicks < this.ticksForDetectingPeek) ?
|
||||
ReferencesCommandMode.Peek : ReferencesCommandMode.Find);
|
||||
@@ -429,7 +429,7 @@ export class ReferencesManager {
|
||||
}
|
||||
|
||||
if (this.referencesStartedWhileTagParsing) {
|
||||
let msg: string = localize("some.references.may.be.missing", "[Warning] Some references may be missing, because workspace parsing was incomplete when {0} was started.",
|
||||
const msg: string = localize("some.references.may.be.missing", "[Warning] Some references may be missing, because workspace parsing was incomplete when {0} was started.",
|
||||
referencesCommandModeToString(this.client.ReferencesCommandMode));
|
||||
if (this.client.ReferencesCommandMode === ReferencesCommandMode.Peek) {
|
||||
if (this.referencesChannel) {
|
||||
@@ -438,7 +438,7 @@ export class ReferencesManager {
|
||||
this.referencesChannel.show(true);
|
||||
}
|
||||
} else if (this.client.ReferencesCommandMode === ReferencesCommandMode.Find) {
|
||||
let logChannel: vscode.OutputChannel = logger.getOutputChannel();
|
||||
const logChannel: vscode.OutputChannel = logger.getOutputChannel();
|
||||
logChannel.appendLine(msg);
|
||||
logChannel.appendLine("");
|
||||
logChannel.show(true);
|
||||
@@ -447,12 +447,12 @@ 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.
|
||||
let referencesRequestPending: boolean = this.referencesRequestPending;
|
||||
let referencesCanceled: boolean = this.referencesCanceled;
|
||||
const referencesRequestPending: boolean = this.referencesRequestPending;
|
||||
const referencesCanceled: boolean = this.referencesCanceled;
|
||||
this.referencesRequestPending = false;
|
||||
this.referencesCanceled = false;
|
||||
|
||||
let currentReferenceCommandMode: ReferencesCommandMode = this.client.ReferencesCommandMode;
|
||||
const currentReferenceCommandMode: ReferencesCommandMode = this.client.ReferencesCommandMode;
|
||||
|
||||
if (referencesResult.isFinished) {
|
||||
this.symbolSearchInProgress = false;
|
||||
@@ -490,9 +490,9 @@ export class ReferencesManager {
|
||||
|
||||
// Display data based on command mode: peek references OR find all references
|
||||
if (currentReferenceCommandMode === ReferencesCommandMode.Peek) {
|
||||
let showConfirmedReferences: boolean = referencesCanceled;
|
||||
const showConfirmedReferences: boolean = referencesCanceled;
|
||||
if (this.findAllRefsView) {
|
||||
let peekReferencesResults: string = this.findAllRefsView.getResultsAsText(showConfirmedReferences);
|
||||
const peekReferencesResults: string = this.findAllRefsView.getResultsAsText(showConfirmedReferences);
|
||||
if (peekReferencesResults) {
|
||||
if (this.referencesChannel) {
|
||||
this.referencesChannel.appendLine(peekReferencesResults);
|
||||
|
||||
@@ -15,15 +15,15 @@ export class ReferencesModel {
|
||||
this.originalSymbol = resultsInput.text;
|
||||
this.groupByFile = groupByFile;
|
||||
|
||||
let results: ReferenceInfo[] = resultsInput.referenceInfos.filter(r => r.type !== ReferenceType.Confirmed);
|
||||
const results: ReferenceInfo[] = resultsInput.referenceInfos.filter(r => r.type !== ReferenceType.Confirmed);
|
||||
|
||||
// Build a single flat list of all leaf nodes
|
||||
// Currently, the hierarchy is built each time referencesTreeDataProvider requests nodes.
|
||||
for (let r of results) {
|
||||
for (const r of results) {
|
||||
// Add reference to file
|
||||
let noReferenceLocation: boolean = (r.position.line === 0 && r.position.character === 0);
|
||||
const noReferenceLocation: boolean = (r.position.line === 0 && r.position.character === 0);
|
||||
if (noReferenceLocation) {
|
||||
let node: TreeNode = new TreeNode(this, NodeType.fileWithPendingRef);
|
||||
const node: TreeNode = new TreeNode(this, NodeType.fileWithPendingRef);
|
||||
node.fileUri = vscode.Uri.file(r.file);
|
||||
node.filename = r.file;
|
||||
node.referenceType = r.type;
|
||||
@@ -32,7 +32,7 @@ export class ReferencesModel {
|
||||
const range: vscode.Range = new vscode.Range(r.position.line, r.position.character, r.position.line, r.position.character + this.originalSymbol.length);
|
||||
const uri: vscode.Uri = vscode.Uri.file(r.file);
|
||||
const location: vscode.Location = new vscode.Location(uri, range);
|
||||
let node: TreeNode = new TreeNode(this, NodeType.reference);
|
||||
const node: TreeNode = new TreeNode(this, NodeType.reference);
|
||||
node.fileUri = uri;
|
||||
node.filename = r.file;
|
||||
node.referencePosition = r.position;
|
||||
@@ -49,11 +49,11 @@ export class ReferencesModel {
|
||||
}
|
||||
|
||||
getReferenceTypeNodes(): TreeNode[] {
|
||||
let result: TreeNode[] = [];
|
||||
for (let n of this.nodes) {
|
||||
let i: number = result.findIndex(e => e.referenceType === n.referenceType);
|
||||
const result: TreeNode[] = [];
|
||||
for (const n of this.nodes) {
|
||||
const i: number = result.findIndex(e => e.referenceType === n.referenceType);
|
||||
if (i < 0) {
|
||||
let node: TreeNode = new TreeNode(this, NodeType.referenceType);
|
||||
const node: TreeNode = new TreeNode(this, NodeType.referenceType);
|
||||
node.referenceType = n.referenceType;
|
||||
result.push(node);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ export class ReferencesModel {
|
||||
}
|
||||
|
||||
getFileNodes(refType?: ReferenceType): TreeNode[] {
|
||||
let result: TreeNode[] = [];
|
||||
const result: TreeNode[] = [];
|
||||
let filteredFiles: TreeNode[] = [];
|
||||
|
||||
// Get files by reference type if refType is specified.
|
||||
@@ -73,11 +73,11 @@ export class ReferencesModel {
|
||||
}
|
||||
|
||||
// Create new nodes per unique file
|
||||
for (let n of filteredFiles) {
|
||||
let i: number = result.findIndex(item => item.filename === n.filename);
|
||||
for (const n of filteredFiles) {
|
||||
const i: number = result.findIndex(item => item.filename === n.filename);
|
||||
if (i < 0) {
|
||||
let nodeType: NodeType = (n.node === NodeType.fileWithPendingRef ? NodeType.fileWithPendingRef : NodeType.file);
|
||||
let node: TreeNode = new TreeNode(this, nodeType);
|
||||
const nodeType: NodeType = (n.node === NodeType.fileWithPendingRef ? NodeType.fileWithPendingRef : NodeType.file);
|
||||
const node: TreeNode = new TreeNode(this, nodeType);
|
||||
node.filename = n.filename;
|
||||
node.fileUri = n.fileUri;
|
||||
node.referenceType = refType;
|
||||
@@ -118,7 +118,7 @@ export class ReferencesModel {
|
||||
}
|
||||
|
||||
getAllFilesWithPendingReferenceNodes(): TreeNode[] {
|
||||
let result: TreeNode[] = this.nodes.filter(i => i.node === NodeType.fileWithPendingRef);
|
||||
const result: TreeNode[] = this.nodes.filter(i => i.node === NodeType.fileWithPendingRef);
|
||||
result.sort((a, b) => {
|
||||
if (a.filename === undefined) {
|
||||
if (b.filename === undefined) {
|
||||
|
||||
@@ -49,7 +49,7 @@ export class ReferencesTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
throw new Error("Undefined referenceType in getTreeItem()");
|
||||
}
|
||||
const label: string = getReferenceTagString(element.referenceType, this.referencesModel.isCanceled, true);
|
||||
let resultRefType: vscode.TreeItem = new vscode.TreeItem(label, vscode.TreeItemCollapsibleState.Expanded);
|
||||
const resultRefType: vscode.TreeItem = new vscode.TreeItem(label, vscode.TreeItemCollapsibleState.Expanded);
|
||||
return resultRefType;
|
||||
|
||||
case NodeType.file:
|
||||
@@ -57,7 +57,7 @@ export class ReferencesTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
if (element.fileUri === undefined) {
|
||||
throw new Error("Undefined fileUri in getTreeItem()");
|
||||
}
|
||||
let resultFile: vscode.TreeItem = new vscode.TreeItem(element.fileUri);
|
||||
const resultFile: vscode.TreeItem = new vscode.TreeItem(element.fileUri);
|
||||
resultFile.collapsibleState = vscode.TreeItemCollapsibleState.Expanded;
|
||||
resultFile.iconPath = vscode.ThemeIcon.File;
|
||||
resultFile.description = true;
|
||||
@@ -68,7 +68,7 @@ export class ReferencesTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
command: 'C_Cpp.ShowReferenceItem',
|
||||
arguments: [element]
|
||||
};
|
||||
let tag: string = getReferenceTagString(ReferenceType.ConfirmationInProgress, this.referencesModel.isCanceled);
|
||||
const tag: string = getReferenceTagString(ReferenceType.ConfirmationInProgress, this.referencesModel.isCanceled);
|
||||
resultFile.tooltip = `[${tag}]\n${element.filename}`;
|
||||
resultFile.collapsibleState = vscode.TreeItemCollapsibleState.None;
|
||||
}
|
||||
@@ -82,9 +82,9 @@ export class ReferencesTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
if (element.referenceType === undefined) {
|
||||
throw new Error("Undefined referenceType in getTreeItem()");
|
||||
}
|
||||
let resultRef: vscode.TreeItem = new vscode.TreeItem(element.referenceText, vscode.TreeItemCollapsibleState.None);
|
||||
const resultRef: vscode.TreeItem = new vscode.TreeItem(element.referenceText, vscode.TreeItemCollapsibleState.None);
|
||||
resultRef.iconPath = getReferenceItemIconPath(element.referenceType, this.referencesModel.isCanceled);
|
||||
let tag: string = getReferenceTagString(element.referenceType, this.referencesModel.isCanceled);
|
||||
const tag: string = getReferenceTagString(element.referenceType, this.referencesModel.isCanceled);
|
||||
resultRef.tooltip = `[${tag}]\n${element.referenceText}`;
|
||||
|
||||
resultRef.command = {
|
||||
|
||||
@@ -48,14 +48,14 @@ export class FindAllRefsView {
|
||||
|
||||
getResultsAsText(includeConfirmedReferences: boolean): string {
|
||||
let results: string[] = [];
|
||||
let confirmedRefs: string[] = [];
|
||||
let otherRefs: string[] = [];
|
||||
let fileRefs: string[] = [];
|
||||
const confirmedRefs: string[] = [];
|
||||
const otherRefs: string[] = [];
|
||||
const fileRefs: string[] = [];
|
||||
|
||||
if (!this.referencesModel) {
|
||||
throw new Error("Missiung ReferencesModel in getResultsAsText()");
|
||||
}
|
||||
for (let ref of this.referencesModel.getAllReferenceNodes()) {
|
||||
for (const ref of this.referencesModel.getAllReferenceNodes()) {
|
||||
let line: string = "";
|
||||
if (ref.referenceType !== null && ref.referenceType !== undefined) {
|
||||
line = "[" + getReferenceTagString(ref.referenceType, this.referencesModel.isCanceled) + "] ";
|
||||
@@ -73,9 +73,9 @@ export class FindAllRefsView {
|
||||
}
|
||||
|
||||
// Get files with pending references items (location of reference is pending)
|
||||
let fileReferences: TreeNode[] = this.referencesModel.getAllFilesWithPendingReferenceNodes();
|
||||
for (let fileRef of fileReferences) {
|
||||
let line: string =
|
||||
const fileReferences: TreeNode[] = this.referencesModel.getAllFilesWithPendingReferenceNodes();
|
||||
for (const fileRef of fileReferences) {
|
||||
const line: string =
|
||||
("[" + getReferenceTagString(ReferenceType.ConfirmationInProgress, this.referencesModel.isCanceled) + "] "
|
||||
+ fileRef.filename);
|
||||
fileRefs.push(line);
|
||||
|
||||
@@ -30,7 +30,7 @@ class Settings {
|
||||
protected get Section(): vscode.WorkspaceConfiguration { return this.settings; }
|
||||
|
||||
protected getWithFallback<T>(section: string, deprecatedSection: string): T {
|
||||
let info: any = this.settings.inspect<T>(section);
|
||||
const info: any = this.settings.inspect<T>(section);
|
||||
if (info.workspaceFolderValue !== undefined) {
|
||||
return info.workspaceFolderValue;
|
||||
} else if (info.workspaceValue !== undefined) {
|
||||
@@ -38,7 +38,7 @@ class Settings {
|
||||
} else if (info.globalValue !== undefined) {
|
||||
return info.globalValue;
|
||||
}
|
||||
let value: T | undefined = this.settings.get<T>(deprecatedSection);
|
||||
const value: T | undefined = this.settings.get<T>(deprecatedSection);
|
||||
if (value !== undefined) {
|
||||
return value;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ class Settings {
|
||||
}
|
||||
|
||||
protected getWithNullAsUndefined<T>(section: string): T | undefined {
|
||||
let result: T | undefined | null = this.settings.get<T>(section);
|
||||
const result: T | undefined | null = this.settings.get<T>(section);
|
||||
if (result === null) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -81,8 +81,8 @@ export class CppSettings extends Settings {
|
||||
// Attempt to invoke both our own version of clang-format to see if we can successfully execute it, and to get it's version.
|
||||
let clangFormatVersion: string;
|
||||
try {
|
||||
let exePath: string = getExtensionFilePath(`./LLVM/bin/${this.clangFormatName}`);
|
||||
let output: string[] = execSync(`${exePath} --version`).toString().split(" ");
|
||||
const exePath: string = getExtensionFilePath(`./LLVM/bin/${this.clangFormatName}`);
|
||||
const output: string[] = execSync(`${exePath} --version`).toString().split(" ");
|
||||
if (output.length < 3 || output[0] !== "clang-format" || output[1] !== "version" || !semver.valid(output[2])) {
|
||||
return path;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ export class CppSettings extends Settings {
|
||||
|
||||
// Invoke the version on the system to compare versions. Use ours if it's more recent.
|
||||
try {
|
||||
let output: string[] = execSync(`"${path}" --version`).toString().split(" ");
|
||||
const output: string[] = execSync(`"${path}" --version`).toString().split(" ");
|
||||
if (output.length < 3 || output[0] !== "clang-format" || output[1] !== "version" || semver.ltr(output[2], clangFormatVersion)) {
|
||||
path = "";
|
||||
}
|
||||
@@ -140,7 +140,7 @@ export class CppSettings extends Settings {
|
||||
public get defaultForcedInclude(): string[] | undefined { return super.Section.get<string[]>("default.forcedInclude"); }
|
||||
public get defaultIntelliSenseMode(): string | undefined { return super.Section.get<string>("default.intelliSenseMode"); }
|
||||
public get defaultCompilerPath(): string | undefined {
|
||||
let result: string | undefined | null = super.Section.get<string | null>("default.compilerPath");
|
||||
const result: string | undefined | null = super.Section.get<string | null>("default.compilerPath");
|
||||
if (result === null) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -155,6 +155,7 @@ export class CppSettings extends Settings {
|
||||
public get defaultLimitSymbolsToIncludedHeaders(): boolean | undefined { return super.Section.get<boolean>("default.browse.limitSymbolsToIncludedHeaders"); }
|
||||
public get defaultSystemIncludePath(): string[] | undefined { return super.Section.get<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") === "Enabled"; }
|
||||
|
||||
@@ -171,7 +172,7 @@ export class CppSettings extends Settings {
|
||||
}
|
||||
|
||||
public toggleSetting(name: string, value1: string, value2: string): void {
|
||||
let value: string | undefined = super.Section.get<string>(name);
|
||||
const value: string | undefined = super.Section.get<string>(name);
|
||||
super.Section.update(name, value === value1 ? value2 : value1, getTarget());
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ export class SettingsPanel {
|
||||
|
||||
public setKnownCompilers(knownCompilers?: config.KnownCompiler[], pathSeparator?: string): void {
|
||||
if (knownCompilers && knownCompilers.length) {
|
||||
for (let compiler of knownCompilers) {
|
||||
for (const compiler of knownCompilers) {
|
||||
// Normalize path separators.
|
||||
let path: string = compiler.path;
|
||||
if (pathSeparator === "Forward Slash") {
|
||||
@@ -274,7 +274,7 @@ export class SettingsPanel {
|
||||
}
|
||||
|
||||
private updateConfig(message: any): void {
|
||||
let splitEntries: (input: any) => string[] = (input: any) => input.split("\n").filter((e: string) => e);
|
||||
const splitEntries: (input: any) => string[] = (input: any) => input.split("\n").filter((e: string) => e);
|
||||
|
||||
switch (message.key) {
|
||||
case elementId.configName:
|
||||
|
||||
@@ -26,12 +26,12 @@ export class SettingsTracker {
|
||||
}
|
||||
|
||||
public getUserModifiedSettings(): { [key: string]: string } {
|
||||
let filter: FilterFunction = (key: string, val: string, settings: vscode.WorkspaceConfiguration) => !this.areEqual(val, settings.inspect(key)?.defaultValue);
|
||||
const filter: FilterFunction = (key: string, val: string, settings: vscode.WorkspaceConfiguration) => !this.areEqual(val, settings.inspect(key)?.defaultValue);
|
||||
return this.collectSettings(filter);
|
||||
}
|
||||
|
||||
public getChangedSettings(): { [key: string]: string } {
|
||||
let filter: FilterFunction = (key: string, val: string) => !(key in this.previousCppSettings) || !this.areEqual(val, this.previousCppSettings[key]);
|
||||
const filter: FilterFunction = (key: string, val: string) => !(key in this.previousCppSettings) || !this.areEqual(val, this.previousCppSettings[key]);
|
||||
return this.collectSettings(filter);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export class SettingsTracker {
|
||||
const settingsNonScoped: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("C_Cpp");
|
||||
const selectCorrectlyScopedSettings = (rawSetting: any): vscode.WorkspaceConfiguration =>
|
||||
(!rawSetting || rawSetting.scope === "resource" || rawSetting.scope === "machine-overridable") ? settingsResourceScope : settingsNonScoped;
|
||||
let result: { [key: string]: string } = {};
|
||||
const result: { [key: string]: string } = {};
|
||||
for (const key in settingsResourceScope) {
|
||||
const rawSetting: any = util.packageJson.contributes.configuration.properties["C_Cpp." + key];
|
||||
const correctlyScopedSettings: vscode.WorkspaceConfiguration = selectCorrectlyScopedSettings(rawSetting);
|
||||
@@ -77,20 +77,20 @@ export class SettingsTracker {
|
||||
private getSetting(settings: vscode.WorkspaceConfiguration, key: string): any {
|
||||
// Ignore methods and settings that don't exist
|
||||
if (settings.inspect(key)?.defaultValue !== undefined) {
|
||||
let val: any = settings.get(key);
|
||||
const val: any = settings.get(key);
|
||||
if (val instanceof Object) {
|
||||
return val; // It's a sub-section.
|
||||
}
|
||||
|
||||
// Only return values that match the setting's type and enum (if applicable).
|
||||
let curSetting: any = util.packageJson.contributes.configuration.properties["C_Cpp." + key];
|
||||
const curSetting: any = util.packageJson.contributes.configuration.properties["C_Cpp." + key];
|
||||
if (curSetting) {
|
||||
let type: string | undefined = this.typeMatch(val, curSetting["type"]);
|
||||
const type: string | undefined = this.typeMatch(val, curSetting["type"]);
|
||||
if (type) {
|
||||
if (type !== "string") {
|
||||
return val;
|
||||
}
|
||||
let curEnum: any[] = curSetting["enum"];
|
||||
const curEnum: any[] = curSetting["enum"];
|
||||
if (curEnum && curEnum.indexOf(val) === -1) {
|
||||
return "<invalid>";
|
||||
}
|
||||
@@ -105,7 +105,7 @@ export class SettingsTracker {
|
||||
if (type) {
|
||||
if (type instanceof Array) {
|
||||
for (let i: number = 0; i < type.length; i++) {
|
||||
let t: string = type[i];
|
||||
const t: string = type[i];
|
||||
if (t) {
|
||||
if (typeof value === t) {
|
||||
return t;
|
||||
@@ -132,7 +132,7 @@ export class SettingsTracker {
|
||||
switch (key) {
|
||||
case "clang_format_style":
|
||||
case "clang_format_fallbackStyle": {
|
||||
let newKey: string = key + "2";
|
||||
const newKey: string = key + "2";
|
||||
if (val) {
|
||||
switch (String(val).toLowerCase()) {
|
||||
case "visual studio":
|
||||
@@ -158,6 +158,7 @@ export class SettingsTracker {
|
||||
break;
|
||||
}
|
||||
case "commentContinuationPatterns": {
|
||||
key = "commentContinuationPatterns2";
|
||||
value = this.areEqual(val, settings.inspect(key)?.defaultValue) ? "<default>" : "..."; // Track whether it's being used, but nothing specific about it.
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -157,14 +157,14 @@ export class UI {
|
||||
}
|
||||
|
||||
public activeDocumentChanged(): void {
|
||||
let activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
if (!activeEditor) {
|
||||
this.ShowConfiguration = false;
|
||||
} else {
|
||||
let isCpp: boolean = (activeEditor.document.uri.scheme === "file" && (activeEditor.document.languageId === "cpp" || activeEditor.document.languageId === "c"));
|
||||
const isCpp: boolean = (activeEditor.document.uri.scheme === "file" && (activeEditor.document.languageId === "cpp" || activeEditor.document.languageId === "c"));
|
||||
|
||||
// It's sometimes desirable to see the config and icons when making settings changes.
|
||||
let isSettingsJson: boolean = ((activeEditor.document.fileName.endsWith("c_cpp_properties.json") || activeEditor.document.fileName.endsWith("settings.json")));
|
||||
const isSettingsJson: boolean = ((activeEditor.document.fileName.endsWith("c_cpp_properties.json") || activeEditor.document.fileName.endsWith("settings.json")));
|
||||
|
||||
this.ShowConfiguration = isCpp || isSettingsJson;
|
||||
}
|
||||
@@ -179,10 +179,10 @@ export class UI {
|
||||
}
|
||||
|
||||
public showConfigurations(configurationNames: string[]): Thenable<number> {
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.a.configuration", "Select a Configuration...");
|
||||
|
||||
let items: IndexableQuickPickItem[] = [];
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
for (let i: number = 0; i < configurationNames.length; i++) {
|
||||
items.push({ label: configurationNames[i], description: "", index: i });
|
||||
}
|
||||
@@ -194,11 +194,11 @@ export class UI {
|
||||
}
|
||||
|
||||
public showConfigurationProviders(currentProvider?: string): Thenable<string | undefined> {
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.configuration.provider", "Select a Configuration Provider...");
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
|
||||
let items: KeyedQuickPickItem[] = [];
|
||||
const items: KeyedQuickPickItem[] = [];
|
||||
providers.forEach(provider => {
|
||||
let label: string = provider.name;
|
||||
if (isSameProviderExtensionId(currentProvider, provider.extensionId)) {
|
||||
@@ -213,10 +213,10 @@ export class UI {
|
||||
}
|
||||
|
||||
public showCompileCommands(paths: string[]): Thenable<number> {
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.compile.commands", "Select a compile_commands.json...");
|
||||
|
||||
let items: IndexableQuickPickItem[] = [];
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
for (let i: number = 0; i < paths.length; i++) {
|
||||
items.push({label: paths[i], description: "", index: i});
|
||||
}
|
||||
@@ -226,10 +226,10 @@ export class UI {
|
||||
}
|
||||
|
||||
public showWorkspaces(workspaceNames: { name: string; key: string }[]): Thenable<string> {
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.workspace", "Select a workspace folder...");
|
||||
|
||||
let items: KeyedQuickPickItem[] = [];
|
||||
const items: KeyedQuickPickItem[] = [];
|
||||
workspaceNames.forEach(name => items.push({ label: name.name, description: "", key: name.key }));
|
||||
|
||||
return vscode.window.showQuickPick(items, options)
|
||||
@@ -237,11 +237,10 @@ export class UI {
|
||||
}
|
||||
|
||||
public showParsingCommands(): Thenable<number> {
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.parsing.command", "Select a parsing command...");
|
||||
|
||||
let items: IndexableQuickPickItem[];
|
||||
items = [];
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
if (this.browseEngineStatusBarItem.tooltip === "Parsing paused") {
|
||||
items.push({ label: localize("resume.parsing", "Resume Parsing"), description: "", index: 1 });
|
||||
} else {
|
||||
@@ -269,8 +268,8 @@ export class UI {
|
||||
}
|
||||
|
||||
private showConfigurationPrompt(priority: ConfigurationPriority, prompt: () => Thenable<boolean>, onSkip: () => void): void {
|
||||
let showPrompt: () => Thenable<ConfigurationResult> = async () => {
|
||||
let configured: boolean = await prompt();
|
||||
const showPrompt: () => Thenable<ConfigurationResult> = async () => {
|
||||
const configured: boolean = await prompt();
|
||||
return Promise.resolve({
|
||||
priority: priority,
|
||||
configured: configured
|
||||
|
||||
@@ -68,7 +68,7 @@ export class ABTestSettings {
|
||||
const exists: boolean = fs.existsSync(cpptoolsJsonFile);
|
||||
if (exists) {
|
||||
const fileContent: string = fs.readFileSync(cpptoolsJsonFile).toString();
|
||||
let newSettings: Settings = <Settings>JSON.parse(fileContent);
|
||||
const newSettings: Settings = <Settings>JSON.parse(fileContent);
|
||||
this.intelliSenseEngineDefault.Value = util.isNumber(newSettings.defaultIntelliSenseEngine) ? newSettings.defaultIntelliSenseEngine : this.intelliSenseEngineDefault.DefaultValue;
|
||||
this.recursiveIncludesDefault.Value = util.isNumber(newSettings.recursiveIncludes) ? newSettings.recursiveIncludes : this.recursiveIncludesDefault.DefaultValue;
|
||||
this.gotoDefIntelliSenseDefault.Value = util.isNumber(newSettings.gotoDefIntelliSense) ? newSettings.gotoDefIntelliSense : this.gotoDefIntelliSenseDefault.DefaultValue;
|
||||
@@ -87,7 +87,7 @@ export class ABTestSettings {
|
||||
|
||||
private downloadCpptoolsJsonPkgAsync(): Promise<void> {
|
||||
let hasError: boolean = false;
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
const telemetryProperties: { [key: string]: string } = {};
|
||||
const localConfigPath: string = util.getExtensionFilePath(localConfigFile);
|
||||
return util.downloadFileToDestination("https://go.microsoft.com/fwlink/?linkid=2097702", localConfigPath)
|
||||
.catch((error) => {
|
||||
|
||||
+106
-53
@@ -31,6 +31,9 @@ export type Mutable<T> = {
|
||||
-readonly [P in keyof T]: T[P] extends ReadonlyArray<infer U> ? Mutable<U>[] : Mutable<T[P]>
|
||||
};
|
||||
|
||||
// Platform-specific environment variable delimiter
|
||||
export const envDelimiter: string = (process.platform === 'win32') ? ";" : ":";
|
||||
|
||||
export let extensionPath: string;
|
||||
export let extensionContext: vscode.ExtensionContext | undefined;
|
||||
export function setExtensionContext(context: vscode.ExtensionContext): void {
|
||||
@@ -81,7 +84,7 @@ export function getRawTasksJson(): Promise<any> {
|
||||
}
|
||||
|
||||
export async function ensureBuildTaskExists(taskName: string): Promise<void> {
|
||||
let rawTasksJson: any = await getRawTasksJson();
|
||||
const rawTasksJson: any = await getRawTasksJson();
|
||||
|
||||
// Ensure that the task exists in the user's task.json. Task will not be found otherwise.
|
||||
if (!rawTasksJson.tasks) {
|
||||
@@ -93,7 +96,7 @@ export async function ensureBuildTaskExists(taskName: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
const buildTasks: vscode.Task[] = await getBuildTasks(false);
|
||||
const buildTasks: vscode.Task[] = await getBuildTasks(false, true);
|
||||
selectedTask = buildTasks.find(task => task.name === taskName);
|
||||
console.assert(selectedTask);
|
||||
if (!selectedTask) {
|
||||
@@ -102,14 +105,19 @@ export async function ensureBuildTaskExists(taskName: string): Promise<void> {
|
||||
|
||||
rawTasksJson.version = "2.0.0";
|
||||
|
||||
let selectedTask2: vscode.Task = selectedTask;
|
||||
const selectedTask2: vscode.Task = selectedTask;
|
||||
if (!rawTasksJson.tasks.find((task: any) => task.label === selectedTask2.definition.label)) {
|
||||
rawTasksJson.tasks.push(selectedTask2.definition);
|
||||
const task: any = {
|
||||
...selectedTask2.definition,
|
||||
problemMatcher: selectedTask2.problemMatchers,
|
||||
group: { kind: "build", "isDefault": true }
|
||||
};
|
||||
rawTasksJson.tasks.push(task);
|
||||
}
|
||||
|
||||
// TODO: It's dangerous to overwrite this file. We could be wiping out comments.
|
||||
let settings: OtherSettings = new OtherSettings();
|
||||
let tasksJsonPath: string | undefined = getTasksJsonPath();
|
||||
const settings: OtherSettings = new OtherSettings();
|
||||
const tasksJsonPath: string | undefined = getTasksJsonPath();
|
||||
if (!tasksJsonPath) {
|
||||
throw new Error("Failed to get tasksJsonPath in ensureBuildTaskExists()");
|
||||
}
|
||||
@@ -123,7 +131,7 @@ export function fileIsCOrCppSource(file: string): boolean {
|
||||
}
|
||||
|
||||
export function isEditorFileCpp(file: string): boolean {
|
||||
let editor: vscode.TextEditor | undefined = vscode.window.visibleTextEditors.find(e => e.document.uri.toString() === file);
|
||||
const editor: vscode.TextEditor | undefined = vscode.window.visibleTextEditors.find(e => e.document.uri.toString() === file);
|
||||
if (!editor) {
|
||||
return false;
|
||||
}
|
||||
@@ -159,13 +167,13 @@ export function getTasksJsonPath(): string | undefined {
|
||||
|
||||
export function getVcpkgPathDescriptorFile(): string {
|
||||
if (process.platform === 'win32') {
|
||||
let pathPrefix: string | undefined = process.env.LOCALAPPDATA;
|
||||
const pathPrefix: string | undefined = process.env.LOCALAPPDATA;
|
||||
if (!pathPrefix) {
|
||||
throw new Error("Unable to read process.env.LOCALAPPDATA");
|
||||
}
|
||||
return path.join(pathPrefix, "vcpkg/vcpkg.path.txt");
|
||||
} else {
|
||||
let pathPrefix: string | undefined = process.env.HOME;
|
||||
const pathPrefix: string | undefined = process.env.HOME;
|
||||
if (!pathPrefix) {
|
||||
throw new Error("Unable to read process.env.HOME");
|
||||
}
|
||||
@@ -195,7 +203,7 @@ export function getVcpkgRoot(): string {
|
||||
* @param document The document to check.
|
||||
*/
|
||||
export function isHeader(uri: vscode.Uri): boolean {
|
||||
let ext: string = path.extname(uri.fsPath);
|
||||
const ext: string = path.extname(uri.fsPath);
|
||||
return !ext || ext.startsWith(".h") || ext.startsWith(".H");
|
||||
}
|
||||
|
||||
@@ -234,8 +242,8 @@ const progressIntelliSenseNoSquiggles: number = 1000;
|
||||
// Might add more IntelliSense progress measurements later.
|
||||
// IntelliSense progress is separate from the install progress, because parse root can occur afterwards.
|
||||
|
||||
let installProgressStr: string = "CPP." + packageJson.version + ".Progress";
|
||||
let intelliSenseProgressStr: string = "CPP." + packageJson.version + ".IntelliSenseProgress";
|
||||
const installProgressStr: string = "CPP." + packageJson.version + ".Progress";
|
||||
const intelliSenseProgressStr: string = "CPP." + packageJson.version + ".IntelliSenseProgress";
|
||||
|
||||
export function getProgress(): number {
|
||||
return extensionContext ? extensionContext.globalState.get<number>(installProgressStr, -1) : -1;
|
||||
@@ -248,7 +256,7 @@ export function getIntelliSenseProgress(): number {
|
||||
export function setProgress(progress: number): void {
|
||||
if (extensionContext && getProgress() < progress) {
|
||||
extensionContext.globalState.update(installProgressStr, progress);
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
const telemetryProperties: { [key: string]: string } = {};
|
||||
let progressName: string | undefined;
|
||||
switch (progress) {
|
||||
case 0: progressName = "install started"; break;
|
||||
@@ -267,7 +275,7 @@ export function setProgress(progress: number): void {
|
||||
export function setIntelliSenseProgress(progress: number): void {
|
||||
if (extensionContext && getIntelliSenseProgress() < progress) {
|
||||
extensionContext.globalState.update(intelliSenseProgressStr, progress);
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
const telemetryProperties: { [key: string]: string } = {};
|
||||
let progressName: string | undefined;
|
||||
switch (progress) {
|
||||
case progressIntelliSenseNoSquiggles: progressName = "IntelliSense no squiggles"; break;
|
||||
@@ -338,7 +346,7 @@ export function resolveVariables(input: string | undefined, additionalEnvironmen
|
||||
// Replace environment and configuration variables.
|
||||
let regexp: () => RegExp = () => /\$\{((env|config|workspaceFolder)(\.|:))?(.*?)\}/g;
|
||||
let ret: string = input;
|
||||
let cycleCache: Set<string> = new Set();
|
||||
const cycleCache: Set<string> = new Set();
|
||||
while (!cycleCache.has(ret)) {
|
||||
cycleCache.add(ret);
|
||||
ret = ret.replace(regexp(), (match: string, ignored1: string, varType: string, ignored2: string, name: string) => {
|
||||
@@ -351,11 +359,11 @@ export function resolveVariables(input: string | undefined, additionalEnvironmen
|
||||
switch (varType) {
|
||||
case "env": {
|
||||
if (additionalEnvironment) {
|
||||
let v: string | string[] | undefined = additionalEnvironment[name];
|
||||
const v: string | string[] | undefined = additionalEnvironment[name];
|
||||
if (isString(v)) {
|
||||
newValue = v;
|
||||
} else if (input === match && isArrayOfString(v)) {
|
||||
newValue = v.join(";");
|
||||
newValue = v.join(envDelimiter);
|
||||
}
|
||||
if (newValue === undefined) {
|
||||
newValue = process.env[name];
|
||||
@@ -364,7 +372,7 @@ export function resolveVariables(input: string | undefined, additionalEnvironmen
|
||||
break;
|
||||
}
|
||||
case "config": {
|
||||
let config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration();
|
||||
const config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration();
|
||||
if (config) {
|
||||
newValue = config.get<string>(name);
|
||||
}
|
||||
@@ -375,7 +383,7 @@ export function resolveVariables(input: string | undefined, additionalEnvironmen
|
||||
// We may consider doing replacement of ${workspaceFolder} here later, but we would have to update the language server and also
|
||||
// intercept messages with paths in them and add the ${workspaceFolder} variable back in (e.g. for light bulb suggestions)
|
||||
if (name && vscode.workspace && vscode.workspace.workspaceFolders) {
|
||||
let folder: vscode.WorkspaceFolder | undefined = vscode.workspace.workspaceFolders.find(folder => folder.name.toLocaleLowerCase() === name.toLocaleLowerCase());
|
||||
const folder: vscode.WorkspaceFolder | undefined = vscode.workspace.workspaceFolders.find(folder => folder.name.toLocaleLowerCase() === name.toLocaleLowerCase());
|
||||
if (folder) {
|
||||
newValue = folder.uri.fsPath;
|
||||
}
|
||||
@@ -391,7 +399,7 @@ export function resolveVariables(input: string | undefined, additionalEnvironmen
|
||||
// Resolve '~' at the start of the path.
|
||||
regexp = () => /^\~/g;
|
||||
ret = ret.replace(regexp(), (match: string, name: string) => {
|
||||
let newValue: string | undefined = (process.platform === 'win32') ? process.env.USERPROFILE : process.env.HOME;
|
||||
const newValue: string | undefined = (process.platform === 'win32') ? process.env.USERPROFILE : process.env.HOME;
|
||||
return newValue ? newValue : match;
|
||||
});
|
||||
|
||||
@@ -433,13 +441,13 @@ export function getHttpsProxyAgent(): HttpsProxyAgent | undefined {
|
||||
}
|
||||
|
||||
// Basic sanity checking on proxy url
|
||||
let proxyUrl: any = url.parse(proxy);
|
||||
const proxyUrl: any = url.parse(proxy);
|
||||
if (proxyUrl.protocol !== "https:" && proxyUrl.protocol !== "http:") {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let strictProxy: any = vscode.workspace.getConfiguration().get("http.proxyStrictSSL", true);
|
||||
let proxyOptions: any = {
|
||||
const strictProxy: any = vscode.workspace.getConfiguration().get("http.proxyStrictSSL", true);
|
||||
const proxyOptions: any = {
|
||||
host: proxyUrl.hostname,
|
||||
port: parseInt(proxyUrl.port, 10),
|
||||
auth: proxyUrl.auth,
|
||||
@@ -655,14 +663,14 @@ export function spawnChildProcess(process: string, args: string[], workingDirect
|
||||
return new Promise<void>(function (resolve, reject): void {
|
||||
const child: child_process.ChildProcess = child_process.spawn(process, args, { cwd: workingDirectory });
|
||||
|
||||
let stdout: Readable | null = child.stdout;
|
||||
const stdout: Readable | null = child.stdout;
|
||||
if (stdout) {
|
||||
stdout.on('data', (data) => {
|
||||
dataCallback(`${data}`);
|
||||
});
|
||||
}
|
||||
|
||||
let stderr: Readable | null = child.stderr;
|
||||
const stderr: Readable | null = child.stderr;
|
||||
if (stderr) {
|
||||
stderr.on('data', (data) => {
|
||||
errorCallback(`${data}`);
|
||||
@@ -722,9 +730,9 @@ export function allowExecution(file: string): Promise<void> {
|
||||
}
|
||||
|
||||
export function removePotentialPII(str: string): string {
|
||||
let words: string[] = str.split(" ");
|
||||
const words: string[] = str.split(" ");
|
||||
let result: string = "";
|
||||
for (let word of words) {
|
||||
for (const word of words) {
|
||||
if (word.indexOf(".") === -1 && word.indexOf("/") === -1 && word.indexOf("\\") === -1 && word.indexOf(":") === -1) {
|
||||
result += word + " ";
|
||||
} else {
|
||||
@@ -769,7 +777,7 @@ export function promptForReloadWindowDueToSettingsChange(): void {
|
||||
}
|
||||
|
||||
export function promptReloadWindow(message: string): void {
|
||||
let reload: string = localize("reload.string", "Reload");
|
||||
const reload: string = localize("reload.string", "Reload");
|
||||
vscode.window.showInformationMessage(message, reload).then((value?: string) => {
|
||||
if (value === reload) {
|
||||
vscode.commands.executeCommand("workbench.action.reloadWindow");
|
||||
@@ -790,8 +798,8 @@ export function createTempFileWithPostfix(postfix: string): Promise<tmp.FileResu
|
||||
|
||||
export function downloadFileToDestination(urlStr: string, destinationPath: string, headers?: OutgoingHttpHeaders): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let parsedUrl: url.Url = url.parse(urlStr);
|
||||
let request: ClientRequest = https.request({
|
||||
const parsedUrl: url.Url = url.parse(urlStr);
|
||||
const request: ClientRequest = https.request({
|
||||
host: parsedUrl.host,
|
||||
path: parsedUrl.path,
|
||||
agent: getHttpsProxyAgent(),
|
||||
@@ -815,7 +823,7 @@ export function downloadFileToDestination(urlStr: string, destinationPath: strin
|
||||
return reject();
|
||||
}
|
||||
// Write file using downloaded data
|
||||
let createdFile: fs.WriteStream = fs.createWriteStream(destinationPath);
|
||||
const createdFile: fs.WriteStream = fs.createWriteStream(destinationPath);
|
||||
createdFile.on('finish', () => { resolve(); });
|
||||
response.on('error', (error) => { reject(error); });
|
||||
response.pipe(createdFile);
|
||||
@@ -827,8 +835,8 @@ export function downloadFileToDestination(urlStr: string, destinationPath: strin
|
||||
|
||||
export function downloadFileToStr(urlStr: string, headers?: OutgoingHttpHeaders): Promise<any> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
let parsedUrl: url.Url = url.parse(urlStr);
|
||||
let request: ClientRequest = https.request({
|
||||
const parsedUrl: url.Url = url.parse(urlStr);
|
||||
const request: ClientRequest = https.request({
|
||||
host: parsedUrl.host,
|
||||
path: parsedUrl.path,
|
||||
agent: getHttpsProxyAgent(),
|
||||
@@ -867,11 +875,58 @@ export interface CompilerPathAndArgs {
|
||||
additionalArgs: string[];
|
||||
}
|
||||
|
||||
function extractArgs(argsString: string): string[] {
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
const result: string[] = [];
|
||||
let currentArg: string = "";
|
||||
let isWithinDoubleQuote: boolean = false;
|
||||
let isWithinSingleQuote: boolean = false;
|
||||
for (let i: number = 0; i < argsString.length; i++) {
|
||||
const c: string = argsString[i];
|
||||
if (c === '\\') {
|
||||
currentArg += c;
|
||||
if (++i === argsString.length) {
|
||||
if (currentArg !== "") {
|
||||
result.push(currentArg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
currentArg += argsString[i];
|
||||
continue;
|
||||
}
|
||||
if (c === '"') {
|
||||
if (!isWithinSingleQuote) {
|
||||
isWithinDoubleQuote = !isWithinDoubleQuote;
|
||||
}
|
||||
} else if (c === '\'') {
|
||||
// On Windows, a single quote string is not allowed to join multiple args into a single arg
|
||||
if (!isWindows) {
|
||||
if (!isWithinDoubleQuote) {
|
||||
isWithinSingleQuote = !isWithinSingleQuote;
|
||||
}
|
||||
}
|
||||
} else if (c === ' ') {
|
||||
if (!isWithinDoubleQuote && !isWithinSingleQuote) {
|
||||
if (currentArg !== "") {
|
||||
result.push(currentArg);
|
||||
currentArg = "";
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
currentArg += c;
|
||||
}
|
||||
if (currentArg !== "") {
|
||||
result.push(currentArg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputCompilerArgs?: string[]): CompilerPathAndArgs {
|
||||
let compilerPath: string | undefined = inputCompilerPath;
|
||||
let compilerName: string = "";
|
||||
let additionalArgs: string[] = [];
|
||||
let isWindows: boolean = os.platform() === 'win32';
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
if (compilerPath) {
|
||||
if (compilerPath.endsWith("\\cl.exe") || compilerPath.endsWith("/cl.exe") || compilerPath === "cl.exe") {
|
||||
// Input is only compiler name, this is only for cl.exe
|
||||
@@ -879,10 +934,9 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp
|
||||
|
||||
} else if (compilerPath.startsWith("\"")) {
|
||||
// Input has quotes around compiler path
|
||||
let endQuote: number = compilerPath.substr(1).search("\"") + 1;
|
||||
const endQuote: number = compilerPath.substr(1).search("\"") + 1;
|
||||
if (endQuote !== -1) {
|
||||
additionalArgs = compilerPath.substr(endQuote + 1).split(" ");
|
||||
additionalArgs = additionalArgs.filter((arg: string) => arg.trim().length !== 0); // Remove empty args.
|
||||
additionalArgs = extractArgs(compilerPath.substr(endQuote + 1));
|
||||
compilerPath = compilerPath.substr(1, endQuote - 1);
|
||||
compilerName = path.basename(compilerPath);
|
||||
}
|
||||
@@ -903,8 +957,7 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp
|
||||
}
|
||||
if (compilerPath !== potentialCompilerPath) {
|
||||
// Found a valid compilerPath and args.
|
||||
additionalArgs = compilerPath.substr(spaceStart + 1).split(" ");
|
||||
additionalArgs = additionalArgs.filter((arg: string) => arg.trim().length !== 0); // Remove empty args.
|
||||
additionalArgs = extractArgs(compilerPath.substr(spaceStart + 1));
|
||||
compilerPath = potentialCompilerPath;
|
||||
}
|
||||
compilerName = path.basename(compilerPath);
|
||||
@@ -965,10 +1018,10 @@ export class BlockingTask<T> {
|
||||
this.promise = task();
|
||||
} else {
|
||||
this.promise = new Promise<T>((resolve, reject) => {
|
||||
let f1: () => void = () => {
|
||||
const f1: () => void = () => {
|
||||
task().then(resolve, reject);
|
||||
};
|
||||
let f2: (err: any) => void = (err) => {
|
||||
const f2: (err: any) => void = (err) => {
|
||||
console.log(err);
|
||||
task().then(resolve, reject);
|
||||
};
|
||||
@@ -997,9 +1050,9 @@ interface VSCodeNlsConfig {
|
||||
export function getLocaleId(): string {
|
||||
// This replicates the language detection used by initializeSettings() in vscode-nls
|
||||
if (isString(process.env.VSCODE_NLS_CONFIG)) {
|
||||
let vscodeOptions: VSCodeNlsConfig = JSON.parse(process.env.VSCODE_NLS_CONFIG) as VSCodeNlsConfig;
|
||||
const vscodeOptions: VSCodeNlsConfig = JSON.parse(process.env.VSCODE_NLS_CONFIG) as VSCodeNlsConfig;
|
||||
if (vscodeOptions.availableLanguages) {
|
||||
let value: any = vscodeOptions.availableLanguages['*'];
|
||||
const value: any = vscodeOptions.availableLanguages['*'];
|
||||
if (isString(value)) {
|
||||
return value;
|
||||
}
|
||||
@@ -1012,8 +1065,8 @@ export function getLocaleId(): string {
|
||||
}
|
||||
|
||||
export function getLocalizedHtmlPath(originalPath: string): string {
|
||||
let locale: string = getLocaleId();
|
||||
let localizedFilePath: string = getExtensionFilePath(path.join("dist/html/", locale, originalPath));
|
||||
const locale: string = getLocaleId();
|
||||
const localizedFilePath: string = getExtensionFilePath(path.join("dist/html/", locale, originalPath));
|
||||
if (!fs.existsSync(localizedFilePath)) {
|
||||
return getExtensionFilePath(originalPath);
|
||||
}
|
||||
@@ -1040,9 +1093,9 @@ export function getLocalizedString(params: LocalizeStringParams): string {
|
||||
}
|
||||
|
||||
function decodeUCS16(input: string): number[] {
|
||||
let output: number[] = [];
|
||||
const output: number[] = [];
|
||||
let counter: number = 0;
|
||||
let length: number = input.length;
|
||||
const length: number = input.length;
|
||||
let value: number;
|
||||
let extra: number;
|
||||
while (counter < length) {
|
||||
@@ -1065,7 +1118,7 @@ function decodeUCS16(input: string): number[] {
|
||||
return output;
|
||||
}
|
||||
|
||||
let allowedIdentifierUnicodeRanges: number[][] = [
|
||||
const allowedIdentifierUnicodeRanges: number[][] = [
|
||||
[0x0030, 0x0039], // digits
|
||||
[0x0041, 0x005A], // upper case letters
|
||||
[0x005F, 0x005F], // underscore
|
||||
@@ -1114,7 +1167,7 @@ let allowedIdentifierUnicodeRanges: number[][] = [
|
||||
[0xE0000, 0xEFFFD] // LANGUAGE TAG (U+E0001) - VARIATION SELECTOR-256 (U+E01EF)
|
||||
];
|
||||
|
||||
let disallowedFirstCharacterIdentifierUnicodeRanges: number[][] = [
|
||||
const disallowedFirstCharacterIdentifierUnicodeRanges: number[][] = [
|
||||
[0x0030, 0x0039], // digits
|
||||
[0x0300, 0x036F], // COMBINING GRAVE ACCENT - COMBINING LATIN SMALL LETTER X
|
||||
[0x1DC0, 0x1DFF], // COMBINING DOTTED GRAVE ACCENT - COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW
|
||||
@@ -1126,14 +1179,14 @@ export function isValidIdentifier(candidate: string): boolean {
|
||||
if (!candidate) {
|
||||
return false;
|
||||
}
|
||||
let decoded: number[] = decodeUCS16(candidate);
|
||||
const decoded: number[] = decodeUCS16(candidate);
|
||||
if (!decoded || !decoded.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reject if first character is disallowed
|
||||
for (let i: number = 0; i < disallowedFirstCharacterIdentifierUnicodeRanges.length; i++) {
|
||||
let disallowedCharacters: number[] = disallowedFirstCharacterIdentifierUnicodeRanges[i];
|
||||
const disallowedCharacters: number[] = disallowedFirstCharacterIdentifierUnicodeRanges[i];
|
||||
if (decoded[0] >= disallowedCharacters[0] && decoded[0] <= disallowedCharacters[1]) {
|
||||
return false;
|
||||
}
|
||||
@@ -1142,7 +1195,7 @@ export function isValidIdentifier(candidate: string): boolean {
|
||||
for (let position: number = 0; position < decoded.length; position++) {
|
||||
let found: boolean = false;
|
||||
for (let i: number = 0; i < allowedIdentifierUnicodeRanges.length; i++) {
|
||||
let allowedCharacters: number[] = allowedIdentifierUnicodeRanges[i];
|
||||
const allowedCharacters: number[] = allowedIdentifierUnicodeRanges[i];
|
||||
if (decoded[position] >= allowedCharacters[0] && decoded[position] <= allowedCharacters[1]) {
|
||||
found = true;
|
||||
break;
|
||||
@@ -1156,7 +1209,7 @@ export function isValidIdentifier(candidate: string): boolean {
|
||||
}
|
||||
|
||||
function getUniqueWorkspaceNameHelper(workspaceFolder: vscode.WorkspaceFolder, addSubfolder: boolean): string {
|
||||
let workspaceFolderName: string = workspaceFolder ? workspaceFolder.name : "untitled";
|
||||
const workspaceFolderName: string = workspaceFolder ? workspaceFolder.name : "untitled";
|
||||
if (!workspaceFolder || workspaceFolder.index < 1) {
|
||||
return workspaceFolderName; // No duplicate names to search for.
|
||||
}
|
||||
|
||||
+10
-10
@@ -34,7 +34,7 @@ export class CppTools implements CppToolsTestApi {
|
||||
private addNotifyReadyTimer(provider: CustomConfigurationProvider1): void {
|
||||
if (this.version >= Version.v2) {
|
||||
const timeout: number = 30;
|
||||
let timer: NodeJS.Timer = global.setTimeout(() => {
|
||||
const timer: NodeJS.Timer = global.setTimeout(() => {
|
||||
console.warn(`registered provider ${provider.extensionId} did not call 'notifyReady' within ${timeout} seconds`);
|
||||
}, timeout * 1000);
|
||||
this.timers.set(provider.extensionId, timer);
|
||||
@@ -43,7 +43,7 @@ export class CppTools implements CppToolsTestApi {
|
||||
|
||||
private removeNotifyReadyTimer(provider: CustomConfigurationProvider1): void {
|
||||
if (this.version >= Version.v2) {
|
||||
let timer: NodeJS.Timer | undefined = this.timers.get(provider.extensionId);
|
||||
const timer: NodeJS.Timer | undefined = this.timers.get(provider.extensionId);
|
||||
if (timer) {
|
||||
this.timers.delete(provider.extensionId);
|
||||
clearTimeout(timer);
|
||||
@@ -56,11 +56,11 @@ export class CppTools implements CppToolsTestApi {
|
||||
}
|
||||
|
||||
public registerCustomConfigurationProvider(provider: CustomConfigurationProvider): void {
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
if (providers.add(provider, this.version)) {
|
||||
const added: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
if (added) {
|
||||
let settings: CppSettings = new CppSettings();
|
||||
const settings: CppSettings = new CppSettings();
|
||||
if (settings.loggingLevel === "Information" || settings.loggingLevel === "Debug") {
|
||||
getOutputChannel().appendLine(localize("provider.registered", "Custom configuration provider '{0}' registered", added.name));
|
||||
}
|
||||
@@ -74,8 +74,8 @@ export class CppTools implements CppToolsTestApi {
|
||||
}
|
||||
|
||||
public notifyReady(provider: CustomConfigurationProvider): void {
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
let p: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
const p: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
|
||||
if (p) {
|
||||
this.removeNotifyReadyTimer(p);
|
||||
@@ -92,8 +92,8 @@ export class CppTools implements CppToolsTestApi {
|
||||
}
|
||||
|
||||
public didChangeCustomConfiguration(provider: CustomConfigurationProvider): void {
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
let p: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
const p: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
|
||||
if (p) {
|
||||
if (!p.isReady) {
|
||||
@@ -108,8 +108,8 @@ export class CppTools implements CppToolsTestApi {
|
||||
}
|
||||
|
||||
public didChangeCustomBrowseConfiguration(provider: CustomConfigurationProvider): void {
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
let p: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
const p: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
|
||||
if (p) {
|
||||
LanguageServer.getClients().forEach(client => client.updateCustomBrowseConfiguration(p));
|
||||
|
||||
@@ -126,10 +126,11 @@ export interface BuildInfo {
|
||||
/**
|
||||
* Use the GitHub API to retrieve the download URL of the extension version the user should update to, if any.
|
||||
* @param updateChannel The user's updateChannel setting.
|
||||
* @param isFromSettingsChange True if the invocation is the result of a settings change.
|
||||
* @return Download URL for the extension VSIX package that the user should install. If the user
|
||||
* does not need to update, resolves to undefined.
|
||||
*/
|
||||
export async function getTargetBuildInfo(updateChannel: string): Promise<BuildInfo | undefined> {
|
||||
export async function getTargetBuildInfo(updateChannel: string, isFromSettingsChange: boolean): Promise<BuildInfo | undefined> {
|
||||
return getReleaseJson()
|
||||
.then(builds => {
|
||||
if (!builds || builds.length === 0) {
|
||||
@@ -139,11 +140,12 @@ export async function getTargetBuildInfo(updateChannel: string): Promise<BuildIn
|
||||
// If the user version is greater than or incomparable to the latest available verion then there is no need to update
|
||||
const userVersion: PackageVersion = new PackageVersion(util.packageJson.version);
|
||||
const latestVersion: PackageVersion = new PackageVersion(builds[0].name);
|
||||
if (!testingInsidersVsixInstall && ((userVersion.suffix && userVersion.suffix !== 'insiders') || (userVersion.isEqual(latestVersion)))) {
|
||||
const latestIsCorrect: boolean = latestVersion.suffix !== 'insiders' || updateChannel === 'insiders';
|
||||
if (!testingInsidersVsixInstall && ((userVersion.suffix && userVersion.suffix !== 'insiders') || (userVersion.isEqual(latestVersion) && latestIsCorrect))) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const targetBuild: Build | undefined = getTargetBuild(builds, userVersion, updateChannel);
|
||||
const targetBuild: Build | undefined = getTargetBuild(builds, userVersion, updateChannel, isFromSettingsChange);
|
||||
if (targetBuild === undefined) {
|
||||
// no action
|
||||
telemetry.logLanguageServerEvent("UpgradeCheck", { "action": "none" });
|
||||
@@ -179,10 +181,11 @@ export async function getTargetBuildInfo(updateChannel: string): Promise<BuildIn
|
||||
* @param builds The GitHub release list parsed as an array of Builds.
|
||||
* @param userVersion The verion of the extension that the user is running.
|
||||
* @param updateChannel The user's updateChannel setting.
|
||||
* @param isFromSettingsChange True if the invocation is the result of a settings change.
|
||||
* @return The Build if the user should update to it, otherwise undefined.
|
||||
*/
|
||||
export function getTargetBuild(builds: Build[], userVersion: PackageVersion, updateChannel: string): Build | undefined {
|
||||
if (!vscode.workspace.getConfiguration("extensions", null).get<boolean>("autoUpdate")) {
|
||||
export function getTargetBuild(builds: Build[], userVersion: PackageVersion, updateChannel: string, isFromSettingsChange: boolean): Build | undefined {
|
||||
if (!isFromSettingsChange && !vscode.workspace.getConfiguration("extensions", null).get<boolean>("autoUpdate")) {
|
||||
return undefined;
|
||||
}
|
||||
const latestVersion: PackageVersion = new PackageVersion(builds[0].name);
|
||||
|
||||
@@ -16,11 +16,9 @@ export class LinuxDistribution {
|
||||
* https://www.freedesktop.org/software/systemd/man/os-release.html
|
||||
*/
|
||||
public static GetDistroInformation(): Promise<LinuxDistribution> {
|
||||
let linuxDistro: Promise<LinuxDistribution>;
|
||||
|
||||
// First check /etc/os-release and only fallback to /usr/lib/os-release
|
||||
// as per the os-release documentation.
|
||||
linuxDistro = LinuxDistribution.getDistroInformationFromFile('/etc/os-release')
|
||||
const linuxDistro: Promise<LinuxDistribution> = LinuxDistribution.getDistroInformationFromFile('/etc/os-release')
|
||||
.catch(() => LinuxDistribution.getDistroInformationFromFile('/usr/lib/os-release'))
|
||||
.catch(() => Promise.resolve(new LinuxDistribution('unknown', 'unknown'))); // couldn't get distro information;
|
||||
return linuxDistro;
|
||||
@@ -45,9 +43,9 @@ export class LinuxDistribution {
|
||||
let distroName: string = 'unknown';
|
||||
let distroVersion: string = 'unknown';
|
||||
|
||||
let keyValues: string[] = data.split(os.EOL);
|
||||
const keyValues: string[] = data.split(os.EOL);
|
||||
for (let i: number = 0; i < keyValues.length; i++) {
|
||||
let keyValue: string[] = keyValues[i].split('=');
|
||||
const keyValue: string[] = keyValues[i].split('=');
|
||||
if (keyValue.length === 2) {
|
||||
if (keyValue[0] === idKey) {
|
||||
distroName = keyValue[1];
|
||||
|
||||
+23
-21
@@ -31,7 +31,7 @@ const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
const cppTools: CppTools1 = new CppTools1();
|
||||
let languageServiceDisabled: boolean = false;
|
||||
let reloadMessageShown: boolean = false;
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<CppToolsApi & CppToolsExtension> {
|
||||
let errMsg: string = "";
|
||||
@@ -54,8 +54,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
|
||||
class SchemaProvider implements vscode.TextDocumentContentProvider {
|
||||
public async provideTextDocumentContent(uri: vscode.Uri): Promise<string> {
|
||||
console.assert(uri.path[0] === '/', "A preceeding slash is expected on schema uri path");
|
||||
let fileName: string = uri.path.substr(1);
|
||||
let locale: string = util.getLocaleId();
|
||||
const fileName: string = uri.path.substr(1);
|
||||
const locale: string = util.getLocaleId();
|
||||
let localizedFilePath: string = util.getExtensionFilePath(path.join("dist/schema/", locale, fileName));
|
||||
const fileExists: boolean = await util.checkFileExists(localizedFilePath);
|
||||
if (!fileExists) {
|
||||
@@ -73,7 +73,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
|
||||
await processRuntimeDependencies();
|
||||
|
||||
// check if the correct offline/insiders vsix is installed on the correct platform
|
||||
let installedPlatform: string | undefined = util.getInstalledBinaryPlatform();
|
||||
const installedPlatform: string | undefined = util.getInstalledBinaryPlatform();
|
||||
if (!installedPlatform || (process.platform !== installedPlatform)) {
|
||||
const platformInfo: PlatformInformation = await PlatformInformation.GetPlatformInformation();
|
||||
const vsixName: string = vsixNameForPlatform(platformInfo);
|
||||
@@ -203,10 +203,10 @@ async function onlineInstallation(info: PlatformInformation): Promise<void> {
|
||||
}
|
||||
|
||||
async function downloadAndInstallPackages(info: PlatformInformation): Promise<void> {
|
||||
let outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
const outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
outputChannelLogger.appendLine(localize("updating.dependencies", "Updating C/C++ dependencies..."));
|
||||
|
||||
let packageManager: PackageManager = new PackageManager(info, outputChannelLogger);
|
||||
const packageManager: PackageManager = new PackageManager(info, outputChannelLogger);
|
||||
|
||||
return vscode.window.withProgress({
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
@@ -241,8 +241,8 @@ function invalidPackageVersion(pkg: IPackage, info: PlatformInformation): boolea
|
||||
}
|
||||
|
||||
function makeOfflineBinariesExecutable(info: PlatformInformation): Promise<void> {
|
||||
let promises: Thenable<void>[] = [];
|
||||
let packages: IPackage[] = util.packageJson["runtimeDependencies"];
|
||||
const promises: Thenable<void>[] = [];
|
||||
const packages: IPackage[] = util.packageJson["runtimeDependencies"];
|
||||
packages.forEach(p => {
|
||||
if (p.binaries && p.binaries.length > 0 &&
|
||||
packageMatchesPlatform(p, info)) {
|
||||
@@ -253,8 +253,8 @@ function makeOfflineBinariesExecutable(info: PlatformInformation): Promise<void>
|
||||
}
|
||||
|
||||
function cleanUpUnusedBinaries(info: PlatformInformation): Promise<void> {
|
||||
let promises: Thenable<void>[] = [];
|
||||
let packages: IPackage[] = util.packageJson["runtimeDependencies"];
|
||||
const promises: Thenable<void>[] = [];
|
||||
const packages: IPackage[] = util.packageJson["runtimeDependencies"];
|
||||
const logger: Logger = getOutputChannelLogger();
|
||||
|
||||
packages.forEach(p => {
|
||||
@@ -274,7 +274,7 @@ function cleanUpUnusedBinaries(info: PlatformInformation): Promise<void> {
|
||||
|
||||
function removeUnnecessaryFile(): Promise<void> {
|
||||
if (os.platform() !== 'win32') {
|
||||
let sourcePath: string = util.getDebugAdaptersPath("bin/OpenDebugAD7.exe.config");
|
||||
const sourcePath: string = util.getDebugAdaptersPath("bin/OpenDebugAD7.exe.config");
|
||||
if (fs.existsSync(sourcePath)) {
|
||||
fs.rename(sourcePath, util.getDebugAdaptersPath("bin/OpenDebugAD7.exe.config.unused"), (err: NodeJS.ErrnoException | null) => {
|
||||
if (err) {
|
||||
@@ -293,13 +293,13 @@ function touchInstallLockFile(): Promise<void> {
|
||||
}
|
||||
|
||||
function handleError(error: any): void {
|
||||
let installationInformation: InstallationInformation = getInstallationInformation();
|
||||
const installationInformation: InstallationInformation = getInstallationInformation();
|
||||
installationInformation.hasError = true;
|
||||
installationInformation.telemetryProperties['stage'] = installationInformation.stage ?? "";
|
||||
let errorMessage: string;
|
||||
|
||||
if (error instanceof PackageManagerError) {
|
||||
let packageError: PackageManagerError = error;
|
||||
const packageError: PackageManagerError = error;
|
||||
|
||||
installationInformation.telemetryProperties['error.methodName'] = packageError.methodName;
|
||||
installationInformation.telemetryProperties['error.message'] = packageError.message;
|
||||
@@ -324,7 +324,7 @@ function handleError(error: any): void {
|
||||
installationInformation.telemetryProperties['error.toString'] = util.removePotentialPII(errorMessage);
|
||||
}
|
||||
|
||||
let outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
const outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
if (installationInformation.stage === 'downloadPackages') {
|
||||
outputChannelLogger.appendLine("");
|
||||
}
|
||||
@@ -337,7 +337,7 @@ function handleError(error: any): void {
|
||||
}
|
||||
|
||||
function sendTelemetry(info: PlatformInformation): boolean {
|
||||
let installBlob: InstallationInformation = getInstallationInformation();
|
||||
const installBlob: InstallationInformation = getInstallationInformation();
|
||||
const success: boolean = !installBlob.hasError;
|
||||
|
||||
installBlob.telemetryProperties['success'] = success.toString();
|
||||
@@ -360,7 +360,7 @@ function sendTelemetry(info: PlatformInformation): boolean {
|
||||
}
|
||||
|
||||
async function postInstall(info: PlatformInformation): Promise<void> {
|
||||
let outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
const outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
outputChannelLogger.appendLine("");
|
||||
outputChannelLogger.appendLine(localize('finished.installing.dependencies', "Finished installing dependencies"));
|
||||
outputChannelLogger.appendLine("");
|
||||
@@ -379,7 +379,7 @@ async function postInstall(info: PlatformInformation): Promise<void> {
|
||||
}
|
||||
|
||||
async function finalizeExtensionActivation(): Promise<void> {
|
||||
let settings: CppSettings = new CppSettings();
|
||||
const settings: CppSettings = new CppSettings();
|
||||
if (settings.intelliSenseEngine === "Disabled") {
|
||||
languageServiceDisabled = true;
|
||||
getTemporaryCommandRegistrarInstance().disableLanguageServer();
|
||||
@@ -399,9 +399,9 @@ async function finalizeExtensionActivation(): Promise<void> {
|
||||
}));
|
||||
getTemporaryCommandRegistrarInstance().activateLanguageServer();
|
||||
|
||||
let packageJson: any = util.getRawPackageJson();
|
||||
const packageJson: any = util.getRawPackageJson();
|
||||
let writePackageJson: boolean = false;
|
||||
let packageJsonPath: string = util.getExtensionFilePath("package.json");
|
||||
const packageJsonPath: string = util.getExtensionFilePath("package.json");
|
||||
if (packageJsonPath.includes(".vscode-insiders") || packageJsonPath.includes(".vscode-exploration")) {
|
||||
if (packageJson.contributes.configuration.properties['C_Cpp.updateChannel'].default === 'Default') {
|
||||
packageJson.contributes.configuration.properties['C_Cpp.updateChannel'].default = 'Insiders';
|
||||
@@ -416,7 +416,7 @@ async function finalizeExtensionActivation(): Promise<void> {
|
||||
|
||||
function rewriteManifest(): Promise<void> {
|
||||
// Replace activationEvents with the events that the extension should be activated for subsequent sessions.
|
||||
let packageJson: any = util.getRawPackageJson();
|
||||
const packageJson: any = util.getRawPackageJson();
|
||||
|
||||
packageJson.activationEvents = [
|
||||
"onLanguage:cpp",
|
||||
@@ -439,7 +439,9 @@ function rewriteManifest(): Promise<void> {
|
||||
"onCommand:C_Cpp.RescanWorkspace",
|
||||
"onCommand:C_Cpp.VcpkgClipboardInstallSuggested",
|
||||
"onCommand:C_Cpp.VcpkgClipboardOnlineHelpSuggested",
|
||||
"onDebug",
|
||||
"onDebugInitialConfigurations",
|
||||
"onDebugResolve:cppdbg",
|
||||
"onDebugResolve:cppvsdbg",
|
||||
"workspaceContains:/.vscode/c_cpp_properties.json",
|
||||
"onFileSystem:cpptools-schema"
|
||||
];
|
||||
|
||||
@@ -157,6 +157,37 @@
|
||||
"fallback_to_64_bit_mode2": "Failed to query compiler. Falling back to 64-bit intelliSenseMode.",
|
||||
"fallback_to_no_bitness": "Failed to query compiler. Falling back to no bitness.",
|
||||
"intellisense_client_creation_aborted": "IntelliSense client creation aborted: {0}",
|
||||
"include_errors_tag_parser_provide_intellisense_features": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_tag_parser_provide_intellisense_features_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser. Squiggles are disabled for this translation unit."
|
||||
"include_errors_config_provider_intellisense_disabled ": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.",
|
||||
"include_errors_config_provider_squiggles_disabled ": "#include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit ({0}).",
|
||||
"preprocessor_keyword": {
|
||||
"text": "preprocessor keyword",
|
||||
"hint": "Refers to C/C++ processor keywords"
|
||||
},
|
||||
"c_keyword": "C keyword",
|
||||
"cpp_keyword": "C++ keyword",
|
||||
"overload": {
|
||||
"text": "+1 overload",
|
||||
"hint": "Refers to 'overloaded' function in C++. This is part of a description indicating there is 1 additional overload of a specified function."
|
||||
},
|
||||
"overloads": {
|
||||
"text": "+%d overloads",
|
||||
"hint": "Refers to 'overloaded' functions in C++. This is part of a description indicating there are N additional overloads of a specified function. %d is replaced with that number."
|
||||
},
|
||||
"specialization": {
|
||||
"text": "+1 specialization",
|
||||
"hint": "Refers to a C++ template specialization. This is part of a description indicating there is 1 additional specialization of a function."
|
||||
},
|
||||
"specializations": {
|
||||
"text": "+%d specializations",
|
||||
"hint": "Refers to C++ template specializations. This is part of a description indicating there are N additional specializations of a function. %d is replaced with that number."
|
||||
},
|
||||
"expands_to": "Expands to:",
|
||||
"file_label": "File:",
|
||||
"parameters_label": "Parameters:",
|
||||
"returns_label": {
|
||||
"text": "Returns:",
|
||||
"hint": "This label is for the return value description for a function. Usage example: 'Returns: Area of a shape.'"
|
||||
},
|
||||
"deprecated_label": "Deprecated:",
|
||||
"exceptions_label": "Exceptions:"
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ export class PackageManager {
|
||||
private BuildPromiseChain<TItem, TPromise>(items: TItem[], promiseBuilder: (item: TItem) => Promise<TPromise>): Promise<TPromise | null> {
|
||||
let promiseChain: Promise<TPromise | null> = Promise.resolve<TPromise | null>(null);
|
||||
|
||||
for (let item of items) {
|
||||
for (const item of items) {
|
||||
promiseChain = promiseChain.then(() => promiseBuilder(item));
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ export class PackageManager {
|
||||
this.allPackages = <IPackage[]>util.packageJson.runtimeDependencies;
|
||||
|
||||
// Convert relative binary paths to absolute
|
||||
for (let pkg of this.allPackages) {
|
||||
for (const pkg of this.allPackages) {
|
||||
if (pkg.binaries) {
|
||||
pkg.binaries = pkg.binaries.map((value) => util.getExtensionFilePath(value));
|
||||
}
|
||||
@@ -210,10 +210,10 @@ export class PackageManager {
|
||||
this.AppendLineChannel(" " + localize("done", "Done!"));
|
||||
if (retryCount !== 0) {
|
||||
// Log telemetry to see if retrying helps.
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
const telemetryProperties: { [key: string]: string } = {};
|
||||
telemetryProperties["success"] = success ? `OnRetry${retryCount}` : 'false';
|
||||
if (lastError instanceof PackageManagerError) {
|
||||
let packageError: PackageManagerError = lastError;
|
||||
const packageError: PackageManagerError = lastError;
|
||||
telemetryProperties['error.methodName'] = packageError.methodName;
|
||||
telemetryProperties['error.message'] = packageError.message;
|
||||
if (packageError.pkg) {
|
||||
@@ -230,10 +230,10 @@ export class PackageManager {
|
||||
|
||||
// reloadCpptoolsJson in main.ts uses ~25% of this function.
|
||||
private DownloadFile(urlString: any, pkg: IPackage, delay: number, progress: vscode.Progress<{message?: string; increment?: number}>): Promise<void> {
|
||||
let parsedUrl: url.Url = url.parse(urlString);
|
||||
let proxyStrictSSL: any = vscode.workspace.getConfiguration().get("http.proxyStrictSSL", true);
|
||||
const parsedUrl: url.Url = url.parse(urlString);
|
||||
const proxyStrictSSL: any = vscode.workspace.getConfiguration().get("http.proxyStrictSSL", true);
|
||||
|
||||
let options: https.RequestOptions = {
|
||||
const options: https.RequestOptions = {
|
||||
host: parsedUrl.host,
|
||||
path: parsedUrl.path,
|
||||
agent: util.getHttpsProxyAgent(),
|
||||
@@ -253,7 +253,7 @@ export class PackageManager {
|
||||
return reject(new PackageManagerError('Temporary Package file unavailable', localize("temp.package.unavailable", 'Temporary Package file unavailable'), 'DownloadFile', pkg));
|
||||
}
|
||||
|
||||
let handleHttpResponse: (response: IncomingMessage) => void = (response: IncomingMessage) => {
|
||||
const handleHttpResponse: (response: IncomingMessage) => void = (response: IncomingMessage) => {
|
||||
if (response.statusCode === 301 || response.statusCode === 302) {
|
||||
// Redirect - download from new location
|
||||
let redirectUrl: string | string[];
|
||||
@@ -271,7 +271,7 @@ export class PackageManager {
|
||||
return reject(new PackageManagerError('Invalid response code received', localize("invalid.response.code.received", 'Invalid response code received'), 'DownloadFile', pkg));
|
||||
}
|
||||
// Download failed - print error message
|
||||
let errorMessage: string = localize("failed.web.error", "failed (error code '{0}')", response.statusCode);
|
||||
const errorMessage: string = localize("failed.web.error", "failed (error code '{0}')", response.statusCode);
|
||||
return reject(new PackageManagerWebResponseError(response.socket, 'HTTP/HTTPS Response Error', localize("web.response.error", 'HTTP/HTTPS Response Error'), 'DownloadFile', pkg, errorMessage, response.statusCode.toString()));
|
||||
} else {
|
||||
// Downloading - hook up events
|
||||
@@ -284,16 +284,16 @@ export class PackageManager {
|
||||
}
|
||||
contentLength = response.headers['content-length'][0];
|
||||
}
|
||||
let packageSize: number = parseInt(contentLength, 10);
|
||||
let downloadPercentage: number = 0;
|
||||
const packageSize: number = parseInt(contentLength, 10);
|
||||
const downloadPercentage: number = 0;
|
||||
let dots: number = 0;
|
||||
let tmpFile: fs.WriteStream = fs.createWriteStream("", { fd: pkg.tmpFile.fd });
|
||||
const tmpFile: fs.WriteStream = fs.createWriteStream("", { fd: pkg.tmpFile.fd });
|
||||
|
||||
this.AppendChannel(`(${Math.ceil(packageSize / 1024)} KB) `);
|
||||
|
||||
response.on('data', (data) => {
|
||||
// Update dots after package name in output console
|
||||
let newDots: number = Math.ceil(downloadPercentage / 5);
|
||||
const newDots: number = Math.ceil(downloadPercentage / 5);
|
||||
if (newDots > dots) {
|
||||
this.AppendChannel(".".repeat(newDots - dots));
|
||||
dots = newDots;
|
||||
@@ -310,7 +310,7 @@ export class PackageManager {
|
||||
}
|
||||
};
|
||||
|
||||
let request: ClientRequest = https.request(options, handleHttpResponse);
|
||||
const request: ClientRequest = https.request(options, handleHttpResponse);
|
||||
|
||||
request.on('error', (error) =>
|
||||
reject(new PackageManagerError(
|
||||
@@ -347,7 +347,7 @@ export class PackageManager {
|
||||
zipfile.readEntry();
|
||||
|
||||
zipfile.on('entry', (entry: yauzl.Entry) => {
|
||||
let absoluteEntryPath: string = util.getExtensionFilePath(entry.fileName);
|
||||
const absoluteEntryPath: string = util.getExtensionFilePath(entry.fileName);
|
||||
|
||||
if (entry.fileName.endsWith("/")) {
|
||||
// Directory - create it
|
||||
@@ -377,7 +377,7 @@ export class PackageManager {
|
||||
|
||||
// Create as a .tmp file to avoid partially unzipped files
|
||||
// counting as completed files.
|
||||
let absoluteEntryTempFile: string = absoluteEntryPath + ".tmp";
|
||||
const absoluteEntryTempFile: string = absoluteEntryPath + ".tmp";
|
||||
if (fs.existsSync(absoluteEntryTempFile)) {
|
||||
try {
|
||||
await util.unlinkPromise(absoluteEntryTempFile);
|
||||
@@ -387,8 +387,8 @@ export class PackageManager {
|
||||
}
|
||||
|
||||
// Make sure executable files have correct permissions when extracted
|
||||
let fileMode: number = (pkg.binaries && pkg.binaries.indexOf(absoluteEntryPath) !== -1) ? 0o755 : 0o664;
|
||||
let writeStream: fs.WriteStream = fs.createWriteStream(absoluteEntryTempFile, { mode: fileMode });
|
||||
const fileMode: number = (pkg.binaries && pkg.binaries.indexOf(absoluteEntryPath) !== -1) ? 0o755 : 0o664;
|
||||
const writeStream: fs.WriteStream = fs.createWriteStream(absoluteEntryTempFile, { mode: fileMode });
|
||||
|
||||
writeStream.on('close', async () => {
|
||||
try {
|
||||
|
||||
@@ -27,7 +27,7 @@ export class PlatformInformation {
|
||||
constructor(public platform: string, public architecture?: string, public distribution?: LinuxDistribution, public version?: string) { }
|
||||
|
||||
public static GetPlatformInformation(): Promise<PlatformInformation> {
|
||||
let platform: string = os.platform();
|
||||
const platform: string = os.platform();
|
||||
let architecturePromise: Promise<string | undefined>;
|
||||
let distributionPromise: Promise<LinuxDistribution | undefined> = Promise.resolve<LinuxDistribution | undefined>(undefined);
|
||||
let versionPromise: Promise<string | undefined> = Promise.resolve<string | undefined>(undefined);
|
||||
@@ -63,9 +63,9 @@ export class PlatformInformation {
|
||||
return util.execChildProcess('wmic os get osarchitecture', util.extensionPath)
|
||||
.then((architecture) => {
|
||||
if (architecture) {
|
||||
let archArray: string[] = architecture.split(os.EOL);
|
||||
const archArray: string[] = architecture.split(os.EOL);
|
||||
if (archArray.length >= 2) {
|
||||
let arch: string = archArray[1].trim();
|
||||
const arch: string = archArray[1].trim();
|
||||
|
||||
// Note: This string can be localized. So, we'll just check to see if it contains 32 or 64.
|
||||
if (arch.indexOf('64') >= 0) {
|
||||
|
||||
@@ -45,7 +45,7 @@ export function logLanguageServerEvent(eventName: string, properties?: { [key: s
|
||||
|
||||
function createReporter(): TelemetryReporter | null {
|
||||
if (util.extensionContext) {
|
||||
let packageInfo: IPackageInfo = getPackageInfo();
|
||||
const packageInfo: IPackageInfo = getPackageInfo();
|
||||
if (packageInfo) {
|
||||
return new TelemetryReporter(packageInfo.name, packageInfo.version, appInsightsKey);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
"noImplicitUseStrict": true
|
||||
},
|
||||
"include": [
|
||||
"test/**/*.ts"
|
||||
"test/**/*.ts",
|
||||
"tools/**/*.ts",
|
||||
"ui/**/*.ts"
|
||||
]
|
||||
}
|
||||
@@ -11,9 +11,9 @@ import * as testHelpers from '../testHelpers';
|
||||
|
||||
suite("[Quick info test]", function(): void {
|
||||
let cpptools: apit.CppToolsTestApi;
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
let filePath: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/quickInfo.cpp";
|
||||
let fileUri: vscode.Uri = vscode.Uri.file(filePath);
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
const filePath: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/quickInfo.cpp";
|
||||
const fileUri: vscode.Uri = vscode.Uri.file(filePath);
|
||||
let platform: string = "";
|
||||
|
||||
suiteSetup(async function(): Promise<void> {
|
||||
@@ -21,10 +21,10 @@ suite("[Quick info test]", function(): void {
|
||||
|
||||
cpptools = await apit.getCppToolsTestApi(api.Version.latest);
|
||||
platform = os.platform();
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
const testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
disposables.push(testHook);
|
||||
|
||||
let getIntelliSenseStatus: any = new Promise<void>((resolve, reject) => {
|
||||
const getIntelliSenseStatus: any = new Promise<void>((resolve, reject) => {
|
||||
disposables.push(testHook.IntelliSenseStatusChanged(result => {
|
||||
result = result as apit.IntelliSenseStatus;
|
||||
if (result.filename === "quickInfo.cpp" && result.status === apit.Status.IntelliSenseReady) {
|
||||
@@ -45,51 +45,51 @@ suite("[Quick info test]", function(): void {
|
||||
});
|
||||
|
||||
test("[Hover over function call]", async () => {
|
||||
let result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 12)));
|
||||
const result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 12)));
|
||||
|
||||
let expectedMap: Map<string, string> = new Map<string, string>();
|
||||
const expectedMap: Map<string, string> = new Map<string, string>();
|
||||
expectedMap.set("win32", `\`\`\`cpp\nvoid myfunction(int var1, std::string var2, std::string var3)\n\`\`\``);
|
||||
expectedMap.set("linux", `\`\`\`cpp\nvoid myfunction(int var1, std::string var2, std::string var3)\n\`\`\``);
|
||||
expectedMap.set("darwin", `\`\`\`cpp\nvoid myfunction(int var1, std::__cxx11::string var2, std::__cxx11::string var3)\n\`\`\``);
|
||||
|
||||
let expected1: string = expectedMap.get(platform);
|
||||
let actual1: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
const expected1: string = expectedMap.get(platform);
|
||||
const actual1: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
assert.equal(actual1, expected1);
|
||||
let expected2: string = `comment for myfunction`;
|
||||
let actual2: string = (<vscode.MarkdownString>result[0].contents[1]).value;
|
||||
const expected2: string = `comment for myfunction`;
|
||||
const actual2: string = (<vscode.MarkdownString>result[0].contents[1]).value;
|
||||
assert.equal(actual2, expected2);
|
||||
});
|
||||
|
||||
test("[Hover over function param string variable]", async () => {
|
||||
let result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 30)));
|
||||
const result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 30)));
|
||||
|
||||
let expectedMap: Map<string, string> = new Map<string, string>();
|
||||
const expectedMap: Map<string, string> = new Map<string, string>();
|
||||
expectedMap.set("win32", `\`\`\`cpp\nstd::string stringVar\n\`\`\``);
|
||||
expectedMap.set("linux", `\`\`\`cpp\nstd::string stringVar\n\`\`\``);
|
||||
expectedMap.set("darwin", `\`\`\`cpp\nstd::__cxx11::string stringVar\n\`\`\``);
|
||||
|
||||
let expected: string = expectedMap.get(platform);
|
||||
let actual: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
const expected: string = expectedMap.get(platform);
|
||||
const actual: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
assert.equal(actual, expected);
|
||||
});
|
||||
|
||||
test("[Hover over function param string literal]", async () => {
|
||||
let result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 44)));
|
||||
const result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 44)));
|
||||
|
||||
let expectedMap: Map<string, string> = new Map<string, string>();
|
||||
const expectedMap: Map<string, string> = new Map<string, string>();
|
||||
expectedMap.set("win32", `\`\`\`cpp\nstd::string::basic_string(const char *_Ptr)\n\`\`\`\n\n+17 overloads\n`);
|
||||
expectedMap.set("linux", `\`\`\`cpp\nstd::string::basic_string<...>(const char *__s, const std::allocator<...> &__a = std::allocator<...>())\n\`\`\`\n\n+17 overloads\n`);
|
||||
expectedMap.set("darwin", `\`\`\`cpp\nstd::__cxx11::string::basic_string<...>(const char *__s, const std::allocator<...> &__a = std::allocator<...>())\n\`\`\`\n\n+17 overloads\n`);
|
||||
|
||||
let expected: string = expectedMap.get(platform);
|
||||
let actual: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
const expected: string = expectedMap.get(platform);
|
||||
const actual: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
assert.equal(actual, expected);
|
||||
});
|
||||
|
||||
test("[Hover over function param with squiggles]", async () => {
|
||||
let result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(13, 18)));
|
||||
let expected: string = `\`\`\`cpp\nint intVar\n\`\`\``;
|
||||
let actual: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
const result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(13, 18)));
|
||||
const expected: string = `\`\`\`cpp\nint intVar\n\`\`\``;
|
||||
const actual: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
assert.equal(actual, expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,9 +14,9 @@ function delay(ms: number): Promise<void> {
|
||||
|
||||
suite(`[Reference test]`, function(): void {
|
||||
let cpptools: apit.CppToolsTestApi;
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/references.cpp";
|
||||
let fileUri: vscode.Uri = vscode.Uri.file(path);
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/references.cpp";
|
||||
const fileUri: vscode.Uri = vscode.Uri.file(path);
|
||||
let testHook: apit.CppToolsTestHook;
|
||||
let getIntelliSenseStatus: any;
|
||||
let document: vscode.TextDocument;
|
||||
@@ -46,10 +46,10 @@ suite(`[Reference test]`, function(): void {
|
||||
|
||||
test("[Find confirmed references of a symbol]", async () => {
|
||||
// Get reference of function declaration "int func1()"
|
||||
let declarationResult: vscode.Location[] = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeReferenceProvider", fileUri, new vscode.Position(17, 7)));
|
||||
let functionCallResult: vscode.Location[] = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeReferenceProvider", fileUri, new vscode.Position(24, 21)));
|
||||
const declarationResult: vscode.Location[] = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeReferenceProvider", fileUri, new vscode.Position(17, 7)));
|
||||
const functionCallResult: vscode.Location[] = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeReferenceProvider", fileUri, new vscode.Position(24, 21)));
|
||||
|
||||
let expectedText: string = "func1";
|
||||
const expectedText: string = "func1";
|
||||
assertTextInLocation(document, expectedText, declarationResult);
|
||||
assertTextInLocation(document, expectedText, functionCallResult);
|
||||
assert.deepEqual(declarationResult, functionCallResult);
|
||||
@@ -57,9 +57,9 @@ suite(`[Reference test]`, function(): void {
|
||||
|
||||
test("[Find references of local param]", async () => {
|
||||
// Get reference of local param: var1 in "int func1(float var1)"
|
||||
let result: vscode.Location[] = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeReferenceProvider", fileUri, new vscode.Position(21, 18)));
|
||||
const result: vscode.Location[] = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeReferenceProvider", fileUri, new vscode.Position(21, 18)));
|
||||
|
||||
let expectedText: string = "var1";
|
||||
const expectedText: string = "var1";
|
||||
assertTextInLocation(document, expectedText, result);
|
||||
assert.equal(result.length, 2);
|
||||
});
|
||||
@@ -90,7 +90,7 @@ function assertTextInLocation(document: vscode.TextDocument, expectedText: strin
|
||||
console.log("expected reference text: " + expectedText);
|
||||
}
|
||||
Locations.forEach(location => {
|
||||
let actualtext: string = document.getText(location.range);
|
||||
const actualtext: string = document.getText(location.range);
|
||||
if (displayLog) {
|
||||
console.log("actual reference text: " + actualtext);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ suite(`Debug Integration Test: `, function(): void {
|
||||
let hijackedFactoryFile: string;
|
||||
|
||||
suiteSetup(async function(): Promise<void> {
|
||||
let extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
const extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
if (!extension.isActive) {
|
||||
await extension.activate();
|
||||
}
|
||||
@@ -21,7 +21,7 @@ suite(`Debug Integration Test: `, function(): void {
|
||||
// If it is failing on startDebugging. Investigate the SimpleCppProject's tasks.json or launch.json.
|
||||
await vscode.debug.startDebugging(vscode.workspace.workspaceFolders[0], "(gdb) Launch");
|
||||
|
||||
let debugSessionTerminated: Promise<void> = new Promise(resolve => {
|
||||
const debugSessionTerminated: Promise<void> = new Promise(resolve => {
|
||||
vscode.debug.onDidTerminateDebugSession((e) => resolve());
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ suite("multiline comment setting tests", function(): void {
|
||||
await testHelpers.activateCppExtension();
|
||||
});
|
||||
|
||||
let defaultRules: vscode.OnEnterRule[] = [
|
||||
const defaultRules: vscode.OnEnterRule[] = [
|
||||
{
|
||||
beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
|
||||
afterText: /^\s*\*\/$/,
|
||||
@@ -39,7 +39,7 @@ suite("multiline comment setting tests", function(): void {
|
||||
action: { indentAction: vscode.IndentAction.None, removeText: 1 }
|
||||
}
|
||||
];
|
||||
let defaultSLRules: vscode.OnEnterRule[] = [
|
||||
const defaultSLRules: vscode.OnEnterRule[] = [
|
||||
{
|
||||
beforeText: /^\s*\/\/\/.+$/,
|
||||
action: { indentAction: vscode.IndentAction.None, appendText: '///' }
|
||||
@@ -51,27 +51,27 @@ suite("multiline comment setting tests", function(): void {
|
||||
];
|
||||
|
||||
test("Check the default OnEnterRules for C", () => {
|
||||
let rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('c', [ "/**" ]).onEnterRules;
|
||||
const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('c', [ "/**" ]).onEnterRules;
|
||||
assert.deepEqual(rules, defaultRules);
|
||||
});
|
||||
|
||||
test("Check for removal of single line comment continuations for C", () => {
|
||||
let rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('c', [ "/**", "///" ]).onEnterRules;
|
||||
const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('c', [ "/**", "///" ]).onEnterRules;
|
||||
assert.deepEqual(rules, defaultRules);
|
||||
});
|
||||
|
||||
test("Check the default OnEnterRules for C++", () => {
|
||||
let rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "/**" ]).onEnterRules;
|
||||
const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "/**" ]).onEnterRules;
|
||||
assert.deepEqual(rules, defaultRules);
|
||||
});
|
||||
|
||||
test("Make sure duplicate rules are removed", () => {
|
||||
let rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "/**", { begin: "/**", continue: " * " }, "/**" ]).onEnterRules;
|
||||
const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "/**", { begin: "/**", continue: " * " }, "/**" ]).onEnterRules;
|
||||
assert.deepEqual(rules, defaultRules);
|
||||
});
|
||||
|
||||
test("Check single line rules for C++", () => {
|
||||
let rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "///" ]).onEnterRules;
|
||||
const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "///" ]).onEnterRules;
|
||||
assert.deepEqual(rules, defaultSLRules);
|
||||
});
|
||||
|
||||
@@ -85,7 +85,7 @@ function cppPropertiesPath(): string {
|
||||
|
||||
async function changeCppProperties(cppProperties: config.ConfigurationJson, disposables: vscode.Disposable[]): Promise<void> {
|
||||
await util.writeFileText(cppPropertiesPath(), JSON.stringify(cppProperties));
|
||||
let contents: string = await util.readFileText(cppPropertiesPath());
|
||||
const contents: string = await util.readFileText(cppPropertiesPath());
|
||||
console.log(" wrote c_cpp_properties.json: " + contents);
|
||||
|
||||
// Sleep for 4000ms for file watcher
|
||||
@@ -97,34 +97,34 @@ async function changeCppProperties(cppProperties: config.ConfigurationJson, disp
|
||||
suite("extensibility tests v3", function(): void {
|
||||
let cpptools: apit.CppToolsTestApi;
|
||||
let lastResult: api.SourceFileConfigurationItem[];
|
||||
let defaultConfig: api.SourceFileConfiguration = {
|
||||
const defaultConfig: api.SourceFileConfiguration = {
|
||||
includePath: [ "${workspaceFolder}", "/v3/folder" ],
|
||||
defines: [ "${workspaceFolder}" ],
|
||||
intelliSenseMode: "msvc-x64",
|
||||
standard: "c++17"
|
||||
};
|
||||
let lastBrowseResult: api.WorkspaceBrowseConfiguration;
|
||||
let defaultBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
const defaultBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
browsePath: [ "/v3/folder" ],
|
||||
compilerPath: "",
|
||||
standard: "c++14",
|
||||
windowsSdkVersion: "8.1"
|
||||
};
|
||||
let defaultFolderBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
const defaultFolderBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
browsePath: [ "/v3/folder-1" ],
|
||||
compilerPath: "",
|
||||
standard: "c++14",
|
||||
windowsSdkVersion: "8.1"
|
||||
};
|
||||
|
||||
let provider: api.CustomConfigurationProvider = {
|
||||
const provider: api.CustomConfigurationProvider = {
|
||||
name: "cpptoolsTest-v3",
|
||||
extensionId: "ms-vscode.cpptools-test3",
|
||||
canProvideConfiguration(document: vscode.Uri): Thenable<boolean> {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
provideConfigurations(uris: vscode.Uri[]): Thenable<api.SourceFileConfigurationItem[]> {
|
||||
let result: api.SourceFileConfigurationItem[] = [];
|
||||
const result: api.SourceFileConfigurationItem[] = [];
|
||||
uris.forEach(uri => {
|
||||
result.push({
|
||||
uri: uri.toString(),
|
||||
@@ -152,7 +152,7 @@ suite("extensibility tests v3", function(): void {
|
||||
console.log(" disposed");
|
||||
}
|
||||
};
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
|
||||
suiteSetup(async function(): Promise<void> {
|
||||
cpptools = await apit.getCppToolsTestApi(api.Version.v3);
|
||||
@@ -173,15 +173,15 @@ suite("extensibility tests v3", function(): void {
|
||||
|
||||
test("Check provider - main3.cpp", async () => {
|
||||
// Open a c++ file to start the language server.
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main3.cpp";
|
||||
let uri: vscode.Uri = vscode.Uri.file(path);
|
||||
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main3.cpp";
|
||||
const uri: vscode.Uri = vscode.Uri.file(path);
|
||||
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
let testResult: any = new Promise<void>((resolve, reject) => {
|
||||
const testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
const testResult: any = new Promise<void>((resolve, reject) => {
|
||||
disposables.push(testHook.IntelliSenseStatusChanged(result => {
|
||||
result = result as apit.IntelliSenseStatus;
|
||||
if (result.filename === "main3.cpp" && result.status === apit.Status.IntelliSenseReady) {
|
||||
let expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
const expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
assert.deepEqual(lastResult, expected);
|
||||
assert.deepEqual(lastBrowseResult, defaultFolderBrowseConfig);
|
||||
resolve();
|
||||
@@ -191,7 +191,7 @@ suite("extensibility tests v3", function(): void {
|
||||
});
|
||||
disposables.push(testHook);
|
||||
|
||||
let document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
await vscode.window.showTextDocument(document);
|
||||
await testResult;
|
||||
});
|
||||
@@ -202,14 +202,14 @@ suite("extensibility tests v3", function(): void {
|
||||
suite("extensibility tests v2", function(): void {
|
||||
let cpptools: apit.CppToolsTestApi;
|
||||
let lastResult: api.SourceFileConfigurationItem[];
|
||||
let defaultConfig: api.SourceFileConfiguration = {
|
||||
const defaultConfig: api.SourceFileConfiguration = {
|
||||
includePath: [ "${workspaceFolder}", "/v2/folder" ],
|
||||
defines: [ "${workspaceFolder}" ],
|
||||
intelliSenseMode: "msvc-x64",
|
||||
standard: "c++17"
|
||||
};
|
||||
let lastBrowseResult: api.WorkspaceBrowseConfiguration;
|
||||
let defaultBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
const defaultBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
browsePath: [ "/v2/folder" ],
|
||||
compilerPath: "",
|
||||
standard: "c++14",
|
||||
@@ -217,14 +217,14 @@ suite("extensibility tests v2", function(): void {
|
||||
};
|
||||
|
||||
// Has to be 'any' instead of api.CustomConfigurationProvider because of missing interface members.
|
||||
let provider: any = {
|
||||
const provider: any = {
|
||||
name: "cpptoolsTest-v2",
|
||||
extensionId: "ms-vscode.cpptools-test2",
|
||||
canProvideConfiguration(document: vscode.Uri): Thenable<boolean> {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
provideConfigurations(uris: vscode.Uri[]): Thenable<api.SourceFileConfigurationItem[]> {
|
||||
let result: api.SourceFileConfigurationItem[] = [];
|
||||
const result: api.SourceFileConfigurationItem[] = [];
|
||||
uris.forEach(uri => {
|
||||
result.push({
|
||||
uri: uri.toString(),
|
||||
@@ -245,7 +245,7 @@ suite("extensibility tests v2", function(): void {
|
||||
console.log(" disposed");
|
||||
}
|
||||
};
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
|
||||
suiteSetup(async function(): Promise<void> {
|
||||
cpptools = await apit.getCppToolsTestApi(api.Version.v2);
|
||||
@@ -266,16 +266,16 @@ suite("extensibility tests v2", function(): void {
|
||||
|
||||
test("Check provider - main2.cpp", async () => {
|
||||
// Open a c++ file to start the language server.
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main2.cpp";
|
||||
let uri: vscode.Uri = vscode.Uri.file(path);
|
||||
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main2.cpp";
|
||||
const uri: vscode.Uri = vscode.Uri.file(path);
|
||||
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
let testResult: any = new Promise<void>((resolve, reject) => {
|
||||
const testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
const testResult: any = new Promise<void>((resolve, reject) => {
|
||||
disposables.push(testHook.IntelliSenseStatusChanged(result => {
|
||||
result = result as apit.IntelliSenseStatus;
|
||||
if (result.filename === "main2.cpp" && result.status === apit.Status.IntelliSenseReady) {
|
||||
|
||||
let expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
const expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
assert.deepEqual(lastResult, expected);
|
||||
assert.deepEqual(lastBrowseResult, defaultBrowseConfig);
|
||||
resolve();
|
||||
@@ -285,7 +285,7 @@ suite("extensibility tests v2", function(): void {
|
||||
});
|
||||
disposables.push(testHook);
|
||||
|
||||
let document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
await vscode.window.showTextDocument(document);
|
||||
await testResult;
|
||||
});
|
||||
@@ -296,7 +296,7 @@ suite("extensibility tests v2", function(): void {
|
||||
suite("extensibility tests v1", function(): void {
|
||||
let cpptools: apit.CppToolsTestApi;
|
||||
let lastResult: api.SourceFileConfigurationItem[];
|
||||
let defaultConfig: api.SourceFileConfiguration = {
|
||||
const defaultConfig: api.SourceFileConfiguration = {
|
||||
includePath: [ "${workspaceFolder}" ],
|
||||
defines: [ "${workspaceFolder}" ],
|
||||
intelliSenseMode: "msvc-x64",
|
||||
@@ -304,14 +304,14 @@ suite("extensibility tests v1", function(): void {
|
||||
};
|
||||
|
||||
// Has to be 'any' instead of api.CustomConfigurationProvider because of missing interface members.
|
||||
let provider: any = {
|
||||
const provider: any = {
|
||||
name: "cpptoolsTest-v1",
|
||||
extensionId: "ms-vscode.cpptools-test",
|
||||
canProvideConfiguration(document: vscode.Uri): Thenable<boolean> {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
provideConfigurations(uris: vscode.Uri[]): Thenable<api.SourceFileConfigurationItem[]> {
|
||||
let result: api.SourceFileConfigurationItem[] = [];
|
||||
const result: api.SourceFileConfigurationItem[] = [];
|
||||
uris.forEach(uri => {
|
||||
result.push({
|
||||
uri: uri.toString(),
|
||||
@@ -325,7 +325,7 @@ suite("extensibility tests v1", function(): void {
|
||||
console.log(" disposed");
|
||||
}
|
||||
};
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
|
||||
suiteSetup(async function(): Promise<void> {
|
||||
cpptools = await apit.getCppToolsTestApi(api.Version.v1);
|
||||
@@ -345,15 +345,15 @@ suite("extensibility tests v1", function(): void {
|
||||
|
||||
test("Check provider - main1.cpp", async () => {
|
||||
// Open a c++ file to start the language server.
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main1.cpp";
|
||||
let uri: vscode.Uri = vscode.Uri.file(path);
|
||||
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main1.cpp";
|
||||
const uri: vscode.Uri = vscode.Uri.file(path);
|
||||
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
let testResult: any = new Promise<void>((resolve, reject) => {
|
||||
const testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
const testResult: any = new Promise<void>((resolve, reject) => {
|
||||
disposables.push(testHook.IntelliSenseStatusChanged(result => {
|
||||
result = result as apit.IntelliSenseStatus;
|
||||
if (result.filename === "main1.cpp" && result.status === apit.Status.IntelliSenseReady) {
|
||||
let expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
const expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
assert.deepEqual(lastResult, expected);
|
||||
resolve();
|
||||
}
|
||||
@@ -362,7 +362,7 @@ suite("extensibility tests v1", function(): void {
|
||||
});
|
||||
disposables.push(testHook);
|
||||
|
||||
let document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
await vscode.window.showTextDocument(document);
|
||||
await testResult;
|
||||
});
|
||||
@@ -373,7 +373,7 @@ suite("extensibility tests v1", function(): void {
|
||||
suite("extensibility tests v0", function(): void {
|
||||
let cpptools: apit.CppToolsTestApi;
|
||||
let lastResult: api.SourceFileConfigurationItem[];
|
||||
let defaultConfig: api.SourceFileConfiguration = {
|
||||
const defaultConfig: api.SourceFileConfiguration = {
|
||||
includePath: [ "${workspaceFolder}" ],
|
||||
defines: [ "${workspaceFolder}" ],
|
||||
intelliSenseMode: "msvc-x64",
|
||||
@@ -381,13 +381,13 @@ suite("extensibility tests v0", function(): void {
|
||||
};
|
||||
|
||||
// Has to be 'any' instead of api.CustomConfigurationProvider because of missing interface members.
|
||||
let provider: any = {
|
||||
const provider: any = {
|
||||
name: "cpptoolsTest-v0",
|
||||
canProvideConfiguration(document: vscode.Uri): Thenable<boolean> {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
provideConfigurations(uris: vscode.Uri[]): Thenable<api.SourceFileConfigurationItem[]> {
|
||||
let result: api.SourceFileConfigurationItem[] = [];
|
||||
const result: api.SourceFileConfigurationItem[] = [];
|
||||
uris.forEach(uri => {
|
||||
result.push({
|
||||
uri: uri.toString(),
|
||||
@@ -398,7 +398,7 @@ suite("extensibility tests v0", function(): void {
|
||||
return Promise.resolve(result);
|
||||
}
|
||||
};
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
|
||||
suiteSetup(async function(): Promise<void> {
|
||||
cpptools = await apit.getCppToolsTestApi(api.Version.v0);
|
||||
@@ -419,15 +419,15 @@ suite("extensibility tests v0", function(): void {
|
||||
|
||||
test("Check provider - main.cpp", async () => {
|
||||
// Open a C++ file to start the language server.
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main.cpp";
|
||||
let uri: vscode.Uri = vscode.Uri.file(path);
|
||||
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main.cpp";
|
||||
const uri: vscode.Uri = vscode.Uri.file(path);
|
||||
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
let testResult: any = new Promise<void>((resolve, reject) => {
|
||||
const testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
const testResult: any = new Promise<void>((resolve, reject) => {
|
||||
disposables.push(testHook.IntelliSenseStatusChanged(result => {
|
||||
result = result as apit.IntelliSenseStatus;
|
||||
if (result.filename === "main.cpp" && result.status === apit.Status.IntelliSenseReady) {
|
||||
let expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
const expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
assert.deepEqual(lastResult, expected);
|
||||
resolve();
|
||||
}
|
||||
@@ -436,7 +436,7 @@ suite("extensibility tests v0", function(): void {
|
||||
});
|
||||
disposables.push(testHook);
|
||||
|
||||
let document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
await vscode.window.showTextDocument(document);
|
||||
await testResult;
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as vscode from 'vscode';
|
||||
export const defaultTimeout: number = 100000;
|
||||
|
||||
export async function activateCppExtension(): Promise<void> {
|
||||
let extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
const extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
if (!extension.isActive) {
|
||||
await extension.activate();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as assert from 'assert';
|
||||
// Because the environment variable is set as an array, the index does not matter.
|
||||
function assertEnvironmentEqual(env: Environment[], name: string, value: string): void {
|
||||
let found: boolean = false;
|
||||
for (let e of env) {
|
||||
for (const e of env) {
|
||||
if (e.name === name) {
|
||||
assert(e.value === value, `Checking if ${e.value} == ${value}`);
|
||||
found = true;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
import * as assert from "assert";
|
||||
import { resolveVariables, escapeForSquiggles } from "../../src/common";
|
||||
import { envDelimiter, resolveVariables, escapeForSquiggles } from "../../src/common";
|
||||
|
||||
suite("Common Utility validation", () => {
|
||||
suite("resolveVariables", () => {
|
||||
@@ -32,7 +32,7 @@ suite("Common Utility validation", () => {
|
||||
inputAndEnvironment("${test}", {
|
||||
test: ["foo", "bar"]
|
||||
})
|
||||
.shouldResolveTo("foo;bar");
|
||||
.shouldResolveTo(`foo${envDelimiter}bar`);
|
||||
});
|
||||
|
||||
test("solo env input with empty array env value", () => {
|
||||
@@ -198,8 +198,8 @@ suite("Common Utility validation", () => {
|
||||
});
|
||||
|
||||
test("escapeForSquiggles:", () => {
|
||||
let testEscapeForSquigglesScenario: any = (input: string, expectedOutput: string) => {
|
||||
let result: string = escapeForSquiggles(input);
|
||||
const testEscapeForSquigglesScenario: any = (input: string, expectedOutput: string) => {
|
||||
const result: string = escapeForSquiggles(input);
|
||||
if (result !== expectedOutput) {
|
||||
throw new Error(`escapeForSquiggles failure: for \"${input}\", \"${result}\" !== \"${expectedOutput}\"`);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user