Compare commits
73
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b33117997a | ||
|
|
734ce74be2 | ||
|
|
5262a75d87 | ||
|
|
214a22911d | ||
|
|
c8a36e091e | ||
|
|
6c95236356 | ||
|
|
6bdf5f2495 | ||
|
|
9b559d0a18 | ||
|
|
255ecac866 | ||
|
|
f97729a8cb | ||
|
|
a88ca881ad | ||
|
|
9ea6727743 | ||
|
|
bd1f66b411 | ||
|
|
c5be0b55c7 | ||
|
|
e8080fc86f | ||
|
|
579e4db42b | ||
|
|
16bc8f6e5d | ||
|
|
6c4080832b | ||
|
|
882b62c25b | ||
|
|
5878686eac | ||
|
|
f87944a72a | ||
|
|
8e0a0792b8 | ||
|
|
6712181c45 | ||
|
|
940a720501 | ||
|
|
211e497a89 | ||
|
|
f04ee43425 | ||
|
|
8a4bfa2183 | ||
|
|
c6af5ce8b5 | ||
|
|
014f30e942 | ||
|
|
d1c9d4d298 | ||
|
|
09ccd3af42 | ||
|
|
375b64b4f8 | ||
|
|
783ef7290a | ||
|
|
7f1efd4b84 | ||
|
|
d68f76b51e | ||
|
|
6ba1262347 | ||
|
|
490fc7504f | ||
|
|
f2959f4d7a | ||
|
|
fa4d7b22c1 | ||
|
|
3cb7f7e61f | ||
|
|
779f2ce2b5 | ||
|
|
0c4c83e5bd | ||
|
|
a369ede8d9 | ||
|
|
36ce8f885f | ||
|
|
347794b0c7 | ||
|
|
3ed087134c | ||
|
|
902355e021 | ||
|
|
32e98912df | ||
|
|
084a8e708c | ||
|
|
045d50bb90 | ||
|
|
68eda19665 | ||
|
|
39ab866a10 | ||
|
|
d4cdfe6994 | ||
|
|
c18592b5a3 | ||
|
|
fee924b374 | ||
|
|
6724e13c63 | ||
|
|
717de54b06 | ||
|
|
51cd214f1e | ||
|
|
da277c8593 | ||
|
|
b3cce807bb | ||
|
|
a533eb9a43 | ||
|
|
9702eae953 | ||
|
|
a4b51997ff | ||
|
|
b1274d3c76 | ||
|
|
8f8565dbfd | ||
|
|
7f4614c31c | ||
|
|
e231453778 | ||
|
|
8729804dc2 | ||
|
|
0cf237c839 | ||
|
|
ddc1f901c2 | ||
|
|
9ca27af2df | ||
|
|
082435ec8b | ||
|
|
324c5f59f4 |
@@ -1,112 +0,0 @@
|
||||
variables:
|
||||
llvm_repo: https://github.com/llvm/llvm-project.git
|
||||
llvm_branch: release/10.x
|
||||
llvm_build_type: Release
|
||||
llvm_arch: x86_64
|
||||
llvm_additional_parameters: "-DLLVM_BUILD_LLVM_DYLIB=On -DLLDB_ENABLE_CURSES=Off -DLLDB_ENABLE_PYTHON=Off -DLLDB_INCLUDE_TESTS=OFF"
|
||||
# TODO: fix lldb_mi_repo and lldb_mi_branch (https://github.com/lldb-tools/lldb-mi/pull/37 and https://github.com/lldb-tools/lldb-mi/pull/39)
|
||||
lldb_mi_repo: https://github.com/WardenGnaw/lldb-mi # TODO: Change to lldb-tools
|
||||
lldb_mi_branch: release/cpptools # TODO: Change to master
|
||||
lldb_mi_additional_parameters: ""
|
||||
|
||||
jobs:
|
||||
- job: LLDB_MI
|
||||
timeoutInMinutes: 360
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- task: CmdLine@2
|
||||
displayName: 'Install Dependencies'
|
||||
inputs:
|
||||
script: sudo apt-get install cmake ninja-build swig
|
||||
continueOnError: true
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: 'Build LLVM Project'
|
||||
inputs:
|
||||
script: |
|
||||
log_and_exec_cmd() {
|
||||
echo "##[command] $1"
|
||||
$1
|
||||
}
|
||||
|
||||
log_and_exec_cmd "cd $(Build.StagingDirectory)"
|
||||
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/buildspace"
|
||||
|
||||
log_and_exec_cmd "git clone $(llvm_repo) llvm-project"
|
||||
log_and_exec_cmd "cd llvm-project"
|
||||
log_and_exec_cmd "git checkout $(llvm_branch)"
|
||||
|
||||
log_and_exec_cmd "cd .."
|
||||
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/buildspace/llvm-inst"
|
||||
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/buildspace/llvm-build"
|
||||
log_and_exec_cmd "cd $(Build.StagingDirectory)/buildspace/llvm-build"
|
||||
|
||||
log_and_exec_cmd "cmake -DLLVM_ENABLE_PROJECTS=clang;lldb -DCMAKE_BUILD_TYPE=$(llvm_build_type) -DCMAKE_INSTALL_PREFIX=$(Build.StagingDirectory)/buildspace/llvm-inst/ -DCMAKE_OSX_ARCHITECTURES=$(llvm_arch) $(llvm_additional_parameters) -GNinja $(Build.StagingDirectory)/llvm-project/llvm"
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
echo "##[error] cmake llvm failed"
|
||||
cat $(Build.SourcesDirectory)/buildspace/llvm-build/CMakeFiles/CMakeError.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_and_exec_cmd ninja
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
echo "##[error] ninja failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
### Workaround for https://github.com/llvm/llvm-project/issues/108
|
||||
log_and_exec_cmd "ninja install"
|
||||
|
||||
# Remove conflicting LLDB.framework file.
|
||||
log_and_exec_cmd "rm -rf $(Build.StagingDirectory)/buildspace/llvm-inst/Library/Frameworks/LLDB.framework"
|
||||
|
||||
# Build lldb/sources/API first
|
||||
log_and_exec_cmd "cmake -P $(Build.StagingDirectory)/buildspace/llvm-build/tools/lldb/source/API/cmake_install.cmake"
|
||||
### End of Workaround
|
||||
|
||||
log_and_exec_cmd "ninja install"
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
echo "##[error] ninja install failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "##[section] Build LLDB-MI"
|
||||
# Download lldb-mi and build it against our custom installation.
|
||||
log_and_exec_cmd "cd $(Build.StagingDirectory)/buildspace"
|
||||
log_and_exec_cmd "git clone $(lldb_mi_repo) lldb-mi"
|
||||
log_and_exec_cmd "cd lldb-mi"
|
||||
log_and_exec_cmd "git checkout $(lldb_mi_branch)"
|
||||
|
||||
# Create a separate build directory for building lldb-mi.
|
||||
log_and_exec_cmd "mkdir build"
|
||||
log_and_exec_cmd "cd build"
|
||||
log_and_exec_cmd "cmake -DCMAKE_PREFIX_PATH=$(Build.StagingDirectory)/buildspace/llvm-inst/ $(lldb_mi_additional_parameters) -GNinja .."
|
||||
log_and_exec_cmd "ninja"
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
echo "##[error] ninja failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/publish"
|
||||
log_and_exec_cmd "cd $(Build.StagingDirectory)/publish"
|
||||
|
||||
log_and_exec_cmd "mkdir -p ./debugAdapters/lldb-mi/bin"
|
||||
|
||||
log_and_exec_cmd "cp $(Build.StagingDirectory)/buildspace/lldb-mi/build/src/lldb-mi ./debugAdapters/lldb-mi/bin/."
|
||||
log_and_exec_cmd "cp $(Build.StagingDirectory)/buildspace/llvm-inst/lib/liblldb.so* ./debugAdapters/lldb-mi/bin/."
|
||||
|
||||
# Grab NOTICE.TXT
|
||||
cp $(Build.SourcesDirectory)/Build/lldb-mi/NOTICE.TXT ./debugAdapters/lldb-mi/.
|
||||
|
||||
# Build can be found at https://dev.azure.com/ms/vscode-cpptools/_build?definitionId=313
|
||||
# Click on the build and select 'Artifacts'
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: 'Publish LLDB-MI'
|
||||
inputs:
|
||||
targetPath: '$(Build.StagingDirectory)/publish'
|
||||
artifactName: 'lldb-mi'
|
||||
@@ -1,4 +1,2 @@
|
||||
gulpfile.js
|
||||
test/**/index.ts
|
||||
test/**/runTest.ts
|
||||
tools/prepublish.js
|
||||
|
||||
@@ -87,7 +87,6 @@ module.exports = {
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"prefer-const": "error",
|
||||
"prefer-object-spread": "error",
|
||||
"space-in-parens": [
|
||||
"error",
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# C/C++ for Visual Studio Code Change Log
|
||||
|
||||
## 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)
|
||||
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"neplatná hodnota cannot-redefine",
|
||||
"duplicitní modifikátor funkce",
|
||||
"neplatný znak pro literál char16_t",
|
||||
null,
|
||||
"__LPREFIX se nedá použít u literálů char8_t, char16_t nebo char32_t.",
|
||||
"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 se může vyskytovat jen jedna z těchto možností: constexpr, consteval a constinit",
|
||||
"V deklaraci nemůžou být současně constexpr i consteval.",
|
||||
"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í nastavený jako výchozí musí být členem třídy, na kterou se vztahuje, nebo pro ni musí být nastavený jako friend.",
|
||||
"Operátor porovnání se dá nastavit na výchozí hodnotu jen v definici třídy.",
|
||||
"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,8 +3233,6 @@
|
||||
"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.",
|
||||
@@ -3244,7 +3242,7 @@
|
||||
"Atomické omezení není konstanta.",
|
||||
"Hodnota atomického omezení se vyhodnotí jako false.",
|
||||
"Omezení šablony není splněné.",
|
||||
"V tomto oboru se definice konceptu nemůže vyskytovat.",
|
||||
"Definice koncepce se nemůže vyskytovat v tomto oboru.",
|
||||
"Neplatná změna deklarace %nd",
|
||||
"Nepodařilo se nahradit argumenty pro concept-id.",
|
||||
"Koncept je false.",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"Šablona konceptu",
|
||||
"Klauzule requires není kompatibilní s %nfd.",
|
||||
"Očekával se atribut.",
|
||||
null,
|
||||
"Neplatný začátek požadavku",
|
||||
"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.",
|
||||
@@ -3276,14 +3274,14 @@
|
||||
"Soubor modulu",
|
||||
"Nepodařilo se najít soubor modulu pro modul %sq.",
|
||||
"Soubor modulu %sq se nepovedlo naimportovat.",
|
||||
"Očekávalo se %s1, ale našlo se %s2.",
|
||||
"Očekával se soubor modulu %s1, ale našel se soubor modulu %s2.",
|
||||
"Při otevírání souboru modulu %sq",
|
||||
"Neznámý název oddílu %sq",
|
||||
"neznámý soubor modulu",
|
||||
"soubor modulu s importovatelnou hlavičkou",
|
||||
"soubor modulu EDG",
|
||||
"soubor modulu IFC",
|
||||
"neočekávaný soubor modulu",
|
||||
"Neznámé",
|
||||
"Importovatelné záhlaví",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"Neočekávané",
|
||||
"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.",
|
||||
@@ -3299,27 +3297,5 @@
|
||||
"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í.",
|
||||
"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)."
|
||||
"Výchozí funkce pro porovnání constexpr volá funkci %nd, která constexpr není."
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"Ungültiger Wert für Neudefinitionsfehler.",
|
||||
"Doppelter Funktionsmodifizierer.",
|
||||
"Ungültiges Zeichen für char16_t-Literal.",
|
||||
null,
|
||||
"__LPREFIX kann nicht auf char8_t-, char16_t- oder char32_t-Literale angewendet werden.",
|
||||
"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",
|
||||
"portierbare Assembly",
|
||||
"übertragbare 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.",
|
||||
"In einer Deklaration kann nur einer der Werte \"constexpr\", \"consteval\" und \"constinit\" verwendet werden.",
|
||||
"\"constexpr\" und \"consteval\" können in einer Deklaration nicht zugleich auftreten.",
|
||||
"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 auf den Standardwert festgelegter Vergleichsoperator muss ein Member oder Friend der Klasse sein, auf die er angewendet wird.",
|
||||
"Ein Vergleichsoperator kann nur in einer Klassendefinition standardmäßig verwendet werden.",
|
||||
"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,8 +3233,6 @@
|
||||
"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.",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"Konzeptvorlage",
|
||||
"Die requires-Klausel ist nicht mit \"%nfd\" kompatibel.",
|
||||
"Es wurde ein Attribut erwartet.",
|
||||
null,
|
||||
"Ungültiger Start der Anforderung.",
|
||||
"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.",
|
||||
@@ -3276,14 +3274,14 @@
|
||||
"Moduldatei",
|
||||
"Die Moduldatei für das Modul \"%sq\" wurde nicht gefunden.",
|
||||
"Die Moduldatei \"%sq\" konnte nicht importiert werden.",
|
||||
"Erwartet wurde \"%s1\", stattdessen gefunden: \"%s2\".",
|
||||
"Es wurde die Moduldatei \"%s1\" erwartet, stattdessen wurde die Moduldatei \"%s2\" gefunden.",
|
||||
"beim Öffnen der Moduldatei \"%sq\"",
|
||||
"Unbekannter Partitionsname \"%sq\".",
|
||||
"Unbekannte Moduldatei",
|
||||
"Importierbare Headermoduldatei",
|
||||
"EDG-Moduldatei",
|
||||
"IFC-Moduldatei",
|
||||
"Unerwartete Moduldatei",
|
||||
"unbekanntes Element",
|
||||
"importierbarer Header",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"unerwartetes Element",
|
||||
"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.",
|
||||
@@ -3299,27 +3297,5 @@
|
||||
"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.",
|
||||
"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."
|
||||
"Die constexpr-Standardvergleichsfunktion ruft die Nicht-constexpr-Funktion \"%nd\" auf."
|
||||
]
|
||||
@@ -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",
|
||||
null,
|
||||
"__LPREFIX no se puede aplicar a los literales char8_t, char16_t o char32_t",
|
||||
"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 portable",
|
||||
"ensamblado portátil",
|
||||
"'%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",
|
||||
"solo puede aparecer uno de los elementos \"constexpr\", \"consteval\" y \"constinit'' en una declaración",
|
||||
"\"constexpr\" y \"consteval\" no pueden aparecer simultáneamente 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",
|
||||
"un operador de comparación predeterminado debe ser un miembro o un elemento de confianza de la clase a la que se aplica",
|
||||
"a un operador de comparación solo se le puede asignar un valor predeterminado en una definición de clase",
|
||||
"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,8 +3233,6 @@
|
||||
"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",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"plantilla de concepto",
|
||||
"la cláusula requires es incompatible con %nfd",
|
||||
"se esperaba un atributo",
|
||||
null,
|
||||
"inicio no válido del requisito",
|
||||
"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",
|
||||
@@ -3276,14 +3274,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 %s1, pero se encontró %s2 en su lugar",
|
||||
"se esperaba el archivo de módulo %s1, pero se encontró el archivo de módulo %s2 en su lugar",
|
||||
"al abrir el archivo de módulo %sq",
|
||||
"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",
|
||||
"nombre de partición %sq desconocida",
|
||||
"desconocido",
|
||||
"encabezado importable",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"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",
|
||||
@@ -3299,27 +3297,5 @@
|
||||
"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 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)"
|
||||
"la función de comparación constexpr predeterminada llama a una función %nd que no es constexpr"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"valeur cannot-redefine non valide",
|
||||
"modificateur de fonction dupliqué",
|
||||
"caractère non valide pour le littéral char16_t",
|
||||
null,
|
||||
"Impossible d'appliquer __LPREFIX aux littéraux char8_t, char16_t ou char32_t",
|
||||
"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",
|
||||
"seule une instance de 'constexpr', 'consteval' et 'constinit' peut apparaître dans une déclaration",
|
||||
"'constexpr' et 'consteval' ne peuvent pas apparaître tous les deux 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 par défaut doit être membre ou ami de la classe à laquelle il s'applique",
|
||||
"un opérateur de comparaison peut uniquement être utilisé par défaut dans une définition de classe",
|
||||
"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,8 +3233,6 @@
|
||||
"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",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"modèle de concept",
|
||||
"clause requires incompatible avec %nfd",
|
||||
"attribut attendu",
|
||||
null,
|
||||
"début d'exigence non valide",
|
||||
"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",
|
||||
@@ -3276,14 +3274,14 @@
|
||||
"fichier de module",
|
||||
"fichier de module introuvable pour le module %sq",
|
||||
"impossible d'importer le fichier de module %sq",
|
||||
"%s1 attendu, %s2 trouvé à la place",
|
||||
"fichier de module %s1 attendu, fichier de module %s2 trouvé à la place",
|
||||
"à l'ouverture du fichier de module %sq",
|
||||
"nom de partition inconnu %sq",
|
||||
"fichier de module inconnu",
|
||||
"fichier de module d'en-tête importable",
|
||||
"fichier de module EDG",
|
||||
"fichier de module IFC",
|
||||
"fichier de module inattendu",
|
||||
"inconnu",
|
||||
"en-tête importable",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"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",
|
||||
@@ -3299,27 +3297,5 @@
|
||||
"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 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)"
|
||||
"la fonction de comparaison constexpr par défaut appelle la fonction non constexpr %nd"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"valore di Impossibile ridefinire non valido",
|
||||
"modificatore di funzione duplicato",
|
||||
"carattere non valido per il valore letterale char16_t",
|
||||
null,
|
||||
"non è possibile applicare __LPREFIX al valore letterale char8_t, char16_t o char32_t",
|
||||
"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 portabile",
|
||||
"assembly portatile",
|
||||
"'%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 può contenere solo una tra le variabili 'constexpr', 'consteval' e 'constinit'",
|
||||
"una dichiarazione non può contenere sia 'constexpr' che 'consteval'",
|
||||
"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",
|
||||
"l'operatore di confronto impostato come predefinito deve essere un membro o un elemento friend della classe a cui si applica",
|
||||
"un operatore di confronto può essere impostato come predefinito solo in una definizione di classe",
|
||||
"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,8 +3233,6 @@
|
||||
"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",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"modello di concetto",
|
||||
"la clausola requires non è compatibile con %nfd",
|
||||
"è previsto un attributo",
|
||||
null,
|
||||
"l'inizio del requisito non è valido",
|
||||
"è 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",
|
||||
@@ -3276,14 +3274,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 %s1, ma è stato trovato %s2",
|
||||
"è previsto il file di modulo %s1, ma è stato trovato il file di modulo %s2",
|
||||
"durante l'apertura del file di modulo %sq",
|
||||
"il nome di partizione %sq è sconosciuto",
|
||||
"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",
|
||||
"sconosciuto",
|
||||
"intestazione importabile",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"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",
|
||||
@@ -3299,27 +3297,5 @@
|
||||
"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",
|
||||
"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)"
|
||||
"la funzione di confronto constexpr predefinita chiama la funzione non constexpr %nd"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"再定義できない無効な値です",
|
||||
"関数修飾子が重複しています",
|
||||
"char16_t リテラルには無効な文字です",
|
||||
null,
|
||||
"__LPREFIX は char8_t、char16_t、または char32_t リテラルに適用できません",
|
||||
"呼び出し規約 %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'、および 'constinit'のうちの 1 つのみです",
|
||||
"宣言で 'constexpr' および 'consteval' の両方を使用することはできません",
|
||||
"このモードでは、関数に consteval と virtual の両方を指定することはできません",
|
||||
"明示的なインスタンス化ディレクティブでは 'consteval' を使用できません",
|
||||
"ここでは 'consteval' は無効です",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"'internal_linkage' 属性は、前の宣言では使用されませんでした",
|
||||
"%n の有効なテンプレート引数演繹候補が見つかりませんでした",
|
||||
"完全修飾コンストラクターの呼び出しは許可されていません",
|
||||
"既定の比較演算子は、適用先のクラスのメンバーまたはフレンドでなければなりません。",
|
||||
"比較演算子は、クラス定義でのみ既定値にすることができます",
|
||||
"既定の比較演算子のパラメーターの型 %t が正しくありません ('const X' への参照でなければなりません。X は、囲むクラスの型です)",
|
||||
"既定の比較演算子の戻り値の型は 'bool' である必要があります",
|
||||
"既定のメンバー比較演算子は 'const' である必要があります",
|
||||
@@ -3233,8 +3233,6 @@
|
||||
"co_await は範囲ベースの for ステートメントにのみ適用できます",
|
||||
"範囲ベースの 'for' ループの範囲の種類を推測できません",
|
||||
"インライン変数は C++17 の機能です",
|
||||
"destroying operator delete には、最初のパラメーターとして %t が必要です",
|
||||
"destroying operator delete に、std::size_t および std::align_val_t 以外のパラメーターを指定することはできません",
|
||||
"緩和された抽象クラス オプションは C++ をコンパイルするときにのみ使用できます",
|
||||
"requires 句の式の先頭が無効です",
|
||||
"requires 句内のキャスト式はかっこで囲む必要があります",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"コンセプト テンプレート",
|
||||
"requires 句は %nfd と互換性がありません",
|
||||
"属性が必要です",
|
||||
null,
|
||||
"要件の開始が無効です",
|
||||
"型名が必要です",
|
||||
"requires 式では省略記号パラメーターは許可されていません",
|
||||
"requires 式に名前のないパラメーターを指定しても効果がありません",
|
||||
@@ -3276,14 +3274,14 @@
|
||||
"モジュール ファイル",
|
||||
"モジュール %sq のモジュール ファイルが見つかりませんでした",
|
||||
"モジュール ファイル %sq をインポートできませんでした",
|
||||
"%s1 が必要ですが、%s2 が見つかりました",
|
||||
"%s1 モジュール ファイルが必要ですが、%s2 モジュール ファイルが見つかりました",
|
||||
"モジュール ファイル %sq を開くとき",
|
||||
"不明なパーティション名 %sq",
|
||||
"不明なモジュール ファイル",
|
||||
"インポート可能なヘッダー モジュール ファイル",
|
||||
"EDG モジュール ファイル",
|
||||
"IFC モジュール ファイル",
|
||||
"予期しないモジュール ファイル",
|
||||
"不明",
|
||||
"インポート可能なヘッダー",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"予期しない",
|
||||
"第 2 オペランド %t2 の型は、%t1 と同じサイズである必要があります",
|
||||
"型は普通にコピー可能である必要があります",
|
||||
"型 %t は、現在、__builtin_bit_cast の constexpr 評価ではサポートされていません",
|
||||
@@ -3299,27 +3297,5 @@
|
||||
"この演算子はこの時点では許可されていません。先行する新しい式をかっこで囲んでください",
|
||||
"概念が正しく使用されていません",
|
||||
"既定のメンバー比較演算子を '&&' で修飾することはできません",
|
||||
"既定の constexpr 比較関数は、constexpr ではない関数 %nd を呼び出します",
|
||||
"constexpr のメモリ比較は、トップレベルの整数または整数の配列オブジェクトでのみサポートされています",
|
||||
"概念テンプレートに関連する制約を持たせることはできません",
|
||||
"[エクスポート] は許可されていません",
|
||||
"個別のクラス メンバーのエクスポートは許可されていません",
|
||||
"エクスポートされた宣言は名前を導入する必要があります",
|
||||
"エクスポート宣言にエクスポート宣言を含めることはできません (前の宣言 %p)",
|
||||
"エクスポート宣言にモジュール インポート宣言を含めることはできません",
|
||||
"エクスポート宣言はモジュール インターフェイス ユニットでのみ使用できます",
|
||||
"エクスポート宣言では、内部リンケージを含む名前をエクスポートできません",
|
||||
"using 宣言には %nfd が含まれます",
|
||||
"fp16 の浮動小数点型がサポートされていないので、ビルトイン関数を使用できません(__F)",
|
||||
"requires 式には少なくとも 1 つの要件を指定する必要があります",
|
||||
"ここでは 'constinit' は無効です",
|
||||
"'constinit' は、静的またはスレッド ストレージ存続期間を持つ変数の宣言にのみ有効です",
|
||||
"constinit 変数には動的な初期化が必要です",
|
||||
"変数は、以前に 'constinit' %p で宣言されました",
|
||||
"プロトタイプ以外の関数宣言子の使用",
|
||||
"引数に const 修飾型を指定することはできません",
|
||||
"不完全な型 %t のメンバーへのポインターは使用できません",
|
||||
"初期化キャプチャのパック展開はこのモードでは有効ではありません",
|
||||
"初期化キャプチャのパック展開は C++20 の機能です",
|
||||
"クラス定義で既定値にされた比較演算子は、その比較演算子の最初の宣言でなければなりません (%nd)"
|
||||
"既定の constexpr 比較関数は、constexpr ではない関数 %nd を呼び出します"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"다시 정의할 수 없는 값이 잘못되었습니다.",
|
||||
"중복된 함수 한정자",
|
||||
"char16_t 리터럴에 대한 잘못된 문자",
|
||||
null,
|
||||
"__LPREFIX를 char8_t, char16_t 또는 char32_t 리터럴에 적용할 수 없습니다.",
|
||||
"인식할 수 없는 호출 규칙 %s, 다음 중 하나여야 함:",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"*this 캡처는 이 모드에서 표준이 아닙니다.",
|
||||
"C++17 스타일 'using' 특성 접두사는 이 모드에서 표준이 아닙니다.",
|
||||
"C++17 스타일 중첩 네임스페이스는 이 모드에서 표준이 아닙니다.",
|
||||
"선언에 'constexpr', 'consteval' 및 'constinit' 중 하나만 나타날 수 있습니다.",
|
||||
"'constexpr' 및 'consteval'을 둘 다 한 선언에서 사용할 수는 없습니다.",
|
||||
"이 모드에서 함수가 동시에 consteval 및 virtual일 수는 없습니다.",
|
||||
"'consteval'은 명시적 인스턴스화 지시문에서 사용할 수 없습니다.",
|
||||
"'consteval'은 여기에 유효하지 않습니다.",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"'internal_linkage' 특성이 이전 선언에 나타나지 않았습니다.",
|
||||
"%n에 대한 실행 가능한 템플릿 인수 추론 후보를 찾을 수 없음",
|
||||
"정규화된 생성자 호출은 허용되지 않습니다.",
|
||||
"기본 비교 연산자는 적용되는 클래스의 멤버 또는 friend여야 합니다.",
|
||||
"비교 연산자는 클래스 정의에서 기본값으로만 사용할 수 있습니다.",
|
||||
"기본 비교 연산자의 매개 변수에 대한 잘못된 형식 %t('const X에 대한 참조'여야 함, 여기서 X는 바깥쪽 클래스 형식임)",
|
||||
"기본 비교 연산자의 반환 형식은 'bool'이어야 합니다.",
|
||||
"기본 멤버 비교 연산자는 'cost'여야 합니다.",
|
||||
@@ -3233,8 +3233,6 @@
|
||||
"co_await는 범위 기반의 for 문에만 적용할 수 있습니다.",
|
||||
"범위 기반의 'for' 루프에서 범위 형식을 추론할 수 없습니다.",
|
||||
"인라인 변수는 C++17 기능입니다.",
|
||||
"destroying operator delete에는 첫 번째 매개 변수로 %t이(가) 필요합니다.",
|
||||
"destroying operator delete는 std::size_t 및 std::align_val_t 이외의 매개 변수를 가질 수 없습니다.",
|
||||
"낮은 수준의 추상 클래스 옵션은 C++를 컴파일할 경우에만 사용할 수 있습니다.",
|
||||
"requires 절에서 식의 시작이 잘못되었습니다.",
|
||||
"requires 절의 캐스트 식은 괄호로 묶어야 합니다.",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"개념 템플릿",
|
||||
"requires 절이 %nfd과(와) 호환되지 않습니다.",
|
||||
"특성이 필요합니다.",
|
||||
null,
|
||||
"요구 사항의 시작이 잘못되었습니다.",
|
||||
"형식 이름이 필요합니다.",
|
||||
"requires 식에는 가변 매개 변수(...)를 사용할 수 없습니다.",
|
||||
"requires 식의 명명되지 않은 매개 변수는 영향을 주지 않습니다.",
|
||||
@@ -3276,14 +3274,14 @@
|
||||
"모듈 파일",
|
||||
"모듈 %sq의 모듈 파일을 찾을 수 없습니다.",
|
||||
"모듈 파일 %sq을(를) 가져올 수 없습니다.",
|
||||
"%s1이(가) 필요한데, %s2이(가) 발견되었습니다.",
|
||||
"%s1 모듈 파일이 필요한데 %s2 모듈 파일이 발견되었습니다.",
|
||||
"%sq 모듈 파일을 열 때",
|
||||
"알 수 없는 파티션 이름 %sq",
|
||||
"알 수 없는 모듈 파일",
|
||||
"가져올 수 있는 헤더 모듈 파일",
|
||||
"EDG 모듈 파일",
|
||||
"IFC 모듈 파일",
|
||||
"예기치 않은 모듈 파일",
|
||||
"알 수 없음",
|
||||
"가져올 수 있는 헤더",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"예기치 않음",
|
||||
"두 번째 피연산자 %t2의 형식은 %t1과(와) 크기가 같아야 합니다.",
|
||||
"형식은 일반적으로 복사할 수 있어야 합니다.",
|
||||
"%t 형식은 현재 __builtin_bit_cast의 constexpr 평가에서 지원되지 않습니다.",
|
||||
@@ -3295,31 +3293,9 @@
|
||||
"생성자를 상속하기 위해 %t의 하위 개체를 생성할 수 없습니다. 암시적 기본 생성자가 삭제됩니다.",
|
||||
"%n은(는) void를 반환해야 합니다.",
|
||||
"잘못된 멤버 선언 시작",
|
||||
"'auto'가 필요합니다.",
|
||||
"'자동' 필요",
|
||||
"이 시점에 이 연산자를 사용할 수 없습니다. 앞의 새 식을 괄호로 묶으세요.",
|
||||
"잘못된 개념 사용",
|
||||
"기본 멤버 비교 연산자는 '&&'-qualified일 수 없습니다.",
|
||||
"기본 constexpr 비교 함수에서 비 constexpr 함수 %nd 호출",
|
||||
"constexpr 메모리 비교는 최상위 정수 또는 정수 배열 개체에 대해서만 지원됩니다.",
|
||||
"개념 템플릿에는 관련된 제약 조건이 있을 수 없습니다.",
|
||||
"'export'는 허용되지 않습니다.",
|
||||
"개별 클래스 멤버를 내보낼 수 없습니다.",
|
||||
"내보낸 선언은 이름이 있어야 합니다.",
|
||||
"내보내기 선언은 내보내기 선언(이전 선언 %p)을 포함할 수 없습니다.",
|
||||
"내보내기 선언은 모듈 가져오기 선언을 포함할 수 없습니다.",
|
||||
"내보내기 선언은 모듈 인터페이스 단위에만 나타날 수 있습니다.",
|
||||
"내보내기 선언은 내부 링크가 있는 이름을 내보낼 수 없습니다.",
|
||||
"using 선언에 %nfd가 포함되어 있습니다.",
|
||||
"__fp16 부동 소수점 형식이 지원되지 않으므로 기본 제공 함수를 사용할 수 없습니다.",
|
||||
"requires 식은 하나 이상의 요구 사항을 지정해야 합니다.",
|
||||
"'constinit'는 여기에 유효하지 않습니다.",
|
||||
"'constinit'는 정적 또는 스레드 저장 기간을 사용하는 변수 선언에만 유효합니다.",
|
||||
"constinit 변수에는 동적 초기화가 필요합니다.",
|
||||
"변수가 이전에 'constinit' %p(으)로 선언되었습니다.",
|
||||
"프로토타입 함수가 아닌 함수 선언자를 사용합니다.",
|
||||
"인수에는 const 한정 형식을 사용할 수 없습니다.",
|
||||
"불완전한 형식 %t의 멤버 포인터는 사용할 수 없습니다.",
|
||||
"init-capture의 팩 확장은 이 모드에서 사용할 수 없습니다.",
|
||||
"init-capture의 팩 확장은 C++20 기능입니다.",
|
||||
"클래스 정의의 기본 비교 연산자는 해당 비교 연산자(%nd)의 첫 번째 선언이어야 합니다."
|
||||
"기본 constexpr 비교 함수에서 비 constexpr 함수 %nd 호출"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"nieprawidłowa wartość flagi cannot-redefine",
|
||||
"zduplikowany modyfikator funkcji",
|
||||
"nieprawidłowy znak dla literału char16_t",
|
||||
null,
|
||||
"Nie można zastosować makra __LPREFIX do literałów char8_t, char16_t ani char32_t",
|
||||
"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",
|
||||
"tylko jeden element „constexpr, „consteval” i „constinit” może występować w deklaracji",
|
||||
"słowa kluczowe „constexpr” i „consteval” nie mogą występować razem 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",
|
||||
"przyjęty domyślnie operator porównania musi być składową lub elementem zaprzyjaźnionym klasy, do której ma zastosowanie",
|
||||
"operator porównania może być tylko domyślny w definicji klasy",
|
||||
"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,8 +3233,6 @@
|
||||
"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",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"szablon koncepcji",
|
||||
"klauzula requires jest niezgodna z elementem %nfd",
|
||||
"oczekiwano atrybutu",
|
||||
null,
|
||||
"nieprawidłowy początek wymagania",
|
||||
"oczekiwano nazwy typu",
|
||||
"parametr wielokropka nie jest dozwolony w wyrażeniu requires",
|
||||
"parametr bez nazwy wyrażeniu requires nie ma żadnego wpływu",
|
||||
@@ -3276,14 +3274,14 @@
|
||||
"plik modułu",
|
||||
"nie można odnaleźć pliku modułu dla modułu %sq",
|
||||
"nie można zaimportować pliku modułu %sq",
|
||||
"oczekiwano elementu %s1, zamiast niego znaleziono element %s2",
|
||||
"oczekiwano pliku modułu %s1, a zamiast tego znaleziono plik modułu %s2",
|
||||
"podczas otwierania pliku modułu %sq",
|
||||
"nieznana nazwa partycji %sq",
|
||||
"nieznany plik modułu",
|
||||
"plik modułu z importowalnym nagłówkiem",
|
||||
"plik modułu EDG",
|
||||
"plik modułu IFC",
|
||||
"nieoczekiwany plik modułu",
|
||||
"nieznany",
|
||||
"nagłówek, który można zaimportować",
|
||||
"element EDG",
|
||||
"obiekt IFC",
|
||||
"nieoczekiwany",
|
||||
"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",
|
||||
@@ -3295,31 +3293,9 @@
|
||||
"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 elementu „auto”",
|
||||
"oczekiwano wartości „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",
|
||||
"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)"
|
||||
"domyślna funkcja porównywania constexpr wywołuje funkcję non-constexpr %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",
|
||||
null,
|
||||
"O __LPREFIX não pode ser aplicado aos literais char8_t, char16_t ou char32_t",
|
||||
"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",
|
||||
"somente uma das opções: 'constexpr', 'consteval' e 'constinit' pode aparecer em uma declaração",
|
||||
"'constexpr' e 'consteval' não podem aparecer juntos 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 usado como padrão precisa ser um membro ou um friend da classe à qual se aplica",
|
||||
"um operador de comparação pode ser usado como padrão somente em uma definição de classe",
|
||||
"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,8 +3233,6 @@
|
||||
"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",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"modelo de conceito",
|
||||
"cláusula requires incompatível com %nfd",
|
||||
"um atributo é esperado",
|
||||
null,
|
||||
"início de requisito inválido",
|
||||
"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",
|
||||
@@ -3276,14 +3274,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",
|
||||
"era esperado %s1, foi encontrado %s2",
|
||||
"o arquivo de módulo %s1 era esperado; em vez dele, foi encontrado o arquivo de módulo %s2",
|
||||
"ao abrir o arquivo de módulo %sq",
|
||||
"nome de partição desconhecido %sq",
|
||||
"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",
|
||||
"um desconhecido",
|
||||
"um cabeçalho importável",
|
||||
"um EDG",
|
||||
"um IFC",
|
||||
"um 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",
|
||||
@@ -3295,31 +3293,9 @@
|
||||
"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' era esperado",
|
||||
"'auto' 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",
|
||||
"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)"
|
||||
"a função de comparação constexpr padrão chama a função não constexpr %nd"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"недопустимое значение cannot-redefine",
|
||||
"повторяющийся модификатор функции",
|
||||
"недопустимый знак для литерала char16_t",
|
||||
null,
|
||||
"__LPREFIX не может применяться к литералам char8_t, char16_t или char32_t",
|
||||
"нераспознанное соглашение о вызовах %s; необходимо использовать одно из следующих:",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"захват значения *this является нестандартным в этом режиме",
|
||||
"Префикс атрибута using в стиле C++17 является нестандартным в этом режиме",
|
||||
"Вложенные пространства имен в стиле C++17 являются нестандартными в этом режиме",
|
||||
"в объявлении может использоваться только одно из ключевых слов \"constexpr\", \"consteval\" и \"constinit\"",
|
||||
"constexpr и consteval не могут присутствовать в объявлении вместе",
|
||||
"в этом режиме функция не может быть consteval и virtual одновременно",
|
||||
"consteval не допускается в директиве явного создания экземпляра",
|
||||
"consteval здесь не допускается",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"атрибут \"internal_linkage\" отсутствует в предыдущем объявлении",
|
||||
"Не найдено подходящего кандидата для дедукции аргумента шаблона для %n.",
|
||||
"полный вызов конструктора не допускается",
|
||||
"оператор сравнения по умолчанию должен быть членом или дружественным классом класса, к которому он применяется",
|
||||
"оператор сравнения можно использовать по умолчанию только в определении класса",
|
||||
"недопустимый тип %t для параметра оператора сравнения по умолчанию (необходимо указать ссылку на константу X, где X — тип включающего класса)",
|
||||
"необходимо использовать возвращаемый тип оператора сравнения по умолчанию \"bool\"",
|
||||
"необходимо использовать оператор сравнения элемента по умолчанию \"const\"",
|
||||
@@ -3233,8 +3233,6 @@
|
||||
"co_await можно применить только к оператору for на основе диапазонов.",
|
||||
"Невозможно вывести тип диапазона в цикле for на основе диапазона.",
|
||||
"встроенные переменные — это функция C++17",
|
||||
"для оператора удаления delete необходимо указать %t в качестве первого параметра",
|
||||
"оператор удаления delete не может иметь параметров, типы которых отличаются от std::size_t и std::align_val_t",
|
||||
"Нестрогие параметры абстрактного класса можно использовать только при компиляции C++.",
|
||||
"Недопустимое начало выражения в предложении requires",
|
||||
"Выражение приведения в предложении requires должно быть заключено в круглые скобки",
|
||||
@@ -3247,12 +3245,12 @@
|
||||
"Определение концепции не может находиться в этой области",
|
||||
"Недопустимое повторное объявление %nd",
|
||||
"Не удалось подставить аргументы для идентификатора концепции",
|
||||
"концепция имеет значение false",
|
||||
"Концепция имеет значение false",
|
||||
"Использование здесь предложения requires запрещено (не шаблонная функция)",
|
||||
"шаблон концепции",
|
||||
"Шаблон концепции",
|
||||
"Предложение requires несовместимо с %nfd",
|
||||
"ожидается атрибут",
|
||||
null,
|
||||
"требуется атрибут",
|
||||
"Недопустимое начало требования",
|
||||
"Требуется имя типа",
|
||||
"Использование параметра-многоточия в выражении requires запрещено",
|
||||
"Неименованный параметр в выражении requires не оказывает никакого влияния",
|
||||
@@ -3276,14 +3274,14 @@
|
||||
"файл модуля",
|
||||
"не удалось найти файл модуля для модуля %sq",
|
||||
"не удалось импортировать файл модуля %sq",
|
||||
"ожидалось \"%s1\", но было использовано \"%s2\"",
|
||||
"Ожидался файл модуля %s1, вместо него обнаружен файл модуля %s2",
|
||||
"При открытии файла модуля %sq",
|
||||
"Неизвестное имя раздела %sq",
|
||||
"неизвестный файл модуля",
|
||||
"импортируемый файл модуля заголовка",
|
||||
"файл модуля EDG",
|
||||
"файл модуля IFC",
|
||||
"непредвиденный файл модуля",
|
||||
"неизвестный",
|
||||
"Пригодный для импорта заголовок",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"непредвиденный",
|
||||
"тип второго операнда %t2 должен иметь тот же размер, что и %t1.",
|
||||
"тип должен поддерживать элементарное копирование.",
|
||||
"тип %t сейчас не поддерживается в вычислении constexpr для __builtin_bit_cast.",
|
||||
@@ -3295,31 +3293,9 @@
|
||||
"невозможно выполнить конструирование подобъекта %t для наследования конструкторов — неявный конструктор по умолчанию удален.",
|
||||
"%n требует возврата void.",
|
||||
"недопустимое начало объявления элемента",
|
||||
"ожидается \"auto\"",
|
||||
"требуется \"auto\"",
|
||||
"этот оператор не может использоваться в этом месте; заключите предыдущее выражение new в скобки",
|
||||
"недопустимое использование концепции",
|
||||
"оператор сравнения элемента по умолчанию не может быть квалифицирован как \"&&\"",
|
||||
"функция сравнения constexpr по умолчанию вызывает функцию %nd, не являющуюся constexpr",
|
||||
"Сравнение памяти с помощью constexpr поддерживается только для целочисленных объектов верхнего уровня или массивов целых чисел",
|
||||
"шаблон концепции не может иметь связанные ограничения",
|
||||
"использование \"export\" запрещено",
|
||||
"экспорт отдельных членов класса запрещен",
|
||||
"экспортированное объявление должно представлять имя",
|
||||
"объявление экспорта не может содержать объявление экспорта (предыдущее объявление %p)",
|
||||
"объявление экспорта не может содержать объявление импорта модуля",
|
||||
"объявление экспорта может находиться только в блоке интерфейса модуля",
|
||||
"объявление экспорта не может экспортировать имя с внутренней компоновкой",
|
||||
"объявление using включает %nfd",
|
||||
"встроенная функция недоступна, так как типы с плавающей запятой __fp16 не поддерживаются",
|
||||
"в выражении requires должно быть указано по крайней мере одно требование",
|
||||
"\"constinit\" не может использоваться здесь",
|
||||
"\"constinit\" может использоваться только для объявлений переменных со сроком хранения в статическом или потоковом хранилище",
|
||||
"для переменной constinit требуется динамическая инициализация",
|
||||
"переменная ранее была объявлена с \"constinit\" %p",
|
||||
"использование объявления функции, не являющегося прототипом",
|
||||
"аргумент не может иметь тип, квалифицированный как const",
|
||||
"недопустимый указатель на член неполного типа %t",
|
||||
"расширение пакета в init-capture не включено в этом режиме",
|
||||
"расширение пакета в init-capture — это функция C++ 20",
|
||||
"оператор сравнения по умолчанию в определении класса должен быть первым объявлением этого оператора сравнения (%nd)"
|
||||
"функция сравнения constexpr по умолчанию вызывает функцию %nd, не являющуюся constexpr"
|
||||
]
|
||||
@@ -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",
|
||||
null,
|
||||
"__LPREFIX, char8_t, char16_t veya char32_t sabit değerlerine uygulanamıyor",
|
||||
"ç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ışı",
|
||||
"bir bildirimde yalnızca bir 'constexpr', 'consteval' ve 'constinit' görünebilir",
|
||||
"'constexpr' ve 'consteval' bir bildirimde birlikte bulunamaz",
|
||||
"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",
|
||||
"varsayılan olarak kullanılan karşılaştırma işleci, uygulandığı sınıfın bir üyesi veya arkadaşı olmalıdır",
|
||||
"karşılaştırma işleci yalnızca sınıf tanımında varsayılan olarak ayarlanabilir",
|
||||
"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,8 +3233,6 @@
|
||||
"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",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"kavram şablonu",
|
||||
"requires yan tümcesi %nfd ile uyumsuz",
|
||||
"öznitelik bekleniyordu",
|
||||
null,
|
||||
"geçersiz gereksinim başlangıcı",
|
||||
"tür adı bekleniyordu",
|
||||
"requires ifadesinde üç nokta parametresine izin verilmez",
|
||||
"requires ifadesindeki adlandırılmamış parametrenin etkisi yok",
|
||||
@@ -3276,50 +3274,28 @@
|
||||
"modül dosyası",
|
||||
"%sq modülü için modül dosyası bulunamadı",
|
||||
"%sq modül dosyası içeri aktarılamadı",
|
||||
"%s1 bekleniyordu ancak bunun yerine %s2 bulundu",
|
||||
"%s1 modül dosyası bekleniyordu ancak bunun yerine %s2 modül dosyası bulundu",
|
||||
"%sq modül dosyası açılırken",
|
||||
"%sq bölüm adı bilinmiyor",
|
||||
"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ı",
|
||||
"bilinmeyen",
|
||||
"İçeri aktarılabilen üst bilgi",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"beklenmeyen",
|
||||
"%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 %t türü birleşim, işaretçi veya üye işaretçisi __builtin_bit_cast constexpr değerlendirmesine engel oluyor",
|
||||
"bir Union, işaretçi veya üye işaretçisi türü %t __builtin_bit_cast constexpr değerlendirmesine engel olur",
|
||||
"%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' bekleniyordu",
|
||||
"'auto' bekleniyor",
|
||||
"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",
|
||||
"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)"
|
||||
"varsayılan constexpr karşılaştırma işlevi constexpr olmayan %nd işlevini çağırıyor"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"cannot-redefine 值无效",
|
||||
"重复的函数修饰符",
|
||||
"char16_t 文本的无效字符",
|
||||
null,
|
||||
"__LPREFIX 不可应用于 char8_t、char16_t 或 char32_t 文本",
|
||||
"无法识别的调用约定 %s,必须为以下内容之一:",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"正在捕获 *这在此模式中是非标准的",
|
||||
"C++17 样式 \"using\" 属性前缀在此模式中是非标准的",
|
||||
"C++17 样式嵌套命名空间在此模式中是非标准的",
|
||||
"声明中只能出现 \"constexpr\"、\"consteval\" 和 \"constinit\" 中的一个",
|
||||
"\"constexpr\" 和 \"consteval\" 不能同时出现在声明中",
|
||||
"在此模式下,函数不能同时为 consteval 和 virtual",
|
||||
"不允许对显式实例化指令使用 \"consteval\"",
|
||||
"\"consteval\" 在此处无效",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"\"internal_linkage\" 属性未出现在之前的声明中",
|
||||
"未找到 %n 的可行模板参数推导候选项",
|
||||
"不允许使用完全限定的构造函数调用",
|
||||
"默认比较运算符必须是它适用于的类的成员或友元",
|
||||
"仅可在类定义中将比较运算符设为默认值",
|
||||
"默认比较运算符的参数的类型 %t 不正确(必须是“对 const X 的引用”,其中 X 是封闭类类型)",
|
||||
"默认比较运算符的返回类型必须是 \"bool\"",
|
||||
"默认成员比较运算符必须为 \"const\"",
|
||||
@@ -3233,8 +3233,6 @@
|
||||
"co_await 只能应用到基于范围的 for 语句",
|
||||
"无法在基于范围的 \"for\" 循环中推断范围类型",
|
||||
"内联变量是 C++17 功能",
|
||||
"销毁运算符 delete 需要 %t 作为第一个参数",
|
||||
"销毁运算符 delete 不能具有 std::size_t 和 std::align_val_t 以外的参数",
|
||||
"宽松抽象类选项只能在编译 C++ 时使用",
|
||||
"requires 子句中表达式的开头无效",
|
||||
"requires 子句中的强制转换表达式必须放在括号中",
|
||||
@@ -3252,7 +3250,7 @@
|
||||
"概念模板",
|
||||
"requires 子句与 %nfd 不兼容",
|
||||
"预期特性",
|
||||
null,
|
||||
"要求的开头无效",
|
||||
"预期类型名称",
|
||||
"requires 表达式中不允许使用省略号参数",
|
||||
"requires 表达式中未命名的参数不起任何作用",
|
||||
@@ -3276,18 +3274,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 计算",
|
||||
@@ -3299,27 +3297,5 @@
|
||||
"此位置不允许使用此运算符;请前面的新表达式括起来",
|
||||
"概念的使用无效",
|
||||
"默认成员比较运算符不能是 \"&&\" 限定",
|
||||
"默认的 constexpr 比较函数会调用非 constexpr 函数 %nd",
|
||||
"只有顶级整数或数组整数对象支持 constexpr 内存比较",
|
||||
"概念模板不能具有关联约束",
|
||||
"不允许使用 \"export\"",
|
||||
"不允许导出单个类成员",
|
||||
"导出的声明必须引入名称",
|
||||
"导出声明不能包含导出声明(以前的声明 %p)",
|
||||
"导出声明不能包含模块导入声明",
|
||||
"导出声明只能出现在模块接口单元中",
|
||||
"导出声明无法导出具有内部链接的名称",
|
||||
"using 声明包括 %nfd",
|
||||
"内置函数不可用,因为不支持 __fp16 浮点类型",
|
||||
"requires 表达式必须指定至少一个要求",
|
||||
"\"constinit\" 在此处无效",
|
||||
"\"constinit\" 仅对具有静态或线程存储持续时间的变量的声明有效",
|
||||
"constinit 变量需要动态初始化",
|
||||
"以前使用 \"constinit\" %p 声明了变量",
|
||||
"使用非原型函数声明符",
|
||||
"参数不能具有常量限定类型",
|
||||
"不允许使用不完整类型 %t 的指向成员的指针",
|
||||
"此模式下未启用 init-capture 中的包扩展",
|
||||
"init-capture 中的包扩展是 C++ 20 功能",
|
||||
"类定义中默认的比较运算符必须是该比较运算符的第一个声明(%nd)"
|
||||
"默认的 constexpr 比较函数会调用非 constexpr 函数 %nd"
|
||||
]
|
||||
@@ -1535,7 +1535,7 @@
|
||||
"無法重新定義的值無效",
|
||||
"函式修飾元重複",
|
||||
"char16_t literal 的字元無效",
|
||||
null,
|
||||
"__LPREFIX 無法套用至 char8_t、char16_t 或 char32_t 常值",
|
||||
"無法辨認的呼叫慣例 %s,必須是下列其中一個: ",
|
||||
null,
|
||||
null,
|
||||
@@ -3122,7 +3122,7 @@
|
||||
"在此模式中擷取 *這個不是標準用法",
|
||||
"在此模式中 C++17 樣式的 'using' 屬性前置詞不是標準用法",
|
||||
"在此模式中 C++17 樣式的巢狀命名空間不是標準用法",
|
||||
"只有 'constexpr'、'consteval' 或 'constinit' 其中之一可以出現宣告上",
|
||||
"'constexpr' 和 'consteval' 不能同時出現在宣告中",
|
||||
"在此模式中函式不可同時為 consteval 和 virtual",
|
||||
"明確具現化指示詞中不允許 'consteval'",
|
||||
"'consteval' 在這裡無效",
|
||||
@@ -3166,7 +3166,7 @@
|
||||
"'internal_linkage' 屬性未出現在前一個宣告上",
|
||||
"找不到 %n 的任何可行範本引數推算候選",
|
||||
"不允許完整的建構函式呼叫",
|
||||
"預設比較運算子必須是其所套用之類別的成員或 Friend",
|
||||
"比較運算子只有在類別定義中才能是預設",
|
||||
"預設比較運算子參數的類型 %t 不正確 (必須是 'reference to const X',其中 X 是外層類別類型)",
|
||||
"預設比較運算子的傳回型別必須是 'bool'",
|
||||
"預設的成員比較運算子必須是 'const'",
|
||||
@@ -3233,8 +3233,6 @@
|
||||
"co_await 只能套用至範圍架構 for 陳述式",
|
||||
"無法推算範圍架構 'for' 迴圈中的範圍類型",
|
||||
"內嵌變數為 C++17 功能",
|
||||
"終結運算子 Delete 需要 %t 作為第一個參數",
|
||||
"終結運算子 Delete 不能有除了 std::size_t 與 std::align_val_t 的參數",
|
||||
"寬鬆抽象類別選項只有在編譯 C++ 時才能使用",
|
||||
"requires 子句中運算式的開頭無效",
|
||||
"requires 子句中的 cast 運算式必須以括號括住",
|
||||
@@ -3247,12 +3245,12 @@
|
||||
"概念定義不能出現在此範圍中",
|
||||
"%nd 的重新宣告無效",
|
||||
"概念識別碼的引數替代失敗",
|
||||
"概念為 False",
|
||||
"概念為 false",
|
||||
"此處不允許使用 requires 子句 (非樣板化函式)",
|
||||
"概念範本",
|
||||
"requires 子句與 %nfd 不相容",
|
||||
"必須是屬性",
|
||||
null,
|
||||
"必須為屬性名稱",
|
||||
"需求的開頭無效",
|
||||
"必須為類型名稱",
|
||||
"requires 運算式中不允許使用省略符號參數",
|
||||
"requires 運算式中未命名的參數沒有作用",
|
||||
@@ -3276,14 +3274,14 @@
|
||||
"模組檔案",
|
||||
"找不到模組 %sq 的模組檔案",
|
||||
"無法匯入模組檔案 %sq",
|
||||
"必須為 %s1,但找到 %s2",
|
||||
"必須為 %s1 模組檔案,但找到 %s2 模組檔案",
|
||||
"在開啟模組檔案 %sq 時",
|
||||
"未知的分割名稱 %sq",
|
||||
"未知的模組檔案",
|
||||
"可匯入的標頭模組檔案",
|
||||
"EDG 模組檔案",
|
||||
"IFC 模組檔案",
|
||||
"未預期的模組檔案",
|
||||
"未知的",
|
||||
"可匯入的標頭",
|
||||
"EDG",
|
||||
"IFC",
|
||||
"未預期的",
|
||||
"第二個運算元 %t2 的類型必須與 %t1 的大小相同",
|
||||
"類型必須可以原樣複製",
|
||||
"__builtin_bit_cast 的 constexpr 評估目前不支援類型 %t",
|
||||
@@ -3295,31 +3293,9 @@
|
||||
"無法執行用於繼承建構函式的 %t 子物件建構 -- 已刪除隱含的預設建構函式",
|
||||
"%n 必須傳回 void",
|
||||
"成員宣告開頭無效",
|
||||
"必須是 'auto'",
|
||||
"必須為 'auto'",
|
||||
"目前不允許此運算子; 請以括號括住前面的 new 運算式",
|
||||
"概念使用無效",
|
||||
"預設的成員比較運算子不可限定為 '&&'",
|
||||
"預設 constexpr 比較函式會呼叫非 constexpr 函式 %nd",
|
||||
"只有最上層整數或整數陣列物件支援 constexpr 記憶體比較",
|
||||
"概念範本不能具有已建立關聯的條件約束",
|
||||
"不允許 'export'",
|
||||
"不允許匯出個別類別成員",
|
||||
"匯出的宣告必須引入名稱",
|
||||
"匯出宣告不能包含匯出宣告 (前一個宣告 %p)",
|
||||
"匯出宣告不能包含模組匯入宣告",
|
||||
"匯出宣告只能出現在模組介面單位中",
|
||||
"匯出宣告不能匯出具有內部連結的名稱",
|
||||
"using 宣告包含 %nfd",
|
||||
"因為不支援 __fp16 浮點數類型,所以無法使用內建函式",
|
||||
"Requires 運算式必須至少指定一個需求",
|
||||
"'constinit' 在這裡無效",
|
||||
"'constinit' 只對具有靜態或執行緒儲存期的變數宣告有效",
|
||||
"constinit 變數需要進行動態初始化",
|
||||
"變數先前使用 'constinit' %p 宣告",
|
||||
"使用非原型函式宣告子",
|
||||
"引數不能有常數限定類型",
|
||||
"不允許使用不完整類型 %t 的成員指標",
|
||||
"此模式未啟用 init-capture 中的參數序列展開式",
|
||||
"init-capture 中的參數序列展開式是 C++20 功能",
|
||||
"類別定義中預設的比較運算子,必須為該比較運算子的第一個宣告 (%nd)"
|
||||
"預設 constexpr 比較函式會呼叫非 constexpr 函式 %nd"
|
||||
]
|
||||
@@ -142,16 +142,6 @@
|
||||
}
|
||||
},
|
||||
"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
|
||||
|
||||
+5
-48
@@ -2,7 +2,7 @@
|
||||
"name": "cpptools",
|
||||
"displayName": "C/C++",
|
||||
"description": "C/C++ IntelliSense, debugging, and code browsing.",
|
||||
"version": "0.29.0-master",
|
||||
"version": "0.28.3",
|
||||
"publisher": "ms-vscode",
|
||||
"preview": true,
|
||||
"icon": "LanguageCCPP_color_128x.png",
|
||||
@@ -52,13 +52,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"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",
|
||||
@@ -477,20 +470,6 @@
|
||||
"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,
|
||||
@@ -679,10 +658,6 @@
|
||||
{
|
||||
"type": "cppdbg",
|
||||
"label": "C++ (GDB/LLDB)",
|
||||
"languages": [
|
||||
"c",
|
||||
"cpp"
|
||||
],
|
||||
"variables": {
|
||||
"pickProcess": "extension.pickNativeProcess",
|
||||
"pickRemoteProcess": "extension.pickRemoteNativeProcess"
|
||||
@@ -975,13 +950,6 @@
|
||||
},
|
||||
"description": "%c_cpp.debuggers.pipeTransport.pipeEnv.description%",
|
||||
"default": {}
|
||||
},
|
||||
"quoteArgs": {
|
||||
"exceptions": {
|
||||
"type": "boolean",
|
||||
"description": "%c_cpp.debuggers.logging.quoteArgs.description%",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1168,13 +1136,6 @@
|
||||
},
|
||||
"description": "%c_cpp.debuggers.pipeTransport.pipeEnv.description%",
|
||||
"default": {}
|
||||
},
|
||||
"quoteArgs": {
|
||||
"exceptions": {
|
||||
"type": "boolean",
|
||||
"description": "%c_cpp.debuggers.logging.quoteArgs.description%",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1231,10 +1192,6 @@
|
||||
{
|
||||
"type": "cppvsdbg",
|
||||
"label": "C++ (Windows)",
|
||||
"languages": [
|
||||
"c",
|
||||
"cpp"
|
||||
],
|
||||
"variables": {
|
||||
"pickProcess": "extension.pickNativeProcess"
|
||||
},
|
||||
@@ -1606,7 +1563,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",
|
||||
@@ -1633,7 +1590,7 @@
|
||||
"runtimeDependencies": [
|
||||
{
|
||||
"description": "C/C++ language components (Linux / x86_64)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2131982",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2131174",
|
||||
"platforms": [
|
||||
"linux"
|
||||
],
|
||||
@@ -1647,7 +1604,7 @@
|
||||
},
|
||||
{
|
||||
"description": "C/C++ language components (OS X)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2132316",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2131173",
|
||||
"platforms": [
|
||||
"darwin"
|
||||
],
|
||||
@@ -1658,7 +1615,7 @@
|
||||
},
|
||||
{
|
||||
"description": "C/C++ language components (Windows)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2132317",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2131076",
|
||||
"platforms": [
|
||||
"win32"
|
||||
],
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
"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.",
|
||||
@@ -78,7 +77,6 @@
|
||||
"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.",
|
||||
|
||||
@@ -24,7 +24,7 @@ export class ParsedEnvironmentFile {
|
||||
}
|
||||
|
||||
public static CreateFromFile(envFile: string, initialEnv?: Environment[]): ParsedEnvironmentFile {
|
||||
const content: string = fs.readFileSync(envFile, "utf8");
|
||||
let content: string = fs.readFileSync(envFile, "utf8");
|
||||
return this.CreateFromContent(content, envFile, initialEnv);
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ export class ParsedEnvironmentFile {
|
||||
content = content.substr(1);
|
||||
}
|
||||
|
||||
const parseErrors: string[] = [];
|
||||
const env: Map<string, any> = new Map();
|
||||
let parseErrors: string[] = [];
|
||||
let 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 (const key of env.keys()) {
|
||||
for (let 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) => {
|
||||
const quickPick: vscode.QuickPick<AttachItem> = vscode.window.createQuickPick<AttachItem>();
|
||||
let 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()];
|
||||
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
let 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.")));
|
||||
}
|
||||
|
||||
const selectedId: string | undefined = quickPick.selectedItems[0].id;
|
||||
let 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();
|
||||
|
||||
const pipeTransport: any = config ? config.pipeTransport : undefined;
|
||||
let 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;
|
||||
}
|
||||
|
||||
const pipeArgs: string[] = pipeTransport.pipeArgs;
|
||||
let pipeArgs: string[] = pipeTransport.pipeArgs;
|
||||
|
||||
const argList: string = RemoteAttachPicker.createArgumentList(pipeArgs);
|
||||
let argList: string = RemoteAttachPicker.createArgumentList(pipeArgs);
|
||||
|
||||
const pipeCmd: string = `"${pipeProgram}" ${argList}`;
|
||||
let pipeCmd: string = `"${pipeProgram}" ${argList}`;
|
||||
|
||||
return this.getRemoteOSAndProcesses(pipeCmd)
|
||||
.then(processes => {
|
||||
const attachPickOptions: vscode.QuickPickOptions = {
|
||||
let 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 = `\\\"`;
|
||||
|
||||
const settings: CppSettings = new CppSettings();
|
||||
let 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
|
||||
const lines: string[] = output.split(/\r?\n/);
|
||||
let 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 {
|
||||
const remoteOS: string = lines[0].replace(/[\r\n]+/g, '');
|
||||
let 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 {
|
||||
const processes: string[] = lines.slice(1);
|
||||
let 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;
|
||||
}
|
||||
const aLower: string = a.name.toLowerCase();
|
||||
const bLower: string = b.name.toLowerCase();
|
||||
let aLower: string = a.name.toLowerCase();
|
||||
let 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 (const arg of args) {
|
||||
for (let arg of args) {
|
||||
if (argsString) {
|
||||
argsString += " ";
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export class QuickPickConfigurationProvider implements vscode.DebugConfiguration
|
||||
}
|
||||
|
||||
const items: MenuItem[] = configs.map<MenuItem>(config => {
|
||||
const menuItem: MenuItem = {label: config.name, configuration: config};
|
||||
let 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");
|
||||
@@ -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.
|
||||
const configs: vscode.DebugConfiguration[] = await Promise.all(buildTasks.map<Promise<vscode.DebugConfiguration>>(async task => {
|
||||
let 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);
|
||||
|
||||
const newConfig: vscode.DebugConfiguration = {...defaultConfig}; // Copy enumerables and properties
|
||||
let newConfig: vscode.DebugConfiguration = {...defaultConfig}; // Copy enumerables and properties
|
||||
|
||||
newConfig.name = compilerName + buildAndDebugActiveFileStr();
|
||||
newConfig.preLaunchTask = task.name;
|
||||
@@ -256,7 +256,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
vscode.window.showErrorMessage(LLDBFrameworkMissingMessage, moreInfoButton)
|
||||
.then(value => {
|
||||
if (value === moreInfoButton) {
|
||||
const helpURL: string = "https://aka.ms/vscode-cpptools/LLDBFrameworkNotFound";
|
||||
let helpURL: string = "https://aka.ms/vscode-cpptools/LLDBFrameworkNotFound";
|
||||
vscode.env.openExternal(vscode.Uri.parse(helpURL));
|
||||
}
|
||||
});
|
||||
@@ -272,7 +272,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
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.
|
||||
const searchPaths: string[] = [
|
||||
let searchPaths: string[] = [
|
||||
"/Library/Developer/CommandLineTools/Library/PrivateFrameworks", // XCode CLI
|
||||
"/Applications/Xcode.app/Contents/SharedFrameworks" // App Store XCode
|
||||
];
|
||||
@@ -326,7 +326,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
}
|
||||
|
||||
private resolveSourceFileMapVariables(config: vscode.DebugConfiguration): void {
|
||||
const messages: string[] = [];
|
||||
let messages: string[] = [];
|
||||
if (config.sourceFileMap) {
|
||||
for (const sourceFileMapSource of Object.keys(config.sourceFileMap)) {
|
||||
let message: string = "";
|
||||
@@ -370,9 +370,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") };
|
||||
const result: vscode.MessageItem | undefined = await vscode.window.showWarningMessage(message, openItem);
|
||||
let result: vscode.MessageItem | undefined = await vscode.window.showWarningMessage(message, openItem);
|
||||
if (result && result.title === openItem.title) {
|
||||
const doc: vscode.TextDocument = await vscode.workspace.openTextDocument(fileName);
|
||||
let doc: vscode.TextDocument = await vscode.workspace.openTextDocument(fileName);
|
||||
if (doc) {
|
||||
vscode.window.showTextDocument(doc);
|
||||
}
|
||||
@@ -416,14 +416,14 @@ abstract class DefaultConfigurationProvider implements IConfigurationAssetProvid
|
||||
configurations: IConfiguration[] = [];
|
||||
|
||||
public getInitialConfigurations(debuggerType: DebuggerType): any {
|
||||
const configurationSnippet: IConfigurationSnippet[] = [];
|
||||
let configurationSnippet: IConfigurationSnippet[] = [];
|
||||
|
||||
// Only launch configurations are initial configurations
|
||||
this.configurations.forEach(configuration => {
|
||||
configurationSnippet.push(configuration.GetLaunchConfiguration());
|
||||
});
|
||||
|
||||
const initialConfigurations: any = configurationSnippet.filter(snippet => snippet.debuggerType === debuggerType && snippet.isInitialConfiguration)
|
||||
let 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 +431,7 @@ abstract class DefaultConfigurationProvider implements IConfigurationAssetProvid
|
||||
}
|
||||
|
||||
public getConfigurationSnippets(): vscode.CompletionItem[] {
|
||||
const completionItems: vscode.CompletionItem[] = [];
|
||||
let completionItems: vscode.CompletionItem[] = [];
|
||||
|
||||
this.configurations.forEach(configuration => {
|
||||
completionItems.push(convertConfigurationSnippetToCompetionItem(configuration.GetLaunchConfiguration()));
|
||||
@@ -500,7 +500,7 @@ class LinuxConfigurationProvider extends DefaultConfigurationProvider {
|
||||
}
|
||||
|
||||
function convertConfigurationSnippetToCompetionItem(snippet: IConfigurationSnippet): vscode.CompletionItem {
|
||||
const item: vscode.CompletionItem = new vscode.CompletionItem(snippet.label, vscode.CompletionItemKind.Snippet);
|
||||
let 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 (const arg in args) {
|
||||
for (let 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 {
|
||||
const name: string = `(${this.MIMode}) ${localize("launch.string", "Launch").replace(/\"/g, "\\\"")}`;
|
||||
let name: string = `(${this.MIMode}) ${localize("launch.string", "Launch").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
const body: string = formatString(`{
|
||||
let 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 {
|
||||
const name: string = `(${this.MIMode}) ${localize("attach.string", "Attach").replace(/\"/g, "\\\"")}`;
|
||||
let name: string = `(${this.MIMode}) ${localize("attach.string", "Attach").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
const body: string = formatString(`{
|
||||
let 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 {
|
||||
const name: string = `(${this.MIMode}) ${localize("pipe.launch", "Pipe Launch").replace(/\"/g, "\\\"")}`;
|
||||
let name: string = `(${this.MIMode}) ${localize("pipe.launch", "Pipe Launch").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
const body: string = formatString(`
|
||||
let 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 {
|
||||
const name: string = `(${this.MIMode}) ${localize("pipe.attach", "Pipe Attach").replace(/\"/g, "\\\"")}`;
|
||||
let name: string = `(${this.MIMode}) ${localize("pipe.attach", "Pipe Attach").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
const body: string = formatString(`
|
||||
let 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 {
|
||||
const name: string = `(Windows) ${localize("launch.string", "Launch").replace(/\"/g, "\\\"")}`;
|
||||
let name: string = `(Windows) ${localize("launch.string", "Launch").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
const body: string = `
|
||||
let body: string = `
|
||||
{
|
||||
\t${indentJsonString(createLaunchString(name, this.windowsDebugger, this.executable))}
|
||||
}`;
|
||||
@@ -204,9 +204,9 @@ export class WindowsConfigurations extends Configuration {
|
||||
}
|
||||
|
||||
public GetAttachConfiguration(): IConfigurationSnippet {
|
||||
const name: string = `(Windows) ${localize("attach.string", "Attach").replace(/\"/g, "\\\"")}`;
|
||||
let name: string = `(Windows) ${localize("attach.string", "Attach").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
const body: string = `
|
||||
let 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 {
|
||||
const name: string = `(${this.MIMode}) ${localize("bash.on.windows.launch", "Bash on Windows Launch").replace(/\"/g, "\\\"")}`;
|
||||
let name: string = `(${this.MIMode}) ${localize("bash.on.windows.launch", "Bash on Windows Launch").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
const body: string = formatString(`
|
||||
let 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 {
|
||||
const name: string = `(${this.MIMode}) ${localize("bash.on.windows.attach", "Bash on Windows Attach").replace(/\"/g, "\\\"")}`;
|
||||
let name: string = `(${this.MIMode}) ${localize("bash.on.windows.attach", "Bash on Windows Attach").replace(/\"/g, "\\\"")}`;
|
||||
|
||||
const body: string = formatString(`
|
||||
let 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.
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
let 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
|
||||
const attachItemsProvider: AttachItemsProvider = NativeAttachItemsProviderFactory.Get();
|
||||
const attacher: AttachPicker = new AttachPicker(attachItemsProvider);
|
||||
let attachItemsProvider: AttachItemsProvider = NativeAttachItemsProviderFactory.Get();
|
||||
let attacher: AttachPicker = new AttachPicker(attachItemsProvider);
|
||||
disposables.push(vscode.commands.registerCommand('extension.pickNativeProcess', () => attacher.ShowAttachEntries()));
|
||||
const remoteAttacher: RemoteAttachPicker = new RemoteAttachPicker();
|
||||
let remoteAttacher: RemoteAttachPicker = new RemoteAttachPicker();
|
||||
disposables.push(vscode.commands.registerCommand('extension.pickRemoteNativeProcess', (any) => remoteAttacher.ShowAttachEntries(any)));
|
||||
|
||||
// Activate ConfigurationProvider
|
||||
const configurationProvider: IConfigurationAssetProvider = ConfigurationAssetProviderFactory.getConfigurationProvider();
|
||||
let 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();
|
||||
}
|
||||
|
||||
const configs: vscode.DebugConfiguration[] = (await provider.provideDebugConfigurations(folder)).filter(config =>
|
||||
let configs: vscode.DebugConfiguration[] = (await provider.provideDebugConfigurations(folder)).filter(config =>
|
||||
config.name.indexOf(buildAndDebugActiveFileStr()) !== -1);
|
||||
|
||||
if (vsdbgProvider) {
|
||||
const vsdbgConfigs: vscode.DebugConfiguration[] = (await vsdbgProvider.provideDebugConfigurations(folder)).filter(config =>
|
||||
let 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;
|
||||
}
|
||||
const aLower: string = a.name.toLowerCase();
|
||||
const bLower: string = b.name.toLowerCase();
|
||||
let aLower: string = a.name.toLowerCase();
|
||||
let bLower: string = b.name.toLowerCase();
|
||||
if (aLower === bLower) {
|
||||
return 0;
|
||||
}
|
||||
return aLower < bLower ? -1 : 1;
|
||||
});
|
||||
const attachItems: AttachItem[] = processEntries.map(p => p.toAttachItem());
|
||||
let 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[] {
|
||||
const lines: string[] = processes.split(os.EOL);
|
||||
let lines: string[] = processes.split(os.EOL);
|
||||
return PsProcessParser.ParseProcessFromPsArray(lines);
|
||||
}
|
||||
|
||||
public static ParseProcessFromPsArray(processArray: string[]): Process[] {
|
||||
const processEntries: Process[] = [];
|
||||
let processEntries: Process[] = [];
|
||||
|
||||
// lines[0] is the header of the table
|
||||
for (let i: number = 1; i < processArray.length; i++) {
|
||||
const line: string = processArray[i];
|
||||
let line: string = processArray[i];
|
||||
if (!line) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const processEntry: Process | undefined = PsProcessParser.parseLineFromPs(line);
|
||||
let 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[] {
|
||||
const lines: string[] = processes.split(os.EOL);
|
||||
let lines: string[] = processes.split(os.EOL);
|
||||
let currentProcess: Process = new Process("current process", undefined, undefined);
|
||||
const processEntries: Process[] = [];
|
||||
let processEntries: Process[] = [];
|
||||
|
||||
for (let i: number = 0; i < lines.length; i++) {
|
||||
const line: string = lines[i];
|
||||
let line: string = lines[i];
|
||||
if (!line) {
|
||||
continue;
|
||||
}
|
||||
@@ -229,9 +229,9 @@ export class WmicProcessParser {
|
||||
}
|
||||
|
||||
private static parseLineFromWmic(line: string, process: Process): void {
|
||||
const splitter: number = line.indexOf('=');
|
||||
let splitter: number = line.indexOf('=');
|
||||
if (splitter >= 0) {
|
||||
const key: string = line.slice(0, line.indexOf('=')).trim();
|
||||
let 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[] {
|
||||
const result: ClientKey[] = [];
|
||||
let 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 => {
|
||||
const newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
let 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);
|
||||
const client: cpptools.Client | undefined = this.languageClients.get(key);
|
||||
let 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;
|
||||
const activeClient: cpptools.Client = this.getClientFor(document.uri);
|
||||
let 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 {
|
||||
const client: cpptools.Client | undefined = this.languageClients.get(key);
|
||||
let 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 (const pair of this.languageClients) {
|
||||
for (let 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 {
|
||||
const folderCount: number = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders.length : 0;
|
||||
let 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 => {
|
||||
const path: string = util.asFolder(folder.uri);
|
||||
let 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 => {
|
||||
const path: string = util.asFolder(folder.uri);
|
||||
const client: cpptools.Client | undefined = this.languageClients.get(path);
|
||||
let path: string = util.asFolder(folder.uri);
|
||||
let client: cpptools.Client | undefined = this.languageClients.get(path);
|
||||
if (!client) {
|
||||
const newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
let newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
this.languageClients.set(path, newClient);
|
||||
newClient.deactivate(); // e.g. prevent the current config from switching.
|
||||
const defaultClient: cpptools.DefaultClient = <cpptools.DefaultClient>newClient;
|
||||
defaultClient.sendAllSettings();
|
||||
let defaultClient: cpptools.DefaultClient = <cpptools.DefaultClient>newClient;
|
||||
defaultClient.sendDidChangeSettings();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private transferOwnership(document: vscode.TextDocument, oldOwner: cpptools.Client): void {
|
||||
const newOwner: cpptools.Client = this.getClientFor(document.uri);
|
||||
let newOwner: cpptools.Client = this.getClientFor(document.uri);
|
||||
if (newOwner !== oldOwner) {
|
||||
newOwner.takeOwnership(document);
|
||||
}
|
||||
}
|
||||
|
||||
public getClientFor(uri: vscode.Uri): cpptools.Client {
|
||||
const folder: vscode.WorkspaceFolder | undefined = uri ? vscode.workspace.getWorkspaceFolder(uri) : undefined;
|
||||
let folder: vscode.WorkspaceFolder | undefined = uri ? vscode.workspace.getWorkspaceFolder(uri) : undefined;
|
||||
if (!folder) {
|
||||
return this.defaultClient;
|
||||
} else {
|
||||
const key: string = util.asFolder(folder.uri);
|
||||
const client: cpptools.Client | undefined = this.languageClients.get(key);
|
||||
let key: string = util.asFolder(folder.uri);
|
||||
let client: cpptools.Client | undefined = this.languageClients.get(key);
|
||||
if (client) {
|
||||
return client;
|
||||
}
|
||||
const newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
let newClient: cpptools.Client = cpptools.createClient(this, folder);
|
||||
this.languageClients.set(key, newClient);
|
||||
getCustomConfigProviders().forEach(provider => newClient.onRegisterCustomConfigurationProvider(provider));
|
||||
const defaultClient: cpptools.DefaultClient = <cpptools.DefaultClient>newClient;
|
||||
defaultClient.sendAllSettings();
|
||||
let defaultClient: cpptools.DefaultClient = <cpptools.DefaultClient>newClient;
|
||||
defaultClient.sendDidChangeSettings();
|
||||
return newClient;
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ export class ClientCollection {
|
||||
}
|
||||
|
||||
public dispose(): Thenable<void> {
|
||||
const promises: Thenable<void>[] = [];
|
||||
let 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);
|
||||
});
|
||||
|
||||
const otherSettings: OtherSettings = new OtherSettings(this.uri);
|
||||
let otherSettings: OtherSettings = new OtherSettings(this.uri);
|
||||
|
||||
// Next in priority would be a global user override of token color of the equivilent scope
|
||||
const colorTokenName: string | undefined = ColorizationSettings.scopeToTokenColorNameMap.get(scope);
|
||||
let colorTokenName: string | undefined = ColorizationSettings.scopeToTokenColorNameMap.get(scope);
|
||||
if (colorTokenName) {
|
||||
const settingValue: string | undefined = otherSettings.getCustomColorToken(colorTokenName);
|
||||
let 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) {
|
||||
const settingValue: string | undefined = otherSettings.getCustomThemeSpecificColorToken(colorTokenName, themeName);
|
||||
let 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
|
||||
const textMateRules: TextMateRule[] | undefined = otherSettings.getCustomThemeSpecificTextMateRules(themeName);
|
||||
let 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
|
||||
const parts: string[] = scope.split(".");
|
||||
let 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)) {
|
||||
const themeContentText: string = await util.readFileText(themePath);
|
||||
let 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
|
||||
const includedThemePath: string = path.join(path.dirname(themePath), themeContent.include);
|
||||
let includedThemePath: string = path.join(path.dirname(themePath), themeContent.include);
|
||||
rules = await this.loadTheme(includedThemePath, defaultStyle);
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ export class ColorizationSettings {
|
||||
}
|
||||
});
|
||||
|
||||
const scopelessSetting: any = textMateRules.find(e => e.settings && !e.scope);
|
||||
let 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 {
|
||||
const f: () => void = async () => {
|
||||
const otherSettings: OtherSettings = new OtherSettings(this.uri);
|
||||
const themeName: string | undefined = otherSettings.colorTheme;
|
||||
let f: () => void = async () => {
|
||||
let otherSettings: OtherSettings = new OtherSettings(this.uri);
|
||||
let 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++) {
|
||||
const extensionPath: string = vscode.extensions.all[i].extensionPath;
|
||||
const extensionPackageJsonPath: string = path.join(extensionPath, "package.json");
|
||||
let extensionPath: string = vscode.extensions.all[i].extensionPath;
|
||||
let extensionPackageJsonPath: string = path.join(extensionPath, "package.json");
|
||||
if (!await util.checkFileExists(extensionPackageJsonPath)) {
|
||||
continue;
|
||||
}
|
||||
const packageJsonText: string = await util.readFileText(extensionPackageJsonPath);
|
||||
const packageJson: any = jsonc.parse(packageJsonText);
|
||||
let packageJsonText: string = await util.readFileText(extensionPackageJsonPath);
|
||||
let packageJson: any = jsonc.parse(packageJsonText);
|
||||
if (packageJson.contributes && packageJson.contributes.themes) {
|
||||
const foundTheme: any = packageJson.contributes.themes.find((e: any) => e.id === themeName || e.label === themeName);
|
||||
let foundTheme: any = packageJson.contributes.themes.find((e: any) => e.id === themeName || e.label === themeName);
|
||||
if (foundTheme) {
|
||||
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);
|
||||
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);
|
||||
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)) {
|
||||
const options: vscode.DecorationRenderOptions = {};
|
||||
let 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) {
|
||||
const parts: string[] = themeStyle.fontStyle.split(" ");
|
||||
let parts: string[] = themeStyle.fontStyle.split(" ");
|
||||
parts.forEach((part) => {
|
||||
switch (part) {
|
||||
case "italic":
|
||||
@@ -368,7 +368,7 @@ export class ColorizationState {
|
||||
}
|
||||
|
||||
private createColorizationDecorations(isCpp: boolean): void {
|
||||
const settings: CppSettings = new CppSettings(this.uri);
|
||||
let 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) {
|
||||
const opacity: number | undefined = settings.inactiveRegionOpacity;
|
||||
let 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++) {
|
||||
const decoration: vscode.TextEditorDecorationType | undefined = this.decorations[i];
|
||||
let 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 {
|
||||
const settings: CppSettings = new CppSettings(this.uri);
|
||||
let settings: CppSettings = new CppSettings(this.uri);
|
||||
if (settings.enhancedColorization) {
|
||||
for (let i: number = 0; i < TokenKind.Count; i++) {
|
||||
const decoration: vscode.TextEditorDecorationType | undefined = this.decorations[i];
|
||||
let decoration: vscode.TextEditorDecorationType | undefined = this.decorations[i];
|
||||
if (decoration) {
|
||||
const ranges: vscode.Range[] = this.semanticRanges[i];
|
||||
let 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();
|
||||
const f: () => void = async () => {
|
||||
let f: () => void = async () => {
|
||||
this.refreshInner(e);
|
||||
};
|
||||
this.colorizationSettings.syncWithLoadingSettings(f);
|
||||
}
|
||||
|
||||
public onSettingsChanged(uri: vscode.Uri): void {
|
||||
const f: () => void = async () => {
|
||||
let f: () => void = async () => {
|
||||
this.applyEdits();
|
||||
this.disposeColorizationDecorations();
|
||||
const isCpp: boolean = util.isEditorFileCpp(uri.toString());
|
||||
let isCpp: boolean = util.isEditorFileCpp(uri.toString());
|
||||
this.createColorizationDecorations(isCpp);
|
||||
const editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri === uri);
|
||||
for (const e of editors) {
|
||||
let editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri === uri);
|
||||
for (let 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 {
|
||||
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 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;
|
||||
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 {
|
||||
const lineDelta: number = removeStartPosition.line - removeEndPosition.line;
|
||||
let 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;
|
||||
}
|
||||
}
|
||||
const newStart: vscode.Position = range.start.translate(lineDelta, startCharacterDelta);
|
||||
const newEnd: vscode.Position = range.end.translate(lineDelta, endCharacterDelta);
|
||||
let newStart: vscode.Position = range.start.translate(lineDelta, startCharacterDelta);
|
||||
let 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 {
|
||||
const addedLines: number = insertEndPosition.line - insertStartPosition.line;
|
||||
const newStartLine: number = range.start.line + addedLines;
|
||||
const newEndLine: number = range.end.line + addedLines;
|
||||
let addedLines: number = insertEndPosition.line - insertStartPosition.line;
|
||||
let newStartLine: number = range.start.line + addedLines;
|
||||
let 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.
|
||||
const removedLines: number = removeEndPosition.line - removeInsertStartPosition.line;
|
||||
const addedLines: number = insertEndPosition.line - removeInsertStartPosition.line;
|
||||
const deltaLines: number = addedLines - removedLines;
|
||||
let removedLines: number = removeEndPosition.line - removeInsertStartPosition.line;
|
||||
let addedLines: number = insertEndPosition.line - removeInsertStartPosition.line;
|
||||
let 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) => {
|
||||
const newRanges: vscode.Range[] = [];
|
||||
const insertRange: vscode.Range = this.textToRange(change.text, change.range.start);
|
||||
let newRanges: vscode.Range[] = [];
|
||||
let insertRange: vscode.Range = this.textToRange(change.text, change.range.start);
|
||||
for (let i: number = 0; i < ranges.length; i++) {
|
||||
const newRange: vscode.Range | undefined = this.fixRange(ranges[i], change.range.start, change.range.end, insertRange.end);
|
||||
let 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 {
|
||||
const edits: VersionedEdits = {
|
||||
let 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 {
|
||||
const minVersion: number = this.lastReceivedSemanticVersion;
|
||||
const index: number = this.versionedEdits.findIndex((edit) => edit.editVersion > minVersion);
|
||||
let minVersion: number = this.lastReceivedSemanticVersion;
|
||||
let 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 {
|
||||
const f: () => void = async () => {
|
||||
let 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.
|
||||
const oldInactiveDecoration: vscode.TextEditorDecorationType | undefined = this.inactiveDecoration;
|
||||
const oldDecorations: (vscode.TextEditorDecorationType | undefined)[] = this.decorations;
|
||||
let oldInactiveDecoration: vscode.TextEditorDecorationType | undefined = this.inactiveDecoration;
|
||||
let oldDecorations: (vscode.TextEditorDecorationType | undefined)[] = this.decorations;
|
||||
this.inactiveDecoration = undefined;
|
||||
this.decorations = new Array<vscode.TextEditorDecorationType>(TokenKind.Count);
|
||||
|
||||
const isCpp: boolean = util.isEditorFileCpp(uri);
|
||||
let isCpp: boolean = util.isEditorFileCpp(uri);
|
||||
this.createColorizationDecorations(isCpp);
|
||||
|
||||
// Apply the decorations to all *visible* text editors
|
||||
const editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri.toString() === uri);
|
||||
for (const e of editors) {
|
||||
let editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri.toString() === uri);
|
||||
for (let e of editors) {
|
||||
this.refreshInner(e);
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ export class ColorizationState {
|
||||
}
|
||||
if (oldDecorations) {
|
||||
for (let i: number = 0; i < TokenKind.Count; i++) {
|
||||
const oldDecoration: vscode.TextEditorDecorationType | undefined = oldDecorations[i];
|
||||
let oldDecoration: vscode.TextEditorDecorationType | undefined = oldDecorations[i];
|
||||
if (oldDecoration) {
|
||||
oldDecoration.dispose();
|
||||
}
|
||||
|
||||
@@ -67,7 +67,6 @@ export interface Configuration {
|
||||
forcedInclude?: string[];
|
||||
configurationProvider?: string;
|
||||
browse?: Browse;
|
||||
customConfigurationVariables?: {[key: string]: string};
|
||||
}
|
||||
|
||||
export interface ConfigurationErrors {
|
||||
@@ -124,7 +123,6 @@ 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[]>();
|
||||
@@ -141,7 +139,7 @@ export class CppProperties {
|
||||
|
||||
constructor(rootUri?: vscode.Uri, workspaceFolder?: vscode.WorkspaceFolder) {
|
||||
this.rootUri = rootUri;
|
||||
const rootPath: string = rootUri ? rootUri.fsPath : "";
|
||||
let rootPath: string = rootUri ? rootUri.fsPath : "";
|
||||
if (workspaceFolder) {
|
||||
this.currentConfigurationIndex = new PersistentFolderState<number>("CppProperties.currentConfigurationIndex", -1, workspaceFolder);
|
||||
}
|
||||
@@ -167,7 +165,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
public get ConfigurationNames(): string[] | undefined {
|
||||
const result: string[] = [];
|
||||
let result: string[] = [];
|
||||
if (this.configurationJson) {
|
||||
this.configurationJson.configurations.forEach((config: Configuration) => {
|
||||
result.push(config.name);
|
||||
@@ -189,14 +187,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.
|
||||
const configFilePath: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
let 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;
|
||||
}
|
||||
|
||||
const settingsPath: string = path.join(this.configFolder, this.configurationGlobPattern);
|
||||
let settingsPath: string = path.join(this.configFolder, this.configurationGlobPattern);
|
||||
this.configFileWatcher = vscode.workspace.createFileSystemWatcher(settingsPath);
|
||||
this.disposables.push(this.configFileWatcher);
|
||||
this.configFileWatcher.onDidCreate((uri) => {
|
||||
@@ -266,7 +264,7 @@ export class CppProperties {
|
||||
this.configurationJson = getDefaultCppProperties();
|
||||
if (resetIndex || this.CurrentConfigurationIndex < 0 ||
|
||||
this.CurrentConfigurationIndex >= this.configurationJson.configurations.length) {
|
||||
const index: number | undefined = this.getConfigIndexForPlatform(this.configurationJson);
|
||||
let index: number | undefined = this.getConfigIndexForPlatform(this.configurationJson);
|
||||
if (this.currentConfigurationIndex !== undefined) {
|
||||
if (index === undefined) {
|
||||
this.currentConfigurationIndex.setDefault();
|
||||
@@ -280,7 +278,7 @@ export class CppProperties {
|
||||
|
||||
private applyDefaultIncludePathsAndFrameworks(): void {
|
||||
if (this.configurationIncomplete && this.defaultIncludes && this.defaultFrameworks && this.vcpkgPathReady) {
|
||||
const configuration: Configuration | undefined = this.CurrentConfiguration;
|
||||
let configuration: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (configuration) {
|
||||
this.applyDefaultConfigurationValues(configuration);
|
||||
this.configurationIncomplete = false;
|
||||
@@ -289,9 +287,9 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
private applyDefaultConfigurationValues(configuration: Configuration): void {
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
// default values for "default" config settings is null.
|
||||
const isUnset: (input: any) => boolean = (input: any) => input === null || input === undefined;
|
||||
let 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
|
||||
@@ -301,8 +299,8 @@ export class CppProperties {
|
||||
|
||||
if (isUnset(settings.defaultIncludePath)) {
|
||||
// We don't add system includes to the includePath anymore. The language server has this information.
|
||||
const abTestSettings: ABTestSettings = getABTestSettings();
|
||||
const rootFolder: string = abTestSettings.UseRecursiveIncludes ? "${workspaceFolder}/**" : "${workspaceFolder}";
|
||||
let abTestSettings: ABTestSettings = getABTestSettings();
|
||||
let 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.
|
||||
@@ -330,13 +328,10 @@ 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 {
|
||||
const result: Environment = {};
|
||||
let result: Environment = {};
|
||||
if (this.configurationJson?.env) {
|
||||
Object.assign(result, this.configurationJson.env);
|
||||
}
|
||||
@@ -348,14 +343,14 @@ export class CppProperties {
|
||||
private async buildVcpkgIncludePath(): Promise<void> {
|
||||
try {
|
||||
// Check for vcpkgRoot and include relevent paths if found.
|
||||
const vcpkgRoot: string = util.getVcpkgRoot();
|
||||
let vcpkgRoot: string = util.getVcpkgRoot();
|
||||
if (vcpkgRoot) {
|
||||
const list: string[] = await util.readDir(vcpkgRoot);
|
||||
let 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") {
|
||||
const pathToCheck: string = path.join(vcpkgRoot, entry);
|
||||
let pathToCheck: string = path.join(vcpkgRoot, entry);
|
||||
if (fs.existsSync(pathToCheck)) {
|
||||
let p: string = path.join(pathToCheck, "include");
|
||||
if (fs.existsSync(p)) {
|
||||
@@ -423,13 +418,13 @@ export class CppProperties {
|
||||
configuration.intelliSenseMode === "${default}") {
|
||||
return "";
|
||||
}
|
||||
const resolvedCompilerPath: string = this.resolvePath(configuration.compilerPath, true);
|
||||
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(resolvedCompilerPath);
|
||||
let resolvedCompilerPath: string = this.resolvePath(configuration.compilerPath, true);
|
||||
let 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
|
||||
const isValid: boolean = compilerPathAndArgs.compilerName.endsWith("cl.exe") === configuration.intelliSenseMode.startsWith("msvc");
|
||||
let isValid: boolean = compilerPathAndArgs.compilerName.endsWith("cl.exe") === configuration.intelliSenseMode.startsWith("msvc");
|
||||
if (isValid) {
|
||||
return "";
|
||||
} else {
|
||||
@@ -440,7 +435,7 @@ export class CppProperties {
|
||||
public addToIncludePathCommand(path: string): void {
|
||||
this.handleConfigurationEditCommand(() => {
|
||||
this.parsePropertiesFile(); // Clear out any modifications we may have made internally.
|
||||
const config: Configuration | undefined = this.CurrentConfiguration;
|
||||
let config: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (config) {
|
||||
telemetry.logLanguageServerEvent("addToIncludePath");
|
||||
if (config.includePath === undefined) {
|
||||
@@ -458,7 +453,7 @@ export class CppProperties {
|
||||
if (this.propertiesFile) {
|
||||
this.handleConfigurationEditJSONCommand(() => {
|
||||
this.parsePropertiesFile(); // Clear out any modifications we may have made internally.
|
||||
const config: Configuration | undefined = this.CurrentConfiguration;
|
||||
let config: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (config) {
|
||||
if (providerId) {
|
||||
config.configurationProvider = providerId;
|
||||
@@ -471,13 +466,13 @@ export class CppProperties {
|
||||
resolve();
|
||||
}, () => {});
|
||||
} else {
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
if (providerId) {
|
||||
settings.update("default.configurationProvider", providerId);
|
||||
} else {
|
||||
settings.update("default.configurationProvider", undefined); // delete the setting
|
||||
}
|
||||
const config: Configuration | undefined = this.CurrentConfiguration;
|
||||
let config: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (config) {
|
||||
config.configurationProvider = providerId;
|
||||
}
|
||||
@@ -489,7 +484,7 @@ export class CppProperties {
|
||||
public setCompileCommands(path: string): void {
|
||||
this.handleConfigurationEditJSONCommand(() => {
|
||||
this.parsePropertiesFile(); // Clear out any modifications we may have made internally.
|
||||
const config: Configuration | undefined = this.CurrentConfiguration;
|
||||
let config: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (config) {
|
||||
config.compileCommands = path;
|
||||
this.writeToJson();
|
||||
@@ -532,30 +527,12 @@ 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);
|
||||
paths.forEach(entry => {
|
||||
const entries: string[] = util.resolveVariables(entry, env).split(util.envDelimiter).filter(e => e);
|
||||
let entries: string[] = util.resolveVariables(entry, env).split(util.envDelimiter).filter(e => e);
|
||||
result = result.concat(entries);
|
||||
});
|
||||
}
|
||||
@@ -595,24 +572,14 @@ 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;
|
||||
}
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
const env: Environment = this.ExtendedEnvironment;
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
let env: Environment = this.ExtendedEnvironment;
|
||||
for (let i: number = 0; i < this.configurationJson.configurations.length; i++) {
|
||||
const configuration: Configuration = this.configurationJson.configurations[i];
|
||||
let configuration: Configuration = this.configurationJson.configurations[i];
|
||||
|
||||
configuration.includePath = this.updateConfigurationStringArray(configuration.includePath, settings.defaultIncludePath, env);
|
||||
configuration.defines = this.updateConfigurationStringArray(configuration.defines, settings.defaultDefines, env);
|
||||
@@ -625,7 +592,6 @@ 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) {
|
||||
@@ -667,10 +633,10 @@ export class CppProperties {
|
||||
if (this.configurationJson) {
|
||||
this.compileCommandFileWatchers.forEach((watcher: fs.FSWatcher) => watcher.close());
|
||||
this.compileCommandFileWatchers = []; // reset it
|
||||
const filePaths: Set<string> = new Set<string>();
|
||||
let filePaths: Set<string> = new Set<string>();
|
||||
this.configurationJson.configurations.forEach(c => {
|
||||
if (c.compileCommands) {
|
||||
const fileSystemCompileCommandsPath: string = this.resolvePath(c.compileCommands, os.platform() === "win32");
|
||||
let fileSystemCompileCommandsPath: string = this.resolvePath(c.compileCommands, os.platform() === "win32");
|
||||
if (fs.existsSync(fileSystemCompileCommandsPath)) {
|
||||
filePaths.add(fileSystemCompileCommandsPath);
|
||||
}
|
||||
@@ -708,7 +674,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 {
|
||||
const otherSettings: OtherSettings = new OtherSettings(this.rootUri);
|
||||
let otherSettings: OtherSettings = new OtherSettings(this.rootUri);
|
||||
if (otherSettings.settingsEditor === "ui") {
|
||||
this.handleConfigurationEditUICommand(onBeforeOpen, showDocument);
|
||||
} else {
|
||||
@@ -736,7 +702,7 @@ export class CppProperties {
|
||||
|
||||
private ensureSettingsPanelInitlialized(): void {
|
||||
if (this.settingsPanel === undefined) {
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
this.settingsPanel = new SettingsPanel();
|
||||
this.settingsPanel.setKnownCompilers(this.knownCompilers, settings.preferredPathSeparator);
|
||||
this.settingsPanel.SettingsPanelActivated(() => this.onSettingsPanelActivated());
|
||||
@@ -757,7 +723,7 @@ export class CppProperties {
|
||||
if (this.parsePropertiesFile()) {
|
||||
this.ensureSettingsPanelInitlialized();
|
||||
if (this.settingsPanel) {
|
||||
const configNames: string[] | undefined = this.ConfigurationNames;
|
||||
let 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;
|
||||
@@ -783,7 +749,7 @@ export class CppProperties {
|
||||
this.ensurePropertiesFile().then(() => {
|
||||
if (this.propertiesFile) {
|
||||
if (this.parsePropertiesFile()) {
|
||||
const configNames: string[] | undefined = this.ConfigurationNames;
|
||||
let 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
|
||||
@@ -806,7 +772,7 @@ export class CppProperties {
|
||||
private saveConfigurationUI(): void {
|
||||
this.parsePropertiesFile(); // Clear out any modifications we may have made internally.
|
||||
if (this.settingsPanel && this.configurationJson) {
|
||||
const config: Configuration = this.settingsPanel.getLastValuesFromConfigUI();
|
||||
let config: Configuration = this.settingsPanel.getLastValuesFromConfigUI();
|
||||
this.configurationJson.configurations[this.settingsPanel.selectedConfigIndex] = config;
|
||||
this.settingsPanel.updateErrors(this.getErrorsForConfigUI(this.settingsPanel.selectedConfigIndex));
|
||||
this.writeToJson();
|
||||
@@ -814,7 +780,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
private onConfigSelectionChanged(): void {
|
||||
const configNames: string[] | undefined = this.ConfigurationNames;
|
||||
let configNames: string[] | undefined = this.ConfigurationNames;
|
||||
if (configNames && this.settingsPanel && this.configurationJson) {
|
||||
this.settingsPanel.updateConfigUI(configNames,
|
||||
this.configurationJson.configurations[this.settingsPanel.selectedConfigIndex],
|
||||
@@ -826,9 +792,9 @@ export class CppProperties {
|
||||
this.parsePropertiesFile(); // Clear out any modifications we may have made internally.
|
||||
|
||||
// Create default config and add to list of configurations
|
||||
const newConfig: Configuration = { name: configName };
|
||||
let newConfig: Configuration = { name: configName };
|
||||
this.applyDefaultConfigurationValues(newConfig);
|
||||
const configNames: string[] | undefined = this.ConfigurationNames;
|
||||
let configNames: string[] | undefined = this.ConfigurationNames;
|
||||
if (configNames && this.settingsPanel && this.configurationJson) {
|
||||
this.configurationJson.configurations.push(newConfig);
|
||||
|
||||
@@ -856,7 +822,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.
|
||||
const index: number | undefined = this.getConfigIndexForPlatform(this.configurationJson);
|
||||
let index: number | undefined = this.getConfigIndexForPlatform(this.configurationJson);
|
||||
if (this.currentConfigurationIndex !== undefined) {
|
||||
if (!index) {
|
||||
this.currentConfigurationIndex.setDefault();
|
||||
@@ -885,12 +851,12 @@ export class CppProperties {
|
||||
fs.mkdirSync(this.configFolder);
|
||||
}
|
||||
|
||||
const fullPathToFile: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
let fullPathToFile: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
if (this.configurationJson) {
|
||||
this.resetToDefaultSettings(true);
|
||||
}
|
||||
this.applyDefaultIncludePathsAndFrameworks();
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
if (settings.defaultConfigurationProvider) {
|
||||
if (this.configurationJson) {
|
||||
this.configurationJson.configurations.forEach(config => {
|
||||
@@ -905,7 +871,7 @@ export class CppProperties {
|
||||
this.propertiesFile = vscode.Uri.file(path.join(this.configFolder, "c_cpp_properties.json"));
|
||||
|
||||
} catch (err) {
|
||||
const failedToCreate: string = localize("failed.to.create.config.folder", 'Failed to create "{0}"', this.configFolder);
|
||||
let failedToCreate: string = localize("failed.to.create.config.folder", 'Failed to create "{0}"', this.configFolder);
|
||||
vscode.window.showErrorMessage(`${failedToCreate}: ${err.message}`);
|
||||
}
|
||||
}
|
||||
@@ -918,13 +884,13 @@ export class CppProperties {
|
||||
}
|
||||
let success: boolean = true;
|
||||
try {
|
||||
const readResults: string = fs.readFileSync(this.propertiesFile.fsPath, 'utf8');
|
||||
let 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.
|
||||
const newJson: ConfigurationJson = JSON.parse(readResults);
|
||||
let 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.") };
|
||||
}
|
||||
@@ -941,7 +907,7 @@ export class CppProperties {
|
||||
}
|
||||
this.configurationJson = newJson;
|
||||
if (this.CurrentConfigurationIndex < 0 || this.CurrentConfigurationIndex >= newJson.configurations.length) {
|
||||
const index: number | undefined = this.getConfigIndexForPlatform(newJson);
|
||||
let index: number | undefined = this.getConfigIndexForPlatform(newJson);
|
||||
if (this.currentConfigurationIndex !== undefined) {
|
||||
if (index === undefined) {
|
||||
this.currentConfigurationIndex.setDefault();
|
||||
@@ -953,7 +919,7 @@ export class CppProperties {
|
||||
|
||||
let dirty: boolean = false;
|
||||
for (let i: number = 0; i < this.configurationJson.configurations.length; i++) {
|
||||
const newId: string | undefined = getCustomConfigProviders().checkId(this.configurationJson.configurations[i].configurationProvider);
|
||||
let 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;
|
||||
@@ -1008,7 +974,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
const failedToParse: string = localize("failed.to.parse.properties", 'Failed to parse "{0}"', this.propertiesFile.fsPath);
|
||||
let failedToParse: string = localize("failed.to.parse.properties", 'Failed to parse "{0}"', this.propertiesFile.fsPath);
|
||||
vscode.window.showErrorMessage(`${failedToParse}: ${err.message}`);
|
||||
success = false;
|
||||
}
|
||||
@@ -1060,16 +1026,16 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
private getErrorsForConfigUI(configIndex: number): ConfigurationErrors {
|
||||
const errors: ConfigurationErrors = {};
|
||||
let errors: ConfigurationErrors = {};
|
||||
if (!this.configurationJson) {
|
||||
return errors;
|
||||
}
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
const config: Configuration = this.configurationJson.configurations[configIndex];
|
||||
let config: Configuration = this.configurationJson.configurations[configIndex];
|
||||
|
||||
// Validate compilerPath
|
||||
let resolvedCompilerPath: string | undefined = this.resolvePath(config.compilerPath, isWindows);
|
||||
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(resolvedCompilerPath);
|
||||
let 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")) {
|
||||
@@ -1077,13 +1043,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.
|
||||
const compilerPathNeedsQuotes: boolean =
|
||||
let compilerPathNeedsQuotes: boolean =
|
||||
(compilerPathAndArgs.additionalArgs && compilerPathAndArgs.additionalArgs.length > 0) &&
|
||||
!resolvedCompilerPath.startsWith('"') &&
|
||||
compilerPathAndArgs.compilerPath !== undefined &&
|
||||
compilerPathAndArgs.compilerPath.includes(" ");
|
||||
|
||||
const compilerPathErrors: string[] = [];
|
||||
let compilerPathErrors: string[] = [];
|
||||
if (compilerPathNeedsQuotes) {
|
||||
compilerPathErrors.push(localize("path.with.spaces", 'Compiler path with spaces and arguments is missing double quotes " around the path.'));
|
||||
}
|
||||
@@ -1092,7 +1058,7 @@ export class CppProperties {
|
||||
resolvedCompilerPath = compilerPathAndArgs.compilerPath;
|
||||
if (resolvedCompilerPath) {
|
||||
let pathExists: boolean = true;
|
||||
const existsWithExeAdded: (path: string) => boolean = (path: string) => isWindows && !path.startsWith("/") && fs.existsSync(path + ".exe");
|
||||
let existsWithExeAdded: (path: string) => boolean = (path: string) => isWindows && !path.startsWith("/") && fs.existsSync(path + ".exe");
|
||||
if (!fs.existsSync(resolvedCompilerPath)) {
|
||||
if (existsWithExeAdded(resolvedCompilerPath)) {
|
||||
resolvedCompilerPath += ".exe";
|
||||
@@ -1114,13 +1080,13 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
if (!pathExists) {
|
||||
const message: string = localize('cannot.find', "Cannot find: {0}", resolvedCompilerPath);
|
||||
let message: string = localize('cannot.find', "Cannot find: {0}", resolvedCompilerPath);
|
||||
compilerPathErrors.push(message);
|
||||
} else if (compilerPathAndArgs.compilerPath === "") {
|
||||
const message: string = localize("cannot.resolve.compiler.path", "Invalid input, cannot resolve compiler path");
|
||||
let message: string = localize("cannot.resolve.compiler.path", "Invalid input, cannot resolve compiler path");
|
||||
compilerPathErrors.push(message);
|
||||
} else if (!util.checkFileExistsSync(resolvedCompilerPath)) {
|
||||
const message: string = localize("path.is.not.a.file", "Path is not a file: {0}", resolvedCompilerPath);
|
||||
let message: string = localize("path.is.not.a.file", "Path is not a file: {0}", resolvedCompilerPath);
|
||||
compilerPathErrors.push(message);
|
||||
}
|
||||
|
||||
@@ -1142,7 +1108,7 @@ export class CppProperties {
|
||||
|
||||
// Validate intelliSenseMode
|
||||
if (isWindows) {
|
||||
const intelliSenesModeError: string = this.validateIntelliSenseMode(config);
|
||||
let intelliSenesModeError: string = this.validateIntelliSenseMode(config);
|
||||
if (intelliSenesModeError.length > 0) {
|
||||
errors.intelliSenseMode = intelliSenesModeError;
|
||||
}
|
||||
@@ -1158,7 +1124,7 @@ export class CppProperties {
|
||||
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
let errorMsg: string | undefined;
|
||||
const errors: string[] = [];
|
||||
let errors: string[] = [];
|
||||
let paths: string[] = [];
|
||||
|
||||
if (util.isString(input)) {
|
||||
@@ -1170,7 +1136,7 @@ export class CppProperties {
|
||||
// Resolve and split any environment variables
|
||||
paths = this.resolveAndSplit(paths, undefined, this.ExtendedEnvironment);
|
||||
|
||||
for (const p of paths) {
|
||||
for (let p of paths) {
|
||||
let pathExists: boolean = true;
|
||||
let resolvedPath: string = this.resolvePath(p, isWindows);
|
||||
if (!resolvedPath) {
|
||||
@@ -1193,17 +1159,17 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
if (!pathExists) {
|
||||
const message: string = localize('cannot.find', "Cannot find: {0}", resolvedPath);
|
||||
let 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)) {
|
||||
const message: string = localize("path.is.not.a.directory", "Path is not a directory: {0}", resolvedPath);
|
||||
let message: string = localize("path.is.not.a.directory", "Path is not a directory: {0}", resolvedPath);
|
||||
errors.push(message);
|
||||
} else if (!isDirectory && !util.checkFileExistsSync(resolvedPath)) {
|
||||
const message: string = localize("path.is.not.a.file", "Path is not a file: {0}", resolvedPath);
|
||||
let message: string = localize("path.is.not.a.file", "Path is not a file: {0}", resolvedPath);
|
||||
errors.push(message);
|
||||
}
|
||||
}
|
||||
@@ -1233,16 +1199,16 @@ export class CppProperties {
|
||||
return;
|
||||
}
|
||||
vscode.workspace.openTextDocument(this.propertiesFile).then((document: vscode.TextDocument) => {
|
||||
const diagnostics: vscode.Diagnostic[] = new Array<vscode.Diagnostic>();
|
||||
let 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.
|
||||
const configurationsText: string = util.escapeForSquiggles(curText);
|
||||
const configurations: ConfigurationJson = JSON.parse(configurationsText);
|
||||
const currentConfiguration: Configuration = configurations.configurations[this.CurrentConfigurationIndex];
|
||||
let configurationsText: string = util.escapeForSquiggles(curText);
|
||||
let configurations: ConfigurationJson = JSON.parse(configurationsText);
|
||||
let currentConfiguration: Configuration = configurations.configurations[this.CurrentConfigurationIndex];
|
||||
|
||||
let curTextStartOffset: number = 0;
|
||||
if (!currentConfiguration.name) {
|
||||
@@ -1250,7 +1216,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);
|
||||
@@ -1280,7 +1246,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 });
|
||||
}
|
||||
const newSquiggleMetrics: { [key: string]: number } = { 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 isWindows: boolean = os.platform() === 'win32';
|
||||
|
||||
// TODO: Add other squiggles.
|
||||
@@ -1293,10 +1259,10 @@ export class CppProperties {
|
||||
const intelliSenseModeValueStart: number = curText.indexOf('"', curText.indexOf(":", intelliSenseModeStart));
|
||||
const intelliSenseModeValueEnd: number = intelliSenseModeStart === -1 ? -1 : curText.indexOf('"', intelliSenseModeValueStart + 1) + 1;
|
||||
|
||||
const intelliSenseModeError: string = this.validateIntelliSenseMode(currentConfiguration);
|
||||
let intelliSenseModeError: string = this.validateIntelliSenseMode(currentConfiguration);
|
||||
if (intelliSenseModeError.length > 0) {
|
||||
const message: string = intelliSenseModeError;
|
||||
const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
let message: string = intelliSenseModeError;
|
||||
let diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
new vscode.Range(document.positionAt(curTextStartOffset + intelliSenseModeValueStart),
|
||||
document.positionAt(curTextStartOffset + intelliSenseModeValueEnd)),
|
||||
message, vscode.DiagnosticSeverity.Warning);
|
||||
@@ -1308,10 +1274,10 @@ export class CppProperties {
|
||||
|
||||
// Check for path-related squiggles.
|
||||
let paths: string[] = [];
|
||||
for (const pathArray of [ (currentConfiguration.browse ? currentConfiguration.browse.path : undefined),
|
||||
for (let pathArray of [ (currentConfiguration.browse ? currentConfiguration.browse.path : undefined),
|
||||
currentConfiguration.includePath, currentConfiguration.macFrameworkPath, currentConfiguration.forcedInclude ]) {
|
||||
if (pathArray) {
|
||||
for (const curPath of pathArray) {
|
||||
for (let curPath of pathArray) {
|
||||
paths.push(`${curPath}`);
|
||||
}
|
||||
}
|
||||
@@ -1336,10 +1302,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;
|
||||
|
||||
const processedPaths: Set<string> = new Set<string>();
|
||||
let processedPaths: Set<string> = new Set<string>();
|
||||
|
||||
// Validate paths
|
||||
for (const curPath of paths) {
|
||||
for (let 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.
|
||||
@@ -1361,7 +1327,7 @@ export class CppProperties {
|
||||
let compilerPathNeedsQuotes: boolean = false;
|
||||
if (isCompilerPath) {
|
||||
resolvedPath = resolvedPath.trim();
|
||||
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(resolvedPath);
|
||||
let 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.
|
||||
}
|
||||
@@ -1377,7 +1343,7 @@ export class CppProperties {
|
||||
|
||||
const isWSL: boolean = isWindows && resolvedPath.startsWith("/");
|
||||
let pathExists: boolean = true;
|
||||
const existsWithExeAdded: (path: string) => boolean = (path: string) => isCompilerPath && isWindows && !isWSL && fs.existsSync(path + ".exe");
|
||||
let existsWithExeAdded: (path: string) => boolean = (path: string) => isCompilerPath && isWindows && !isWSL && fs.existsSync(path + ".exe");
|
||||
if (!fs.existsSync(resolvedPath)) {
|
||||
if (existsWithExeAdded(resolvedPath)) {
|
||||
resolvedPath += ".exe";
|
||||
@@ -1414,12 +1380,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.
|
||||
const pattern: RegExp = new RegExp(`"[^"]*?(?<="|;)${escapedPath}(?="|;).*?"`, "g");
|
||||
const configMatches: string[] | null = curText.match(pattern);
|
||||
let pattern: RegExp = new RegExp(`"[^"]*?(?<="|;)${escapedPath}(?="|;).*?"`, "g");
|
||||
let configMatches: string[] | null = curText.match(pattern);
|
||||
if (configMatches) {
|
||||
let curOffset: number = 0;
|
||||
let endOffset: number = 0;
|
||||
for (const curMatch of configMatches) {
|
||||
for (let curMatch of configMatches) {
|
||||
curOffset = curText.substr(endOffset).search(pattern) + endOffset;
|
||||
endOffset = curOffset + curMatch.length;
|
||||
let message: string;
|
||||
@@ -1449,25 +1415,25 @@ export class CppProperties {
|
||||
newSquiggleMetrics.PathNotADirectory++;
|
||||
}
|
||||
}
|
||||
const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
let 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) {
|
||||
const envMatches: string[] | null = envText.match(pattern);
|
||||
let envMatches: string[] | null = envText.match(pattern);
|
||||
if (envMatches) {
|
||||
let curOffset: number = 0;
|
||||
let endOffset: number = 0;
|
||||
for (const curMatch of envMatches) {
|
||||
for (let 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++;
|
||||
const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
let diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
new vscode.Range(document.positionAt(envTextStartOffSet + curOffset),
|
||||
document.positionAt(envTextStartOffSet + endOffset)),
|
||||
message, vscode.DiagnosticSeverity.Warning);
|
||||
@@ -1485,7 +1451,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
// Send telemetry on squiggle changes.
|
||||
const changedSquiggleMetrics: { [key: string]: number } = {};
|
||||
let changedSquiggleMetrics: { [key: string]: number } = {};
|
||||
if (newSquiggleMetrics.PathNonExistent !== this.prevSquiggleMetrics.get(currentConfiguration.name)?.PathNonExistent) {
|
||||
changedSquiggleMetrics.PathNonExistent = newSquiggleMetrics.PathNonExistent;
|
||||
}
|
||||
@@ -1520,7 +1486,7 @@ export class CppProperties {
|
||||
if (this.configurationJson) {
|
||||
this.configurationJson.version = 3;
|
||||
for (let i: number = 0; i < this.configurationJson.configurations.length; i++) {
|
||||
const config: Configuration = this.configurationJson.configurations[i];
|
||||
let 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) {
|
||||
@@ -1539,9 +1505,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
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
let settings: CppSettings = new CppSettings(this.rootUri);
|
||||
for (let i: number = 0; i < this.configurationJson.configurations.length; i++) {
|
||||
const config: Configuration = this.configurationJson.configurations[i];
|
||||
let config: Configuration = this.configurationJson.configurations[i];
|
||||
|
||||
if (config.intelliSenseMode === undefined && !settings.defaultIntelliSenseMode) {
|
||||
config.intelliSenseMode = this.getIntelliSenseModeForPlatform(config.name);
|
||||
@@ -1569,7 +1535,7 @@ export class CppProperties {
|
||||
|
||||
public checkCppProperties(): void {
|
||||
// Check for change properties in case of file watcher failure.
|
||||
const propertiesFile: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
let 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 {
|
||||
const missing: string[] = [];
|
||||
let missing: string[] = [];
|
||||
if (!provider.name) {
|
||||
missing.push("'name'");
|
||||
}
|
||||
@@ -162,14 +162,14 @@ export class CustomConfigurationProviderCollection {
|
||||
return false;
|
||||
}
|
||||
|
||||
const wrapper: CustomProviderWrapper = new CustomProviderWrapper(provider, version);
|
||||
let wrapper: CustomProviderWrapper = new CustomProviderWrapper(provider, version);
|
||||
if (!wrapper.isValid) {
|
||||
this.logProblems(provider, version);
|
||||
return false;
|
||||
}
|
||||
|
||||
let exists: boolean = false;
|
||||
const existing: CustomProviderWrapper | undefined = this.providers.get(wrapper.extensionId);
|
||||
let 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 {
|
||||
const id: string = this.getId(provider);
|
||||
let 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;
|
||||
}
|
||||
const found: CustomConfigurationProvider1[] = [];
|
||||
let found: CustomConfigurationProvider1[] = [];
|
||||
let noUpdate: boolean = false;
|
||||
this.forEach(provider => {
|
||||
if (provider.extensionId === providerId) {
|
||||
@@ -241,7 +241,7 @@ export class CustomConfigurationProviderCollection {
|
||||
}
|
||||
}
|
||||
|
||||
const providerCollection: CustomConfigurationProviderCollection = new CustomConfigurationProviderCollection();
|
||||
let 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, OtherSettings } from './settings';
|
||||
import { CppSettings } 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;
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
let languageConfigurations: vscode.Disposable[] = [];
|
||||
let intervalTimer: NodeJS.Timer;
|
||||
let insiderUpdateEnabled: boolean = false;
|
||||
@@ -75,10 +75,10 @@ function initVcpkgDatabase(): Promise<vcpkgDatabase> {
|
||||
resolve({});
|
||||
return;
|
||||
}
|
||||
const database: vcpkgDatabase = {};
|
||||
const reader: rd.ReadLine = rd.createInterface(stream);
|
||||
let database: vcpkgDatabase = {};
|
||||
let reader: rd.ReadLine = rd.createInterface(stream);
|
||||
reader.on('line', (lineText: string) => {
|
||||
const portFilePair: string[] = lineText.split(':');
|
||||
let portFilePair: string[] = lineText.split(':');
|
||||
if (portFilePair.length !== 2) {
|
||||
return;
|
||||
}
|
||||
@@ -215,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) {
|
||||
const config: string = path.join(vscode.workspace.workspaceFolders[i].uri.fsPath, ".vscode/c_cpp_properties.json");
|
||||
let config: string = path.join(vscode.workspace.workspaceFolders[i].uri.fsPath, ".vscode/c_cpp_properties.json");
|
||||
if (fs.existsSync(config)) {
|
||||
onActivationEvent();
|
||||
return;
|
||||
@@ -226,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) {
|
||||
const document: vscode.TextDocument = vscode.workspace.textDocuments[i];
|
||||
let document: vscode.TextDocument = vscode.workspace.textDocuments[i];
|
||||
if (document.uri.scheme === "file") {
|
||||
if (document.languageId === "cpp" || document.languageId === "c") {
|
||||
onActivationEvent();
|
||||
@@ -343,13 +343,12 @@ export async function getBuildTasks(returnCompilerPath: boolean, appendSourceToN
|
||||
return [];
|
||||
}
|
||||
|
||||
const createTask: (compilerPath: string, compilerArgs?: string []) => vscode.Task = (compilerPath: string, compilerArgs?: string []) => {
|
||||
let 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 compilerPathDir: string = path.dirname(compilerPath);
|
||||
const taskName: string = (appendSourceToName ? taskSourceStr + ": " : "") + compilerPathBase + " build active file";
|
||||
const isCl: boolean = compilerPathBase === "cl.exe";
|
||||
const cwd: string = isWindows && !isCl && !process.env.PATH?.includes(compilerPathDir) ? compilerPathDir : "${workspaceFolder}";
|
||||
const cwd: string = "${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);
|
||||
@@ -369,7 +368,7 @@ export async function getBuildTasks(returnCompilerPath: boolean, appendSourceToN
|
||||
}
|
||||
|
||||
const command: vscode.ShellExecution = new vscode.ShellExecution(compilerPath, [...args], { cwd: cwd });
|
||||
const uri: vscode.Uri | undefined = clients.ActiveClient.RootUri;
|
||||
let uri: vscode.Uri | undefined = clients.ActiveClient.RootUri;
|
||||
if (!uri) {
|
||||
throw new Error("No client URI found in getBuildTasks()");
|
||||
}
|
||||
@@ -377,7 +376,7 @@ export async function getBuildTasks(returnCompilerPath: boolean, appendSourceToN
|
||||
if (!target) {
|
||||
throw new Error("No target WorkspaceFolder found in getBuildTasks()");
|
||||
}
|
||||
const task: vscode.Task = new vscode.Task(kind, target, taskName, taskSourceStr, command, isCl ? '$msCompile' : '$gcc');
|
||||
let 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;
|
||||
|
||||
@@ -394,7 +393,7 @@ export async function getBuildTasks(returnCompilerPath: boolean, appendSourceToN
|
||||
|
||||
// Task for user compiler path setting
|
||||
if (userCompilerPath) {
|
||||
const task: vscode.Task = createTask(userCompilerPath, userCompilerPathAndArgs?.additionalArgs);
|
||||
let task: vscode.Task = createTask(userCompilerPath, userCompilerPathAndArgs?.additionalArgs);
|
||||
buildTasks.push(task);
|
||||
}
|
||||
|
||||
@@ -428,10 +427,10 @@ function realActivation(): void {
|
||||
throw new Error(intelliSenseDisabledError);
|
||||
} else {
|
||||
console.log("activating extension");
|
||||
const checkForConflictingExtensions: PersistentState<boolean> = new PersistentState<boolean>("CPP." + util.packageJson.version + ".checkForConflictingExtensions", true);
|
||||
let checkForConflictingExtensions: PersistentState<boolean> = new PersistentState<boolean>("CPP." + util.packageJson.version + ".checkForConflictingExtensions", true);
|
||||
if (checkForConflictingExtensions.Value) {
|
||||
checkForConflictingExtensions.Value = false;
|
||||
const clangCommandAdapterActive: boolean = vscode.extensions.all.some((extension: vscode.Extension<any>, index: number, array: Readonly<vscode.Extension<any>[]>): boolean =>
|
||||
let 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");
|
||||
@@ -469,8 +468,8 @@ 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.
|
||||
const vscodeVersion: PackageVersion = new PackageVersion(vscode.version);
|
||||
const minimumSupportedVersionForInsidersUpgrades: PackageVersion = new PackageVersion("1.43.2");
|
||||
let vscodeVersion: PackageVersion = new PackageVersion(vscode.version);
|
||||
let minimumSupportedVersionForInsidersUpgrades: PackageVersion = new PackageVersion("1.43.2");
|
||||
if (vscodeVersion.isGreaterThan(minimumSupportedVersionForInsidersUpgrades, "insider")) {
|
||||
insiderUpdateEnabled = true;
|
||||
if (settings.updateChannel === 'Default') {
|
||||
@@ -500,7 +499,7 @@ export function updateLanguageConfigurations(): void {
|
||||
* workspace events
|
||||
*/
|
||||
function onDidChangeSettings(event: vscode.ConfigurationChangeEvent): void {
|
||||
const activeClient: Client = clients.ActiveClient;
|
||||
let activeClient: Client = clients.ActiveClient;
|
||||
const changedActiveClientSettings: { [key: string]: string } = activeClient.onDidChangeSettings(event, true);
|
||||
clients.forEach(client => {
|
||||
if (client !== activeClient) {
|
||||
@@ -529,7 +528,7 @@ export function onDidChangeActiveTextEditor(editor?: vscode.TextEditor): void {
|
||||
return;
|
||||
}
|
||||
|
||||
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
let 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 {
|
||||
@@ -558,37 +557,26 @@ function onDidChangeTextEditorSelection(event: vscode.TextEditorSelectionChangeE
|
||||
}
|
||||
|
||||
export function processDelayedDidOpen(document: vscode.TextDocument): void {
|
||||
const client: Client = clients.getClientFor(document.uri);
|
||||
let 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") {
|
||||
const cppSettings: CppSettings = new CppSettings();
|
||||
let 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;
|
||||
}
|
||||
}
|
||||
if (!languageChanged) {
|
||||
finishDidOpen(document);
|
||||
}
|
||||
client.provideCustomConfiguration(document.uri, undefined);
|
||||
client.notifyWhenReady(() => {
|
||||
client.takeOwnership(document);
|
||||
client.onDidOpenTextDocument(document);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -603,7 +591,7 @@ function onDidChangeVisibleTextEditors(editors: vscode.TextEditor[]): void {
|
||||
});
|
||||
|
||||
clients.forEach(client => {
|
||||
const editorsForThisClient: vscode.TextEditor[] = [];
|
||||
let 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")) {
|
||||
@@ -619,7 +607,7 @@ function onDidChangeVisibleTextEditors(editors: vscode.TextEditor[]): void {
|
||||
}
|
||||
|
||||
function onDidChangeTextEditorVisibleRanges(textEditorVisibleRangesChangeEvent: vscode.TextEditorVisibleRangesChangeEvent): void {
|
||||
const languageId: String = textEditorVisibleRangesChangeEvent.textEditor.document.languageId;
|
||||
let languageId: String = textEditorVisibleRangesChangeEvent.textEditor.document.languageId;
|
||||
if (languageId === "c" || languageId === "cpp") {
|
||||
clients.forEach(client => {
|
||||
if (clients.checkOwnership(client, textEditorVisibleRangesChangeEvent.textEditor.document)) {
|
||||
@@ -639,10 +627,10 @@ function onInterval(): void {
|
||||
* @param updateChannel The user's updateChannel setting.
|
||||
*/
|
||||
function installVsix(vsixLocation: string): Thenable<void> {
|
||||
const userVersion: PackageVersion = new PackageVersion(vscode.version);
|
||||
let userVersion: PackageVersion = new PackageVersion(vscode.version);
|
||||
|
||||
// 1.33.0 introduces workbench.extensions.installExtension. 1.32.3 was immediately prior.
|
||||
const lastVersionWithoutInstallExtensionCommand: PackageVersion = new PackageVersion('1.32.3');
|
||||
let lastVersionWithoutInstallExtensionCommand: PackageVersion = new PackageVersion('1.32.3');
|
||||
if (userVersion.isGreaterThan(lastVersionWithoutInstallExtensionCommand, "insider")) {
|
||||
return vscode.commands.executeCommand('workbench.extensions.installExtension', vscode.Uri.file(vsixLocation));
|
||||
}
|
||||
@@ -681,7 +669,7 @@ function installVsix(vsixLocation: string): Thenable<void> {
|
||||
}
|
||||
|
||||
// 1.28.0 changes the CLI for making installations. 1.27.2 was immediately prior.
|
||||
const oldVersion: PackageVersion = new PackageVersion('1.27.2');
|
||||
let oldVersion: PackageVersion = new PackageVersion('1.27.2');
|
||||
if (userVersion.isGreaterThan(oldVersion, "insider")) {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let process: ChildProcess;
|
||||
@@ -733,7 +721,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;
|
||||
const stdout: Readable | null = process.stdout;
|
||||
let stdout: Readable | null = process.stdout;
|
||||
if (!stdout) {
|
||||
reject(new Error("Failed to communicate with VS Code script process for installation"));
|
||||
return;
|
||||
@@ -742,7 +730,7 @@ function installVsix(vsixLocation: string): Thenable<void> {
|
||||
if (sentOverride) {
|
||||
return;
|
||||
}
|
||||
const stdin: Writable | null = process.stdin;
|
||||
let stdin: Writable | null = process.stdin;
|
||||
if (!stdin) {
|
||||
reject(new Error("Failed to communicate with VS Code script process for installation"));
|
||||
return;
|
||||
@@ -757,7 +745,7 @@ function installVsix(vsixLocation: string): Thenable<void> {
|
||||
}
|
||||
|
||||
async function suggestInsidersChannel(): Promise<void> {
|
||||
const suggestInsiders: PersistentState<boolean> = new PersistentState<boolean>("CPP.suggestInsiders", true);
|
||||
let suggestInsiders: PersistentState<boolean> = new PersistentState<boolean>("CPP.suggestInsiders", true);
|
||||
|
||||
if (!suggestInsiders.Value) {
|
||||
return;
|
||||
@@ -779,7 +767,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");
|
||||
const selection: string | undefined = await vscode.window.showInformationMessage(message, yes, askLater, dontShowAgain);
|
||||
let selection: string | undefined = await vscode.window.showInformationMessage(message, yes, askLater, dontShowAgain);
|
||||
switch (selection) {
|
||||
case yes:
|
||||
// Cache buildInfo.
|
||||
@@ -803,8 +791,8 @@ async function applyUpdate(buildInfo: BuildInfo): Promise<void> {
|
||||
tempVSIX = await util.createTempFileWithPostfix('.vsix');
|
||||
|
||||
// Try to download VSIX
|
||||
const config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration();
|
||||
const originalProxySupport: string | undefined = config.inspect<string>('http.proxySupport')?.globalValue;
|
||||
let config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration();
|
||||
let 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);
|
||||
@@ -917,14 +905,13 @@ 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();
|
||||
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
let activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
if (!activeEditor || !activeEditor.document) {
|
||||
return;
|
||||
}
|
||||
@@ -934,7 +921,7 @@ function onSwitchHeaderSource(): void {
|
||||
}
|
||||
|
||||
let rootPath: string = clients.ActiveClient.RootPath;
|
||||
const fileName: string = activeEditor.document.fileName;
|
||||
let fileName: string = activeEditor.document.fileName;
|
||||
|
||||
if (!rootPath) {
|
||||
rootPath = path.dirname(fileName); // When switching without a folder open.
|
||||
@@ -973,7 +960,7 @@ function selectClient(): Thenable<Client> {
|
||||
} else {
|
||||
return ui.showWorkspaces(clients.Names).then(key => {
|
||||
if (key !== "") {
|
||||
const client: Client | undefined = clients.get(key);
|
||||
let client: Client | undefined = clients.get(key);
|
||||
if (client) {
|
||||
return client;
|
||||
} else {
|
||||
@@ -1052,28 +1039,28 @@ function onAddToIncludePath(path: string): void {
|
||||
function onEnableSquiggles(): void {
|
||||
onActivationEvent();
|
||||
// This only applies to the active client.
|
||||
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
let settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
settings.update<string>("errorSquiggles", "Enabled");
|
||||
}
|
||||
|
||||
function onDisableSquiggles(): void {
|
||||
onActivationEvent();
|
||||
// This only applies to the active client.
|
||||
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
let settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
settings.update<string>("errorSquiggles", "Disabled");
|
||||
}
|
||||
|
||||
function onToggleIncludeFallback(): void {
|
||||
onActivationEvent();
|
||||
// This only applies to the active client.
|
||||
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
let settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
settings.toggleSetting("intelliSenseEngineFallback", "Enabled", "Disabled");
|
||||
}
|
||||
|
||||
function onToggleDimInactiveRegions(): void {
|
||||
onActivationEvent();
|
||||
// This only applies to the active client.
|
||||
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
let settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
settings.update<boolean>("dimInactiveRegions", !settings.dimInactiveRegions);
|
||||
}
|
||||
|
||||
@@ -1099,14 +1086,14 @@ function onShowReferencesProgress(): void {
|
||||
|
||||
function onToggleRefGroupView(): void {
|
||||
// Set context to switch icons
|
||||
const client: Client = getActiveClient();
|
||||
let client: Client = getActiveClient();
|
||||
client.toggleReferenceResultsView();
|
||||
}
|
||||
|
||||
function onTakeSurvey(): void {
|
||||
onActivationEvent();
|
||||
telemetry.logLanguageServerEvent("onTakeSurvey");
|
||||
const uri: vscode.Uri = vscode.Uri.parse(`https://www.research.net/r/VBVV6C6?o=${os.platform()}&m=${vscode.env.machineId}`);
|
||||
let 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);
|
||||
}
|
||||
|
||||
@@ -1151,7 +1138,7 @@ async function onVcpkgClipboardInstallSuggested(ports?: string[]): Promise<void>
|
||||
}
|
||||
|
||||
// Queue look ups in the vcpkg database for missing ports; filter out duplicate results
|
||||
const portsPromises: Promise<string[]>[] = [];
|
||||
let portsPromises: Promise<string[]>[] = [];
|
||||
missingIncludeLocations.forEach(docAndLineNumbers => {
|
||||
docAndLineNumbers[1].forEach(async line => {
|
||||
portsPromises.push(lookupIncludeInVcpkg(docAndLineNumbers[0], line));
|
||||
@@ -1161,7 +1148,7 @@ async function onVcpkgClipboardInstallSuggested(ports?: string[]): Promise<void>
|
||||
if (!ports.length) {
|
||||
return;
|
||||
}
|
||||
const ports2: string[] = ports;
|
||||
let ports2: string[] = ports;
|
||||
ports = ports2.filter((port: string, index: number) => ports2.indexOf(port) === index);
|
||||
}
|
||||
|
||||
@@ -1180,10 +1167,6 @@ 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();
|
||||
@@ -1221,9 +1204,9 @@ function reportMacCrashes(): void {
|
||||
if (!home) {
|
||||
return;
|
||||
}
|
||||
const crashFolder: string = path.resolve(home, "Library/Logs/DiagnosticReports");
|
||||
let crashFolder: string = path.resolve(home, "Library/Logs/DiagnosticReports");
|
||||
fs.stat(crashFolder, (err, stats) => {
|
||||
const crashObject: { [key: string]: string } = {};
|
||||
let crashObject: { [key: string]: string } = {};
|
||||
if (err?.code) {
|
||||
// If the directory isn't there, we have a problem...
|
||||
crashObject["fs.stat: err.code"] = err.code;
|
||||
@@ -1264,7 +1247,7 @@ function reportMacCrashes(): void {
|
||||
}
|
||||
|
||||
function logCrashTelemetry(data: string): void {
|
||||
const crashObject: { [key: string]: string } = {};
|
||||
let crashObject: { [key: string]: string } = {};
|
||||
crashObject["CrashingThreadCallStack"] = data;
|
||||
telemetry.logLanguageServerEvent("MacCrash", crashObject, undefined);
|
||||
}
|
||||
@@ -1277,7 +1260,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 = "";
|
||||
const startVersion: number = data.indexOf("Version:");
|
||||
let 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)/);
|
||||
@@ -1319,7 +1302,7 @@ function handleCrashFileRead(err: NodeJS.ErrnoException | undefined | null, data
|
||||
}
|
||||
|
||||
// Remove runtime lines because they can be different on different machines.
|
||||
const lines: string[] = data.split("\n");
|
||||
let 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 (const char of chars) {
|
||||
for (let 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("/*")) {
|
||||
const match: string = escape(insert.substr(2)); // trim the leading '/*' and escape any troublesome characters.
|
||||
let 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) {
|
||||
const match: string = escape(insert.trimRight());
|
||||
let match: string = escape(insert.trimRight());
|
||||
if (match) {
|
||||
const right: string = escape(insert.substr(insert.trimRight().length));
|
||||
let 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 {
|
||||
const match: string = escape(insert.trimRight().trimLeft());
|
||||
let 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);
|
||||
}
|
||||
const match: string = escape(insert.trimRight());
|
||||
let 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 {
|
||||
const match: string = escape(insert.trimRight());
|
||||
let match: string = escape(insert.trimRight());
|
||||
return `^\\s*${match}.*$`;
|
||||
}
|
||||
|
||||
function getSLContinuePattern(insert: string): string {
|
||||
const match: string = escape(insert.trimRight());
|
||||
let match: string = escape(insert.trimRight());
|
||||
return `^\\s*${match}.+$`;
|
||||
}
|
||||
|
||||
function getSLEndPattern(insert: string): string {
|
||||
let match: string = escape(insert);
|
||||
const trimmed: string = escape(insert.trimRight());
|
||||
let 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 {
|
||||
const beforePattern: string | undefined = getMLBeginPattern(comment.begin);
|
||||
let 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 {
|
||||
const beforePattern: string | undefined = getMLBeginPattern(comment.begin);
|
||||
let 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 {
|
||||
const continuePattern: string | undefined = getMLContinuePattern(comment.continue);
|
||||
let 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 {
|
||||
const endPattern: string | undefined = getMLEndPattern(comment.continue);
|
||||
let 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 {
|
||||
const endPattern: string | undefined = getMLEmptyEndPattern(comment.continue);
|
||||
let 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 {
|
||||
const continuePattern: string = getSLBeginPattern(comment.begin);
|
||||
let 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 {
|
||||
const continuePattern: string = getSLContinuePattern(comment.continue);
|
||||
let 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 {
|
||||
const endPattern: string = getSLEndPattern(comment.continue);
|
||||
let 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 {
|
||||
const settings: CppSettings = new CppSettings(resource);
|
||||
const patterns: (string | CommentPattern)[] | undefined = settings.commentContinuationPatterns;
|
||||
let settings: CppSettings = new CppSettings(resource);
|
||||
let patterns: (string | CommentPattern)[] | undefined = settings.commentContinuationPatterns;
|
||||
return getLanguageConfigFromPatterns(languageId, patterns);
|
||||
}
|
||||
|
||||
export function getLanguageConfigFromPatterns(languageId: string, patterns?: (string | CommentPattern)[]): vscode.LanguageConfiguration {
|
||||
const beginPatterns: string[] = []; // avoid duplicate rules
|
||||
const continuePatterns: string[] = []; // avoid duplicate rules
|
||||
let beginPatterns: string[] = []; // avoid duplicate rules
|
||||
let 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 => {
|
||||
const c: CommentPattern = isString(pattern) ? { begin: pattern, continue: pattern.startsWith('/*') ? " * " : pattern } : <CommentPattern>pattern;
|
||||
const r: Rules = constructCommentRules(c, languageId);
|
||||
let c: CommentPattern = isString(pattern) ? { begin: pattern, continue: pattern.startsWith('/*') ? " * " : pattern } : <CommentPattern>pattern;
|
||||
let 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')) {
|
||||
const mlBegin1: vscode.OnEnterRule | undefined = getMLSplitRule(comment);
|
||||
let mlBegin1: vscode.OnEnterRule | undefined = getMLSplitRule(comment);
|
||||
if (!mlBegin1) {
|
||||
throw new Error("Failure in constructCommentRules() - mlBegin1");
|
||||
}
|
||||
const mlBegin2: vscode.OnEnterRule | undefined = getMLFirstLineRule(comment);
|
||||
let mlBegin2: vscode.OnEnterRule | undefined = getMLFirstLineRule(comment);
|
||||
if (!mlBegin2) {
|
||||
throw new Error("Failure in constructCommentRules() - mlBegin2");
|
||||
}
|
||||
const mlContinue: vscode.OnEnterRule | undefined = getMLContinuationRule(comment);
|
||||
let mlContinue: vscode.OnEnterRule | undefined = getMLContinuationRule(comment);
|
||||
if (!mlContinue) {
|
||||
throw new Error("Failure in constructCommentRules() - mlContinue");
|
||||
}
|
||||
const mlEnd1: vscode.OnEnterRule | undefined = getMLEmptyEndRule(comment);
|
||||
let mlEnd1: vscode.OnEnterRule | undefined = getMLEmptyEndRule(comment);
|
||||
if (!mlEnd1) {
|
||||
throw new Error("Failure in constructCommentRules() - mlEnd1");
|
||||
}
|
||||
const mlEnd2: vscode.OnEnterRule | undefined = getMLEndRule(comment);
|
||||
let 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') {
|
||||
const slContinue: vscode.OnEnterRule = getSLContinuationRule(comment);
|
||||
const slEnd: vscode.OnEnterRule = getSLEndRule(comment);
|
||||
let slContinue: vscode.OnEnterRule = getSLContinuationRule(comment);
|
||||
let slEnd: vscode.OnEnterRule = getSLEndRule(comment);
|
||||
if (comment.begin !== comment.continue) {
|
||||
const slBegin: vscode.OnEnterRule = getSLFirstLineRule(comment);
|
||||
let 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.
|
||||
const old_key: string = key + (folder ? `-${path.basename(folder.uri.fsPath)}` : "-untitled");
|
||||
let 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);
|
||||
}
|
||||
}
|
||||
const newKey: string = key + (folder ? `-${folder.uri.fsPath}` : "-untitled");
|
||||
let newKey: string = key + (folder ? `-${folder.uri.fsPath}` : "-untitled");
|
||||
super(newKey, defaultValue);
|
||||
if (old_val !== undefined) {
|
||||
this.Value = old_val;
|
||||
|
||||
@@ -9,56 +9,45 @@ import { Middleware } from 'vscode-languageclient';
|
||||
import { ClientCollection } from './clientCollection';
|
||||
import { Client } from './client';
|
||||
import * as vscode from 'vscode';
|
||||
import { CppSettings, OtherSettings } from './settings';
|
||||
import { CppSettings } from './settings';
|
||||
import { onDidChangeActiveTextEditor, processDelayedDidOpen } from './extension';
|
||||
|
||||
export function createProtocolFilter(clients: ClientCollection): Middleware {
|
||||
// Disabling lint for invoke handlers
|
||||
const defaultHandler: (data: any, callback: (data: any) => void) => void = (data, callback: (data: any) => void) => { clients.ActiveClient.notifyWhenReady(() => callback(data)); };
|
||||
let 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; };
|
||||
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));
|
||||
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));
|
||||
/* tslint:enable */
|
||||
|
||||
return {
|
||||
didOpen: (document, sendMessage) => {
|
||||
const editor: vscode.TextEditor | undefined = vscode.window.visibleTextEditors.find(e => e.document === document);
|
||||
let 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.
|
||||
const me: Client = clients.getClientFor(document.uri);
|
||||
let 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") {
|
||||
const cppSettings: CppSettings = new CppSettings();
|
||||
let 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;
|
||||
}
|
||||
}
|
||||
if (!languageChanged) {
|
||||
finishDidOpen(document);
|
||||
}
|
||||
me.provideCustomConfiguration(document.uri, undefined);
|
||||
me.notifyWhenReady(() => {
|
||||
sendMessage(document);
|
||||
me.onDidOpenTextDocument(document);
|
||||
if (editor && editor === vscode.window.activeTextEditor) {
|
||||
onDidChangeActiveTextEditor(editor);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// NO-OP
|
||||
@@ -71,7 +60,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware {
|
||||
}
|
||||
},
|
||||
didChange: (textDocumentChangeEvent, sendMessage) => {
|
||||
const me: Client = clients.getClientFor(textDocumentChangeEvent.document.uri);
|
||||
let me: Client = clients.getClientFor(textDocumentChangeEvent.document.uri);
|
||||
if (!me.TrackedDocuments.has(textDocumentChangeEvent.document)) {
|
||||
processDelayedDidOpen(textDocumentChangeEvent.document);
|
||||
}
|
||||
@@ -80,7 +69,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware {
|
||||
},
|
||||
willSave: defaultHandler,
|
||||
willSaveWaitUntil: (event, sendMessage) => {
|
||||
const me: Client = clients.getClientFor(event.document.uri);
|
||||
let me: Client = clients.getClientFor(event.document.uri);
|
||||
if (me.TrackedDocuments.has(event.document)) {
|
||||
return me.requestWhenReady(() => sendMessage(event));
|
||||
}
|
||||
@@ -88,7 +77,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware {
|
||||
},
|
||||
didSave: defaultHandler,
|
||||
didClose: (document, sendMessage) => {
|
||||
const me: Client = clients.getClientFor(document.uri);
|
||||
let me: Client = clients.getClientFor(document.uri);
|
||||
if (me.TrackedDocuments.has(document)) {
|
||||
me.onDidCloseTextDocument(document);
|
||||
me.TrackedDocuments.delete(document);
|
||||
@@ -99,7 +88,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware {
|
||||
provideCompletionItem: invoke4,
|
||||
resolveCompletionItem: invoke2,
|
||||
provideHover: (document, position, token, next: (document: any, position: any, token: any) => any) => {
|
||||
const me: Client = clients.getClientFor(document.uri);
|
||||
let 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;
|
||||
}
|
||||
|
||||
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);
|
||||
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);
|
||||
return {
|
||||
light: lightPathUri,
|
||||
dark: darkPathUri
|
||||
@@ -148,10 +148,10 @@ export function getReferenceTypeIconPath(referenceType: ReferenceType): { light:
|
||||
}
|
||||
|
||||
function getReferenceCanceledIconPath(): { light: vscode.Uri; dark: vscode.Uri } {
|
||||
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);
|
||||
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);
|
||||
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 (const targetLocationProgress of this.referencesCurrentProgress.targetReferencesProgress) {
|
||||
for (let 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;
|
||||
|
||||
const mode: ReferencesCommandMode =
|
||||
let 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) {
|
||||
const msg: string = localize("some.references.may.be.missing", "[Warning] Some references may be missing, because workspace parsing was incomplete when {0} was started.",
|
||||
let 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) {
|
||||
const logChannel: vscode.OutputChannel = logger.getOutputChannel();
|
||||
let 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.
|
||||
const referencesRequestPending: boolean = this.referencesRequestPending;
|
||||
const referencesCanceled: boolean = this.referencesCanceled;
|
||||
let referencesRequestPending: boolean = this.referencesRequestPending;
|
||||
let referencesCanceled: boolean = this.referencesCanceled;
|
||||
this.referencesRequestPending = false;
|
||||
this.referencesCanceled = false;
|
||||
|
||||
const currentReferenceCommandMode: ReferencesCommandMode = this.client.ReferencesCommandMode;
|
||||
let 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) {
|
||||
const showConfirmedReferences: boolean = referencesCanceled;
|
||||
let showConfirmedReferences: boolean = referencesCanceled;
|
||||
if (this.findAllRefsView) {
|
||||
const peekReferencesResults: string = this.findAllRefsView.getResultsAsText(showConfirmedReferences);
|
||||
let 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;
|
||||
|
||||
const results: ReferenceInfo[] = resultsInput.referenceInfos.filter(r => r.type !== ReferenceType.Confirmed);
|
||||
let 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 (const r of results) {
|
||||
for (let r of results) {
|
||||
// Add reference to file
|
||||
const noReferenceLocation: boolean = (r.position.line === 0 && r.position.character === 0);
|
||||
let noReferenceLocation: boolean = (r.position.line === 0 && r.position.character === 0);
|
||||
if (noReferenceLocation) {
|
||||
const node: TreeNode = new TreeNode(this, NodeType.fileWithPendingRef);
|
||||
let 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);
|
||||
const node: TreeNode = new TreeNode(this, NodeType.reference);
|
||||
let 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[] {
|
||||
const result: TreeNode[] = [];
|
||||
for (const n of this.nodes) {
|
||||
const i: number = result.findIndex(e => e.referenceType === n.referenceType);
|
||||
let result: TreeNode[] = [];
|
||||
for (let n of this.nodes) {
|
||||
let i: number = result.findIndex(e => e.referenceType === n.referenceType);
|
||||
if (i < 0) {
|
||||
const node: TreeNode = new TreeNode(this, NodeType.referenceType);
|
||||
let 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[] {
|
||||
const result: TreeNode[] = [];
|
||||
let 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 (const n of filteredFiles) {
|
||||
const i: number = result.findIndex(item => item.filename === n.filename);
|
||||
for (let n of filteredFiles) {
|
||||
let i: number = result.findIndex(item => item.filename === n.filename);
|
||||
if (i < 0) {
|
||||
const nodeType: NodeType = (n.node === NodeType.fileWithPendingRef ? NodeType.fileWithPendingRef : NodeType.file);
|
||||
const node: TreeNode = new TreeNode(this, nodeType);
|
||||
let nodeType: NodeType = (n.node === NodeType.fileWithPendingRef ? NodeType.fileWithPendingRef : NodeType.file);
|
||||
let 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[] {
|
||||
const result: TreeNode[] = this.nodes.filter(i => i.node === NodeType.fileWithPendingRef);
|
||||
let 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);
|
||||
const resultRefType: vscode.TreeItem = new vscode.TreeItem(label, vscode.TreeItemCollapsibleState.Expanded);
|
||||
let 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()");
|
||||
}
|
||||
const resultFile: vscode.TreeItem = new vscode.TreeItem(element.fileUri);
|
||||
let 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]
|
||||
};
|
||||
const tag: string = getReferenceTagString(ReferenceType.ConfirmationInProgress, this.referencesModel.isCanceled);
|
||||
let 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()");
|
||||
}
|
||||
const resultRef: vscode.TreeItem = new vscode.TreeItem(element.referenceText, vscode.TreeItemCollapsibleState.None);
|
||||
let resultRef: vscode.TreeItem = new vscode.TreeItem(element.referenceText, vscode.TreeItemCollapsibleState.None);
|
||||
resultRef.iconPath = getReferenceItemIconPath(element.referenceType, this.referencesModel.isCanceled);
|
||||
const tag: string = getReferenceTagString(element.referenceType, this.referencesModel.isCanceled);
|
||||
let 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[] = [];
|
||||
const confirmedRefs: string[] = [];
|
||||
const otherRefs: string[] = [];
|
||||
const fileRefs: string[] = [];
|
||||
let confirmedRefs: string[] = [];
|
||||
let otherRefs: string[] = [];
|
||||
let fileRefs: string[] = [];
|
||||
|
||||
if (!this.referencesModel) {
|
||||
throw new Error("Missiung ReferencesModel in getResultsAsText()");
|
||||
}
|
||||
for (const ref of this.referencesModel.getAllReferenceNodes()) {
|
||||
for (let 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)
|
||||
const fileReferences: TreeNode[] = this.referencesModel.getAllFilesWithPendingReferenceNodes();
|
||||
for (const fileRef of fileReferences) {
|
||||
const line: string =
|
||||
let fileReferences: TreeNode[] = this.referencesModel.getAllFilesWithPendingReferenceNodes();
|
||||
for (let fileRef of fileReferences) {
|
||||
let 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 {
|
||||
const info: any = this.settings.inspect<T>(section);
|
||||
let 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;
|
||||
}
|
||||
const value: T | undefined = this.settings.get<T>(deprecatedSection);
|
||||
let 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 {
|
||||
const result: T | undefined | null = this.settings.get<T>(section);
|
||||
let 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 {
|
||||
const exePath: string = getExtensionFilePath(`./LLVM/bin/${this.clangFormatName}`);
|
||||
const output: string[] = execSync(`${exePath} --version`).toString().split(" ");
|
||||
let exePath: string = getExtensionFilePath(`./LLVM/bin/${this.clangFormatName}`);
|
||||
let 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 {
|
||||
const output: string[] = execSync(`"${path}" --version`).toString().split(" ");
|
||||
let 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 {
|
||||
const result: string | undefined | null = super.Section.get<string | null>("default.compilerPath");
|
||||
let result: string | undefined | null = super.Section.get<string | null>("default.compilerPath");
|
||||
if (result === null) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -155,7 +155,6 @@ 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"; }
|
||||
|
||||
@@ -172,7 +171,7 @@ export class CppSettings extends Settings {
|
||||
}
|
||||
|
||||
public toggleSetting(name: string, value1: string, value2: string): void {
|
||||
const value: string | undefined = super.Section.get<string>(name);
|
||||
let 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 (const compiler of knownCompilers) {
|
||||
for (let 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 {
|
||||
const splitEntries: (input: any) => string[] = (input: any) => input.split("\n").filter((e: string) => e);
|
||||
let 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 } {
|
||||
const filter: FilterFunction = (key: string, val: string, settings: vscode.WorkspaceConfiguration) => !this.areEqual(val, settings.inspect(key)?.defaultValue);
|
||||
let 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 } {
|
||||
const filter: FilterFunction = (key: string, val: string) => !(key in this.previousCppSettings) || !this.areEqual(val, this.previousCppSettings[key]);
|
||||
let 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;
|
||||
const result: { [key: string]: string } = {};
|
||||
let 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) {
|
||||
const val: any = settings.get(key);
|
||||
let 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).
|
||||
const curSetting: any = util.packageJson.contributes.configuration.properties["C_Cpp." + key];
|
||||
let curSetting: any = util.packageJson.contributes.configuration.properties["C_Cpp." + key];
|
||||
if (curSetting) {
|
||||
const type: string | undefined = this.typeMatch(val, curSetting["type"]);
|
||||
let type: string | undefined = this.typeMatch(val, curSetting["type"]);
|
||||
if (type) {
|
||||
if (type !== "string") {
|
||||
return val;
|
||||
}
|
||||
const curEnum: any[] = curSetting["enum"];
|
||||
let 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++) {
|
||||
const t: string = type[i];
|
||||
let 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": {
|
||||
const newKey: string = key + "2";
|
||||
let newKey: string = key + "2";
|
||||
if (val) {
|
||||
switch (String(val).toLowerCase()) {
|
||||
case "visual studio":
|
||||
|
||||
@@ -157,14 +157,14 @@ export class UI {
|
||||
}
|
||||
|
||||
public activeDocumentChanged(): void {
|
||||
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
let activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
if (!activeEditor) {
|
||||
this.ShowConfiguration = false;
|
||||
} else {
|
||||
const isCpp: boolean = (activeEditor.document.uri.scheme === "file" && (activeEditor.document.languageId === "cpp" || activeEditor.document.languageId === "c"));
|
||||
let 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.
|
||||
const isSettingsJson: boolean = ((activeEditor.document.fileName.endsWith("c_cpp_properties.json") || activeEditor.document.fileName.endsWith("settings.json")));
|
||||
let 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> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.a.configuration", "Select a Configuration...");
|
||||
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
let 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> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.configuration.provider", "Select a Configuration Provider...");
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
|
||||
const items: KeyedQuickPickItem[] = [];
|
||||
let 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> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.compile.commands", "Select a compile_commands.json...");
|
||||
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
let 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> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.workspace", "Select a workspace folder...");
|
||||
|
||||
const items: KeyedQuickPickItem[] = [];
|
||||
let items: KeyedQuickPickItem[] = [];
|
||||
workspaceNames.forEach(name => items.push({ label: name.name, description: "", key: name.key }));
|
||||
|
||||
return vscode.window.showQuickPick(items, options)
|
||||
@@ -237,10 +237,11 @@ export class UI {
|
||||
}
|
||||
|
||||
public showParsingCommands(): Thenable<number> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.parsing.command", "Select a parsing command...");
|
||||
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
let items: IndexableQuickPickItem[];
|
||||
items = [];
|
||||
if (this.browseEngineStatusBarItem.tooltip === "Parsing paused") {
|
||||
items.push({ label: localize("resume.parsing", "Resume Parsing"), description: "", index: 1 });
|
||||
} else {
|
||||
@@ -268,8 +269,8 @@ export class UI {
|
||||
}
|
||||
|
||||
private showConfigurationPrompt(priority: ConfigurationPriority, prompt: () => Thenable<boolean>, onSkip: () => void): void {
|
||||
const showPrompt: () => Thenable<ConfigurationResult> = async () => {
|
||||
const configured: boolean = await prompt();
|
||||
let showPrompt: () => Thenable<ConfigurationResult> = async () => {
|
||||
let 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();
|
||||
const newSettings: Settings = <Settings>JSON.parse(fileContent);
|
||||
let 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;
|
||||
const telemetryProperties: { [key: string]: string } = {};
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
const localConfigPath: string = util.getExtensionFilePath(localConfigFile);
|
||||
return util.downloadFileToDestination("https://go.microsoft.com/fwlink/?linkid=2097702", localConfigPath)
|
||||
.catch((error) => {
|
||||
|
||||
+50
-50
@@ -84,7 +84,7 @@ export function getRawTasksJson(): Promise<any> {
|
||||
}
|
||||
|
||||
export async function ensureBuildTaskExists(taskName: string): Promise<void> {
|
||||
const rawTasksJson: any = await getRawTasksJson();
|
||||
let rawTasksJson: any = await getRawTasksJson();
|
||||
|
||||
// Ensure that the task exists in the user's task.json. Task will not be found otherwise.
|
||||
if (!rawTasksJson.tasks) {
|
||||
@@ -105,9 +105,9 @@ export async function ensureBuildTaskExists(taskName: string): Promise<void> {
|
||||
|
||||
rawTasksJson.version = "2.0.0";
|
||||
|
||||
const selectedTask2: vscode.Task = selectedTask;
|
||||
let selectedTask2: vscode.Task = selectedTask;
|
||||
if (!rawTasksJson.tasks.find((task: any) => task.label === selectedTask2.definition.label)) {
|
||||
const task: any = {
|
||||
let task: any = {
|
||||
...selectedTask2.definition,
|
||||
problemMatcher: selectedTask2.problemMatchers,
|
||||
group: { kind: "build", "isDefault": true }
|
||||
@@ -116,8 +116,8 @@ export async function ensureBuildTaskExists(taskName: string): Promise<void> {
|
||||
}
|
||||
|
||||
// TODO: It's dangerous to overwrite this file. We could be wiping out comments.
|
||||
const settings: OtherSettings = new OtherSettings();
|
||||
const tasksJsonPath: string | undefined = getTasksJsonPath();
|
||||
let settings: OtherSettings = new OtherSettings();
|
||||
let tasksJsonPath: string | undefined = getTasksJsonPath();
|
||||
if (!tasksJsonPath) {
|
||||
throw new Error("Failed to get tasksJsonPath in ensureBuildTaskExists()");
|
||||
}
|
||||
@@ -131,7 +131,7 @@ export function fileIsCOrCppSource(file: string): boolean {
|
||||
}
|
||||
|
||||
export function isEditorFileCpp(file: string): boolean {
|
||||
const editor: vscode.TextEditor | undefined = vscode.window.visibleTextEditors.find(e => e.document.uri.toString() === file);
|
||||
let editor: vscode.TextEditor | undefined = vscode.window.visibleTextEditors.find(e => e.document.uri.toString() === file);
|
||||
if (!editor) {
|
||||
return false;
|
||||
}
|
||||
@@ -167,13 +167,13 @@ export function getTasksJsonPath(): string | undefined {
|
||||
|
||||
export function getVcpkgPathDescriptorFile(): string {
|
||||
if (process.platform === 'win32') {
|
||||
const pathPrefix: string | undefined = process.env.LOCALAPPDATA;
|
||||
let 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 {
|
||||
const pathPrefix: string | undefined = process.env.HOME;
|
||||
let pathPrefix: string | undefined = process.env.HOME;
|
||||
if (!pathPrefix) {
|
||||
throw new Error("Unable to read process.env.HOME");
|
||||
}
|
||||
@@ -203,7 +203,7 @@ export function getVcpkgRoot(): string {
|
||||
* @param document The document to check.
|
||||
*/
|
||||
export function isHeader(uri: vscode.Uri): boolean {
|
||||
const ext: string = path.extname(uri.fsPath);
|
||||
let ext: string = path.extname(uri.fsPath);
|
||||
return !ext || ext.startsWith(".h") || ext.startsWith(".H");
|
||||
}
|
||||
|
||||
@@ -242,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.
|
||||
|
||||
const installProgressStr: string = "CPP." + packageJson.version + ".Progress";
|
||||
const intelliSenseProgressStr: string = "CPP." + packageJson.version + ".IntelliSenseProgress";
|
||||
let installProgressStr: string = "CPP." + packageJson.version + ".Progress";
|
||||
let intelliSenseProgressStr: string = "CPP." + packageJson.version + ".IntelliSenseProgress";
|
||||
|
||||
export function getProgress(): number {
|
||||
return extensionContext ? extensionContext.globalState.get<number>(installProgressStr, -1) : -1;
|
||||
@@ -256,7 +256,7 @@ export function getIntelliSenseProgress(): number {
|
||||
export function setProgress(progress: number): void {
|
||||
if (extensionContext && getProgress() < progress) {
|
||||
extensionContext.globalState.update(installProgressStr, progress);
|
||||
const telemetryProperties: { [key: string]: string } = {};
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
let progressName: string | undefined;
|
||||
switch (progress) {
|
||||
case 0: progressName = "install started"; break;
|
||||
@@ -275,7 +275,7 @@ export function setProgress(progress: number): void {
|
||||
export function setIntelliSenseProgress(progress: number): void {
|
||||
if (extensionContext && getIntelliSenseProgress() < progress) {
|
||||
extensionContext.globalState.update(intelliSenseProgressStr, progress);
|
||||
const telemetryProperties: { [key: string]: string } = {};
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
let progressName: string | undefined;
|
||||
switch (progress) {
|
||||
case progressIntelliSenseNoSquiggles: progressName = "IntelliSense no squiggles"; break;
|
||||
@@ -346,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;
|
||||
const cycleCache: Set<string> = new Set();
|
||||
let 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) => {
|
||||
@@ -359,7 +359,7 @@ export function resolveVariables(input: string | undefined, additionalEnvironmen
|
||||
switch (varType) {
|
||||
case "env": {
|
||||
if (additionalEnvironment) {
|
||||
const v: string | string[] | undefined = additionalEnvironment[name];
|
||||
let v: string | string[] | undefined = additionalEnvironment[name];
|
||||
if (isString(v)) {
|
||||
newValue = v;
|
||||
} else if (input === match && isArrayOfString(v)) {
|
||||
@@ -372,7 +372,7 @@ export function resolveVariables(input: string | undefined, additionalEnvironmen
|
||||
break;
|
||||
}
|
||||
case "config": {
|
||||
const config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration();
|
||||
let config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration();
|
||||
if (config) {
|
||||
newValue = config.get<string>(name);
|
||||
}
|
||||
@@ -383,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) {
|
||||
const folder: vscode.WorkspaceFolder | undefined = vscode.workspace.workspaceFolders.find(folder => folder.name.toLocaleLowerCase() === name.toLocaleLowerCase());
|
||||
let folder: vscode.WorkspaceFolder | undefined = vscode.workspace.workspaceFolders.find(folder => folder.name.toLocaleLowerCase() === name.toLocaleLowerCase());
|
||||
if (folder) {
|
||||
newValue = folder.uri.fsPath;
|
||||
}
|
||||
@@ -399,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) => {
|
||||
const newValue: string | undefined = (process.platform === 'win32') ? process.env.USERPROFILE : process.env.HOME;
|
||||
let newValue: string | undefined = (process.platform === 'win32') ? process.env.USERPROFILE : process.env.HOME;
|
||||
return newValue ? newValue : match;
|
||||
});
|
||||
|
||||
@@ -441,13 +441,13 @@ export function getHttpsProxyAgent(): HttpsProxyAgent | undefined {
|
||||
}
|
||||
|
||||
// Basic sanity checking on proxy url
|
||||
const proxyUrl: any = url.parse(proxy);
|
||||
let proxyUrl: any = url.parse(proxy);
|
||||
if (proxyUrl.protocol !== "https:" && proxyUrl.protocol !== "http:") {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const strictProxy: any = vscode.workspace.getConfiguration().get("http.proxyStrictSSL", true);
|
||||
const proxyOptions: any = {
|
||||
let strictProxy: any = vscode.workspace.getConfiguration().get("http.proxyStrictSSL", true);
|
||||
let proxyOptions: any = {
|
||||
host: proxyUrl.hostname,
|
||||
port: parseInt(proxyUrl.port, 10),
|
||||
auth: proxyUrl.auth,
|
||||
@@ -663,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 });
|
||||
|
||||
const stdout: Readable | null = child.stdout;
|
||||
let stdout: Readable | null = child.stdout;
|
||||
if (stdout) {
|
||||
stdout.on('data', (data) => {
|
||||
dataCallback(`${data}`);
|
||||
});
|
||||
}
|
||||
|
||||
const stderr: Readable | null = child.stderr;
|
||||
let stderr: Readable | null = child.stderr;
|
||||
if (stderr) {
|
||||
stderr.on('data', (data) => {
|
||||
errorCallback(`${data}`);
|
||||
@@ -730,9 +730,9 @@ export function allowExecution(file: string): Promise<void> {
|
||||
}
|
||||
|
||||
export function removePotentialPII(str: string): string {
|
||||
const words: string[] = str.split(" ");
|
||||
let words: string[] = str.split(" ");
|
||||
let result: string = "";
|
||||
for (const word of words) {
|
||||
for (let word of words) {
|
||||
if (word.indexOf(".") === -1 && word.indexOf("/") === -1 && word.indexOf("\\") === -1 && word.indexOf(":") === -1) {
|
||||
result += word + " ";
|
||||
} else {
|
||||
@@ -777,7 +777,7 @@ export function promptForReloadWindowDueToSettingsChange(): void {
|
||||
}
|
||||
|
||||
export function promptReloadWindow(message: string): void {
|
||||
const reload: string = localize("reload.string", "Reload");
|
||||
let reload: string = localize("reload.string", "Reload");
|
||||
vscode.window.showInformationMessage(message, reload).then((value?: string) => {
|
||||
if (value === reload) {
|
||||
vscode.commands.executeCommand("workbench.action.reloadWindow");
|
||||
@@ -798,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) => {
|
||||
const parsedUrl: url.Url = url.parse(urlStr);
|
||||
const request: ClientRequest = https.request({
|
||||
let parsedUrl: url.Url = url.parse(urlStr);
|
||||
let request: ClientRequest = https.request({
|
||||
host: parsedUrl.host,
|
||||
path: parsedUrl.path,
|
||||
agent: getHttpsProxyAgent(),
|
||||
@@ -823,7 +823,7 @@ export function downloadFileToDestination(urlStr: string, destinationPath: strin
|
||||
return reject();
|
||||
}
|
||||
// Write file using downloaded data
|
||||
const createdFile: fs.WriteStream = fs.createWriteStream(destinationPath);
|
||||
let createdFile: fs.WriteStream = fs.createWriteStream(destinationPath);
|
||||
createdFile.on('finish', () => { resolve(); });
|
||||
response.on('error', (error) => { reject(error); });
|
||||
response.pipe(createdFile);
|
||||
@@ -835,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) => {
|
||||
const parsedUrl: url.Url = url.parse(urlStr);
|
||||
const request: ClientRequest = https.request({
|
||||
let parsedUrl: url.Url = url.parse(urlStr);
|
||||
let request: ClientRequest = https.request({
|
||||
host: parsedUrl.host,
|
||||
path: parsedUrl.path,
|
||||
agent: getHttpsProxyAgent(),
|
||||
@@ -876,13 +876,13 @@ export interface CompilerPathAndArgs {
|
||||
}
|
||||
|
||||
function extractArgs(argsString: string): string[] {
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
const result: string[] = [];
|
||||
let isWindows: boolean = os.platform() === 'win32';
|
||||
let 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];
|
||||
let c: string = argsString[i];
|
||||
if (c === '\\') {
|
||||
currentArg += c;
|
||||
if (++i === argsString.length) {
|
||||
@@ -926,7 +926,7 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp
|
||||
let compilerPath: string | undefined = inputCompilerPath;
|
||||
let compilerName: string = "";
|
||||
let additionalArgs: string[] = [];
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
let 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
|
||||
@@ -934,7 +934,7 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp
|
||||
|
||||
} else if (compilerPath.startsWith("\"")) {
|
||||
// Input has quotes around compiler path
|
||||
const endQuote: number = compilerPath.substr(1).search("\"") + 1;
|
||||
let endQuote: number = compilerPath.substr(1).search("\"") + 1;
|
||||
if (endQuote !== -1) {
|
||||
additionalArgs = extractArgs(compilerPath.substr(endQuote + 1));
|
||||
compilerPath = compilerPath.substr(1, endQuote - 1);
|
||||
@@ -1018,10 +1018,10 @@ export class BlockingTask<T> {
|
||||
this.promise = task();
|
||||
} else {
|
||||
this.promise = new Promise<T>((resolve, reject) => {
|
||||
const f1: () => void = () => {
|
||||
let f1: () => void = () => {
|
||||
task().then(resolve, reject);
|
||||
};
|
||||
const f2: (err: any) => void = (err) => {
|
||||
let f2: (err: any) => void = (err) => {
|
||||
console.log(err);
|
||||
task().then(resolve, reject);
|
||||
};
|
||||
@@ -1050,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)) {
|
||||
const vscodeOptions: VSCodeNlsConfig = JSON.parse(process.env.VSCODE_NLS_CONFIG) as VSCodeNlsConfig;
|
||||
let vscodeOptions: VSCodeNlsConfig = JSON.parse(process.env.VSCODE_NLS_CONFIG) as VSCodeNlsConfig;
|
||||
if (vscodeOptions.availableLanguages) {
|
||||
const value: any = vscodeOptions.availableLanguages['*'];
|
||||
let value: any = vscodeOptions.availableLanguages['*'];
|
||||
if (isString(value)) {
|
||||
return value;
|
||||
}
|
||||
@@ -1065,8 +1065,8 @@ export function getLocaleId(): string {
|
||||
}
|
||||
|
||||
export function getLocalizedHtmlPath(originalPath: string): string {
|
||||
const locale: string = getLocaleId();
|
||||
const localizedFilePath: string = getExtensionFilePath(path.join("dist/html/", locale, originalPath));
|
||||
let locale: string = getLocaleId();
|
||||
let localizedFilePath: string = getExtensionFilePath(path.join("dist/html/", locale, originalPath));
|
||||
if (!fs.existsSync(localizedFilePath)) {
|
||||
return getExtensionFilePath(originalPath);
|
||||
}
|
||||
@@ -1093,9 +1093,9 @@ export function getLocalizedString(params: LocalizeStringParams): string {
|
||||
}
|
||||
|
||||
function decodeUCS16(input: string): number[] {
|
||||
const output: number[] = [];
|
||||
let output: number[] = [];
|
||||
let counter: number = 0;
|
||||
const length: number = input.length;
|
||||
let length: number = input.length;
|
||||
let value: number;
|
||||
let extra: number;
|
||||
while (counter < length) {
|
||||
@@ -1118,7 +1118,7 @@ function decodeUCS16(input: string): number[] {
|
||||
return output;
|
||||
}
|
||||
|
||||
const allowedIdentifierUnicodeRanges: number[][] = [
|
||||
let allowedIdentifierUnicodeRanges: number[][] = [
|
||||
[0x0030, 0x0039], // digits
|
||||
[0x0041, 0x005A], // upper case letters
|
||||
[0x005F, 0x005F], // underscore
|
||||
@@ -1167,7 +1167,7 @@ const allowedIdentifierUnicodeRanges: number[][] = [
|
||||
[0xE0000, 0xEFFFD] // LANGUAGE TAG (U+E0001) - VARIATION SELECTOR-256 (U+E01EF)
|
||||
];
|
||||
|
||||
const disallowedFirstCharacterIdentifierUnicodeRanges: number[][] = [
|
||||
let 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
|
||||
@@ -1179,14 +1179,14 @@ export function isValidIdentifier(candidate: string): boolean {
|
||||
if (!candidate) {
|
||||
return false;
|
||||
}
|
||||
const decoded: number[] = decodeUCS16(candidate);
|
||||
let 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++) {
|
||||
const disallowedCharacters: number[] = disallowedFirstCharacterIdentifierUnicodeRanges[i];
|
||||
let disallowedCharacters: number[] = disallowedFirstCharacterIdentifierUnicodeRanges[i];
|
||||
if (decoded[0] >= disallowedCharacters[0] && decoded[0] <= disallowedCharacters[1]) {
|
||||
return false;
|
||||
}
|
||||
@@ -1195,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++) {
|
||||
const allowedCharacters: number[] = allowedIdentifierUnicodeRanges[i];
|
||||
let allowedCharacters: number[] = allowedIdentifierUnicodeRanges[i];
|
||||
if (decoded[position] >= allowedCharacters[0] && decoded[position] <= allowedCharacters[1]) {
|
||||
found = true;
|
||||
break;
|
||||
@@ -1209,7 +1209,7 @@ export function isValidIdentifier(candidate: string): boolean {
|
||||
}
|
||||
|
||||
function getUniqueWorkspaceNameHelper(workspaceFolder: vscode.WorkspaceFolder, addSubfolder: boolean): string {
|
||||
const workspaceFolderName: string = workspaceFolder ? workspaceFolder.name : "untitled";
|
||||
let 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;
|
||||
const timer: NodeJS.Timer = global.setTimeout(() => {
|
||||
let 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) {
|
||||
const timer: NodeJS.Timer | undefined = this.timers.get(provider.extensionId);
|
||||
let 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 {
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
if (providers.add(provider, this.version)) {
|
||||
const added: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
if (added) {
|
||||
const settings: CppSettings = new CppSettings();
|
||||
let 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 {
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
const p: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
let 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 {
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
const p: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
let 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 {
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
const p: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
let p: CustomConfigurationProvider1 | undefined = providers.get(provider);
|
||||
|
||||
if (p) {
|
||||
LanguageServer.getClients().forEach(client => client.updateCustomBrowseConfiguration(p));
|
||||
|
||||
@@ -16,9 +16,11 @@ 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.
|
||||
const linuxDistro: Promise<LinuxDistribution> = LinuxDistribution.getDistroInformationFromFile('/etc/os-release')
|
||||
linuxDistro = 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;
|
||||
@@ -43,9 +45,9 @@ export class LinuxDistribution {
|
||||
let distroName: string = 'unknown';
|
||||
let distroVersion: string = 'unknown';
|
||||
|
||||
const keyValues: string[] = data.split(os.EOL);
|
||||
let keyValues: string[] = data.split(os.EOL);
|
||||
for (let i: number = 0; i < keyValues.length; i++) {
|
||||
const keyValue: string[] = keyValues[i].split('=');
|
||||
let keyValue: string[] = keyValues[i].split('=');
|
||||
if (keyValue.length === 2) {
|
||||
if (keyValue[0] === idKey) {
|
||||
distroName = keyValue[1];
|
||||
|
||||
+24
-23
@@ -31,7 +31,7 @@ const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
const cppTools: CppTools1 = new CppTools1();
|
||||
let languageServiceDisabled: boolean = false;
|
||||
let reloadMessageShown: boolean = false;
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
let 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");
|
||||
const fileName: string = uri.path.substr(1);
|
||||
const locale: string = util.getLocaleId();
|
||||
let fileName: string = uri.path.substr(1);
|
||||
let 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
|
||||
const installedPlatform: string | undefined = util.getInstalledBinaryPlatform();
|
||||
let installedPlatform: string | undefined = util.getInstalledBinaryPlatform();
|
||||
if (!installedPlatform || (process.platform !== installedPlatform)) {
|
||||
const platformInfo: PlatformInformation = await PlatformInformation.GetPlatformInformation();
|
||||
const vsixName: string = vsixNameForPlatform(platformInfo);
|
||||
@@ -165,6 +165,9 @@ async function offlineInstallation(info: PlatformInformation): Promise<void> {
|
||||
setInstallationStage('cleanUpUnusedBinaries');
|
||||
await cleanUpUnusedBinaries(info);
|
||||
|
||||
setInstallationStage('cleanUpUnusedBinaries');
|
||||
await cleanUpUnusedBinaries(info);
|
||||
|
||||
setInstallationStage('makeBinariesExecutable');
|
||||
await makeBinariesExecutable();
|
||||
|
||||
@@ -203,10 +206,10 @@ async function onlineInstallation(info: PlatformInformation): Promise<void> {
|
||||
}
|
||||
|
||||
async function downloadAndInstallPackages(info: PlatformInformation): Promise<void> {
|
||||
const outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
let outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
outputChannelLogger.appendLine(localize("updating.dependencies", "Updating C/C++ dependencies..."));
|
||||
|
||||
const packageManager: PackageManager = new PackageManager(info, outputChannelLogger);
|
||||
let packageManager: PackageManager = new PackageManager(info, outputChannelLogger);
|
||||
|
||||
return vscode.window.withProgress({
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
@@ -241,8 +244,8 @@ function invalidPackageVersion(pkg: IPackage, info: PlatformInformation): boolea
|
||||
}
|
||||
|
||||
function makeOfflineBinariesExecutable(info: PlatformInformation): Promise<void> {
|
||||
const promises: Thenable<void>[] = [];
|
||||
const packages: IPackage[] = util.packageJson["runtimeDependencies"];
|
||||
let promises: Thenable<void>[] = [];
|
||||
let packages: IPackage[] = util.packageJson["runtimeDependencies"];
|
||||
packages.forEach(p => {
|
||||
if (p.binaries && p.binaries.length > 0 &&
|
||||
packageMatchesPlatform(p, info)) {
|
||||
@@ -253,8 +256,8 @@ function makeOfflineBinariesExecutable(info: PlatformInformation): Promise<void>
|
||||
}
|
||||
|
||||
function cleanUpUnusedBinaries(info: PlatformInformation): Promise<void> {
|
||||
const promises: Thenable<void>[] = [];
|
||||
const packages: IPackage[] = util.packageJson["runtimeDependencies"];
|
||||
let promises: Thenable<void>[] = [];
|
||||
let packages: IPackage[] = util.packageJson["runtimeDependencies"];
|
||||
const logger: Logger = getOutputChannelLogger();
|
||||
|
||||
packages.forEach(p => {
|
||||
@@ -274,7 +277,7 @@ function cleanUpUnusedBinaries(info: PlatformInformation): Promise<void> {
|
||||
|
||||
function removeUnnecessaryFile(): Promise<void> {
|
||||
if (os.platform() !== 'win32') {
|
||||
const sourcePath: string = util.getDebugAdaptersPath("bin/OpenDebugAD7.exe.config");
|
||||
let 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 +296,13 @@ function touchInstallLockFile(): Promise<void> {
|
||||
}
|
||||
|
||||
function handleError(error: any): void {
|
||||
const installationInformation: InstallationInformation = getInstallationInformation();
|
||||
let installationInformation: InstallationInformation = getInstallationInformation();
|
||||
installationInformation.hasError = true;
|
||||
installationInformation.telemetryProperties['stage'] = installationInformation.stage ?? "";
|
||||
let errorMessage: string;
|
||||
|
||||
if (error instanceof PackageManagerError) {
|
||||
const packageError: PackageManagerError = error;
|
||||
let packageError: PackageManagerError = error;
|
||||
|
||||
installationInformation.telemetryProperties['error.methodName'] = packageError.methodName;
|
||||
installationInformation.telemetryProperties['error.message'] = packageError.message;
|
||||
@@ -324,7 +327,7 @@ function handleError(error: any): void {
|
||||
installationInformation.telemetryProperties['error.toString'] = util.removePotentialPII(errorMessage);
|
||||
}
|
||||
|
||||
const outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
let outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
if (installationInformation.stage === 'downloadPackages') {
|
||||
outputChannelLogger.appendLine("");
|
||||
}
|
||||
@@ -337,7 +340,7 @@ function handleError(error: any): void {
|
||||
}
|
||||
|
||||
function sendTelemetry(info: PlatformInformation): boolean {
|
||||
const installBlob: InstallationInformation = getInstallationInformation();
|
||||
let installBlob: InstallationInformation = getInstallationInformation();
|
||||
const success: boolean = !installBlob.hasError;
|
||||
|
||||
installBlob.telemetryProperties['success'] = success.toString();
|
||||
@@ -360,7 +363,7 @@ function sendTelemetry(info: PlatformInformation): boolean {
|
||||
}
|
||||
|
||||
async function postInstall(info: PlatformInformation): Promise<void> {
|
||||
const outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
let outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
outputChannelLogger.appendLine("");
|
||||
outputChannelLogger.appendLine(localize('finished.installing.dependencies', "Finished installing dependencies"));
|
||||
outputChannelLogger.appendLine("");
|
||||
@@ -379,7 +382,7 @@ async function postInstall(info: PlatformInformation): Promise<void> {
|
||||
}
|
||||
|
||||
async function finalizeExtensionActivation(): Promise<void> {
|
||||
const settings: CppSettings = new CppSettings();
|
||||
let settings: CppSettings = new CppSettings();
|
||||
if (settings.intelliSenseEngine === "Disabled") {
|
||||
languageServiceDisabled = true;
|
||||
getTemporaryCommandRegistrarInstance().disableLanguageServer();
|
||||
@@ -399,9 +402,9 @@ async function finalizeExtensionActivation(): Promise<void> {
|
||||
}));
|
||||
getTemporaryCommandRegistrarInstance().activateLanguageServer();
|
||||
|
||||
const packageJson: any = util.getRawPackageJson();
|
||||
let packageJson: any = util.getRawPackageJson();
|
||||
let writePackageJson: boolean = false;
|
||||
const packageJsonPath: string = util.getExtensionFilePath("package.json");
|
||||
let 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 +419,7 @@ async function finalizeExtensionActivation(): Promise<void> {
|
||||
|
||||
function rewriteManifest(): Promise<void> {
|
||||
// Replace activationEvents with the events that the extension should be activated for subsequent sessions.
|
||||
const packageJson: any = util.getRawPackageJson();
|
||||
let packageJson: any = util.getRawPackageJson();
|
||||
|
||||
packageJson.activationEvents = [
|
||||
"onLanguage:cpp",
|
||||
@@ -439,9 +442,7 @@ function rewriteManifest(): Promise<void> {
|
||||
"onCommand:C_Cpp.RescanWorkspace",
|
||||
"onCommand:C_Cpp.VcpkgClipboardInstallSuggested",
|
||||
"onCommand:C_Cpp.VcpkgClipboardOnlineHelpSuggested",
|
||||
"onDebugInitialConfigurations",
|
||||
"onDebugResolve:cppdbg",
|
||||
"onDebugResolve:cppvsdbg",
|
||||
"onDebug",
|
||||
"workspaceContains:/.vscode/c_cpp_properties.json",
|
||||
"onFileSystem:cpptools-schema"
|
||||
];
|
||||
|
||||
@@ -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 (const item of items) {
|
||||
for (let 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 (const pkg of this.allPackages) {
|
||||
for (let 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.
|
||||
const telemetryProperties: { [key: string]: string } = {};
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
telemetryProperties["success"] = success ? `OnRetry${retryCount}` : 'false';
|
||||
if (lastError instanceof PackageManagerError) {
|
||||
const packageError: PackageManagerError = lastError;
|
||||
let 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> {
|
||||
const parsedUrl: url.Url = url.parse(urlString);
|
||||
const proxyStrictSSL: any = vscode.workspace.getConfiguration().get("http.proxyStrictSSL", true);
|
||||
let parsedUrl: url.Url = url.parse(urlString);
|
||||
let proxyStrictSSL: any = vscode.workspace.getConfiguration().get("http.proxyStrictSSL", true);
|
||||
|
||||
const options: https.RequestOptions = {
|
||||
let 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));
|
||||
}
|
||||
|
||||
const handleHttpResponse: (response: IncomingMessage) => void = (response: IncomingMessage) => {
|
||||
let 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
|
||||
const errorMessage: string = localize("failed.web.error", "failed (error code '{0}')", response.statusCode);
|
||||
let 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];
|
||||
}
|
||||
const packageSize: number = parseInt(contentLength, 10);
|
||||
const downloadPercentage: number = 0;
|
||||
let packageSize: number = parseInt(contentLength, 10);
|
||||
let downloadPercentage: number = 0;
|
||||
let dots: number = 0;
|
||||
const tmpFile: fs.WriteStream = fs.createWriteStream("", { fd: pkg.tmpFile.fd });
|
||||
let 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
|
||||
const newDots: number = Math.ceil(downloadPercentage / 5);
|
||||
let newDots: number = Math.ceil(downloadPercentage / 5);
|
||||
if (newDots > dots) {
|
||||
this.AppendChannel(".".repeat(newDots - dots));
|
||||
dots = newDots;
|
||||
@@ -310,7 +310,7 @@ export class PackageManager {
|
||||
}
|
||||
};
|
||||
|
||||
const request: ClientRequest = https.request(options, handleHttpResponse);
|
||||
let 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) => {
|
||||
const absoluteEntryPath: string = util.getExtensionFilePath(entry.fileName);
|
||||
let 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.
|
||||
const absoluteEntryTempFile: string = absoluteEntryPath + ".tmp";
|
||||
let 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
|
||||
const fileMode: number = (pkg.binaries && pkg.binaries.indexOf(absoluteEntryPath) !== -1) ? 0o755 : 0o664;
|
||||
const writeStream: fs.WriteStream = fs.createWriteStream(absoluteEntryTempFile, { mode: fileMode });
|
||||
let fileMode: number = (pkg.binaries && pkg.binaries.indexOf(absoluteEntryPath) !== -1) ? 0o755 : 0o664;
|
||||
let 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> {
|
||||
const platform: string = os.platform();
|
||||
let 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) {
|
||||
const archArray: string[] = architecture.split(os.EOL);
|
||||
let archArray: string[] = architecture.split(os.EOL);
|
||||
if (archArray.length >= 2) {
|
||||
const arch: string = archArray[1].trim();
|
||||
let 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) {
|
||||
const packageInfo: IPackageInfo = getPackageInfo();
|
||||
let packageInfo: IPackageInfo = getPackageInfo();
|
||||
if (packageInfo) {
|
||||
return new TelemetryReporter(packageInfo.name, packageInfo.version, appInsightsKey);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
"noImplicitUseStrict": true
|
||||
},
|
||||
"include": [
|
||||
"test/**/*.ts",
|
||||
"tools/**/*.ts",
|
||||
"ui/**/*.ts"
|
||||
"test/**/*.ts"
|
||||
]
|
||||
}
|
||||
@@ -11,9 +11,9 @@ import * as testHelpers from '../testHelpers';
|
||||
|
||||
suite("[Quick info test]", function(): void {
|
||||
let cpptools: apit.CppToolsTestApi;
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
const filePath: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/quickInfo.cpp";
|
||||
const fileUri: vscode.Uri = vscode.Uri.file(filePath);
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
let filePath: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/quickInfo.cpp";
|
||||
let 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();
|
||||
const testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
disposables.push(testHook);
|
||||
|
||||
const getIntelliSenseStatus: any = new Promise<void>((resolve, reject) => {
|
||||
let 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 () => {
|
||||
const result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 12)));
|
||||
let result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 12)));
|
||||
|
||||
const expectedMap: Map<string, string> = new Map<string, string>();
|
||||
let 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\`\`\``);
|
||||
|
||||
const expected1: string = expectedMap.get(platform);
|
||||
const actual1: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
let expected1: string = expectedMap.get(platform);
|
||||
let actual1: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
assert.equal(actual1, expected1);
|
||||
const expected2: string = `comment for myfunction`;
|
||||
const actual2: string = (<vscode.MarkdownString>result[0].contents[1]).value;
|
||||
let expected2: string = `comment for myfunction`;
|
||||
let actual2: string = (<vscode.MarkdownString>result[0].contents[1]).value;
|
||||
assert.equal(actual2, expected2);
|
||||
});
|
||||
|
||||
test("[Hover over function param string variable]", async () => {
|
||||
const result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 30)));
|
||||
let result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 30)));
|
||||
|
||||
const expectedMap: Map<string, string> = new Map<string, string>();
|
||||
let 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\`\`\``);
|
||||
|
||||
const expected: string = expectedMap.get(platform);
|
||||
const actual: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
let expected: string = expectedMap.get(platform);
|
||||
let actual: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
assert.equal(actual, expected);
|
||||
});
|
||||
|
||||
test("[Hover over function param string literal]", async () => {
|
||||
const result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 44)));
|
||||
let result: vscode.Hover[] = <vscode.Hover[]>(await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(12, 44)));
|
||||
|
||||
const expectedMap: Map<string, string> = new Map<string, string>();
|
||||
let 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`);
|
||||
|
||||
const expected: string = expectedMap.get(platform);
|
||||
const actual: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
let expected: string = expectedMap.get(platform);
|
||||
let actual: string = (<vscode.MarkdownString>result[0].contents[0]).value;
|
||||
assert.equal(actual, expected);
|
||||
});
|
||||
|
||||
test("[Hover over function param with squiggles]", async () => {
|
||||
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;
|
||||
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;
|
||||
assert.equal(actual, expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,9 +14,9 @@ function delay(ms: number): Promise<void> {
|
||||
|
||||
suite(`[Reference test]`, function(): void {
|
||||
let cpptools: apit.CppToolsTestApi;
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/references.cpp";
|
||||
const fileUri: vscode.Uri = vscode.Uri.file(path);
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/references.cpp";
|
||||
let 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()"
|
||||
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 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 expectedText: string = "func1";
|
||||
let 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)"
|
||||
const result: vscode.Location[] = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeReferenceProvider", fileUri, new vscode.Position(21, 18)));
|
||||
let result: vscode.Location[] = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeReferenceProvider", fileUri, new vscode.Position(21, 18)));
|
||||
|
||||
const expectedText: string = "var1";
|
||||
let 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 => {
|
||||
const actualtext: string = document.getText(location.range);
|
||||
let 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> {
|
||||
const extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
let 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");
|
||||
|
||||
const debugSessionTerminated: Promise<void> = new Promise(resolve => {
|
||||
let 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();
|
||||
});
|
||||
|
||||
const defaultRules: vscode.OnEnterRule[] = [
|
||||
let 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 }
|
||||
}
|
||||
];
|
||||
const defaultSLRules: vscode.OnEnterRule[] = [
|
||||
let 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", () => {
|
||||
const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('c', [ "/**" ]).onEnterRules;
|
||||
let rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('c', [ "/**" ]).onEnterRules;
|
||||
assert.deepEqual(rules, defaultRules);
|
||||
});
|
||||
|
||||
test("Check for removal of single line comment continuations for C", () => {
|
||||
const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('c', [ "/**", "///" ]).onEnterRules;
|
||||
let rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('c', [ "/**", "///" ]).onEnterRules;
|
||||
assert.deepEqual(rules, defaultRules);
|
||||
});
|
||||
|
||||
test("Check the default OnEnterRules for C++", () => {
|
||||
const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "/**" ]).onEnterRules;
|
||||
let rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "/**" ]).onEnterRules;
|
||||
assert.deepEqual(rules, defaultRules);
|
||||
});
|
||||
|
||||
test("Make sure duplicate rules are removed", () => {
|
||||
const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "/**", { begin: "/**", continue: " * " }, "/**" ]).onEnterRules;
|
||||
let rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "/**", { begin: "/**", continue: " * " }, "/**" ]).onEnterRules;
|
||||
assert.deepEqual(rules, defaultRules);
|
||||
});
|
||||
|
||||
test("Check single line rules for C++", () => {
|
||||
const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "///" ]).onEnterRules;
|
||||
let 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));
|
||||
const contents: string = await util.readFileText(cppPropertiesPath());
|
||||
let 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[];
|
||||
const defaultConfig: api.SourceFileConfiguration = {
|
||||
let defaultConfig: api.SourceFileConfiguration = {
|
||||
includePath: [ "${workspaceFolder}", "/v3/folder" ],
|
||||
defines: [ "${workspaceFolder}" ],
|
||||
intelliSenseMode: "msvc-x64",
|
||||
standard: "c++17"
|
||||
};
|
||||
let lastBrowseResult: api.WorkspaceBrowseConfiguration;
|
||||
const defaultBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
let defaultBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
browsePath: [ "/v3/folder" ],
|
||||
compilerPath: "",
|
||||
standard: "c++14",
|
||||
windowsSdkVersion: "8.1"
|
||||
};
|
||||
const defaultFolderBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
let defaultFolderBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
browsePath: [ "/v3/folder-1" ],
|
||||
compilerPath: "",
|
||||
standard: "c++14",
|
||||
windowsSdkVersion: "8.1"
|
||||
};
|
||||
|
||||
const provider: api.CustomConfigurationProvider = {
|
||||
let 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[]> {
|
||||
const result: api.SourceFileConfigurationItem[] = [];
|
||||
let result: api.SourceFileConfigurationItem[] = [];
|
||||
uris.forEach(uri => {
|
||||
result.push({
|
||||
uri: uri.toString(),
|
||||
@@ -152,7 +152,7 @@ suite("extensibility tests v3", function(): void {
|
||||
console.log(" disposed");
|
||||
}
|
||||
};
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
let 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.
|
||||
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main3.cpp";
|
||||
const uri: vscode.Uri = vscode.Uri.file(path);
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main3.cpp";
|
||||
let uri: vscode.Uri = vscode.Uri.file(path);
|
||||
|
||||
const testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
const testResult: any = new Promise<void>((resolve, reject) => {
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
let 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) {
|
||||
const expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
let 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);
|
||||
|
||||
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
let 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[];
|
||||
const defaultConfig: api.SourceFileConfiguration = {
|
||||
let defaultConfig: api.SourceFileConfiguration = {
|
||||
includePath: [ "${workspaceFolder}", "/v2/folder" ],
|
||||
defines: [ "${workspaceFolder}" ],
|
||||
intelliSenseMode: "msvc-x64",
|
||||
standard: "c++17"
|
||||
};
|
||||
let lastBrowseResult: api.WorkspaceBrowseConfiguration;
|
||||
const defaultBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
let 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.
|
||||
const provider: any = {
|
||||
let 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[]> {
|
||||
const result: api.SourceFileConfigurationItem[] = [];
|
||||
let result: api.SourceFileConfigurationItem[] = [];
|
||||
uris.forEach(uri => {
|
||||
result.push({
|
||||
uri: uri.toString(),
|
||||
@@ -245,7 +245,7 @@ suite("extensibility tests v2", function(): void {
|
||||
console.log(" disposed");
|
||||
}
|
||||
};
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
let 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.
|
||||
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main2.cpp";
|
||||
const uri: vscode.Uri = vscode.Uri.file(path);
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main2.cpp";
|
||||
let uri: vscode.Uri = vscode.Uri.file(path);
|
||||
|
||||
const testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
const testResult: any = new Promise<void>((resolve, reject) => {
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
let 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) {
|
||||
|
||||
const expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
let 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);
|
||||
|
||||
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
let 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[];
|
||||
const defaultConfig: api.SourceFileConfiguration = {
|
||||
let 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.
|
||||
const provider: any = {
|
||||
let 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[]> {
|
||||
const result: api.SourceFileConfigurationItem[] = [];
|
||||
let result: api.SourceFileConfigurationItem[] = [];
|
||||
uris.forEach(uri => {
|
||||
result.push({
|
||||
uri: uri.toString(),
|
||||
@@ -325,7 +325,7 @@ suite("extensibility tests v1", function(): void {
|
||||
console.log(" disposed");
|
||||
}
|
||||
};
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
let 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.
|
||||
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main1.cpp";
|
||||
const uri: vscode.Uri = vscode.Uri.file(path);
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main1.cpp";
|
||||
let uri: vscode.Uri = vscode.Uri.file(path);
|
||||
|
||||
const testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
const testResult: any = new Promise<void>((resolve, reject) => {
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
let 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) {
|
||||
const expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
let 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);
|
||||
|
||||
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
let 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[];
|
||||
const defaultConfig: api.SourceFileConfiguration = {
|
||||
let 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.
|
||||
const provider: any = {
|
||||
let provider: any = {
|
||||
name: "cpptoolsTest-v0",
|
||||
canProvideConfiguration(document: vscode.Uri): Thenable<boolean> {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
provideConfigurations(uris: vscode.Uri[]): Thenable<api.SourceFileConfigurationItem[]> {
|
||||
const result: api.SourceFileConfigurationItem[] = [];
|
||||
let 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);
|
||||
}
|
||||
};
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
let 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.
|
||||
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main.cpp";
|
||||
const uri: vscode.Uri = vscode.Uri.file(path);
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main.cpp";
|
||||
let uri: vscode.Uri = vscode.Uri.file(path);
|
||||
|
||||
const testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
const testResult: any = new Promise<void>((resolve, reject) => {
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
let 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) {
|
||||
const expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
let 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);
|
||||
|
||||
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(path);
|
||||
let 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> {
|
||||
const extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
let 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 (const e of env) {
|
||||
for (let e of env) {
|
||||
if (e.name === name) {
|
||||
assert(e.value === value, `Checking if ${e.value} == ${value}`);
|
||||
found = true;
|
||||
|
||||
@@ -198,8 +198,8 @@ suite("Common Utility validation", () => {
|
||||
});
|
||||
|
||||
test("escapeForSquiggles:", () => {
|
||||
const testEscapeForSquigglesScenario: any = (input: string, expectedOutput: string) => {
|
||||
const result: string = escapeForSquiggles(input);
|
||||
let testEscapeForSquigglesScenario: any = (input: string, expectedOutput: string) => {
|
||||
let result: string = escapeForSquiggles(input);
|
||||
if (result !== expectedOutput) {
|
||||
throw new Error(`escapeForSquiggles failure: for \"${input}\", \"${result}\" !== \"${expectedOutput}\"`);
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ suite("LinuxDistro Tests", () => {
|
||||
'REDHAT_SUPPORT_PRODUCT="centos"' + os.EOL +
|
||||
'REDHAT_SUPPORT_PRODUCT_VERSION="7"';
|
||||
|
||||
const ubuntu1404: LinuxDistribution = LinuxDistribution.getDistroInformation(dataUbuntu1404);
|
||||
const ubuntu1510: LinuxDistribution = LinuxDistribution.getDistroInformation(dataUbuntu1510);
|
||||
const centos73: LinuxDistribution = LinuxDistribution.getDistroInformation(dataCentos73);
|
||||
let ubuntu1404: LinuxDistribution = LinuxDistribution.getDistroInformation(dataUbuntu1404);
|
||||
let ubuntu1510: LinuxDistribution = LinuxDistribution.getDistroInformation(dataUbuntu1510);
|
||||
let centos73: LinuxDistribution = LinuxDistribution.getDistroInformation(dataCentos73);
|
||||
|
||||
assert.equal(ubuntu1404.name, 'ubuntu');
|
||||
assert.equal(ubuntu1404.version, '"14.04"');
|
||||
@@ -63,7 +63,7 @@ suite("LinuxDistro Tests", () => {
|
||||
test("Parse invalid os-release file", () => {
|
||||
const data: string = 'garbage"';
|
||||
|
||||
const unknown: LinuxDistribution = LinuxDistribution.getDistroInformation(data);
|
||||
let unknown: LinuxDistribution = LinuxDistribution.getDistroInformation(data);
|
||||
assert.equal(unknown.name, 'unknown');
|
||||
assert.equal(unknown.version, 'unknown');
|
||||
});
|
||||
@@ -86,11 +86,11 @@ suite("Pick Process Tests", () => {
|
||||
'Name=conhost.exe' + os.EOL +
|
||||
'ProcessId=59148' + os.EOL;
|
||||
|
||||
const parsedOutput: Process[] = WmicProcessParser.ParseProcessFromWmic(wmicOutput);
|
||||
let parsedOutput: Process[] = WmicProcessParser.ParseProcessFromWmic(wmicOutput);
|
||||
|
||||
const process1: Process = parsedOutput[0];
|
||||
const process2: Process = parsedOutput[1];
|
||||
const process3: Process = parsedOutput[2];
|
||||
let process1: Process = parsedOutput[0];
|
||||
let process2: Process = parsedOutput[1];
|
||||
let process3: Process = parsedOutput[2];
|
||||
|
||||
assert.equal(process1.commandLine, '');
|
||||
assert.equal(process1.name, 'System Idle Process');
|
||||
@@ -111,11 +111,11 @@ suite("Pick Process Tests", () => {
|
||||
'15470 ScopedBookmarkAgent ScopedBookmarkAgent' + os.EOL +
|
||||
'15220 mdworker mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared' + os.EOL;
|
||||
|
||||
const parsedOutput: Process[] = PsProcessParser.ParseProcessFromPs(psOutput);
|
||||
let parsedOutput: Process[] = PsProcessParser.ParseProcessFromPs(psOutput);
|
||||
|
||||
const process1: Process = parsedOutput[0];
|
||||
const process2: Process = parsedOutput[1];
|
||||
const process3: Process = parsedOutput[2];
|
||||
let process1: Process = parsedOutput[0];
|
||||
let process2: Process = parsedOutput[1];
|
||||
let process3: Process = parsedOutput[2];
|
||||
|
||||
assert.equal(process1.commandLine, 'ScopedBookmarkAgent');
|
||||
assert.equal(process1.name, 'ScopedBookmarkAgent');
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
"parserOptions": {
|
||||
"project": "test.tsconfig.json",
|
||||
"sourceType": "module"
|
||||
}
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
@@ -9,7 +9,7 @@ import * as os from 'os';
|
||||
function appendFieldsToObject(reference: any, obj: any): any {
|
||||
// Make sure it is an object type
|
||||
if (typeof obj === 'object') {
|
||||
for (const referenceKey in reference) {
|
||||
for (let referenceKey in reference) {
|
||||
// If key exists in original object and is an object.
|
||||
if (obj.hasOwnProperty(referenceKey)) {
|
||||
obj[referenceKey] = appendFieldsToObject(reference[referenceKey], obj[referenceKey]);
|
||||
@@ -25,13 +25,13 @@ function appendFieldsToObject(reference: any, obj: any): any {
|
||||
|
||||
// Combines two object's fields, giving the parentDefault a higher precedence.
|
||||
function mergeDefaults(parentDefault: any, childDefault: any): any {
|
||||
const newDefault: any = {};
|
||||
let newDefault: any = {};
|
||||
|
||||
for (const attrname in childDefault) {
|
||||
for (let attrname in childDefault) {
|
||||
newDefault[attrname] = childDefault[attrname];
|
||||
}
|
||||
|
||||
for (const attrname in parentDefault) {
|
||||
for (let attrname in parentDefault) {
|
||||
newDefault[attrname] = parentDefault[attrname];
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ function mergeDefaults(parentDefault: any, childDefault: any): any {
|
||||
|
||||
function updateDefaults(object: any, defaults: any): any {
|
||||
if (defaults !== null) {
|
||||
for (const key in object) {
|
||||
for (let key in object) {
|
||||
if (object[key].hasOwnProperty('type') && object[key].type === 'object' && object[key].properties !== null) {
|
||||
object[key].properties = updateDefaults(object[key].properties, mergeDefaults(defaults, object[key].default));
|
||||
} else if (key in defaults) {
|
||||
@@ -54,17 +54,17 @@ function updateDefaults(object: any, defaults: any): any {
|
||||
|
||||
function refReplace(definitions: any, ref: any): any {
|
||||
// $ref is formatted as "#/definitions/ObjectName"
|
||||
const referenceStringArray: string[] = ref['$ref'].split('/');
|
||||
let referenceStringArray: string[] = ref['$ref'].split('/');
|
||||
|
||||
// Getting "ObjectName"
|
||||
const referenceName: string = referenceStringArray[referenceStringArray.length - 1];
|
||||
let referenceName: string = referenceStringArray[referenceStringArray.length - 1];
|
||||
|
||||
// Make sure reference has replaced its own $ref fields and hope there are no recursive references.
|
||||
definitions[referenceName] = replaceReferences(definitions, definitions[referenceName]);
|
||||
|
||||
// Retrieve ObjectName from definitions. (TODO: Does not retrieve inner objects)
|
||||
// Need to deep copy, there are no functions in these objects.
|
||||
const reference: any = JSON.parse(JSON.stringify(definitions[referenceName]));
|
||||
let reference: any = JSON.parse(JSON.stringify(definitions[referenceName]));
|
||||
|
||||
ref = appendFieldsToObject(reference, ref);
|
||||
|
||||
@@ -75,7 +75,7 @@ function refReplace(definitions: any, ref: any): any {
|
||||
}
|
||||
|
||||
function replaceReferences(definitions: any, objects: any): any {
|
||||
for (const key in objects) {
|
||||
for (let key in objects) {
|
||||
if (objects[key].hasOwnProperty('$ref')) {
|
||||
objects[key] = refReplace(definitions, objects[key]);
|
||||
}
|
||||
@@ -96,8 +96,8 @@ function replaceReferences(definitions: any, objects: any): any {
|
||||
}
|
||||
|
||||
function generateOptionsSchema(): void {
|
||||
const packageJSON: any = JSON.parse(fs.readFileSync('package.json').toString());
|
||||
const schemaJSON: any = JSON.parse(fs.readFileSync('tools/OptionsSchema.json').toString());
|
||||
let packageJSON: any = JSON.parse(fs.readFileSync('package.json').toString());
|
||||
let schemaJSON: any = JSON.parse(fs.readFileSync('tools/OptionsSchema.json').toString());
|
||||
|
||||
schemaJSON.definitions = replaceReferences(schemaJSON.definitions, schemaJSON.definitions);
|
||||
|
||||
|
||||
@@ -45,13 +45,6 @@
|
||||
},
|
||||
"description": "%c_cpp.debuggers.pipeTransport.pipeEnv.description%",
|
||||
"default": {}
|
||||
},
|
||||
"quoteArgs": {
|
||||
"exceptions": {
|
||||
"type": "boolean",
|
||||
"description": "%c_cpp.debuggers.logging.quoteArgs.description%",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,7 +13,7 @@ import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
||||
// Change this to true to force a dev workflow.
|
||||
//Change this to true to force a dev workflow.
|
||||
const EnableDevWorkflow: boolean = false;
|
||||
|
||||
const DebugAdapterPath: string = "./debugAdapters";
|
||||
@@ -46,13 +46,13 @@ function findCppToolsExtensionDebugAdapterFolder(): string {
|
||||
|
||||
let dirPath: string = os.homedir();
|
||||
if (fs.existsSync(dirPath)) {
|
||||
const files: string[] = fs.readdirSync(dirPath);
|
||||
let files: string[] = fs.readdirSync(dirPath);
|
||||
for (let i: number = 0; i < files.length; i++) {
|
||||
// Check to see if it starts with '.vscode'
|
||||
if (vscodeFolderRegExp.test(files[i])) {
|
||||
const extPath: string = path.join(dirPath, files[i], "extensions");
|
||||
let extPath: string = path.join(dirPath, files[i], "extensions");
|
||||
if (fs.existsSync(extPath)) {
|
||||
const extFiles: string[] = fs.readdirSync(extPath);
|
||||
let extFiles: string[] = fs.readdirSync(extPath);
|
||||
for (let j: number = 0; j < extFiles.length; j++) {
|
||||
if (cpptoolsFolderRegExp.test(path.join(extFiles[j]))) {
|
||||
dirPath = path.join(extPath, extFiles[j]);
|
||||
@@ -77,7 +77,7 @@ function findCppToolsExtensionDebugAdapterFolder(): string {
|
||||
|
||||
function enableDevWorkflow(): Boolean {
|
||||
if (process.env.AGENT_ID) {
|
||||
// Agent machines must not attempt any dev workflows
|
||||
//Agent machines must not attempt any dev workflows
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -168,9 +168,9 @@ function removeFolder(root: string): void {
|
||||
return;
|
||||
}
|
||||
|
||||
const files: string[] = fs.readdirSync(root);
|
||||
let files: string[] = fs.readdirSync(root);
|
||||
for (let i: number = 0; i < files.length; i++) {
|
||||
const fullPath: string = path.join(root, files[i]);
|
||||
let fullPath: string = path.join(root, files[i]);
|
||||
console.warn('Found entry %s', fullPath);
|
||||
if (!isDirectory(fullPath)) {
|
||||
console.warn('Deleting %s', fullPath);
|
||||
@@ -194,7 +194,7 @@ function isDirectory(dir: string): Boolean {
|
||||
|
||||
function makeDirectory(dir: string): void {
|
||||
try {
|
||||
// Note: mkdir is limited to creating folders with one level of nesting. Creating "a/b" if 'a' doesn't exist will throw a ENOENT.
|
||||
//Note: mkdir is limited to creating folders with one level of nesting. Creating "a/b" if 'a' doesn't exist will throw a ENOENT.
|
||||
fs.mkdirSync(dir);
|
||||
} catch (e) {
|
||||
if ((<NodeJS.ErrnoException>e).code !== "EEXIST") {
|
||||
|
||||
@@ -40,4 +40,4 @@ if (process.env.CPPTOOLS_DEV || !fs.existsSync('./debugAdapters/bin/cppdbg.ad7En
|
||||
// Required for nightly builds. Nightly builds do not enable CPPTOOLS_DEV.
|
||||
console.log(">> node " + copyDebuggerDependenciesJSFile);
|
||||
cp.execSync("node " + copyDebuggerDependenciesJSFile, { stdio: [0, 1, 2] });
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
"parserOptions": {
|
||||
"project": "test.tsconfig.json",
|
||||
"sourceType": "module"
|
||||
}
|
||||
};
|
||||
+13
-11
@@ -156,7 +156,7 @@ class SettingsApp {
|
||||
}
|
||||
|
||||
const configName: HTMLInputElement = <HTMLInputElement>document.getElementById(elementId.configName);
|
||||
const list: HTMLSelectElement = <HTMLSelectElement>document.getElementById(elementId.configSelection);
|
||||
let list: HTMLSelectElement = <HTMLSelectElement>document.getElementById(elementId.configSelection);
|
||||
|
||||
if (configName.value === "") {
|
||||
(<HTMLInputElement>document.getElementById(elementId.configName)).value = list.options[list.selectedIndex].value;
|
||||
@@ -247,7 +247,9 @@ class SettingsApp {
|
||||
private updateConfig(config: any): void {
|
||||
this.updating = true;
|
||||
try {
|
||||
const joinEntries: (input: any) => string = (input: string[]) => (input && input.length) ? input.join("\n") : "";
|
||||
let joinEntries: (input: any) => string = (input: string[]) => {
|
||||
return (input && input.length) ? input.join("\n") : "";
|
||||
};
|
||||
|
||||
// Basic settings
|
||||
(<HTMLInputElement>document.getElementById(elementId.configName)).value = config.name;
|
||||
@@ -306,14 +308,14 @@ class SettingsApp {
|
||||
private updateConfigSelection(message: any): void {
|
||||
this.updating = true;
|
||||
try {
|
||||
const list: HTMLSelectElement = <HTMLSelectElement>document.getElementById(elementId.configSelection);
|
||||
let list: HTMLSelectElement = <HTMLSelectElement>document.getElementById(elementId.configSelection);
|
||||
|
||||
// Clear list before updating
|
||||
list.options.length = 0;
|
||||
|
||||
// Update list
|
||||
for (const name of message.selections) {
|
||||
const option: HTMLOptionElement = document.createElement("option");
|
||||
for (let name of message.selections) {
|
||||
let option: HTMLOptionElement = document.createElement("option");
|
||||
option.text = name;
|
||||
option.value = name;
|
||||
list.append(option);
|
||||
@@ -328,7 +330,7 @@ class SettingsApp {
|
||||
private setKnownCompilers(compilers: string[]): void {
|
||||
this.updating = true;
|
||||
try {
|
||||
const list: HTMLSelectElement = <HTMLSelectElement>document.getElementById(elementId.knownCompilers);
|
||||
let list: HTMLSelectElement = <HTMLSelectElement>document.getElementById(elementId.knownCompilers);
|
||||
|
||||
// No need to add items unless webview is reloaded, in which case it will not have any elements.
|
||||
// Otherwise, add items again.
|
||||
@@ -338,14 +340,14 @@ class SettingsApp {
|
||||
|
||||
if (compilers.length === 0) {
|
||||
// Get HTML element containing the string, as we can't localize strings in HTML js
|
||||
const noCompilerSpan: HTMLSpanElement = <HTMLSpanElement>document.getElementById(elementId.noCompilerPathsDetected);
|
||||
const option: HTMLOptionElement = document.createElement("option");
|
||||
let noCompilerSpan: HTMLSpanElement = <HTMLSpanElement>document.getElementById(elementId.noCompilerPathsDetected);
|
||||
let option: HTMLOptionElement = document.createElement("option");
|
||||
option.text = noCompilerSpan.textContent;
|
||||
option.disabled = true;
|
||||
list.append(option);
|
||||
} else {
|
||||
for (const path of compilers) {
|
||||
const option: HTMLOptionElement = document.createElement("option");
|
||||
for (let path of compilers) {
|
||||
let option: HTMLOptionElement = document.createElement("option");
|
||||
option.text = path;
|
||||
option.value = path;
|
||||
list.append(option);
|
||||
@@ -367,4 +369,4 @@ class SettingsApp {
|
||||
}
|
||||
}
|
||||
|
||||
const app: SettingsApp = new SettingsApp();
|
||||
let app: SettingsApp = new SettingsApp();
|
||||
|
||||
+4
-4
@@ -5591,10 +5591,10 @@ vm-browserify@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
|
||||
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==
|
||||
|
||||
vscode-cpptools@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-cpptools/-/vscode-cpptools-3.1.0.tgz#fbc0e493e81a05baf01702ea8b9467c39fba257d"
|
||||
integrity sha512-z4W/A1TQMEtqTEWNY3Hb4HJcJ2J3HeaLHp3TyqCotoRkLU8ovH4jmDb5tNTyh3DgIiaAAnDalO03A4wm5IvNBg==
|
||||
vscode-cpptools@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-cpptools/-/vscode-cpptools-4.0.1.tgz#7e591572b437a6aca47b767487b52bc253e6d911"
|
||||
integrity sha512-2IjtWe7rjIp20J+5m0Yjpa8TjGhdQWChwE49iYJBUUTHFqJDFq0aXNAyiDNw6BDWI1Q2Z/gmeQGsJBoxTb0J0Q==
|
||||
|
||||
vscode-debugadapter@^1.35.0:
|
||||
version "1.38.0"
|
||||
|
||||
Reference in New Issue
Block a user