Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82671ea293 | ||
|
|
605015c8af | ||
|
|
baa93534f0 | ||
|
|
e5f74bc638 | ||
|
|
68777f9873 | ||
|
|
4037db9783 | ||
|
|
67565fe0a7 | ||
|
|
a67c6610a7 | ||
|
|
4f5ec73173 | ||
|
|
79f4e8ded0 | ||
|
|
7544de0b47 | ||
|
|
491456e8de | ||
|
|
5b51db1999 | ||
|
|
46eaddc411 | ||
|
|
71c6cb6c6c | ||
|
|
0452f0aad9 | ||
|
|
478ccb6abd | ||
|
|
7504532e58 | ||
|
|
9621430533 | ||
|
|
3ef10f294e | ||
|
|
e394edb630 | ||
|
|
0c9d89787c | ||
|
|
dc7651af75 | ||
|
|
9215fbe9b0 | ||
|
|
a395b8492a | ||
|
|
17e337c874 | ||
|
|
6f4403cf05 | ||
|
|
ec47886d72 |
+16
-2
@@ -1,6 +1,7 @@
|
||||
# C/C++ for Visual Studio Code Changelog
|
||||
|
||||
## Version 1.16.0: May 22, 2023
|
||||
## Version 1.16.2: June 22, 2023
|
||||
|
||||
### New Features
|
||||
* Add Call Hierarchy. [#16](https://github.com/microsoft/vscode-cpptools/issues/16)
|
||||
* Add "Copy Definition" and "Copy Declaration" code actions (for when the default Create placement isn't desired). [#10238](https://github.com/microsoft/vscode-cpptools/issues/10238), [#10942](https://github.com/microsoft/vscode-cpptools/issues/10942)
|
||||
@@ -8,9 +9,15 @@
|
||||
### Enhancements
|
||||
* Add support for other glob pattern syntax, such as `[]` and `^`. [#8960](https://github.com/microsoft/vscode-cpptools/issues/8960)
|
||||
* Add support for C++23 z/Z and zu/ZU suffixes in clang/gcc modes. [#10190](https://github.com/microsoft/vscode-cpptools/issues/10190)
|
||||
* Add warning logging when the database is reset due to a version change. [#10984](https://github.com/microsoft/vscode-cpptools/issues/10984)
|
||||
* Move user compilers to the beginning of the "known compilers" lists. [#10985](https://github.com/microsoft/vscode-cpptools/issues/10985)
|
||||
* Add file path to the details of a call hierarchy result. [#10997](https://github.com/microsoft/vscode-cpptools/issues/10997)
|
||||
* Add `miDebuggerArgs` to debugger attach option.
|
||||
* Thank you for the contribution @Summon528 [PR #11066](https://github.com/microsoft/vscode-cpptools/pull/11066)
|
||||
|
||||
### Bug Fixes
|
||||
* Fix an IntelliSense parsing bug with C++20 ranges. [#8039](https://github.com/microsoft/vscode-cpptools/issues/8039)
|
||||
* Fix incorrect insertion of Create Declaration/Definition when it also adds a #include. [#10464](https://github.com/microsoft/vscode-cpptools/issues/#10464)
|
||||
* Fix an IntelliSense bug with user-defined floating-point literals. [#10837](https://github.com/microsoft/vscode-cpptools/issues/10837)
|
||||
* Fix deadlock with Find All References. [#10855](https://github.com/microsoft/vscode-cpptools/issues/10855)
|
||||
* Fix performance issues on machines with > 32 threads. [#10874](https://github.com/microsoft/vscode-cpptools/issues/10874)
|
||||
@@ -21,6 +28,14 @@
|
||||
* Fix the "known compilers" list not getting updated with "user compilers". [#10943](https://github.com/microsoft/vscode-cpptools/issues/10943)
|
||||
* Fix cancelation of Find All References while confirming references. [#10947](https://github.com/microsoft/vscode-cpptools/issues/10947)
|
||||
* Fix a bug with workspace parsing status. [PR #10974](https://github.com/microsoft/vscode-cpptools/pull/10974)
|
||||
* Fix some bugs if settings were empty string or null. [#10994](https://github.com/microsoft/vscode-cpptools/issues/10994)
|
||||
* Fix cancellation for Find All References/Rename/Call Hierarchy. [#10998](https://github.com/microsoft/vscode-cpptools/issues/10998)
|
||||
* Fix two Doxygen comment generation bugs. [#10995](https://github.com/microsoft/vscode-cpptools/issues/10995), [#11016](https://github.com/microsoft/vscode-cpptools/issues/11016)
|
||||
* Fix the thread pool sometimes not increasing in size, which could lead to the cpptools process incorrectly being shut down. [#11003](https://github.com/microsoft/vscode-cpptools/issues/11003)
|
||||
* Stop using vcFormat if .editorconfig exists with only non-formatting cpp settings. [PR #11015](https://github.com/microsoft/vscode-cpptools/pull/11015)
|
||||
* Use integratedTerminal when user is running cl.exe for debugger. [#11032](https://github.com/microsoft/vscode-cpptools/issues/11032)
|
||||
* Thank you for the contribution @caiohamamura [PR #11035](https://github.com/microsoft/vscode-cpptools/pull/11035)
|
||||
* Fix the configure your IntelliSense notification to not show again when the "Don't Show Again" option is selected. [#11070](https://github.com/microsoft/vscode-cpptools/issues/11070)
|
||||
* Fix a bug that could cause incomplete reading of stdout/stderr of child processes on Windows.
|
||||
* Fix incorrect "declaration is incompatible" IntelliSense errors.
|
||||
* Fix some potential crashes.
|
||||
@@ -69,7 +84,6 @@
|
||||
* Fix the first registered configuration provider still being automatically used after a second registers. [PR #10772](https://github.com/microsoft/vscode-cpptools/pull/10772)
|
||||
* Fix `C_Cpp.default.compilerPath` in the settings UI showing a string editor when it shouldn't. [#10795](https://github.com/microsoft/vscode-cpptools/issues/10795)
|
||||
* Fix some issues due to usage of the spread operator not doing a deep copy. [PR #10803](https://github.com/microsoft/vscode-cpptools/pull/10803)
|
||||
* Fix a deadlock with Find All References. [#10855](https://github.com/microsoft/vscode-cpptools/issues/10855)
|
||||
* Fix the Code Analysis Options dropdown showing 'Resume' instead of 'Pause' after a cancel is done in a paused state. [#10879](https://github.com/microsoft/vscode-cpptools/issues/10879)
|
||||
* Fix "Code Analysis Mode" not being localized when initially shown. [#10881](https://github.com/microsoft/vscode-cpptools/issues/10881)
|
||||
* Fix the C/C++-related status bar items flickering off/on when switching documents. [PR #10888](https://github.com/microsoft/vscode-cpptools/pull/10888)
|
||||
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"running.tagparser.text": "分析工作区",
|
||||
"paused.tagparser.text": "分析工作区: 已暂停",
|
||||
"complete.tagparser.text": "分析完毕",
|
||||
"initializing.tagparser.text": "正在初始化工作区",
|
||||
"indexing.tagparser.text": "正在索引工作区",
|
||||
"rescan.tagparse.text": "重新扫描工作区",
|
||||
"c.cpp.parsing.open.files.tooltip": "正在分析打开的文件",
|
||||
"click.to.preview": "单击以预览结果",
|
||||
"updating.intellisense.tooltip": "正在更新 IntelliSense",
|
||||
"updating.intellisense.text": "IntelliSense: 正在更新",
|
||||
"idle.intellisense.text": "IntelliSense: 就绪",
|
||||
"absent.intellisense.text": "IntelliSense: 未配置",
|
||||
"running.analysis.text": "Code Analysis: 正在运行",
|
||||
"paused.analysis.text": "Code Analysis: 已暂停",
|
||||
"mode.analysis.prefix": "Code Analysis 模式:",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "配置 IntelliSense",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ 配置 IntelliSense",
|
||||
"select.command": "选择命令...",
|
||||
"select.code.analysis.command": "选择代码分析命令...",
|
||||
"c.cpp.configuration.tooltip": "C/C++ 配置",
|
||||
"c.cpp.references.statusbar": "C/C++ 引用状态",
|
||||
"c.cpp.intellisense.statusbar": "C/C++ IntelliSense 状态",
|
||||
"c.cpp.tagparser.statusbar": "C/C++ 标记分析器状态",
|
||||
"discovering.files.tooltip": "正在发现文件",
|
||||
"running.analysis.tooltip": "正在运行 {0}",
|
||||
"code.analysis.paused.tooltip": "已暂停 {0}",
|
||||
"running.analysis.processed.tooltip": "正在运行 {0}: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "C/C++ IntelliSense 状态",
|
||||
"cpptools.status.tagparser": "C/C++ 标记分析器状态",
|
||||
"cpptools.detail.tagparser": "正在初始化...",
|
||||
"cpptools.status.codeanalysis": "C/C++ Code Analysis 状态",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "立即运行",
|
||||
"tagparser.pause.text": "暂停",
|
||||
"tagparser.resume.text": "继续",
|
||||
"intellisense.select.text": "选择编译器",
|
||||
"rescan.intellisense.text": "重新扫描",
|
||||
"rescan.intellisense.tooltip": "重新扫描 IntelliSense",
|
||||
"mode.codeanalysis.status.automatic": "自动",
|
||||
"mode.codeanalysis.status.manual": "手动",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "选项",
|
||||
"startup.codeanalysis.status": "正在启动...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "立即运行",
|
||||
"running.analysis.processed.tooltip": "正在运行: {0}/{1} ({2}%)",
|
||||
"select.a.configuration": "选择配置...",
|
||||
"edit.configuration.ui": "编辑配置(UI)",
|
||||
"edit.configuration.json": "编辑配置(JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "取消",
|
||||
"resume.analysis": "继续",
|
||||
"pause.analysis": "暂停",
|
||||
"another.analysis": "启动另一个..."
|
||||
"another.analysis": "启动另一个...",
|
||||
"active.analysis": "在活动文件上运行 Code Analysis",
|
||||
"all.analysis": "在所有文件上运行 Code Analysis",
|
||||
"open.analysis": "在打开的文件上运行 Code Analysis"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"c.cpp.parsing.open.files.tooltip": "正在剖析開啟的檔案",
|
||||
"running.tagparser.text": "剖析工作區",
|
||||
"paused.tagparser.text": "剖析工作區: 已暫停",
|
||||
"complete.tagparser.text": "剖析完成",
|
||||
"initializing.tagparser.text": "正在初始化工作區",
|
||||
"indexing.tagparser.text": "索引工作區",
|
||||
"rescan.tagparse.text": "重新掃描工作區",
|
||||
"c.cpp.parsing.open.files.tooltip": "剖析開啟的檔案",
|
||||
"click.to.preview": "按一下以預覽結果",
|
||||
"updating.intellisense.tooltip": "正在更新 IntelliSense...",
|
||||
"updating.intellisense.text": "IntelliSense: 更新中",
|
||||
"idle.intellisense.text": "IntelliSense: 就緒",
|
||||
"absent.intellisense.text": "IntelliSense: 未設定",
|
||||
"running.analysis.text": "Code Analysis: 執行中",
|
||||
"paused.analysis.text": "Code Analysis: 已暫停",
|
||||
"mode.analysis.prefix": "Code Analysis 模式: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "設定 IntelliSense",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ 設定 IntelliSense",
|
||||
"select.command": "選取命令...",
|
||||
"select.code.analysis.command": "選取程式碼分析命令...",
|
||||
"c.cpp.configuration.tooltip": "C/C++ 組態",
|
||||
"c.cpp.references.statusbar": "C/C++ 參考狀態",
|
||||
"c.cpp.intellisense.statusbar": "C/C++ IntelliSense 狀態",
|
||||
"c.cpp.tagparser.statusbar": "C/C++ 標記剖析器狀態",
|
||||
"discovering.files.tooltip": "正在探索檔案",
|
||||
"running.analysis.tooltip": "正在執行 {0}",
|
||||
"code.analysis.paused.tooltip": "{0} 已暫停",
|
||||
"running.analysis.processed.tooltip": "正在執行 {0}: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "C/C++ IntelliSense 狀態",
|
||||
"cpptools.status.tagparser": "C/C++ 標記剖析器狀態",
|
||||
"cpptools.detail.tagparser": "正在初始化...",
|
||||
"cpptools.status.codeanalysis": "C/C++ Code Analysis 狀態",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "立即執行",
|
||||
"tagparser.pause.text": "暫停",
|
||||
"tagparser.resume.text": "繼續",
|
||||
"intellisense.select.text": "選取編譯器",
|
||||
"rescan.intellisense.text": "重新掃描",
|
||||
"rescan.intellisense.tooltip": "重新掃描 IntelliSense",
|
||||
"mode.codeanalysis.status.automatic": "自動",
|
||||
"mode.codeanalysis.status.manual": "手動",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "選項",
|
||||
"startup.codeanalysis.status": "正在啟動...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "立即執行",
|
||||
"running.analysis.processed.tooltip": "正在執行: {0} / {1} ({2}%)",
|
||||
"select.a.configuration": "選取組態...",
|
||||
"edit.configuration.ui": "編輯組態 (UI)",
|
||||
"edit.configuration.json": "編輯組態 (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "取消",
|
||||
"resume.analysis": "繼續",
|
||||
"pause.analysis": "暫停",
|
||||
"another.analysis": "啟動另一個..."
|
||||
"another.analysis": "啟動另一個...",
|
||||
"active.analysis": "在使用中檔案上執行程式碼分析",
|
||||
"all.analysis": "在所有檔案上執行程式碼分析",
|
||||
"open.analysis": "在開啟檔案上執行程式碼分析"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"c.cpp.parsing.open.files.tooltip": "Analýza otevřených souborů.",
|
||||
"running.tagparser.text": "Parsování pracovního prostoru",
|
||||
"paused.tagparser.text": "Pracovní prostor analýzy: Pozastaveno",
|
||||
"complete.tagparser.text": "Analýza byla dokončena.",
|
||||
"initializing.tagparser.text": "Inicializuje se pracovní prostor",
|
||||
"indexing.tagparser.text": "Pracovní prostor indexování",
|
||||
"rescan.tagparse.text": "Znovu prohledat pracovní prostor",
|
||||
"c.cpp.parsing.open.files.tooltip": "Analýza otevřených souborů",
|
||||
"click.to.preview": "kliknutím si můžete zobrazit náhled výsledků",
|
||||
"updating.intellisense.tooltip": "Aktualizuje se IntelliSense.",
|
||||
"updating.intellisense.text": "IntelliSense: Aktualizace",
|
||||
"idle.intellisense.text": "IntelliSense: Připraveno",
|
||||
"absent.intellisense.text": "IntelliSense: Nenakonfigurováno",
|
||||
"running.analysis.text": "Code Analysis: Spuštěno",
|
||||
"paused.analysis.text": "Code Analysis: Pozastaveno",
|
||||
"mode.analysis.prefix": "Režim Code Analysis: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "Konfigurovat IntelliSense",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "Konfigurovat IntelliSense v C/C++",
|
||||
"select.command": "Vyberte příkaz…",
|
||||
"select.code.analysis.command": "Vyberte příkaz pro analýzu kódu…",
|
||||
"c.cpp.configuration.tooltip": "Konfigurace C/C++",
|
||||
"c.cpp.references.statusbar": "Stav odkazů jazyka C/C++",
|
||||
"c.cpp.intellisense.statusbar": "C/C++ IntelliSense Status",
|
||||
"c.cpp.tagparser.statusbar": "Stav analyzátoru značky jazyka C/C++",
|
||||
"discovering.files.tooltip": "Zjišťují se soubory.",
|
||||
"running.analysis.tooltip": "Probíhá {0}",
|
||||
"code.analysis.paused.tooltip": "{0} pozastaveno",
|
||||
"running.analysis.processed.tooltip": "Spuštěno {0}: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "C/C++ IntelliSense Status",
|
||||
"cpptools.status.tagparser": "Stav analyzátoru značky jazyka C/C++",
|
||||
"cpptools.detail.tagparser": "Probíhá inicializace...",
|
||||
"cpptools.status.codeanalysis": "Stav Code Analysis C/C++",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "Spustit",
|
||||
"tagparser.pause.text": "Pozastavit",
|
||||
"tagparser.resume.text": "Pokračovat",
|
||||
"intellisense.select.text": "Vyberte kompilátor.",
|
||||
"rescan.intellisense.text": "Prohledat znovu",
|
||||
"rescan.intellisense.tooltip": "Znovu prohledat IntelliSense",
|
||||
"mode.codeanalysis.status.automatic": "Automaticky",
|
||||
"mode.codeanalysis.status.manual": "Ručně",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Možnosti",
|
||||
"startup.codeanalysis.status": "Spouštění...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Spustit",
|
||||
"running.analysis.processed.tooltip": "Spuštěno: {0} / {1} ({2} %)",
|
||||
"select.a.configuration": "Vybrat konfiguraci...",
|
||||
"edit.configuration.ui": "Upravit konfigurace (uživatelské rozhraní)",
|
||||
"edit.configuration.json": "Upravit konfigurace (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "Zrušit",
|
||||
"resume.analysis": "Pokračovat",
|
||||
"pause.analysis": "Pozastavit",
|
||||
"another.analysis": "Spustit další…"
|
||||
"another.analysis": "Spustit další…",
|
||||
"active.analysis": "Spustit Code Analysis u aktivního souboru",
|
||||
"all.analysis": "Spustit Code Analysis u všech souborů",
|
||||
"open.analysis": "Spustit Code Analysis při otevírání souborů"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"c.cpp.parsing.open.files.tooltip": "Offene Dateien werden analysiert",
|
||||
"running.tagparser.text": "Parsing-Arbeitsbereich",
|
||||
"paused.tagparser.text": "Parsing-Arbeitsbereich: Angehalten",
|
||||
"complete.tagparser.text": "Parsing abgeschlossen",
|
||||
"initializing.tagparser.text": "Arbeitsbereich wird initialisiert",
|
||||
"indexing.tagparser.text": "Arbeitsbereich für die Indizierung",
|
||||
"rescan.tagparse.text": "Arbeitsbereich neu einlesen",
|
||||
"c.cpp.parsing.open.files.tooltip": "Offene Dateien werden geparst",
|
||||
"click.to.preview": "Klicken Sie, um eine Vorschau der Ergebnisse anzuzeigen.",
|
||||
"updating.intellisense.tooltip": "IntelliSense wird aktualisiert",
|
||||
"updating.intellisense.text": "IntelliSense: Aktualisieren",
|
||||
"idle.intellisense.text": "IntelliSense: Bereit",
|
||||
"absent.intellisense.text": "IntelliSense: Nicht konfiguriert",
|
||||
"running.analysis.text": "Code Analysis: Wird ausgeführt",
|
||||
"paused.analysis.text": "Code Analysis: Angehalten",
|
||||
"mode.analysis.prefix": "Code Analysis-Modus: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "IntelliSense konfigurieren",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "IntelliSense in C/C++ konfigurieren",
|
||||
"select.command": "Befehl auswählen...",
|
||||
"select.code.analysis.command": "Codeanalysebefehl auswählen...",
|
||||
"c.cpp.configuration.tooltip": "C/C++-Konfiguration",
|
||||
"c.cpp.references.statusbar": "C/C++-Verweisstatus",
|
||||
"c.cpp.intellisense.statusbar": "Status von C/C++-IntelliSense",
|
||||
"c.cpp.tagparser.statusbar": "Status des C/C++-Tagparsers",
|
||||
"discovering.files.tooltip": "Dateien werden ermittelt",
|
||||
"running.analysis.tooltip": "\"{0}\" wird ausgeführt",
|
||||
"code.analysis.paused.tooltip": "{0} angehalten",
|
||||
"running.analysis.processed.tooltip": "Ausführen von {0}: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "Status von C/C++-IntelliSense",
|
||||
"cpptools.status.tagparser": "Status des C/C++-Tagparsers",
|
||||
"cpptools.detail.tagparser": "Wird initialisiert...",
|
||||
"cpptools.status.codeanalysis": "C/C++-Code Analysis-Status",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "Jetzt ausführen",
|
||||
"tagparser.pause.text": "Anhalten",
|
||||
"tagparser.resume.text": "Fortsetzen",
|
||||
"intellisense.select.text": "Compiler auswählen",
|
||||
"rescan.intellisense.text": "Neu einlesen",
|
||||
"rescan.intellisense.tooltip": "IntelliSense neu einlesen",
|
||||
"mode.codeanalysis.status.automatic": "Automatisch",
|
||||
"mode.codeanalysis.status.manual": "Manuell",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Optionen",
|
||||
"startup.codeanalysis.status": "Wird gestartet...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Jetzt ausführen",
|
||||
"running.analysis.processed.tooltip": "Wird ausgeführt: {0} / {1} ({2}%)",
|
||||
"select.a.configuration": "Konfiguration auswählen...",
|
||||
"edit.configuration.ui": "Konfigurationen bearbeiten (Benutzeroberfläche)",
|
||||
"edit.configuration.json": "Konfigurationen bearbeiten (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "Abbrechen",
|
||||
"resume.analysis": "Fortsetzen",
|
||||
"pause.analysis": "Anhalten",
|
||||
"another.analysis": "Starten Sie eine weitere..."
|
||||
"another.analysis": "Starten Sie eine weitere...",
|
||||
"active.analysis": "Code Analysis auf \"Aktive Dateien\" ausführen",
|
||||
"all.analysis": "Code Analysis auf \"Alle Dateien\" ausführen",
|
||||
"open.analysis": "Code Analysis auf \"Dateien öffnen\" ausführen"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"running.tagparser.text": "Analizar área de trabajo",
|
||||
"paused.tagparser.text": "Área de trabajo de análisis: en pausa",
|
||||
"complete.tagparser.text": "Análisis finalizado",
|
||||
"initializing.tagparser.text": "Inicializando área de trabajo",
|
||||
"indexing.tagparser.text": "Área de trabajo de indexación",
|
||||
"rescan.tagparse.text": "Volver a examinar el área de trabajo",
|
||||
"c.cpp.parsing.open.files.tooltip": "Analizando archivos abiertos",
|
||||
"click.to.preview": "hacer clic para obtener una vista previa de los resultados",
|
||||
"updating.intellisense.tooltip": "Actualizando IntelliSense...",
|
||||
"updating.intellisense.text": "IntelliSense: actualización",
|
||||
"idle.intellisense.text": "IntelliSense: listo",
|
||||
"absent.intellisense.text": "IntelliSense: no configurado",
|
||||
"running.analysis.text": "Code Analysis: en ejecución",
|
||||
"paused.analysis.text": "Code Analysis: en pausa",
|
||||
"mode.analysis.prefix": "Modo de Code Analysis: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "Configurar IntelliSense",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "Configuración de IntelliSense en C/C++",
|
||||
"select.command": "Seleccione un comando...",
|
||||
"select.code.analysis.command": "Seleccione un comando de análisis de código...",
|
||||
"c.cpp.configuration.tooltip": "Configuración de C/C++",
|
||||
"c.cpp.references.statusbar": "Estado de referencias de C/C++",
|
||||
"c.cpp.intellisense.statusbar": "Estado de IntelliSense de C/C++",
|
||||
"c.cpp.tagparser.statusbar": "Estado del analizador de etiquetas de C/C++",
|
||||
"discovering.files.tooltip": "Detectando archivos",
|
||||
"running.analysis.tooltip": "Ejecutando {0}",
|
||||
"code.analysis.paused.tooltip": "{0} en pausa",
|
||||
"running.analysis.processed.tooltip": "{0} en ejecución: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "Estado de IntelliSense de C/C++",
|
||||
"cpptools.status.tagparser": "Estado del analizador de etiquetas de C/C++",
|
||||
"cpptools.detail.tagparser": "Inicializando...",
|
||||
"cpptools.status.codeanalysis": "Estado de Code Analysis de C/C++",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "Ejecutar ahora",
|
||||
"tagparser.pause.text": "Pausa",
|
||||
"tagparser.resume.text": "Reanudar",
|
||||
"intellisense.select.text": "Seleccione un compilador",
|
||||
"rescan.intellisense.text": "Volver a examinar",
|
||||
"rescan.intellisense.tooltip": "Volver a examinar IntelliSense",
|
||||
"mode.codeanalysis.status.automatic": "Automático",
|
||||
"mode.codeanalysis.status.manual": "Manual",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Opciones",
|
||||
"startup.codeanalysis.status": "Iniciando...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Ejecutar ahora",
|
||||
"running.analysis.processed.tooltip": "En ejecución: {0} / {1} ({2}%)",
|
||||
"select.a.configuration": "Seleccione una configuración...",
|
||||
"edit.configuration.ui": "Editar configuraciones (interfaz de usuario)",
|
||||
"edit.configuration.json": "Editar configuraciones (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "Cancelar",
|
||||
"resume.analysis": "Reanudar",
|
||||
"pause.analysis": "Pausa",
|
||||
"another.analysis": "Iniciar otro..."
|
||||
"another.analysis": "Iniciar otro...",
|
||||
"active.analysis": "Ejecutar Code Analysis en el archivo activo",
|
||||
"all.analysis": "Ejecutar análisis de código en todos los archivos",
|
||||
"open.analysis": "Ejecutar análisis de código en archivos abiertos"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"running.tagparser.text": "Analyse de l’espace de travail",
|
||||
"paused.tagparser.text": "Analyse de l’espace de travail : suspendu",
|
||||
"complete.tagparser.text": "Analyse terminée",
|
||||
"initializing.tagparser.text": "Initialisation de l’espace de travail",
|
||||
"indexing.tagparser.text": "Indexation de l’espace de travail",
|
||||
"rescan.tagparse.text": "Réanalyser l'espace de travail",
|
||||
"c.cpp.parsing.open.files.tooltip": "Analyse des fichiers ouverts",
|
||||
"click.to.preview": "cliquez pour voir un aperçu des résultats",
|
||||
"updating.intellisense.tooltip": "Mise à jour d'IntelliSense",
|
||||
"updating.intellisense.text": "IntelliSense : mise à jour",
|
||||
"idle.intellisense.text": "IntelliSense : prêt",
|
||||
"absent.intellisense.text": "IntelliSense : non configuré",
|
||||
"running.analysis.text": "Code Analysis : en cours d’exécution",
|
||||
"paused.analysis.text": "Code Analysis : suspendu",
|
||||
"mode.analysis.prefix": "Mode Code Analysis : ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "Configurer IntelliSense",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "Configuration d’IntelliSense en C/C++",
|
||||
"select.command": "Sélectionner une commande...",
|
||||
"select.code.analysis.command": "Sélectionner une commande d’analyse du code...",
|
||||
"c.cpp.configuration.tooltip": "Configuration C/C++",
|
||||
"c.cpp.references.statusbar": "État des références C/C++",
|
||||
"c.cpp.intellisense.statusbar": "État IntelliSense C/C++",
|
||||
"c.cpp.tagparser.statusbar": "État de l’analyseur de balises C/C++",
|
||||
"discovering.files.tooltip": "Détection de fichiers",
|
||||
"running.analysis.tooltip": "Exécution de {0}",
|
||||
"code.analysis.paused.tooltip": "{0} en pause",
|
||||
"running.analysis.processed.tooltip": "En cours d'exécution {0}: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "État IntelliSense C/C++",
|
||||
"cpptools.status.tagparser": "État de l’analyseur de balises C/C++",
|
||||
"cpptools.detail.tagparser": "Initialisation en cours...",
|
||||
"cpptools.status.codeanalysis": "État du Code Analysis C/C++",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "Exécuter maintenant",
|
||||
"tagparser.pause.text": "Pause",
|
||||
"tagparser.resume.text": "Reprendre",
|
||||
"intellisense.select.text": "Sélectionnez un compilateur",
|
||||
"rescan.intellisense.text": "Relancer l'analyse",
|
||||
"rescan.intellisense.tooltip": "Relancer l'analyse IntelliSense",
|
||||
"mode.codeanalysis.status.automatic": "Automatique",
|
||||
"mode.codeanalysis.status.manual": "Manuel",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Options",
|
||||
"startup.codeanalysis.status": "Démarrage en cours...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Exécuter maintenant",
|
||||
"running.analysis.processed.tooltip": "En cours d’exécution : {0}/{1} ({2} %)",
|
||||
"select.a.configuration": "Sélectionner une configuration...",
|
||||
"edit.configuration.ui": "Modifier les configurations (IU)",
|
||||
"edit.configuration.json": "Modifier les configurations (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "Annuler",
|
||||
"resume.analysis": "Reprendre",
|
||||
"pause.analysis": "Suspendre",
|
||||
"another.analysis": "Démarrer une autre..."
|
||||
"another.analysis": "Démarrer une autre...",
|
||||
"active.analysis": "Exécuter Code Analysis sur le fichier actif",
|
||||
"all.analysis": "Exécuter une analyse de code sur Tous les fichiers",
|
||||
"open.analysis": "Exécuter une analyse de code sur Ouvrir les fichiers"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"running.tagparser.text": "Analisi area di lavoro",
|
||||
"paused.tagparser.text": "Analisi area di lavoro: Sospesa",
|
||||
"complete.tagparser.text": "Analisi completata",
|
||||
"initializing.tagparser.text": "Inizializzazione dell'area di lavoro",
|
||||
"indexing.tagparser.text": "Area di lavoro di indicizzazione",
|
||||
"rescan.tagparse.text": "Ripeti analisi area di lavoro",
|
||||
"c.cpp.parsing.open.files.tooltip": "Analisi dei file aperti",
|
||||
"click.to.preview": "fare clic per visualizzare l'anteprima dei risultati",
|
||||
"updating.intellisense.tooltip": "Aggiornamento di IntelliSense",
|
||||
"updating.intellisense.text": "IntelliSense: aggiornamento",
|
||||
"idle.intellisense.text": "IntelliSense: Pronto",
|
||||
"absent.intellisense.text": "IntelliSense: Non configurato",
|
||||
"running.analysis.text": "Code Analysis: In esecuzione",
|
||||
"paused.analysis.text": "Code Analysis: Sospeso",
|
||||
"mode.analysis.prefix": "Modalità Code Analysis: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "Configura IntelliSense",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ - Configura IntelliSense",
|
||||
"select.command": "Seleziona un comando...",
|
||||
"select.code.analysis.command": "Selezionare un comando di Code Analysis...",
|
||||
"c.cpp.configuration.tooltip": "Configurazione C/C++",
|
||||
"c.cpp.references.statusbar": "Stato riferimenti C/C++",
|
||||
"c.cpp.intellisense.statusbar": "Stato IntelliSense C/C++",
|
||||
"c.cpp.tagparser.statusbar": "Stato del parser del tag C/C++",
|
||||
"discovering.files.tooltip": "Individuazione dei file",
|
||||
"running.analysis.tooltip": "{0} in esecuzione",
|
||||
"code.analysis.paused.tooltip": "{0} in pausa",
|
||||
"running.analysis.processed.tooltip": "In esecuzione {0}: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "Stato IntelliSense C/C++",
|
||||
"cpptools.status.tagparser": "Stato del parser del tag C/C++",
|
||||
"cpptools.detail.tagparser": "Inizializzazione...",
|
||||
"cpptools.status.codeanalysis": "Stato Code Analysis C/C++",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "Esegui",
|
||||
"tagparser.pause.text": "Sospendi",
|
||||
"tagparser.resume.text": "Riprendi",
|
||||
"intellisense.select.text": "Seleziona un compilatore",
|
||||
"rescan.intellisense.text": "Ripeti analisi",
|
||||
"rescan.intellisense.tooltip": "Ripeti analisi di IntelliSense",
|
||||
"mode.codeanalysis.status.automatic": "Automatico",
|
||||
"mode.codeanalysis.status.manual": "Manuale",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Opzioni",
|
||||
"startup.codeanalysis.status": "Avvio...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Esegui",
|
||||
"running.analysis.processed.tooltip": "In esecuzione: {0} / {1} ({2}%)",
|
||||
"select.a.configuration": "Seleziona una configurazione...",
|
||||
"edit.configuration.ui": "Modifica configurazioni (interfaccia utente)",
|
||||
"edit.configuration.json": "Modifica configurazioni (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "Annulla",
|
||||
"resume.analysis": "Riprendi",
|
||||
"pause.analysis": "Sospendi",
|
||||
"another.analysis": "Avvia un'altra..."
|
||||
"another.analysis": "Avvia un'altra...",
|
||||
"active.analysis": "Esegui analisi del codice su File attivo",
|
||||
"all.analysis": "Esegui analisi del codice su Tutti i file",
|
||||
"open.analysis": "Esegui analisi del codice su Apri file"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"running.tagparser.text": "ワークスペースを解析しています",
|
||||
"paused.tagparser.text": "ワークスペースを解析しています: 一時停止",
|
||||
"complete.tagparser.text": "解析完了",
|
||||
"initializing.tagparser.text": "ワークスペースの初期化",
|
||||
"indexing.tagparser.text": "ワークスペースのインデックス作成",
|
||||
"rescan.tagparse.text": "ワークスペースの再スキャン",
|
||||
"c.cpp.parsing.open.files.tooltip": "開いているファイルを解析しています",
|
||||
"click.to.preview": "クリックして結果をプレビューします",
|
||||
"updating.intellisense.tooltip": "IntelliSense を更新しています...",
|
||||
"updating.intellisense.text": "IntelliSense: 更新中",
|
||||
"idle.intellisense.text": "IntelliSense: 準備完了",
|
||||
"absent.intellisense.text": "IntelliSense: 未構成",
|
||||
"running.analysis.text": "Code Analysis: 実行中",
|
||||
"paused.analysis.text": "Code Analysis: 一時停止",
|
||||
"mode.analysis.prefix": "Code Analysis モード: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "IntelliSense の構成",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ IntelliSense の構成",
|
||||
"select.command": "コマンドを選択する...",
|
||||
"select.code.analysis.command": "コード分析コマンドを選択...",
|
||||
"c.cpp.configuration.tooltip": "C/C++ 構成",
|
||||
"c.cpp.references.statusbar": "C/C + + リファレンスの状態",
|
||||
"c.cpp.intellisense.statusbar": "C/c + + IntelliSense の状態",
|
||||
"c.cpp.tagparser.statusbar": "C/C + + タグ パーサーの状態",
|
||||
"discovering.files.tooltip": "ファイルを検出しています",
|
||||
"running.analysis.tooltip": "{0} を実行しています",
|
||||
"code.analysis.paused.tooltip": "{0}一時停止",
|
||||
"running.analysis.processed.tooltip": "実行中{0}: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "C/c + + IntelliSense の状態",
|
||||
"cpptools.status.tagparser": "C/C + + タグ パーサーの状態",
|
||||
"cpptools.detail.tagparser": "初期化しています...",
|
||||
"cpptools.status.codeanalysis": "C/C++ Code Analysis の状態",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "直ちに実行",
|
||||
"tagparser.pause.text": "一時停止",
|
||||
"tagparser.resume.text": "再開",
|
||||
"intellisense.select.text": "コンパイラを選択する",
|
||||
"rescan.intellisense.text": "再スキャン",
|
||||
"rescan.intellisense.tooltip": "IntelliSense の再スキャン",
|
||||
"mode.codeanalysis.status.automatic": "自動",
|
||||
"mode.codeanalysis.status.manual": "手動",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "オプション",
|
||||
"startup.codeanalysis.status": "開始しています...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "直ちに実行",
|
||||
"running.analysis.processed.tooltip": "実行中: {0} / {1} ({2}%)",
|
||||
"select.a.configuration": "構成を選択する...",
|
||||
"edit.configuration.ui": "構成の編集 (UI)",
|
||||
"edit.configuration.json": "構成の編集 (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "キャンセル",
|
||||
"resume.analysis": "再開",
|
||||
"pause.analysis": "一時停止",
|
||||
"another.analysis": "別のファイルを開始..."
|
||||
"another.analysis": "別のファイルを開始...",
|
||||
"active.analysis": "アクティブ ファイルで Code Analysis を実行する",
|
||||
"all.analysis": "すべてのファイルで Code Analysis を実行する",
|
||||
"open.analysis": "開いているファイルで Code Analysis を実行する"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"running.tagparser.text": "작업 영역 구문 분석",
|
||||
"paused.tagparser.text": "작업 영역 구문 분석: 일시 중지됨",
|
||||
"complete.tagparser.text": "구문 분석이 완료되었습니다.",
|
||||
"initializing.tagparser.text": "작업 영역 초기화",
|
||||
"indexing.tagparser.text": "작업 영역 인덱싱",
|
||||
"rescan.tagparse.text": "작업 영역 다시 검사",
|
||||
"c.cpp.parsing.open.files.tooltip": "열린 파일을 구문 분석하는 중",
|
||||
"click.to.preview": "결과를 미리 보려면 클릭",
|
||||
"updating.intellisense.tooltip": "IntelliSense를 업데이트하는 중",
|
||||
"updating.intellisense.text": "IntelliSense: 업데이트 중",
|
||||
"idle.intellisense.text": "IntelliSense: 준비 완료",
|
||||
"absent.intellisense.text": "IntelliSense: 구성되지 않음",
|
||||
"running.analysis.text": "Code Analysis: 실행 중",
|
||||
"paused.analysis.text": "Code Analysis: 일시 중지됨",
|
||||
"mode.analysis.prefix": "Code Analysis 모드: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "IntelliSense 구성",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ IntelliSense 구성",
|
||||
"select.command": "명령 선택...",
|
||||
"select.code.analysis.command": "코드 분석 명령 선택...",
|
||||
"c.cpp.configuration.tooltip": "C/C++ 구성",
|
||||
"c.cpp.references.statusbar": "C/C++ 참조 상태",
|
||||
"c.cpp.intellisense.statusbar": "C/C++ IntelliSense 상태",
|
||||
"c.cpp.tagparser.statusbar": "C/C++ 태그 파서 상태",
|
||||
"discovering.files.tooltip": "파일을 검색하는 중",
|
||||
"running.analysis.tooltip": "{0} 실행 중",
|
||||
"code.analysis.paused.tooltip": "{0} 일시 중지됨",
|
||||
"running.analysis.processed.tooltip": "{0}: {1} / {2} 실행 중({3}%)",
|
||||
"cpptools.status.intellisense": "C/C++ IntelliSense 상태",
|
||||
"cpptools.status.tagparser": "C/C++ 태그 파서 상태",
|
||||
"cpptools.detail.tagparser": "초기화하는 중...",
|
||||
"cpptools.status.codeanalysis": "C/C++ Code Analysis 상태",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "지금 실행",
|
||||
"tagparser.pause.text": "일시 중지",
|
||||
"tagparser.resume.text": "다시 시작",
|
||||
"intellisense.select.text": "컴파일러 선택",
|
||||
"rescan.intellisense.text": "다시 검사",
|
||||
"rescan.intellisense.tooltip": "IntelliSense 다시 검사",
|
||||
"mode.codeanalysis.status.automatic": "자동",
|
||||
"mode.codeanalysis.status.manual": "수동",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "옵션",
|
||||
"startup.codeanalysis.status": "시작 중...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "지금 실행",
|
||||
"running.analysis.processed.tooltip": "실행 중: {0} / {1} ({2}%)",
|
||||
"select.a.configuration": "구성 선택...",
|
||||
"edit.configuration.ui": "구성 편집(UI)",
|
||||
"edit.configuration.json": "구성 편집(JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "취소",
|
||||
"resume.analysis": "다시 시작",
|
||||
"pause.analysis": "일시 중지",
|
||||
"another.analysis": "다른 시작..."
|
||||
"another.analysis": "다른 시작...",
|
||||
"active.analysis": "활성 파일에서 코드 분석 실행",
|
||||
"all.analysis": "모든 파일에 대한 코드 분석 실행",
|
||||
"open.analysis": "열린 파일에서 코드 분석 실행"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"running.tagparser.text": "Analizowanie obszaru roboczego",
|
||||
"paused.tagparser.text": "Analizowanie obszaru roboczego: wstrzymane",
|
||||
"complete.tagparser.text": "Analizowanie zakończone",
|
||||
"initializing.tagparser.text": "Inicjowanie obszaru roboczego",
|
||||
"indexing.tagparser.text": "Indeksowanie obszaru roboczego",
|
||||
"rescan.tagparse.text": "Ponowne skanowanie obszaru roboczego",
|
||||
"c.cpp.parsing.open.files.tooltip": "Analizowanie otwartych plików",
|
||||
"click.to.preview": "kliknij, aby wyświetlić podgląd wyników",
|
||||
"updating.intellisense.tooltip": "Aktualizowanie funkcji IntelliSense",
|
||||
"updating.intellisense.text": "IntelliSense: aktualizowanie",
|
||||
"idle.intellisense.text": "IntelliSense: gotowe",
|
||||
"absent.intellisense.text": "IntelliSense: nieskonfigurowane",
|
||||
"running.analysis.text": "Analiza kodu: uruchamianie",
|
||||
"paused.analysis.text": "Analiza kodu: wstrzymano",
|
||||
"mode.analysis.prefix": "Tryb analizy kodu: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "Konfigurowanie funkcji IntelliSense",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "Konfigurowanie funkcji IntelliSense (C/C++)",
|
||||
"select.command": "Wybierz polecenie...",
|
||||
"select.code.analysis.command": "Wybierz polecenie analizy kodu...",
|
||||
"c.cpp.configuration.tooltip": "Konfiguracja języka C/C++",
|
||||
"c.cpp.references.statusbar": "Stan odwołań języka C/C++",
|
||||
"c.cpp.intellisense.statusbar": "Stan funkcji IntelliSense języka C/C++",
|
||||
"c.cpp.tagparser.statusbar": "Stan parsera tagów języka C/C++",
|
||||
"discovering.files.tooltip": "Odnajdowanie plików",
|
||||
"running.analysis.tooltip": "Wykonywanie {0}",
|
||||
"code.analysis.paused.tooltip": "{0} wstrzymana",
|
||||
"running.analysis.processed.tooltip": "Uruchamianie {0}: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "Stan funkcji IntelliSense języka C/C++",
|
||||
"cpptools.status.tagparser": "Stan parsera tagów języka C/C++",
|
||||
"cpptools.detail.tagparser": "Trwa inicjowanie...",
|
||||
"cpptools.status.codeanalysis": "Stan analizy kodu C/C++",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "Uruchom teraz",
|
||||
"tagparser.pause.text": "Wstrzymaj",
|
||||
"tagparser.resume.text": "Wznów",
|
||||
"intellisense.select.text": "Wybierz kompilator",
|
||||
"rescan.intellisense.text": "Skanuj ponownie",
|
||||
"rescan.intellisense.tooltip": "Ponowne skanowanie funkcji IntelliSense",
|
||||
"mode.codeanalysis.status.automatic": "Automatycznie",
|
||||
"mode.codeanalysis.status.manual": "Ręczny",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Opcje",
|
||||
"startup.codeanalysis.status": "Trwa uruchamianie...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Uruchom teraz",
|
||||
"running.analysis.processed.tooltip": "Uruchomione: {0} / {1} ({2}%)",
|
||||
"select.a.configuration": "Wybierz konfigurację...",
|
||||
"edit.configuration.ui": "Edytowanie konfiguracji (interfejs użytkownika)",
|
||||
"edit.configuration.json": "Edytowanie konfiguracji (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "Anuluj",
|
||||
"resume.analysis": "Wznów",
|
||||
"pause.analysis": "Wstrzymaj",
|
||||
"another.analysis": "Uruchom kolejną..."
|
||||
"another.analysis": "Uruchom kolejną...",
|
||||
"active.analysis": "Uruchom analizę kodu dla aktywnego pliku",
|
||||
"all.analysis": "Uruchamianie analizy kodu dla wszystkich plików",
|
||||
"open.analysis": "Uruchamianie rozszerzenia Code Analysis na otwartych plikach"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"c.cpp.parsing.open.files.tooltip": "Analisando arquivos abertos",
|
||||
"running.tagparser.text": "Analisando o Workspace",
|
||||
"paused.tagparser.text": "Workspace de Análise: Pausado",
|
||||
"complete.tagparser.text": "Análise Concluída",
|
||||
"initializing.tagparser.text": "Inicializando o Workspace",
|
||||
"indexing.tagparser.text": "Workspace da Indexação",
|
||||
"rescan.tagparse.text": "Examinar Novamente o Workspace",
|
||||
"c.cpp.parsing.open.files.tooltip": "Analisando Arquivos Abertos",
|
||||
"click.to.preview": "clique aqui para visualizar os resultados",
|
||||
"updating.intellisense.tooltip": "Atualizando o IntelliSense",
|
||||
"updating.intellisense.text": "IntelliSense: Atualizando",
|
||||
"idle.intellisense.text": "IntelliSense: Pronto",
|
||||
"absent.intellisense.text": "IntelliSense: Não Configurado",
|
||||
"running.analysis.text": "Code Analysis: em Execução",
|
||||
"paused.analysis.text": "Code Analysis: Pausado",
|
||||
"mode.analysis.prefix": "Modo do Code Analysis: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "Configurar o IntelliSense",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ Configurar IntelliSense",
|
||||
"select.command": "Selecionar um comando...",
|
||||
"select.code.analysis.command": "Selecione um comando de análise de código...",
|
||||
"c.cpp.configuration.tooltip": "Configuração de C/C++",
|
||||
"c.cpp.references.statusbar": "Status de Referências do C/C++",
|
||||
"c.cpp.intellisense.statusbar": "Status do IntelliSense do C/C++",
|
||||
"c.cpp.tagparser.statusbar": "Status do Analisador de Marcas do C/C++",
|
||||
"discovering.files.tooltip": "Descobrindo arquivos",
|
||||
"running.analysis.tooltip": "Executando {0}",
|
||||
"code.analysis.paused.tooltip": "{0} pausado",
|
||||
"running.analysis.processed.tooltip": "Executando {0}: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "Status do IntelliSense do C/C++",
|
||||
"cpptools.status.tagparser": "Status do Analisador de Marcas do C/C++",
|
||||
"cpptools.detail.tagparser": "Inicializando...",
|
||||
"cpptools.status.codeanalysis": "Status do Code Analysis do C/C++",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "Executar Agora",
|
||||
"tagparser.pause.text": "Pausar",
|
||||
"tagparser.resume.text": "Retomar",
|
||||
"intellisense.select.text": "Selecionar um Compilador",
|
||||
"rescan.intellisense.text": "Examinar novamente",
|
||||
"rescan.intellisense.tooltip": "Examinar Novamente o IntelliSense",
|
||||
"mode.codeanalysis.status.automatic": "Automático",
|
||||
"mode.codeanalysis.status.manual": "Manual",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Opções",
|
||||
"startup.codeanalysis.status": "Iniciando...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Executar Agora",
|
||||
"running.analysis.processed.tooltip": "Executando: {0} / {1} ({2}%)",
|
||||
"select.a.configuration": "Selecione uma Configuração...",
|
||||
"edit.configuration.ui": "Editar Configurações (IU)",
|
||||
"edit.configuration.json": "Editar Configurações (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "Cancelar",
|
||||
"resume.analysis": "Retomar",
|
||||
"pause.analysis": "Pausar",
|
||||
"another.analysis": "Iniciar Outro..."
|
||||
"another.analysis": "Iniciar Outro...",
|
||||
"active.analysis": "Executar Code Analysis no Arquivo Ativo",
|
||||
"all.analysis": "Executar Code Analysis em Todos os Arquivos",
|
||||
"open.analysis": "Executar Code Analysis em Abrir Arquivos"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"running.tagparser.text": "Анализ рабочей области",
|
||||
"paused.tagparser.text": "Анализ рабочей области: приостановлено",
|
||||
"complete.tagparser.text": "Анализ завершен",
|
||||
"initializing.tagparser.text": "Инициализация рабочей области",
|
||||
"indexing.tagparser.text": "Индексация рабочей области",
|
||||
"rescan.tagparse.text": "Повторное сканирование рабочей области",
|
||||
"c.cpp.parsing.open.files.tooltip": "Анализ открытых файлов",
|
||||
"click.to.preview": "щелкните для предварительного просмотра результатов",
|
||||
"updating.intellisense.tooltip": "Обновление IntelliSense",
|
||||
"updating.intellisense.text": "IntelliSense: обновление",
|
||||
"idle.intellisense.text": "IntelliSense: готово",
|
||||
"absent.intellisense.text": "IntelliSense: не настроено",
|
||||
"running.analysis.text": "Code Analysis: запуск",
|
||||
"paused.analysis.text": "Code Analysis: приостановлено",
|
||||
"mode.analysis.prefix": "Режим Code Analysis: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "Настройка IntelliSense",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "Настройка IntelliSense C/C++",
|
||||
"select.command": "Выберите команду...",
|
||||
"select.code.analysis.command": "Выберите команду анализа кода...",
|
||||
"c.cpp.configuration.tooltip": "Конфигурация C/C++",
|
||||
"c.cpp.references.statusbar": "Состояние ссылок C/C++",
|
||||
"c.cpp.intellisense.statusbar": "Состояние IntelliSense C/C++",
|
||||
"c.cpp.tagparser.statusbar": "Состояние анализатора тегов C/C++",
|
||||
"discovering.files.tooltip": "Обнаружение файлов",
|
||||
"running.analysis.tooltip": "Выполняется {0}",
|
||||
"code.analysis.paused.tooltip": "Выполнение {0} приостановлено",
|
||||
"running.analysis.processed.tooltip": "Выполняется {0}: {1} / {2} ({3}%)",
|
||||
"cpptools.status.intellisense": "Состояние IntelliSense C/C++",
|
||||
"cpptools.status.tagparser": "Состояние анализатора тегов C/C++",
|
||||
"cpptools.detail.tagparser": "Выполняется инициализация…",
|
||||
"cpptools.status.codeanalysis": "Состояние Code Analysis C/C++",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "Запустить сейчас",
|
||||
"tagparser.pause.text": "Приостановить",
|
||||
"tagparser.resume.text": "Возобновить",
|
||||
"intellisense.select.text": "Выбор компилятора",
|
||||
"rescan.intellisense.text": "Повторное сканирование",
|
||||
"rescan.intellisense.tooltip": "Повторное сканирование IntelliSense",
|
||||
"mode.codeanalysis.status.automatic": "Автоматически",
|
||||
"mode.codeanalysis.status.manual": "Вручную",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Параметры",
|
||||
"startup.codeanalysis.status": "Запуск…",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Запустить сейчас",
|
||||
"running.analysis.processed.tooltip": "Выполняется: {0}/{1} ({2}%)",
|
||||
"select.a.configuration": "Выберите конфигурацию...",
|
||||
"edit.configuration.ui": "Изменить конфигурации (пользовательский интерфейс)",
|
||||
"edit.configuration.json": "Изменить конфигурации (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "Отмена",
|
||||
"resume.analysis": "Возобновить",
|
||||
"pause.analysis": "Приостановить",
|
||||
"another.analysis": "Запустить другой..."
|
||||
"another.analysis": "Запустить другой...",
|
||||
"active.analysis": "Запустить Code Analysis в активном файле",
|
||||
"all.analysis": "Запустить Code Analysis во всех файлах",
|
||||
"open.analysis": "Запустить Code Analysis в открытых файлах"
|
||||
}
|
||||
@@ -4,21 +4,42 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"c.cpp.parsing.open.files.tooltip": "Açık dosyalar ayrıştırılıyor",
|
||||
"running.tagparser.text": "Çalışma Alanı Ayrıştırılıyor",
|
||||
"paused.tagparser.text": "Çalışma Alanı Ayrıştırılıyor: Duraklatıldı",
|
||||
"complete.tagparser.text": "Ayrıştırma Tamamlandı",
|
||||
"initializing.tagparser.text": "Çalışma Alanı Başlatılıyor",
|
||||
"indexing.tagparser.text": "Çalışma Alanı Dizine Ekleniyor",
|
||||
"rescan.tagparse.text": "Çalışma Alanını Yeniden Tara",
|
||||
"c.cpp.parsing.open.files.tooltip": "Açık Dosyalar Ayrıştırılıyor",
|
||||
"click.to.preview": "sonuçların önizlemesini görüntülemek için tıklayın",
|
||||
"updating.intellisense.tooltip": "IntelliSense güncelleştiriliyor",
|
||||
"updating.intellisense.text": "IntelliSense: Güncelleştiriliyor",
|
||||
"idle.intellisense.text": "IntelliSense: Hazır",
|
||||
"absent.intellisense.text": "IntelliSense: Yapılandırılmadı",
|
||||
"running.analysis.text": "Code Analysis: Çalışıyor",
|
||||
"paused.analysis.text": "Code Analysis: Duraklatıldı",
|
||||
"mode.analysis.prefix": "Code Analysis Modu: ",
|
||||
"c.cpp.configureIntelliSenseStatus.text": "IntelliSense'i Yapılandır",
|
||||
"c.cpp.configureIntelliSenseStatus.cppText": "C/C++ IntelliSense'i Yapılandır",
|
||||
"select.command": "Komut seç...",
|
||||
"select.code.analysis.command": "Kod analizi komutu seçin...",
|
||||
"c.cpp.configuration.tooltip": "C/C++ Yapılandırması",
|
||||
"c.cpp.references.statusbar": "C/C++ Başvuruları Durumu",
|
||||
"c.cpp.intellisense.statusbar": "C/C++ IntelliSense Durumu",
|
||||
"c.cpp.tagparser.statusbar": "C/C++ Etiket Ayrıştırıcısı Durumu",
|
||||
"discovering.files.tooltip": "Dosyalar bulunuyor",
|
||||
"running.analysis.tooltip": "{0} çalıştırılıyor",
|
||||
"code.analysis.paused.tooltip": "{0} durduruldu",
|
||||
"running.analysis.processed.tooltip": "{0} Çalışıyor: {1} / {2} (%{3})",
|
||||
"cpptools.status.intellisense": "C/C++ IntelliSense Durumu",
|
||||
"cpptools.status.tagparser": "C/C++ Etiket Ayrıştırıcısı Durumu",
|
||||
"cpptools.detail.tagparser": "Başlatılıyor...",
|
||||
"cpptools.status.codeanalysis": "C/C++ Code Analysis Durumu",
|
||||
"c.cpp.codeanalysis.statusbar.runNow": "Şimdi Çalıştır",
|
||||
"tagparser.pause.text": "Duraklat",
|
||||
"tagparser.resume.text": "Sürdür",
|
||||
"intellisense.select.text": "Derleyici seçin",
|
||||
"rescan.intellisense.text": "Yeniden tara",
|
||||
"rescan.intellisense.tooltip": "Rescan IntelliSense",
|
||||
"mode.codeanalysis.status.automatic": "Otomatik",
|
||||
"mode.codeanalysis.status.manual": "El ile",
|
||||
"c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions": "Seçenekler",
|
||||
"startup.codeanalysis.status": "Başlatılıyor...",
|
||||
"c.cpp.codeanalysis.statusbar.showRunNowOptions": "Şimdi Çalıştır",
|
||||
"running.analysis.processed.tooltip": "Çalışıyor: {0}/{1} (%{2})",
|
||||
"select.a.configuration": "Yapılandırma Seçin...",
|
||||
"edit.configuration.ui": "Yapılandırmaları Düzenle (UI)",
|
||||
"edit.configuration.json": "Yapılandırmaları Düzenle (JSON)",
|
||||
@@ -33,5 +54,8 @@
|
||||
"cancel.analysis": "İptal",
|
||||
"resume.analysis": "Sürdür",
|
||||
"pause.analysis": "Duraklat",
|
||||
"another.analysis": "Başkasını Başlat..."
|
||||
"another.analysis": "Başkasını Başlat...",
|
||||
"active.analysis": "Aktif Dosyada Code Analysis’i Çalıştır",
|
||||
"all.analysis": "Tüm Dosyalarda Code Analysis’i Çalıştır",
|
||||
"open.analysis": "Açık Dosyalarda Code Analysis’i Çalıştır"
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "cpptools",
|
||||
"displayName": "C/C++",
|
||||
"description": "C/C++ IntelliSense, debugging, and code browsing.",
|
||||
"version": "1.16.0-main",
|
||||
"version": "1.16.2-main",
|
||||
"publisher": "ms-vscode",
|
||||
"icon": "LanguageCCPP_color_128x.png",
|
||||
"readme": "README.md",
|
||||
@@ -733,7 +733,6 @@
|
||||
},
|
||||
"C_Cpp.default.dotConfig": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"markdownDescription": "%c_cpp.configuration.default.dotConfig.markdownDescription%",
|
||||
"scope": "resource"
|
||||
},
|
||||
@@ -4231,6 +4230,11 @@
|
||||
"description": "%c_cpp.debuggers.miDebuggerPath.description%",
|
||||
"default": "/usr/bin/gdb"
|
||||
},
|
||||
"miDebuggerArgs": {
|
||||
"type": "string",
|
||||
"description": "%c_cpp.debuggers.miDebuggerArgs.description%",
|
||||
"default": ""
|
||||
},
|
||||
"miDebuggerServerAddress": {
|
||||
"type": "string",
|
||||
"description": "%c_cpp.debuggers.miDebuggerServerAddress.description%",
|
||||
@@ -6009,9 +6013,7 @@
|
||||
"integrationTests": "tsc -p test.tsconfig.json && node ./out/test/integrationTests/languageServer/runTest.js",
|
||||
"intelliSenseFeaturesTests": "tsc -p test.tsconfig.json && node ./out/test/integrationTests/IntelliSenseFeatures/runTest.js",
|
||||
"import-edge-strings": "node ./import_edge_strings.js",
|
||||
"download-api": "vscode-dts dev",
|
||||
"postdownload-api": "vscode-dts master",
|
||||
"postinstall": "npm run download-api"
|
||||
"postinstall": "npx vscode-dts dev && npx vscode-dts main"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@octokit/rest": "^18.12.0",
|
||||
@@ -6030,6 +6032,7 @@
|
||||
"@typescript-eslint/eslint-plugin-tslint": "^4.31.1",
|
||||
"@typescript-eslint/parser": "^4.31.1",
|
||||
"@vscode/test-electron": "^1.6.1",
|
||||
"@vscode/dts": "^0.4.0",
|
||||
"async-child-process": "^1.1.1",
|
||||
"await-notify": "^1.0.1",
|
||||
"eslint": "^7.32.0",
|
||||
@@ -6054,7 +6057,6 @@
|
||||
"typescript": "^4.4.3",
|
||||
"vscode-debugadapter": "^1.35.0",
|
||||
"vscode-debugprotocol": "^1.35.0",
|
||||
"vscode-dts": "^0.3.2",
|
||||
"vscode-nls-dev": "^4.0.0-next.1",
|
||||
"webpack": "^5.76.0",
|
||||
"webpack-cli": "^5.0.1",
|
||||
@@ -6104,4 +6106,4 @@
|
||||
"yargs-parser": "^15.0.1",
|
||||
"y18n": "^5.0.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -434,7 +434,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
|
||||
if (newConfig.type === DebuggerType.cppdbg) {
|
||||
newConfig.externalConsole = false;
|
||||
} else {
|
||||
newConfig.console = "externalTerminal";
|
||||
newConfig.console = "integratedTerminal";
|
||||
}
|
||||
const isWindows: boolean = platformInfo.platform === 'win32';
|
||||
// Extract the .exe path from the defined task.
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
import * as vscode from 'vscode';
|
||||
import * as path from 'path';
|
||||
import * as Telemetry from '../../telemetry';
|
||||
import { DefaultClient, CancelReferencesNotification, workspaceReferences } from '../client';
|
||||
import { DefaultClient, workspaceReferences } from '../client';
|
||||
import { processDelayedDidOpen } from '../extension';
|
||||
import { CallHierarchyResultCallback } from '../references';
|
||||
import { CancellationSender } from '../references';
|
||||
import { Position, Range, RequestType, TextDocumentIdentifier } from 'vscode-languageclient';
|
||||
import { makeVscodeRange } from '../utils';
|
||||
|
||||
@@ -53,7 +54,7 @@ interface CallHierarchyItemResult {
|
||||
|
||||
/**
|
||||
* If a request is cancelled, `succeeded` will be undefined to indicate no result was returned.
|
||||
* Therfore, object is not defined as optional on the language server.
|
||||
* Therefore, object is not defined as optional on the language server.
|
||||
*/
|
||||
succeeded: boolean;
|
||||
}
|
||||
@@ -76,17 +77,20 @@ export interface CallHierarchyCallsItemResult {
|
||||
calls: CallHierarchyCallsItem[];
|
||||
}
|
||||
|
||||
export enum CallHierarchyRequestStatus {
|
||||
enum CallHierarchyRequestStatus {
|
||||
Unknown,
|
||||
Succeeded,
|
||||
Canceled,
|
||||
CaneledByUser,
|
||||
CanceledByUser,
|
||||
Failed
|
||||
}
|
||||
|
||||
const CallHierarchyItemRequest: RequestType<CallHierarchyParams, CallHierarchyItemResult, void> =
|
||||
new RequestType<CallHierarchyParams, CallHierarchyItemResult, void>('cpptools/prepareCallHierarchy');
|
||||
|
||||
const CallHierarchyCallsToRequest: RequestType<CallHierarchyParams, CallHierarchyCallsItemResult, void> =
|
||||
new RequestType<CallHierarchyParams, CallHierarchyCallsItemResult, void>('cpptools/callHierarchyCallsTo');
|
||||
|
||||
const CallHierarchyCallsFromRequest: RequestType<CallHierarchyParams, CallHierarchyCallsItemResult, void> =
|
||||
new RequestType<CallHierarchyParams, CallHierarchyCallsItemResult, void>('cpptools/callHierarchyCallsFrom');
|
||||
|
||||
@@ -94,26 +98,47 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
|
||||
// Indicates whether a request is from an entry root node (e.g. top function in the call tree).
|
||||
private isEntryRootNodeTelemetry: boolean = false;
|
||||
private client: DefaultClient;
|
||||
|
||||
constructor(client: DefaultClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public async prepareCallHierarchy(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken):
|
||||
Promise<vscode.CallHierarchyItem | undefined> {
|
||||
await this.client.requestWhenReady(() => processDelayedDidOpen(document));
|
||||
workspaceReferences.cancelCurrentReferenceRequest(CancellationSender.NewRequest);
|
||||
workspaceReferences.clearViews();
|
||||
|
||||
const range: vscode.Range | undefined = document.getWordRangeAtPosition(position);
|
||||
if (range === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
await this.client.requestWhenReady(() => processDelayedDidOpen(document));
|
||||
// Listen to a cancellation for this request. When this request is cancelled,
|
||||
// use a local cancellation source to explicitly cancel a token.
|
||||
const cancelSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
|
||||
const cancellationTokenListener: vscode.Disposable = token.onCancellationRequested(() => {
|
||||
cancelSource.cancel();
|
||||
});
|
||||
const requestCanceledListener: vscode.Disposable = workspaceReferences.onCancellationRequested(sender => {
|
||||
cancelSource.cancel();
|
||||
});
|
||||
|
||||
const params: CallHierarchyParams = {
|
||||
textDocument: { uri: document.uri.toString() },
|
||||
position: Position.create(position.line, position.character)
|
||||
};
|
||||
const response: CallHierarchyItemResult = await this.client.languageClient.sendRequest(CallHierarchyItemRequest, params, token);
|
||||
if (token.isCancellationRequested || response.succeeded === undefined) {
|
||||
throw new vscode.CancellationError();
|
||||
const response: CallHierarchyItemResult = await this.client.languageClient.sendRequest(CallHierarchyItemRequest, params, cancelSource.token);
|
||||
|
||||
cancellationTokenListener.dispose();
|
||||
requestCanceledListener.dispose();
|
||||
|
||||
if (cancelSource.token.isCancellationRequested || response.succeeded === undefined) {
|
||||
// Return undefined instead of vscode.CancellationError to avoid the following error message from VS Code:
|
||||
// "MISSING provider."
|
||||
// TODO: per issue https://github.com/microsoft/vscode/issues/169698 vscode.CancellationError is expected,
|
||||
// so when VS Code fixes the error use vscode.CancellationError again.
|
||||
return undefined;
|
||||
} else if (response.item === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -123,76 +148,56 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
|
||||
}
|
||||
|
||||
public async provideCallHierarchyIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken):
|
||||
Promise<vscode.CallHierarchyIncomingCall[] | undefined | any> {
|
||||
return new Promise<vscode.CallHierarchyIncomingCall[] | undefined | any>((resolve, reject) => {
|
||||
const CallHierarchyCallsToEvent: string = "CallHierarchyCallsTo";
|
||||
if (item === undefined) {
|
||||
this.logTelemetry(CallHierarchyCallsToEvent, CallHierarchyRequestStatus.Failed);
|
||||
resolve(undefined);
|
||||
return;
|
||||
}
|
||||
Promise<vscode.CallHierarchyIncomingCall[] | undefined> {
|
||||
await this.client.awaitUntilLanguageClientReady();
|
||||
workspaceReferences.cancelCurrentReferenceRequest(CancellationSender.NewRequest);
|
||||
|
||||
const callback: () => Promise<void> = async () => {
|
||||
await this.client.awaitUntilLanguageClientReady();
|
||||
const params: CallHierarchyParams = {
|
||||
textDocument: { uri: item.uri.toString() },
|
||||
position: Position.create(item.range.start.line, item.range.start.character)
|
||||
};
|
||||
DefaultClient.referencesParams = params;
|
||||
// The current request is represented by referencesParams. If a request detects
|
||||
// referencesParams does not match the object used when creating the request, abort it.
|
||||
if (params !== DefaultClient.referencesParams) {
|
||||
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
|
||||
resolve(undefined);
|
||||
}
|
||||
DefaultClient.referencesRequestPending = true;
|
||||
const CallHierarchyCallsToEvent: string = "CallHierarchyCallsTo";
|
||||
if (item === undefined) {
|
||||
this.logTelemetry(CallHierarchyCallsToEvent, CallHierarchyRequestStatus.Failed);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Register a single-fire handler for the reply.
|
||||
const resultCallback: CallHierarchyResultCallback =
|
||||
(result: CallHierarchyCallsItemResult | null, canceledByUser: boolean, progressBarDuration?: number) => {
|
||||
DefaultClient.referencesRequestPending = false;
|
||||
if (result === null || result?.calls === undefined) {
|
||||
const requestStatus: CallHierarchyRequestStatus = canceledByUser ? CallHierarchyRequestStatus.CaneledByUser : CallHierarchyRequestStatus.Canceled;
|
||||
this.logTelemetry(CallHierarchyCallsToEvent, requestStatus, progressBarDuration);
|
||||
reject(new vscode.CancellationError());
|
||||
} else {
|
||||
this.logTelemetry(CallHierarchyCallsToEvent, CallHierarchyRequestStatus.Succeeded, progressBarDuration);
|
||||
if (result?.calls.length === 0) {
|
||||
resolve(undefined);
|
||||
} else {
|
||||
resolve(this.createIncomingCalls(result.calls));
|
||||
}
|
||||
}
|
||||
|
||||
this.client.clearPendingReferencesCancellations();
|
||||
};
|
||||
|
||||
workspaceReferences.setCallHierarchyResultsCallback(resultCallback);
|
||||
workspaceReferences.startCallHierarchyIncomingCalls(params);
|
||||
|
||||
token.onCancellationRequested(e => {
|
||||
if (params === DefaultClient.referencesParams) {
|
||||
this.client.cancelReferences();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (DefaultClient.referencesRequestPending || workspaceReferences.symbolSearchInProgress) {
|
||||
const cancelling: boolean = DefaultClient.referencesPendingCancellations.length > 0;
|
||||
DefaultClient.referencesPendingCancellations.push({
|
||||
reject: () => {
|
||||
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
|
||||
resolve(undefined);
|
||||
}, callback
|
||||
});
|
||||
if (!cancelling) {
|
||||
workspaceReferences.referencesCanceled = true;
|
||||
this.client.languageClient.sendNotification(CancelReferencesNotification);
|
||||
}
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
// Listen to a cancellation for this request. When this request is cancelled,
|
||||
// use a local cancellation source to explicitly cancel a token.
|
||||
let requestCanceled: CancellationSender | undefined;
|
||||
const cancelSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
|
||||
const cancellationTokenListener: vscode.Disposable = token.onCancellationRequested(() => {
|
||||
requestCanceled = CancellationSender.ProviderToken;
|
||||
cancelSource.cancel();
|
||||
});
|
||||
const requestCanceledListener: vscode.Disposable = workspaceReferences.onCancellationRequested(sender => {
|
||||
requestCanceled = sender;
|
||||
cancelSource.cancel();
|
||||
});
|
||||
|
||||
// Send the request to the language server.
|
||||
let result: vscode.CallHierarchyIncomingCall[] | undefined;
|
||||
const params: CallHierarchyParams = {
|
||||
textDocument: { uri: item.uri.toString() },
|
||||
position: Position.create(item.range.start.line, item.range.start.character)
|
||||
};
|
||||
const response: CallHierarchyCallsItemResult = await this.client.languageClient.sendRequest(CallHierarchyCallsToRequest, params, cancelSource.token);
|
||||
|
||||
// Reset anything that can be cleared before processing the result.
|
||||
const progressBarDuration: number | undefined = workspaceReferences.getCallHierarchyProgressBarDuration();
|
||||
workspaceReferences.resetProgressBar();
|
||||
workspaceReferences.resetReferences();
|
||||
cancellationTokenListener.dispose();
|
||||
requestCanceledListener.dispose();
|
||||
|
||||
// Process the result.
|
||||
if (cancelSource.token.isCancellationRequested || response.calls === undefined || requestCanceled !== undefined) {
|
||||
const requestStatus: CallHierarchyRequestStatus = requestCanceled === CancellationSender.User ?
|
||||
CallHierarchyRequestStatus.CanceledByUser : CallHierarchyRequestStatus.Canceled;
|
||||
this.logTelemetry(CallHierarchyCallsToEvent, requestStatus, progressBarDuration);
|
||||
throw new vscode.CancellationError();
|
||||
} else if (response.calls.length !== 0) {
|
||||
result = this.createIncomingCalls(response.calls);
|
||||
}
|
||||
|
||||
this.logTelemetry(CallHierarchyCallsToEvent, CallHierarchyRequestStatus.Succeeded, progressBarDuration);
|
||||
return result;
|
||||
}
|
||||
|
||||
public async provideCallHierarchyOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken):
|
||||
@@ -210,8 +215,8 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
|
||||
textDocument: { uri: item.uri.toString() },
|
||||
position: Position.create(item.range.start.line, item.range.start.character)
|
||||
};
|
||||
|
||||
const response: CallHierarchyCallsItemResult = await this.client.languageClient.sendRequest(CallHierarchyCallsFromRequest, params, token);
|
||||
|
||||
if (token.isCancellationRequested || response.calls === undefined) {
|
||||
this.logTelemetry(CallHierarchyCallsFromEvent, CallHierarchyRequestStatus.Canceled);
|
||||
throw new vscode.CancellationError();
|
||||
@@ -224,8 +229,10 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
|
||||
}
|
||||
|
||||
private makeVscodeCallHierarchyItem(item: CallHierarchyItem): vscode.CallHierarchyItem {
|
||||
const containerDetail: string = (item.detail !== "") ? `${item.detail} - ` : "";
|
||||
const fileDetail: string = `${path.basename(item.uri)} (${path.dirname(item.uri)})`;
|
||||
return new vscode.CallHierarchyItem(
|
||||
item.kind, item.name, item.detail,
|
||||
item.kind, item.name, containerDetail + fileDetail,
|
||||
vscode.Uri.file(item.uri),
|
||||
makeVscodeRange(item.range),
|
||||
makeVscodeRange(item.selectionRange));
|
||||
@@ -276,7 +283,7 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
|
||||
case CallHierarchyRequestStatus.Unknown: status = "Unknown"; break;
|
||||
case CallHierarchyRequestStatus.Succeeded: status = "Succeeded"; break;
|
||||
case CallHierarchyRequestStatus.Canceled: status = "Canceled"; break;
|
||||
case CallHierarchyRequestStatus.CaneledByUser: status = "CaneledByUser"; break;
|
||||
case CallHierarchyRequestStatus.CanceledByUser: status = "CanceledByUser"; break;
|
||||
case CallHierarchyRequestStatus.Failed: status = "Failed"; break;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,98 +3,67 @@
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
import * as vscode from 'vscode';
|
||||
import { DefaultClient, workspaceReferences, FindAllReferencesParams, RequestReferencesNotification, CancelReferencesNotification } from '../client';
|
||||
import { Position } from 'vscode-languageclient';
|
||||
import * as refs from '../references';
|
||||
import { DefaultClient, workspaceReferences } from '../client';
|
||||
import { Position, RequestType } from 'vscode-languageclient';
|
||||
import { ReferencesParams, ReferencesResult, ReferenceType, ReferenceInfo, CancellationSender } from '../references';
|
||||
|
||||
const FindAllReferencesRequest: RequestType<ReferencesParams, ReferencesResult, void> =
|
||||
new RequestType<ReferencesParams, ReferencesResult, void>('cpptools/findAllReferences');
|
||||
|
||||
export class FindAllReferencesProvider implements vscode.ReferenceProvider {
|
||||
private client: DefaultClient;
|
||||
|
||||
constructor(client: DefaultClient) {
|
||||
this.client = client;
|
||||
}
|
||||
public async provideReferences(document: vscode.TextDocument, position: vscode.Position, context: vscode.ReferenceContext, token: vscode.CancellationToken): Promise<vscode.Location[] | undefined> {
|
||||
return new Promise<vscode.Location[]>((resolve, reject) => {
|
||||
const callback: () => Promise<void> = async () => {
|
||||
const params: FindAllReferencesParams = {
|
||||
position: Position.create(position.line, position.character),
|
||||
textDocument: this.client.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(document)
|
||||
};
|
||||
DefaultClient.referencesParams = params;
|
||||
await this.client.awaitUntilLanguageClientReady();
|
||||
// The current request is represented by referencesParams. If a request detects
|
||||
// referencesParams does not match the object used when creating the request, abort it.
|
||||
if (params !== DefaultClient.referencesParams) {
|
||||
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
|
||||
const locations: vscode.Location[] = [];
|
||||
resolve(locations);
|
||||
return;
|
||||
}
|
||||
DefaultClient.referencesRequestPending = true;
|
||||
// Register a single-fire handler for the reply.
|
||||
const resultCallback: refs.ReferencesResultCallback = (result: refs.ReferencesResult | null, doResolve: boolean) => {
|
||||
DefaultClient.referencesRequestPending = false;
|
||||
const locations: vscode.Location[] = [];
|
||||
if (result) {
|
||||
result.referenceInfos.forEach((referenceInfo: refs.ReferenceInfo) => {
|
||||
if (referenceInfo.type === refs.ReferenceType.Confirmed) {
|
||||
const uri: vscode.Uri = vscode.Uri.file(referenceInfo.file);
|
||||
const range: vscode.Range = new vscode.Range(referenceInfo.position.line, referenceInfo.position.character, referenceInfo.position.line, referenceInfo.position.character + result.text.length);
|
||||
locations.push(new vscode.Location(uri, range));
|
||||
}
|
||||
});
|
||||
}
|
||||
// If references were canceled while in a preview state, there is not an outstanding promise.
|
||||
if (doResolve) {
|
||||
resolve(locations);
|
||||
}
|
||||
|
||||
this.client.clearPendingReferencesCancellations();
|
||||
};
|
||||
if (!workspaceReferences.referencesRefreshPending) {
|
||||
workspaceReferences.setResultsCallback(resultCallback);
|
||||
workspaceReferences.startFindAllReferences(params);
|
||||
} else {
|
||||
// We are responding to a refresh (preview or final result)
|
||||
workspaceReferences.referencesRefreshPending = false;
|
||||
if (workspaceReferences.lastResults) {
|
||||
// This is a final result
|
||||
const lastResults: refs.ReferencesResult = workspaceReferences.lastResults;
|
||||
workspaceReferences.lastResults = null;
|
||||
resultCallback(lastResults, true);
|
||||
} else {
|
||||
// This is a preview (2nd or later preview)
|
||||
workspaceReferences.referencesRequestPending = true;
|
||||
workspaceReferences.setResultsCallback(resultCallback);
|
||||
this.client.languageClient.sendNotification(RequestReferencesNotification);
|
||||
}
|
||||
}
|
||||
token.onCancellationRequested(e => {
|
||||
if (params === DefaultClient.referencesParams) {
|
||||
this.client.cancelReferences();
|
||||
}
|
||||
});
|
||||
};
|
||||
public async provideReferences(document: vscode.TextDocument, position: vscode.Position, context: vscode.ReferenceContext, token: vscode.CancellationToken):
|
||||
Promise<vscode.Location[] | undefined> {
|
||||
await this.client.awaitUntilLanguageClientReady();
|
||||
workspaceReferences.cancelCurrentReferenceRequest(CancellationSender.NewRequest);
|
||||
|
||||
if (DefaultClient.referencesRequestPending || (workspaceReferences.symbolSearchInProgress && !workspaceReferences.referencesRefreshPending)) {
|
||||
const cancelling: boolean = DefaultClient.referencesPendingCancellations.length > 0;
|
||||
DefaultClient.referencesPendingCancellations.push({
|
||||
reject: () => {
|
||||
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
|
||||
const locations: vscode.Location[] = [];
|
||||
resolve(locations);
|
||||
}, callback
|
||||
});
|
||||
if (!cancelling) {
|
||||
DefaultClient.renamePending = false;
|
||||
workspaceReferences.referencesCanceled = true;
|
||||
if (!DefaultClient.referencesRequestPending) {
|
||||
workspaceReferences.referencesCanceledWhilePreviewing = true;
|
||||
}
|
||||
this.client.languageClient.sendNotification(CancelReferencesNotification);
|
||||
// Listen to a cancellation for this request. When this request is cancelled,
|
||||
// use a local cancellation source to explicitly cancel a token.
|
||||
const cancelSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
|
||||
const cancellationTokenListener: vscode.Disposable = token.onCancellationRequested(() => { cancelSource.cancel(); });
|
||||
const requestCanceledListener: vscode.Disposable = workspaceReferences.onCancellationRequested(sender => { cancelSource.cancel(); });
|
||||
|
||||
// Send the request to the language server.
|
||||
const locationsResult: vscode.Location[] = [];
|
||||
const params: ReferencesParams = {
|
||||
newName: "",
|
||||
position: Position.create(position.line, position.character),
|
||||
textDocument: { uri: document.uri.toString() }
|
||||
};
|
||||
const response: ReferencesResult = await this.client.languageClient.sendRequest(FindAllReferencesRequest, params, cancelSource.token);
|
||||
|
||||
// Reset anything that can be cleared before processing the result.
|
||||
// Note: ReferencesManager.resetReferences is called in ReferencesManager.showResultsInPanelView
|
||||
workspaceReferences.resetProgressBar();
|
||||
cancellationTokenListener.dispose();
|
||||
requestCanceledListener.dispose();
|
||||
|
||||
// Process the result.
|
||||
if (cancelSource.token.isCancellationRequested || response.referenceInfos === null || response.isCanceled) {
|
||||
// Return undefined instead of vscode.CancellationError to avoid the following error message from VS Code:
|
||||
// "Cannot destructure property 'range' of 'e.location' as it is undefined."
|
||||
// TODO: per issue https://github.com/microsoft/vscode/issues/169698
|
||||
// vscode.CancellationError is expected, so when VS Code fixes the error use vscode.CancellationError again.
|
||||
return undefined;
|
||||
} else if (response.referenceInfos.length !== 0) {
|
||||
response.referenceInfos.forEach((referenceInfo: ReferenceInfo) => {
|
||||
if (referenceInfo.type === ReferenceType.Confirmed) {
|
||||
const uri: vscode.Uri = vscode.Uri.file(referenceInfo.file);
|
||||
const range: vscode.Range = new vscode.Range(referenceInfo.position.line, referenceInfo.position.character,
|
||||
referenceInfo.position.line, referenceInfo.position.character + response.text.length);
|
||||
locationsResult.push(new vscode.Location(uri, range));
|
||||
}
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Display other reference types in panel or channel view.
|
||||
workspaceReferences.showResultsInPanelView(response);
|
||||
}
|
||||
|
||||
return locationsResult;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,111 +3,77 @@
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
import * as vscode from 'vscode';
|
||||
import { DefaultClient, workspaceReferences, ReferenceParams, CancelReferencesNotification } from '../client';
|
||||
import * as refs from '../references';
|
||||
import { DefaultClient, workspaceReferences } from '../client';
|
||||
import { ReferencesParams, ReferencesResult, ReferenceType, getReferenceTagString, getReferenceItemIconPath, CancellationSender } from '../references';
|
||||
import { CppSettings } from '../settings';
|
||||
import { Position } from 'vscode-languageclient';
|
||||
import { Position, RequestType } from 'vscode-languageclient';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as util from '../../common';
|
||||
|
||||
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
const RenameRequest: RequestType<ReferencesParams, ReferencesResult, void> =
|
||||
new RequestType<ReferencesParams, ReferencesResult, void>('cpptools/rename');
|
||||
|
||||
export class RenameProvider implements vscode.RenameProvider {
|
||||
private client: DefaultClient;
|
||||
|
||||
constructor(client: DefaultClient) {
|
||||
this.client = client;
|
||||
}
|
||||
public async provideRenameEdits(document: vscode.TextDocument, position: vscode.Position, newName: string, token: vscode.CancellationToken): Promise<vscode.WorkspaceEdit> {
|
||||
|
||||
public async provideRenameEdits(document: vscode.TextDocument, position: vscode.Position, newName: string, token: vscode.CancellationToken):
|
||||
Promise<vscode.WorkspaceEdit | undefined> {
|
||||
await this.client.awaitUntilLanguageClientReady();
|
||||
workspaceReferences.cancelCurrentReferenceRequest(CancellationSender.NewRequest);
|
||||
|
||||
const settings: CppSettings = new CppSettings();
|
||||
if (settings.renameRequiresIdentifier && !util.isValidIdentifier(newName)) {
|
||||
vscode.window.showErrorMessage(localize("invalid.identifier.for.rename", "Invalid identifier provided for the Rename Symbol operation."));
|
||||
const workspaceEdit: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
|
||||
return workspaceEdit;
|
||||
return undefined;
|
||||
}
|
||||
// Normally, VS Code considers rename to be an atomic operation.
|
||||
// If the user clicks anywhere in the document, it attempts to cancel it.
|
||||
// Because that prevents our rename UI, we ignore cancellation requests.
|
||||
// VS Code will attempt to issue new rename requests while another is still active.
|
||||
// When we receive another rename request, cancel the one that is in progress.
|
||||
DefaultClient.renamePending = true;
|
||||
++DefaultClient.renameRequestsPending;
|
||||
return new Promise<vscode.WorkspaceEdit>((resolve, reject) => {
|
||||
const callback: () => Promise<void> = async () => {
|
||||
const params: ReferenceParams = {
|
||||
newName: newName,
|
||||
position: Position.create(position.line, position.character),
|
||||
textDocument: this.client.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(document)
|
||||
|
||||
// Listen to a cancellation for this request. When this request is cancelled,
|
||||
// use a local cancellation source to explicitly cancel a token.
|
||||
// Don't listen to the token from the provider, as it will cancel when the cursor is moved to a different position.
|
||||
const cancelSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
|
||||
const requestCanceledListener: vscode.Disposable = workspaceReferences.onCancellationRequested(sender => { cancelSource.cancel(); });
|
||||
|
||||
// Send the request to the language server.
|
||||
workspaceReferences.startRename();
|
||||
const workspaceEditResult: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
|
||||
const params: ReferencesParams = {
|
||||
newName: newName,
|
||||
position: Position.create(position.line, position.character),
|
||||
textDocument: { uri: document.uri.toString() }
|
||||
};
|
||||
const response: ReferencesResult = await this.client.languageClient.sendRequest(RenameRequest, params, cancelSource.token);
|
||||
|
||||
// Reset anything that can be cleared before processing the result.
|
||||
workspaceReferences.resetProgressBar();
|
||||
workspaceReferences.resetReferences();
|
||||
requestCanceledListener.dispose();
|
||||
|
||||
// Process the result.
|
||||
if (cancelSource.token.isCancellationRequested || response.referenceInfos === null || response.isCanceled) {
|
||||
throw new vscode.CancellationError();
|
||||
} else if (response.referenceInfos.length === 0) {
|
||||
vscode.window.showErrorMessage(localize("unable.to.locate.selected.symbol", "A definition for the selected symbol could not be located."));
|
||||
} else {
|
||||
for (const reference of response.referenceInfos) {
|
||||
const uri: vscode.Uri = vscode.Uri.file(reference.file);
|
||||
const range: vscode.Range = new vscode.Range(reference.position.line, reference.position.character,
|
||||
reference.position.line, reference.position.character + response.text.length);
|
||||
const metadata: vscode.WorkspaceEditEntryMetadata = {
|
||||
needsConfirmation: reference.type !== ReferenceType.Confirmed,
|
||||
label: getReferenceTagString(reference.type, false, true),
|
||||
iconPath: getReferenceItemIconPath(reference.type, false)
|
||||
};
|
||||
DefaultClient.referencesParams = params;
|
||||
await this.client.awaitUntilLanguageClientReady();
|
||||
// The current request is represented by referencesParams. If a request detects
|
||||
// referencesParams does not match the object used when creating the request, abort it.
|
||||
if (params !== DefaultClient.referencesParams) {
|
||||
if (--DefaultClient.renameRequestsPending === 0) {
|
||||
DefaultClient.renamePending = false;
|
||||
}
|
||||
|
||||
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
|
||||
const workspaceEdit: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
|
||||
resolve(workspaceEdit);
|
||||
return;
|
||||
}
|
||||
DefaultClient.referencesRequestPending = true;
|
||||
workspaceReferences.setResultsCallback((referencesResult: refs.ReferencesResult | null, doResolve: boolean) => {
|
||||
DefaultClient.referencesRequestPending = false;
|
||||
--DefaultClient.renameRequestsPending;
|
||||
const workspaceEdit: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
|
||||
const cancelling: boolean = DefaultClient.referencesPendingCancellations.length > 0;
|
||||
if (cancelling) {
|
||||
this.client.clearPendingReferencesCancellations();
|
||||
} else {
|
||||
if (DefaultClient.renameRequestsPending === 0) {
|
||||
DefaultClient.renamePending = false;
|
||||
}
|
||||
// If rename UI was canceled, we will get a null result.
|
||||
// If null, return an empty list to avoid Rename failure dialog.
|
||||
if (referencesResult) {
|
||||
for (const reference of referencesResult.referenceInfos) {
|
||||
const uri: vscode.Uri = vscode.Uri.file(reference.file);
|
||||
const range: vscode.Range = new vscode.Range(reference.position.line, reference.position.character, reference.position.line, reference.position.character + referencesResult.text.length);
|
||||
const metadata: vscode.WorkspaceEditEntryMetadata = {
|
||||
needsConfirmation: reference.type !== refs.ReferenceType.Confirmed,
|
||||
label: refs.getReferenceTagString(reference.type, false, true),
|
||||
iconPath: refs.getReferenceItemIconPath(reference.type, false)
|
||||
};
|
||||
workspaceEdit.replace(uri, range, newName, metadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (referencesResult && (referencesResult.referenceInfos === null || referencesResult.referenceInfos.length === 0)) {
|
||||
vscode.window.showErrorMessage(localize("unable.to.locate.selected.symbol", "A definition for the selected symbol could not be located."));
|
||||
}
|
||||
resolve(workspaceEdit);
|
||||
});
|
||||
workspaceReferences.startRename(params);
|
||||
};
|
||||
|
||||
if (DefaultClient.referencesRequestPending || workspaceReferences.symbolSearchInProgress) {
|
||||
const cancelling: boolean = DefaultClient.referencesPendingCancellations.length > 0;
|
||||
DefaultClient.referencesPendingCancellations.push({
|
||||
reject: () => {
|
||||
--DefaultClient.renameRequestsPending;
|
||||
// Complete with nothing instead of rejecting, to avoid an error message from VS Code
|
||||
const workspaceEdit: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
|
||||
resolve(workspaceEdit);
|
||||
}, callback
|
||||
});
|
||||
if (!cancelling) {
|
||||
workspaceReferences.referencesCanceled = true;
|
||||
if (!DefaultClient.referencesRequestPending) {
|
||||
workspaceReferences.referencesCanceledWhilePreviewing = true;
|
||||
}
|
||||
this.client.languageClient.sendNotification(CancelReferencesNotification);
|
||||
}
|
||||
} else {
|
||||
callback();
|
||||
workspaceEditResult.replace(uri, range, newName, metadata);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return workspaceEditResult;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ import { DocumentSymbolProvider } from './Providers/documentSymbolProvider';
|
||||
import { WorkspaceSymbolProvider } from './Providers/workspaceSymbolProvider';
|
||||
import { RenameProvider } from './Providers/renameProvider';
|
||||
import { FindAllReferencesProvider } from './Providers/findAllReferencesProvider';
|
||||
import { CallHierarchyProvider } from './Providers/callHierarchyProvider';
|
||||
import { CodeActionProvider } from './Providers/codeActionProvider';
|
||||
import { InlayHintsProvider } from './Providers/inlayHintProvider';
|
||||
import { CallHierarchyCallsItemResult, CallHierarchyParams, CallHierarchyProvider } from './Providers/callHierarchyProvider';
|
||||
// End provider imports
|
||||
|
||||
import { LanguageClientOptions, NotificationType, TextDocumentIdentifier, RequestType, ErrorAction, CloseAction, DidOpenTextDocumentParams, Range, Position } from 'vscode-languageclient';
|
||||
@@ -34,7 +34,7 @@ import * as configs from './configurations';
|
||||
import { CppSettings, getEditorConfigSettings, OtherSettings, SettingsParams, WorkspaceFolderSettingsParams } from './settings';
|
||||
import * as telemetry from '../telemetry';
|
||||
import { PersistentState, PersistentFolderState, PersistentWorkspaceState } from './persistentState';
|
||||
import { UI, getUI } from './ui';
|
||||
import { ConfigurationType, LanguageStatusUI, getUI } from './ui';
|
||||
import { createProtocolFilter } from './protocolFilter';
|
||||
import { DataBinding } from './dataBinding';
|
||||
import minimatch = require("minimatch");
|
||||
@@ -59,7 +59,7 @@ const deepCopy = (obj: any) => _.cloneDeep(obj);
|
||||
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
let ui: UI;
|
||||
let ui: LanguageStatusUI;
|
||||
let timeStamp: number = 0;
|
||||
const configProviderTimeout: number = 2000;
|
||||
let initializedClientCount: number = 0;
|
||||
@@ -372,17 +372,6 @@ export interface LocalizeSymbolInformation {
|
||||
suffix: LocalizeStringParams;
|
||||
}
|
||||
|
||||
export interface ReferenceParams {
|
||||
newName: string;
|
||||
position: Position;
|
||||
textDocument: TextDocumentIdentifier;
|
||||
}
|
||||
|
||||
export interface FindAllReferencesParams {
|
||||
position: Position;
|
||||
textDocument: TextDocumentIdentifier;
|
||||
}
|
||||
|
||||
export interface FormatParams {
|
||||
uri: string;
|
||||
range: Range;
|
||||
@@ -595,13 +584,9 @@ const CustomConfigurationNotification: NotificationType<CustomConfigurationParam
|
||||
const CustomBrowseConfigurationNotification: NotificationType<CustomBrowseConfigurationParams> = new NotificationType<CustomBrowseConfigurationParams>('cpptools/didChangeCustomBrowseConfiguration');
|
||||
const ClearCustomConfigurationsNotification: NotificationType<WorkspaceFolderParams> = new NotificationType<WorkspaceFolderParams>('cpptools/clearCustomConfigurations');
|
||||
const ClearCustomBrowseConfigurationNotification: NotificationType<WorkspaceFolderParams> = new NotificationType<WorkspaceFolderParams>('cpptools/clearCustomBrowseConfiguration');
|
||||
const PreviewReferencesNotification: NotificationType<void> = new NotificationType<void>('cpptools/previewReferences');
|
||||
const RescanFolderNotification: NotificationType<void> = new NotificationType<void>('cpptools/rescanFolder');
|
||||
export const RequestReferencesNotification: NotificationType<void> = new NotificationType<void>('cpptools/requestReferences');
|
||||
export const CancelReferencesNotification: NotificationType<void> = new NotificationType<void>('cpptools/cancelReferences');
|
||||
const FinishedRequestCustomConfig: NotificationType<FinishedRequestCustomConfigParams> = new NotificationType<FinishedRequestCustomConfigParams>('cpptools/finishedRequestCustomConfig');
|
||||
const FindAllReferencesNotification: NotificationType<FindAllReferencesParams> = new NotificationType<FindAllReferencesParams>('cpptools/findAllReferences');
|
||||
const CallHierarchyCallsToNotification: NotificationType<CallHierarchyParams> = new NotificationType<CallHierarchyParams>('cpptools/callHierarchyCallsTo');
|
||||
const RenameNotification: NotificationType<ReferenceParams> = new NotificationType<ReferenceParams>('cpptools/rename');
|
||||
const DidChangeSettingsNotification: NotificationType<SettingsParams> = new NotificationType<SettingsParams>('cpptools/didChangeSettings');
|
||||
const InitializationNotification: NotificationType<InitializationOptions> = new NotificationType<InitializationOptions>('cpptools/initialize');
|
||||
|
||||
@@ -622,7 +607,6 @@ const DebugLogNotification: NotificationType<LocalizeStringParams> = new Notific
|
||||
const InactiveRegionNotification: NotificationType<InactiveRegionParams> = new NotificationType<InactiveRegionParams>('cpptools/inactiveRegions');
|
||||
const CompileCommandsPathsNotification: NotificationType<CompileCommandsPaths> = new NotificationType<CompileCommandsPaths>('cpptools/compileCommandsPaths');
|
||||
const ReferencesNotification: NotificationType<refs.ReferencesResult> = new NotificationType<refs.ReferencesResult>('cpptools/references');
|
||||
const CallHierarchyNotification: NotificationType<CallHierarchyCallsItemResult> = new NotificationType<CallHierarchyCallsItemResult>('cpptools/callHierarchyCallsToResult');
|
||||
const ReportReferencesProgressNotification: NotificationType<refs.ReportReferencesProgressNotification> = new NotificationType<refs.ReportReferencesProgressNotification>('cpptools/reportReferencesProgress');
|
||||
const RequestCustomConfig: NotificationType<string> = new NotificationType<string>('cpptools/requestCustomConfig');
|
||||
const PublishIntelliSenseDiagnosticsNotification: NotificationType<PublishIntelliSenseDiagnosticsParams> = new NotificationType<PublishIntelliSenseDiagnosticsParams>('cpptools/publishIntelliSenseDiagnostics');
|
||||
@@ -641,11 +625,6 @@ const CanceledReferencesNotification: NotificationType<void> = new NotificationT
|
||||
|
||||
let failureMessageShown: boolean = false;
|
||||
|
||||
interface ReferencesCancellationState {
|
||||
reject(): void;
|
||||
callback(): void;
|
||||
}
|
||||
|
||||
class ClientModel {
|
||||
public isInitializingWorkspace: DataBinding<boolean>;
|
||||
public isIndexingWorkspace: DataBinding<boolean>;
|
||||
@@ -861,13 +840,6 @@ export class DefaultClient implements Client {
|
||||
private configStateReceived: ConfigStateReceived = { compilers: false, compileCommands: false, configProviders: undefined, timeout: false };
|
||||
private showConfigureIntelliSenseButton: boolean = false;
|
||||
|
||||
public static referencesParams: ReferenceParams | FindAllReferencesParams | CallHierarchyParams |undefined;
|
||||
public static referencesRequestPending: boolean = false;
|
||||
public static referencesPendingCancellations: ReferencesCancellationState[] = [];
|
||||
|
||||
public static renameRequestsPending: number = 0;
|
||||
public static renamePending: boolean = false;
|
||||
|
||||
// The "model" that is displayed via the UI (status bar).
|
||||
private model: ClientModel = new ClientModel();
|
||||
|
||||
@@ -1070,7 +1042,7 @@ export class DefaultClient implements Client {
|
||||
if (showSecondPrompt) {
|
||||
this.showPrompt(selectIntelliSenseConfig, true, sender);
|
||||
}
|
||||
ui.ShowConfigureIntelliSenseButton(false, this);
|
||||
ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompilerPath, "disablePrompt");
|
||||
return;
|
||||
}
|
||||
if (index === paths.length - 2) {
|
||||
@@ -1087,6 +1059,7 @@ export class DefaultClient implements Client {
|
||||
return;
|
||||
}
|
||||
}
|
||||
const showButtonSender: string = "quickPick";
|
||||
if (index === paths.length - 3) {
|
||||
const result: vscode.Uri[] | undefined = await vscode.window.showOpenDialog();
|
||||
if (result === undefined || result.length === 0) {
|
||||
@@ -1108,12 +1081,12 @@ export class DefaultClient implements Client {
|
||||
await this.configuration.updateCustomConfigurationProvider(provider.extensionId);
|
||||
this.onCustomConfigurationProviderRegistered(provider);
|
||||
telemetry.logLanguageServerEvent("customConfigurationProvider", { "providerId": provider.extensionId });
|
||||
ui.ShowConfigureIntelliSenseButton(false, this);
|
||||
ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.ConfigProvider, showButtonSender);
|
||||
return;
|
||||
} else if (index < compileCommandsIndex) {
|
||||
action = "select compile commands";
|
||||
this.configuration.setCompileCommands(this.compileCommandsPaths[index - configProvidersIndex - 1]);
|
||||
ui.ShowConfigureIntelliSenseButton(false, this);
|
||||
ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompileCommands, showButtonSender);
|
||||
return;
|
||||
} else {
|
||||
action = "select compiler";
|
||||
@@ -1122,7 +1095,7 @@ export class DefaultClient implements Client {
|
||||
}
|
||||
}
|
||||
|
||||
ui.ShowConfigureIntelliSenseButton(false, this);
|
||||
ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompilerPath, showButtonSender);
|
||||
await this.addTrustedCompiler(settings.defaultCompilerPath);
|
||||
DefaultClient.updateClientConfigurations();
|
||||
} finally {
|
||||
@@ -1178,7 +1151,7 @@ export class DefaultClient implements Client {
|
||||
await this.addTrustedCompiler(settings.defaultCompilerPath);
|
||||
DefaultClient.updateClientConfigurations();
|
||||
action = "confirm compiler";
|
||||
ui.ShowConfigureIntelliSenseButton(false, this);
|
||||
ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompilerPath, "promptSelectCompiler");
|
||||
} else if (value === selectCompiler) {
|
||||
this.handleIntelliSenseConfigurationQuickPick(true, sender, true);
|
||||
action = "show quickpick";
|
||||
@@ -1212,7 +1185,7 @@ export class DefaultClient implements Client {
|
||||
await this.addTrustedCompiler(settings.defaultCompilerPath);
|
||||
DefaultClient.updateClientConfigurations();
|
||||
action = "confirm compiler";
|
||||
ui.ShowConfigureIntelliSenseButton(false, this);
|
||||
ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompilerPath, "promptSelectIntelliSense");
|
||||
} else if (value === selectCompiler) {
|
||||
this.handleIntelliSenseConfigurationQuickPick(true, sender);
|
||||
action = "show quickpick";
|
||||
@@ -1410,18 +1383,6 @@ export class DefaultClient implements Client {
|
||||
}
|
||||
}
|
||||
|
||||
public sendCallHierarchyCallsToNotification(params: CallHierarchyParams): void {
|
||||
this.languageClient.sendNotification(CallHierarchyCallsToNotification, params);
|
||||
}
|
||||
|
||||
public sendFindAllReferencesNotification(params: FindAllReferencesParams): void {
|
||||
this.languageClient.sendNotification(FindAllReferencesNotification, params);
|
||||
}
|
||||
|
||||
public sendRenameNotification(params: ReferenceParams): void {
|
||||
this.languageClient.sendNotification(RenameNotification, params);
|
||||
}
|
||||
|
||||
private getWorkspaceFolderSettings(workspaceFolderUri: vscode.Uri | undefined, settings: CppSettings, otherSettings: OtherSettings): WorkspaceFolderSettingsParams {
|
||||
const result: WorkspaceFolderSettingsParams = {
|
||||
uri: workspaceFolderUri?.toString(),
|
||||
@@ -1441,7 +1402,7 @@ export class DefaultClient implements Client {
|
||||
defaultSystemIncludePath: settings.defaultSystemIncludePath,
|
||||
cppFilesExclude: settings.filesExclude,
|
||||
clangFormatPath: util.resolveVariables(settings.clangFormatPath, this.AdditionalEnvironment),
|
||||
clangFormatStyle: util.resolveVariables(settings.clangFormatStyle, this.AdditionalEnvironment),
|
||||
clangFormatStyle: settings.clangFormatStyle ? util.resolveVariables(settings.clangFormatStyle, this.AdditionalEnvironment) : undefined,
|
||||
clangFormatFallbackStyle: settings.clangFormatFallbackStyle,
|
||||
clangFormatSortIncludes: settings.clangFormatSortIncludes,
|
||||
codeAnalysisRunAutomatically: settings.codeAnalysisRunAutomatically,
|
||||
@@ -1726,8 +1687,13 @@ export class DefaultClient implements Client {
|
||||
if (changedSettings["legacyCompilerArgsBehavior"]) {
|
||||
this.configuration.handleConfigurationChange();
|
||||
}
|
||||
if (changedSettings["default.compilerPath"] !== undefined || changedSettings["default.compileCommands"] !== undefined || changedSettings["default.configurationProvider"] !== undefined) {
|
||||
ui.ShowConfigureIntelliSenseButton(false, this);
|
||||
const showButtonSender: string = "settingsChanged";
|
||||
if (changedSettings["default.configurationProvider"] !== undefined) {
|
||||
ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.ConfigProvider, showButtonSender);
|
||||
} else if (changedSettings["default.compileCommands"] !== undefined) {
|
||||
ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompileCommands, showButtonSender);
|
||||
} if (changedSettings["default.compilerPath"] !== undefined) {
|
||||
ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompilerPath, showButtonSender);
|
||||
}
|
||||
this.configuration.onDidChangeSettings();
|
||||
telemetry.logLanguageServerEvent("CppSettingsChange", changedSettings, undefined);
|
||||
@@ -1750,8 +1716,8 @@ export class DefaultClient implements Client {
|
||||
public onDidChangeTextDocument(textDocumentChangeEvent: vscode.TextDocumentChangeEvent): void {
|
||||
if (util.isCpp(textDocumentChangeEvent.document)) {
|
||||
// If any file has changed, we need to abort the current rename operation
|
||||
if (DefaultClient.renamePending) {
|
||||
this.cancelReferences();
|
||||
if (workspaceReferences.renamePending) {
|
||||
workspaceReferences.cancelCurrentReferenceRequest(refs.CancellationSender.User);
|
||||
}
|
||||
|
||||
const oldVersion: number | undefined = openFileVersions.get(textDocumentChangeEvent.document.uri.toString());
|
||||
@@ -2303,9 +2269,8 @@ export class DefaultClient implements Client {
|
||||
this.languageClient.onNotification(ReportTagParseStatusNotification, (e) => this.updateTagParseStatus(e));
|
||||
this.languageClient.onNotification(InactiveRegionNotification, (e) => this.updateInactiveRegions(e));
|
||||
this.languageClient.onNotification(CompileCommandsPathsNotification, (e) => this.promptCompileCommands(e));
|
||||
this.languageClient.onNotification(ReferencesNotification, (e) => this.processReferencesResult(e));
|
||||
this.languageClient.onNotification(ReferencesNotification, (e) => this.processReferencesPreview(e));
|
||||
this.languageClient.onNotification(ReportReferencesProgressNotification, (e) => this.handleReferencesProgress(e));
|
||||
this.languageClient.onNotification(CallHierarchyNotification, (e) => this.processCallHierarchyResult(e));
|
||||
this.languageClient.onNotification(RequestCustomConfig, (requestFile: string) => {
|
||||
const client: Client = clients.getClientFor(vscode.Uri.file(requestFile));
|
||||
if (client instanceof DefaultClient) {
|
||||
@@ -2326,7 +2291,7 @@ export class DefaultClient implements Client {
|
||||
this.languageClient.onNotification(ReportCodeAnalysisProcessedNotification, (e) => this.updateCodeAnalysisProcessed(e));
|
||||
this.languageClient.onNotification(ReportCodeAnalysisTotalNotification, (e) => this.updateCodeAnalysisTotal(e));
|
||||
this.languageClient.onNotification(DoxygenCommentGeneratedNotification, (e) => void this.insertDoxygenComment(e));
|
||||
this.languageClient.onNotification(CanceledReferencesNotification, this.cancelReferences);
|
||||
this.languageClient.onNotification(CanceledReferencesNotification, this.serverCanceledReferences);
|
||||
}
|
||||
|
||||
private setTextDocumentLanguage(languageStr: string): void {
|
||||
@@ -2499,18 +2464,10 @@ export class DefaultClient implements Client {
|
||||
const status: IntelliSenseStatus = { status: Status.TagParsingBegun };
|
||||
testHook.updateStatus(status);
|
||||
} else if (message.endsWith("Initializing")) {
|
||||
if (ui.isNewUI) {
|
||||
this.model.isInitializingWorkspace.Value = true;
|
||||
} else {
|
||||
this.model.isParsingWorkspace.Value = true;
|
||||
}
|
||||
this.model.isInitializingWorkspace.Value = true;
|
||||
} else if (message.endsWith("Indexing")) {
|
||||
if (ui.isNewUI) {
|
||||
this.model.isIndexingWorkspace.Value = true;
|
||||
this.model.isInitializingWorkspace.Value = false;
|
||||
} else {
|
||||
this.model.isParsingWorkspace.Value = true;
|
||||
}
|
||||
this.model.isIndexingWorkspace.Value = true;
|
||||
this.model.isInitializingWorkspace.Value = false;
|
||||
} else if (message.endsWith("files")) {
|
||||
this.model.isParsingFiles.Value = true;
|
||||
} else if (message.endsWith("IntelliSense")) {
|
||||
@@ -2555,7 +2512,6 @@ export class DefaultClient implements Client {
|
||||
const defaultClient: DefaultClient = <DefaultClient>client;
|
||||
if (!defaultClient.configuration.CurrentConfiguration?.configurationProvider) {
|
||||
const showIntelliSenseFallbackMessage: PersistentState<boolean> = new PersistentState<boolean>("CPP.showIntelliSenseFallbackMessage", true);
|
||||
showIntelliSenseFallbackMessage.Value = true;
|
||||
if (showIntelliSenseFallbackMessage.Value
|
||||
&& !await telemetry.showStatusBarIntelliSenseButton()) {
|
||||
ui.showConfigureIncludePathMessage(async () => {
|
||||
@@ -2608,18 +2564,10 @@ export class DefaultClient implements Client {
|
||||
const settings: CppSettings = new CppSettings(this.RootUri);
|
||||
const opacity: number | undefined = settings.inactiveRegionOpacity;
|
||||
if (opacity !== null && opacity !== undefined) {
|
||||
let backgroundColor: string | undefined = settings.inactiveRegionBackgroundColor;
|
||||
if (backgroundColor === "") {
|
||||
backgroundColor = undefined;
|
||||
}
|
||||
let color: string | undefined = settings.inactiveRegionForegroundColor;
|
||||
if (color === "") {
|
||||
color = undefined;
|
||||
}
|
||||
const decoration: vscode.TextEditorDecorationType = vscode.window.createTextEditorDecorationType({
|
||||
opacity: opacity.toString(),
|
||||
backgroundColor: backgroundColor,
|
||||
color: color,
|
||||
backgroundColor: settings.inactiveRegionBackgroundColor,
|
||||
color: settings.inactiveRegionForegroundColor,
|
||||
rangeBehavior: vscode.DecorationRangeBehavior.OpenOpen
|
||||
});
|
||||
// We must convert to vscode.Ranges in order to make use of the API's
|
||||
@@ -2684,8 +2632,8 @@ export class DefaultClient implements Client {
|
||||
const rootFolder: vscode.WorkspaceFolder | undefined = this.RootFolder;
|
||||
const settings: CppSettings = new CppSettings(this.RootUri);
|
||||
const configProviderNotSet: boolean = !settings.defaultConfigurationProvider && !this.configuration.CurrentConfiguration?.configurationProvider &&
|
||||
!this.configuration.CurrentConfiguration?.configurationProviderInCppPropertiesJson &&
|
||||
(this.lastCustomBrowseConfigurationProviderId === undefined || this.lastCustomBrowseConfigurationProviderId.Value === undefined);
|
||||
!this.configuration.CurrentConfiguration?.configurationProviderInCppPropertiesJson;
|
||||
const configProviderNotSetAndNoCache: boolean = configProviderNotSet && this.lastCustomBrowseConfigurationProviderId?.Value === undefined;
|
||||
const compileCommandsNotSet: boolean = !settings.defaultCompileCommands && !this.configuration.CurrentConfiguration?.compileCommands && !this.configuration.CurrentConfiguration?.compileCommandsInCppPropertiesJson;
|
||||
|
||||
// Handle config providers
|
||||
@@ -2693,7 +2641,7 @@ export class DefaultClient implements Client {
|
||||
!this.configStateReceived.configProviders ? undefined :
|
||||
(this.configStateReceived.configProviders.length === 0 ? undefined : this.configStateReceived.configProviders[0]);
|
||||
let showConfigStatus: boolean = false;
|
||||
if (rootFolder && configProviderNotSet && provider && (statusBarIndicatorEnabled || sender === "configProviders")) {
|
||||
if (rootFolder && configProviderNotSetAndNoCache && provider && (statusBarIndicatorEnabled || sender === "configProviders")) {
|
||||
const ask: PersistentFolderState<boolean> = new PersistentFolderState<boolean>("Client.registerProvider", true, rootFolder);
|
||||
if (ask.Value) {
|
||||
if (statusBarIndicatorEnabled) {
|
||||
@@ -2732,7 +2680,7 @@ export class DefaultClient implements Client {
|
||||
}
|
||||
|
||||
// Handle compile commands
|
||||
if (rootFolder && configProviderNotSet && !this.configStateReceived.configProviders &&
|
||||
if (rootFolder && configProviderNotSetAndNoCache && !this.configStateReceived.configProviders &&
|
||||
compileCommandsNotSet && this.compileCommandsPaths.length > 0 && (statusBarIndicatorEnabled || sender === "compileCommands")) {
|
||||
const ask: PersistentFolderState<boolean> = new PersistentFolderState<boolean>("CPP.showCompileCommandsSelection", true, rootFolder);
|
||||
if (ask.Value) {
|
||||
@@ -2778,7 +2726,7 @@ export class DefaultClient implements Client {
|
||||
}
|
||||
|
||||
const compilerPathNotSet: boolean = settings.defaultCompilerPath === undefined && this.configuration.CurrentConfiguration?.compilerPath === undefined && this.configuration.CurrentConfiguration?.compilerPathInCppPropertiesJson === undefined;
|
||||
const configurationNotSet: boolean = configProviderNotSet && compileCommandsNotSet && compilerPathNotSet;
|
||||
const configurationNotSet: boolean = configProviderNotSetAndNoCache && compileCommandsNotSet && compilerPathNotSet;
|
||||
|
||||
showConfigStatus = showConfigStatus || (configurationNotSet &&
|
||||
!!compilerDefaults && !compilerDefaults.trustedCompilerFound && trustedCompilerPaths && (trustedCompilerPaths.length !== 1 || trustedCompilerPaths[0] !== ""));
|
||||
@@ -2789,11 +2737,22 @@ export class DefaultClient implements Client {
|
||||
} else {
|
||||
this.showConfigureIntelliSenseButton = false;
|
||||
}
|
||||
ui.ShowConfigureIntelliSenseButton(this.showConfigureIntelliSenseButton, this);
|
||||
} else if (showConfigStatus && !displayedSelectCompiler) {
|
||||
this.promptSelectIntelliSenseConfiguration(false, "notification");
|
||||
displayedSelectCompiler = true;
|
||||
}
|
||||
|
||||
const configProviderType: ConfigurationType = this.configuration.ConfigProviderAutoSelected ? ConfigurationType.AutoConfigProvider : ConfigurationType.ConfigProvider;
|
||||
const compilerType: ConfigurationType = this.configuration.CurrentConfiguration?.compilerPathIsExplicit ? ConfigurationType.CompilerPath : ConfigurationType.AutoCompilerPath;
|
||||
const configType: ConfigurationType =
|
||||
!configProviderNotSet ? configProviderType :
|
||||
!compileCommandsNotSet ? ConfigurationType.CompileCommands :
|
||||
!compilerPathNotSet ? compilerType :
|
||||
ConfigurationType.NotConfigured;
|
||||
|
||||
// It's ok to call this method even when the experiment is not enabled because it checks the experiment state
|
||||
// before enabling the button. This method logs configuration telemetry and we always want that.
|
||||
ui.ShowConfigureIntelliSenseButton(showConfigStatus, this, configType, "handleConfig");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3541,7 +3500,6 @@ export class DefaultClient implements Client {
|
||||
const workspaceEdits: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();
|
||||
let modifiedDocument: vscode.Uri | undefined;
|
||||
let lastEdit: vscode.TextEdit | undefined;
|
||||
let editPositionAdjustment: number = 0;
|
||||
let selectionPositionAdjustment: number = 0;
|
||||
for (const file in result.edit.changes) {
|
||||
const uri: vscode.Uri = vscode.Uri.file(file);
|
||||
@@ -3551,23 +3509,13 @@ export class DefaultClient implements Client {
|
||||
for (const edit of result.edit.changes[file]) {
|
||||
const range: vscode.Range = makeVscodeRange(edit.range);
|
||||
// Get new lines from an edit for: #include header file.
|
||||
if (lastEdit && lastEdit.newText.includes("#include")) {
|
||||
if (lastEdit.range.isEqual(range)) {
|
||||
// Destination file is empty.
|
||||
// The edit positions for #include header file and definition or declaration are the same.
|
||||
selectionPositionAdjustment = (lastEdit.newText.match(/\n/g) || []).length;
|
||||
} else {
|
||||
// Destination file is not empty.
|
||||
// VS Code workspace.applyEdit calculates the position of subsequent edits.
|
||||
// That is, the positions of text edits that are originally calculated by the language server
|
||||
// are adjusted based on the number of text edits applied by VS Code workspace.applyEdit.
|
||||
// Since the language server's refactoring API already pre-calculates the positions of multiple text edits,
|
||||
// re-adjust the new line of the next text edit for the VS Code applyEdit to calculate again.
|
||||
editPositionAdjustment = (lastEdit.newText.match(/\n/g) || []).length;
|
||||
}
|
||||
if (lastEdit && lastEdit.newText.includes("#include") && lastEdit.range.isEqual(range)) {
|
||||
// Destination file is empty.
|
||||
// The edit positions for #include header file and definition or declaration are the same.
|
||||
selectionPositionAdjustment = (lastEdit.newText.match(/\n/g) || []).length;
|
||||
}
|
||||
lastEdit = new vscode.TextEdit(range, edit.newText);
|
||||
const position: vscode.Position = new vscode.Position(edit.range.start.line - editPositionAdjustment, edit.range.start.character);
|
||||
const position: vscode.Position = new vscode.Position(edit.range.start.line, edit.range.start.character);
|
||||
workspaceEdits.insert(uri, position, edit.newText);
|
||||
}
|
||||
modifiedDocument = uri;
|
||||
@@ -3671,68 +3619,28 @@ export class DefaultClient implements Client {
|
||||
|
||||
public handleReferencesIcon(): void {
|
||||
this.notifyWhenLanguageClientReady(() => {
|
||||
const cancelling: boolean = DefaultClient.referencesPendingCancellations.length > 0;
|
||||
if (!cancelling) {
|
||||
workspaceReferences.UpdateProgressUICounter(this.model.referencesCommandMode.Value);
|
||||
if (this.ReferencesCommandMode === refs.ReferencesCommandMode.Find) {
|
||||
if (!workspaceReferences.referencesRequestPending) {
|
||||
if (workspaceReferences.referencesRequestHasOccurred) {
|
||||
// References are not usable if a references request is pending,
|
||||
// So after the initial request, we don't send a 2nd references request until the next request occurs.
|
||||
if (!workspaceReferences.referencesRefreshPending) {
|
||||
workspaceReferences.referencesRefreshPending = true;
|
||||
vscode.commands.executeCommand("references-view.refresh");
|
||||
}
|
||||
} else {
|
||||
workspaceReferences.referencesRequestHasOccurred = true;
|
||||
workspaceReferences.referencesRequestPending = true;
|
||||
this.languageClient.sendNotification(RequestReferencesNotification);
|
||||
}
|
||||
}
|
||||
}
|
||||
workspaceReferences.UpdateProgressUICounter(this.model.referencesCommandMode.Value);
|
||||
|
||||
// If the search is find all references, preview partial results.
|
||||
// This will cause the language server to send partial results to display
|
||||
// in the "Other References" view or channel. Doing a preview should not complete
|
||||
// an in-progress request until it is finished or canceled.
|
||||
if (this.ReferencesCommandMode === refs.ReferencesCommandMode.Find) {
|
||||
this.languageClient.sendNotification(PreviewReferencesNotification);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public clearPendingReferencesCancellations(): void {
|
||||
if (DefaultClient.referencesPendingCancellations.length > 0) {
|
||||
while (DefaultClient.referencesPendingCancellations.length > 1) {
|
||||
const pendingCancel: ReferencesCancellationState = DefaultClient.referencesPendingCancellations[0];
|
||||
DefaultClient.referencesPendingCancellations.pop();
|
||||
pendingCancel.reject();
|
||||
}
|
||||
const pendingCancel: ReferencesCancellationState = DefaultClient.referencesPendingCancellations[0];
|
||||
DefaultClient.referencesPendingCancellations.pop();
|
||||
pendingCancel.callback();
|
||||
}
|
||||
}
|
||||
|
||||
public cancelReferences(): void {
|
||||
DefaultClient.referencesParams = undefined;
|
||||
DefaultClient.renamePending = false;
|
||||
if (DefaultClient.referencesRequestPending || workspaceReferences.symbolSearchInProgress) {
|
||||
const cancelling: boolean = DefaultClient.referencesPendingCancellations.length > 0;
|
||||
DefaultClient.referencesPendingCancellations.push({
|
||||
reject: () => { },
|
||||
callback: () => { }
|
||||
});
|
||||
if (!cancelling) {
|
||||
workspaceReferences.referencesCanceled = true;
|
||||
languageClient.sendNotification(CancelReferencesNotification);
|
||||
}
|
||||
}
|
||||
private serverCanceledReferences(): void {
|
||||
workspaceReferences.cancelCurrentReferenceRequest(refs.CancellationSender.LanguageServer);
|
||||
}
|
||||
|
||||
private handleReferencesProgress(notificationBody: refs.ReportReferencesProgressNotification): void {
|
||||
workspaceReferences.handleProgress(notificationBody);
|
||||
}
|
||||
|
||||
private processReferencesResult(referencesResult: refs.ReferencesResult): void {
|
||||
workspaceReferences.processResults(referencesResult);
|
||||
}
|
||||
|
||||
private processCallHierarchyResult(callHierarchyResult: CallHierarchyCallsItemResult): void {
|
||||
workspaceReferences.processCallHierarchyResults(callHierarchyResult);
|
||||
private processReferencesPreview(referencesResult: refs.ReferencesResult): void {
|
||||
workspaceReferences.showResultsInPanelView(referencesResult);
|
||||
}
|
||||
|
||||
public setReferencesCommandMode(mode: refs.ReferencesCommandMode): void {
|
||||
|
||||
@@ -21,7 +21,7 @@ import { setTimeout } from 'timers';
|
||||
import * as which from 'which';
|
||||
import { getOutputChannelLogger } from '../logger';
|
||||
import { DefaultClient } from './client';
|
||||
import { UI, getUI } from './ui';
|
||||
import { ConfigurationType, LanguageStatusUI, getUI } from './ui';
|
||||
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
@@ -351,9 +351,6 @@ export class CppProperties {
|
||||
if (this.configurationIncomplete && this.defaultIncludes && this.defaultFrameworks && this.vcpkgPathReady) {
|
||||
const configuration: Configuration | undefined = this.CurrentConfiguration;
|
||||
if (configuration) {
|
||||
if (configuration.compilerPath !== undefined || configuration.compileCommands !== undefined || configuration.configurationProvider !== undefined) {
|
||||
getUI().then((ui: UI) => ui.ShowConfigureIntelliSenseButton(false, this.client));
|
||||
}
|
||||
this.applyDefaultConfigurationValues(configuration);
|
||||
this.configurationIncomplete = false;
|
||||
}
|
||||
@@ -832,7 +829,13 @@ export class CppProperties {
|
||||
return [];
|
||||
}
|
||||
|
||||
private configProviderAutoSelected: boolean = false;
|
||||
public get ConfigProviderAutoSelected(): boolean {
|
||||
return this.configProviderAutoSelected;
|
||||
}
|
||||
|
||||
private updateServerOnFolderSettingsChange(): void {
|
||||
this.configProviderAutoSelected = false;
|
||||
if (!this.configurationJson) {
|
||||
return;
|
||||
}
|
||||
@@ -963,14 +966,14 @@ export class CppProperties {
|
||||
&& !settings.defaultIncludePath
|
||||
&& !settings.defaultDefines
|
||||
&& !settings.defaultMacFrameworkPath
|
||||
&& settings.defaultWindowsSdkVersion === ""
|
||||
&& !settings.defaultWindowsSdkVersion
|
||||
&& !settings.defaultForcedInclude
|
||||
&& settings.defaultCompileCommands === ""
|
||||
&& !settings.defaultCompileCommands
|
||||
&& !settings.defaultCompilerArgs
|
||||
&& settings.defaultCStandard === ""
|
||||
&& settings.defaultCppStandard === ""
|
||||
&& settings.defaultIntelliSenseMode === ""
|
||||
&& settings.defaultConfigurationProvider === "";
|
||||
&& !settings.defaultConfigurationProvider;
|
||||
|
||||
// Only keep a cached custom browse config if there is an empty configuration,
|
||||
// or if a specified provider ID has not changed.
|
||||
@@ -978,9 +981,12 @@ export class CppProperties {
|
||||
if (hasEmptyConfiguration) {
|
||||
if (providers.size === 1) {
|
||||
providers.forEach(provider => { configuration.configurationProvider = provider.extensionId; });
|
||||
this.configProviderAutoSelected = true;
|
||||
if (this.client.lastCustomBrowseConfigurationProviderId !== undefined) {
|
||||
keepCachedBrowseConfig = configuration.configurationProvider === this.client.lastCustomBrowseConfigurationProviderId.Value;
|
||||
}
|
||||
} else if (providers.size > 1) {
|
||||
keepCachedBrowseConfig = false;
|
||||
}
|
||||
} else if (this.client.lastCustomBrowseConfigurationProviderId !== undefined) {
|
||||
keepCachedBrowseConfig = configuration.configurationProvider === this.client.lastCustomBrowseConfigurationProviderId.Value;
|
||||
@@ -991,6 +997,17 @@ export class CppProperties {
|
||||
this.client.lastCustomBrowseConfigurationProviderId.Value = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
const showButtonSender: string = "configChange";
|
||||
if (configuration.configurationProvider !== undefined) {
|
||||
const configType: ConfigurationType = this.configProviderAutoSelected ? ConfigurationType.AutoConfigProvider : ConfigurationType.ConfigProvider;
|
||||
getUI().then((ui: LanguageStatusUI) => ui.ShowConfigureIntelliSenseButton(false, this.client, configType, showButtonSender));
|
||||
} else if (configuration.compileCommands !== undefined) {
|
||||
getUI().then((ui: LanguageStatusUI) => ui.ShowConfigureIntelliSenseButton(false, this.client, ConfigurationType.CompileCommands, showButtonSender));
|
||||
} else if (configuration.compilerPath !== undefined) {
|
||||
const configType: ConfigurationType = configuration.compilerPathIsExplicit ? ConfigurationType.CompilerPath : ConfigurationType.AutoCompilerPath;
|
||||
getUI().then((ui: LanguageStatusUI) => ui.ShowConfigureIntelliSenseButton(false, this.client, configType, showButtonSender));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as fs from 'fs';
|
||||
import * as util from '../common';
|
||||
import * as telemetry from '../telemetry';
|
||||
import { TreeNode, NodeType } from './referencesModel';
|
||||
import { UI, getUI } from './ui';
|
||||
import { LanguageStatusUI, getUI } from './ui';
|
||||
import { Client, DefaultClient, DoxygenCodeActionCommandArguments, openFileVersions } from './client';
|
||||
import { CodeAnalysisDiagnosticIdentifiersAndUri, CodeActionDiagnosticInfo, codeAnalysisCodeToFixes,
|
||||
codeAnalysisFileToCodeActions, codeAnalysisAllFixes } from './codeAnalysis';
|
||||
@@ -35,7 +35,7 @@ export const configPrefix: string = "C/C++: ";
|
||||
let prevCrashFile: string;
|
||||
export let clients: ClientCollection;
|
||||
let activeDocument: string;
|
||||
let ui: UI;
|
||||
let ui: LanguageStatusUI;
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
const commandDisposables: vscode.Disposable[] = [];
|
||||
let languageConfigurations: vscode.Disposable[] = [];
|
||||
@@ -455,16 +455,6 @@ export function registerCommands(enabled: boolean): void {
|
||||
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RescanCompilers', enabled ? onRescanCompilers : onDisabledCommand));
|
||||
}
|
||||
|
||||
function logForUIExperiment(command: string, sender?: any): void {
|
||||
const settings: CppSettings = new CppSettings();
|
||||
const properties: {[key: string]: string} = {
|
||||
newUI: ui.isNewUI.toString(),
|
||||
uiOverride: (settings.experimentalFeatures ?? false).toString(),
|
||||
sender: util.getSenderType(sender)
|
||||
};
|
||||
telemetry.logLanguageServerEvent(`experiment${command}`, properties);
|
||||
}
|
||||
|
||||
function onDisabledCommand(): void {
|
||||
const message: string = localize(
|
||||
{
|
||||
@@ -478,7 +468,6 @@ function onDisabledCommand(): void {
|
||||
}
|
||||
|
||||
function onRestartIntelliSenseForFile(sender?: any): void {
|
||||
logForUIExperiment("RestartIntelliSenseForFile", sender);
|
||||
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
if (!activeEditor || !util.isCpp(activeEditor.document)) {
|
||||
return;
|
||||
@@ -574,7 +563,6 @@ function selectIntelliSenseConfiguration(sender?: any): void {
|
||||
}
|
||||
|
||||
function onSelectConfiguration(sender?: any): void {
|
||||
logForUIExperiment("ConfigurationSelect", sender);
|
||||
if (!isFolderOpen()) {
|
||||
vscode.window.showInformationMessage(localize("configuration.select.first", 'Open a folder first to select a configuration.'));
|
||||
} else {
|
||||
@@ -761,12 +749,10 @@ function onToggleDimInactiveRegions(): void {
|
||||
}
|
||||
|
||||
function onPauseParsing(sender?: any): void {
|
||||
logForUIExperiment("ParsingCommands", sender);
|
||||
clients.ActiveClient.pauseParsing();
|
||||
}
|
||||
|
||||
function onResumeParsing(sender?: any): void {
|
||||
logForUIExperiment("ParsingCommands", sender);
|
||||
clients.ActiveClient.resumeParsing();
|
||||
}
|
||||
|
||||
@@ -783,22 +769,18 @@ function onCancelCodeAnalysis(): void {
|
||||
}
|
||||
|
||||
function onShowParsingCommands(sender?: any): void {
|
||||
logForUIExperiment("ParsingCommands", sender);
|
||||
clients.ActiveClient.handleShowParsingCommands();
|
||||
}
|
||||
|
||||
function onShowActiveCodeAnalysisCommands(sender?: any): void {
|
||||
logForUIExperiment("ShowActiveCodeAnalysisCommands", sender);
|
||||
clients.ActiveClient.handleShowActiveCodeAnalysisCommands();
|
||||
}
|
||||
|
||||
function onShowIdleCodeAnalysisCommands(sender?: any): void {
|
||||
logForUIExperiment("ShowIdleCodeAnalysisCommands", sender);
|
||||
clients.ActiveClient.handleShowIdleCodeAnalysisCommands();
|
||||
}
|
||||
|
||||
function onShowReferencesProgress(sender?: any): void {
|
||||
logForUIExperiment("ShowReferencesProgress", sender);
|
||||
clients.ActiveClient.handleReferencesIcon();
|
||||
}
|
||||
|
||||
@@ -896,7 +878,6 @@ function onLogDiagnostics(): void {
|
||||
}
|
||||
|
||||
function onRescanWorkspace(sender?: string): void {
|
||||
logForUIExperiment("RescanWorkspace", sender);
|
||||
clients.ActiveClient.rescanFolder();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import { DefaultClient, ReferenceParams, FindAllReferencesParams } from './client';
|
||||
import { FindAllRefsView } from './referencesView';
|
||||
import { DefaultClient } from './client';
|
||||
import * as telemetry from '../telemetry';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as logger from '../logger';
|
||||
import { PersistentState } from './persistentState';
|
||||
import * as util from '../common';
|
||||
import { setInterval } from 'timers';
|
||||
import { CallHierarchyParams, CallHierarchyCallsItemResult } from './Providers/callHierarchyProvider';
|
||||
import { Position, TextDocumentIdentifier } from 'vscode-languageclient';
|
||||
import { FindAllRefsView } from './referencesView';
|
||||
|
||||
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
@@ -34,15 +34,20 @@ export interface ReferenceInfo {
|
||||
type: ReferenceType;
|
||||
}
|
||||
|
||||
export interface ReferencesParams {
|
||||
newName: string;
|
||||
position: Position;
|
||||
textDocument: TextDocumentIdentifier;
|
||||
}
|
||||
|
||||
export interface ReferencesResult {
|
||||
referenceInfos: ReferenceInfo[];
|
||||
text: string;
|
||||
isFinished: boolean;
|
||||
isCanceled: boolean;
|
||||
}
|
||||
|
||||
export type ReferencesResultCallback = (result: ReferencesResult | null, doResolve: boolean) => void;
|
||||
export type CallHierarchyResultCallback =
|
||||
(result: CallHierarchyCallsItemResult | null, canceledByUser: boolean, progressBarDuration?: number) => void;
|
||||
export type ReferencesResultCallback = (result: ReferencesResult | null) => void;
|
||||
|
||||
enum ReferencesProgress {
|
||||
Started,
|
||||
@@ -75,6 +80,23 @@ export enum ReferencesCommandMode {
|
||||
CallHierarchy
|
||||
}
|
||||
|
||||
export enum CancellationSender {
|
||||
/* No cancellations */
|
||||
None,
|
||||
|
||||
/* Cancellation was from a new request */
|
||||
NewRequest,
|
||||
|
||||
/* Cancellation was from the provider cancellation token */
|
||||
ProviderToken,
|
||||
|
||||
/* Cancellation was from the language server */
|
||||
LanguageServer,
|
||||
|
||||
/* Cancellation was from the user selecting the cancel button in the reference search progress bar */
|
||||
User
|
||||
}
|
||||
|
||||
export function referencesCommandModeToString(referencesCommandMode: ReferencesCommandMode): string {
|
||||
switch (referencesCommandMode) {
|
||||
case ReferencesCommandMode.Find:
|
||||
@@ -112,7 +134,6 @@ export function convertReferenceTypeToString(referenceType: ReferenceType, upper
|
||||
case ReferenceType.NotAReference: return localize("not.a.reference", "Not a reference");
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function getReferenceCanceledString(upperCase?: boolean): string {
|
||||
@@ -174,19 +195,14 @@ export class ReferencesManager {
|
||||
private findAllRefsView?: FindAllRefsView;
|
||||
private viewsInitialized: boolean = false;
|
||||
|
||||
public symbolSearchInProgress: boolean = false;
|
||||
public renamePending: boolean = false;
|
||||
private referenceRequestCanceled = new vscode.EventEmitter<CancellationSender>();
|
||||
|
||||
private referencesCurrentProgress?: ReportReferencesProgressNotification;
|
||||
private referencesPrevProgressIncrement: number = 0;
|
||||
private referencesPrevProgressMessage: string = "";
|
||||
public referencesRequestHasOccurred: boolean = false;
|
||||
private referencesFinished: boolean = false;
|
||||
public referencesRequestPending: boolean = false;
|
||||
public referencesRefreshPending: boolean = false;
|
||||
private referencesDelayProgress?: NodeJS.Timeout;
|
||||
private referencesProgressOptions?: vscode.ProgressOptions;
|
||||
private referencesCaneledByUser: boolean = false;
|
||||
public referencesCanceled: boolean = false;
|
||||
public referencesCanceledWhilePreviewing?: boolean;
|
||||
private referencesStartedWhileTagParsing?: boolean;
|
||||
private referencesProgressMethod?: (progress: vscode.Progress<{
|
||||
message?: string;
|
||||
@@ -196,20 +212,19 @@ export class ReferencesManager {
|
||||
private referencesCurrentProgressUICounter: number = 0;
|
||||
private readonly referencesProgressUpdateInterval: number = 1000;
|
||||
private readonly referencesProgressDelayInterval: number = 2000;
|
||||
private currentUpdateProgressTimer?: NodeJS.Timeout;
|
||||
private currentUpdateProgressResolve?: (value: unknown) => void;
|
||||
|
||||
private prevVisibleRangesLength: number = 0;
|
||||
private visibleRangesDecreased: boolean = false;
|
||||
private visibleRangesDecreasedTicks: number = 0;
|
||||
private readonly ticksForDetectingPeek: number = 1000; // TODO: Might need tweaking?
|
||||
|
||||
private resultsCallback?: ReferencesResultCallback;
|
||||
private callHierarchyResultsCallback?: CallHierarchyResultCallback;
|
||||
private currentUpdateProgressTimer?: NodeJS.Timeout;
|
||||
private currentUpdateProgressResolve?: (value: unknown) => void;
|
||||
public groupByFile: PersistentState<boolean> = new PersistentState<boolean>("CPP.referencesGroupByFile", false);
|
||||
|
||||
constructor(client: DefaultClient) {
|
||||
this.client = client;
|
||||
this.disposables.push(vscode.Disposable.from(this.referenceRequestCanceled));
|
||||
}
|
||||
|
||||
initializeViews(): void {
|
||||
@@ -219,6 +234,15 @@ export class ReferencesManager {
|
||||
}
|
||||
}
|
||||
|
||||
public get onCancellationRequested(): vscode.Event<CancellationSender> {
|
||||
return this.referenceRequestCanceled.event;
|
||||
}
|
||||
|
||||
public cancelCurrentReferenceRequest(sender: CancellationSender): void {
|
||||
// Notify the current listener to cancel its request.
|
||||
this.referenceRequestCanceled.fire(sender);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.disposables.forEach((d) => d.dispose());
|
||||
this.disposables = [];
|
||||
@@ -352,10 +376,14 @@ export class ReferencesManager {
|
||||
this.currentUpdateProgressResolve = resolve;
|
||||
this.reportProgress(progress, true, mode);
|
||||
this.currentUpdateProgressTimer = setInterval(() => {
|
||||
if (token.isCancellationRequested && !this.referencesCanceled) {
|
||||
this.client.cancelReferences();
|
||||
this.referencesCanceled = true;
|
||||
this.referencesCaneledByUser = true;
|
||||
if (token.isCancellationRequested) {
|
||||
this.cancelCurrentReferenceRequest(CancellationSender.User);
|
||||
if (this.currentUpdateProgressTimer) {
|
||||
clearInterval(this.currentUpdateProgressTimer);
|
||||
}
|
||||
if (this.referencesDelayProgress) {
|
||||
clearInterval(this.referencesDelayProgress);
|
||||
}
|
||||
}
|
||||
if (this.referencesCurrentProgressUICounter !== referencePreviousProgressUICounter) {
|
||||
if (this.currentUpdateProgressTimer) {
|
||||
@@ -400,58 +428,34 @@ export class ReferencesManager {
|
||||
}
|
||||
}
|
||||
|
||||
private startRequest(): void {
|
||||
this.lastResults = null;
|
||||
this.referencesFinished = false;
|
||||
this.referencesRequestHasOccurred = false;
|
||||
this.referencesRequestPending = false;
|
||||
this.referencesCanceledWhilePreviewing = false;
|
||||
public resetProgressBar(): void {
|
||||
if (this.referencesDelayProgress) {
|
||||
clearInterval(this.referencesDelayProgress);
|
||||
}
|
||||
if (this.currentUpdateProgressTimer) {
|
||||
if (this.currentUpdateProgressTimer) {
|
||||
clearInterval(this.currentUpdateProgressTimer);
|
||||
}
|
||||
if (this.currentUpdateProgressResolve) {
|
||||
this.currentUpdateProgressResolve(undefined);
|
||||
}
|
||||
this.currentUpdateProgressResolve = undefined;
|
||||
this.currentUpdateProgressTimer = undefined;
|
||||
}
|
||||
this.referencesProgressBarStartTime = 0;
|
||||
}
|
||||
|
||||
private cancelRequests(): void {
|
||||
if (this.resultsCallback) {
|
||||
this.resultsCallback(null, true);
|
||||
}
|
||||
if (this.callHierarchyResultsCallback) {
|
||||
this.callHierarchyResultsCallback(null, this.referencesCaneledByUser);
|
||||
this.referencesCaneledByUser = false;
|
||||
}
|
||||
public startRename(): void {
|
||||
this.renamePending = true;
|
||||
}
|
||||
|
||||
public startRename(params: ReferenceParams): void {
|
||||
this.startRequest();
|
||||
if (this.referencesCanceled) {
|
||||
this.referencesCanceled = false;
|
||||
this.cancelRequests();
|
||||
} else {
|
||||
this.client.sendRenameNotification(params);
|
||||
}
|
||||
public resetReferences(): void {
|
||||
this.renamePending = false;
|
||||
this.initializeViews();
|
||||
this.client.setReferencesCommandMode(ReferencesCommandMode.None);
|
||||
}
|
||||
|
||||
public startFindAllReferences(params: FindAllReferencesParams): void {
|
||||
this.startRequest();
|
||||
if (this.referencesCanceled) {
|
||||
this.referencesCanceled = false;
|
||||
this.cancelRequests();
|
||||
} else {
|
||||
this.client.sendFindAllReferencesNotification(params);
|
||||
}
|
||||
}
|
||||
|
||||
public startCallHierarchyIncomingCalls(params: CallHierarchyParams): void {
|
||||
this.startRequest();
|
||||
if (this.referencesCanceled) {
|
||||
this.referencesCanceled = false;
|
||||
this.cancelRequests();
|
||||
} else {
|
||||
this.client.sendCallHierarchyCallsToNotification(params);
|
||||
}
|
||||
}
|
||||
|
||||
public processResults(referencesResult: ReferencesResult): void {
|
||||
if (this.referencesFinished) {
|
||||
return;
|
||||
}
|
||||
public showResultsInPanelView(referencesResult: ReferencesResult): void {
|
||||
this.initializeViews();
|
||||
this.clearViews();
|
||||
|
||||
@@ -477,52 +481,14 @@ export class ReferencesManager {
|
||||
}
|
||||
}
|
||||
|
||||
// Need to reset these before we call the callback, as the callback my trigger another request
|
||||
// and we need to ensure these values are already reset before that happens.
|
||||
const referencesRequestPending: boolean = this.referencesRequestPending;
|
||||
const referencesCanceled: boolean = this.referencesCanceled;
|
||||
this.referencesRequestPending = false;
|
||||
this.referencesCanceled = false;
|
||||
|
||||
const currentReferenceCommandMode: ReferencesCommandMode = this.client.ReferencesCommandMode;
|
||||
|
||||
if (referencesResult.isFinished) {
|
||||
this.symbolSearchInProgress = false;
|
||||
if (this.referencesDelayProgress) {
|
||||
clearInterval(this.referencesDelayProgress);
|
||||
}
|
||||
if (this.currentUpdateProgressTimer) {
|
||||
if (this.currentUpdateProgressTimer) {
|
||||
clearInterval(this.currentUpdateProgressTimer);
|
||||
}
|
||||
if (this.currentUpdateProgressResolve) {
|
||||
this.currentUpdateProgressResolve(undefined);
|
||||
}
|
||||
this.currentUpdateProgressResolve = undefined;
|
||||
this.currentUpdateProgressTimer = undefined;
|
||||
}
|
||||
this.client.setReferencesCommandMode(ReferencesCommandMode.None);
|
||||
}
|
||||
|
||||
if (currentReferenceCommandMode === ReferencesCommandMode.Rename) {
|
||||
if (!referencesCanceled) {
|
||||
if (this.resultsCallback) {
|
||||
this.resultsCallback(referencesResult, true);
|
||||
}
|
||||
} else {
|
||||
// Do nothing when rename is canceled while searching for references was in progress.
|
||||
if (this.resultsCallback) {
|
||||
this.resultsCallback(null, true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.client.ReferencesCommandMode === ReferencesCommandMode.Find || this.client.ReferencesCommandMode === ReferencesCommandMode.Peek) {
|
||||
if (this.findAllRefsView) {
|
||||
this.findAllRefsView.setData(referencesResult, referencesCanceled, this.groupByFile.Value);
|
||||
this.findAllRefsView.setData(referencesResult, this.groupByFile.Value);
|
||||
}
|
||||
|
||||
// Display data based on command mode: peek references OR find all references
|
||||
if (currentReferenceCommandMode === ReferencesCommandMode.Peek) {
|
||||
const showConfirmedReferences: boolean = referencesCanceled;
|
||||
// Display in "Other References" view or channel based on command mode: "peek references" OR "find all references"
|
||||
if (this.client.ReferencesCommandMode === ReferencesCommandMode.Peek) {
|
||||
const showConfirmedReferences: boolean = referencesResult.isCanceled;
|
||||
if (this.findAllRefsView) {
|
||||
const peekReferencesResults: string = this.findAllRefsView.getResultsAsText(showConfirmedReferences);
|
||||
if (peekReferencesResults) {
|
||||
@@ -532,76 +498,27 @@ export class ReferencesManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (currentReferenceCommandMode === ReferencesCommandMode.Find) {
|
||||
} else if (this.client.ReferencesCommandMode === ReferencesCommandMode.Find) {
|
||||
if (this.findAllRefsView) {
|
||||
this.findAllRefsView.show(true);
|
||||
}
|
||||
}
|
||||
if (referencesResult.isFinished) {
|
||||
this.lastResults = referencesResult;
|
||||
this.referencesFinished = true;
|
||||
}
|
||||
if (!this.referencesRefreshPending) {
|
||||
if (referencesResult.isFinished && this.referencesRequestHasOccurred && !referencesRequestPending && !this.referencesCanceledWhilePreviewing) {
|
||||
this.referencesRefreshPending = true;
|
||||
vscode.commands.executeCommand("references-view.refresh");
|
||||
} else {
|
||||
if (this.resultsCallback) {
|
||||
this.resultsCallback(referencesResult, !this.referencesCanceledWhilePreviewing);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If this is the final result, reset after process results.
|
||||
if (referencesResult.isFinished || referencesResult.isCanceled) {
|
||||
this.resetReferences();
|
||||
}
|
||||
}
|
||||
|
||||
public lastResults: ReferencesResult | null = null; // Saved for the final request after a preview occurs.
|
||||
|
||||
public setResultsCallback(callback: ReferencesResultCallback): void {
|
||||
this.symbolSearchInProgress = true;
|
||||
this.resultsCallback = callback;
|
||||
}
|
||||
|
||||
public processCallHierarchyResults(callHierarchyResult: CallHierarchyCallsItemResult): void {
|
||||
const referencesCanceled: boolean = this.referencesCanceled;
|
||||
const referenceCanceledByUser: boolean = this.referencesCaneledByUser;
|
||||
public getCallHierarchyProgressBarDuration(): number | undefined {
|
||||
let referencesProgressBarDuration: number | undefined;
|
||||
|
||||
// Need to reset these before we call the callback, as the callback my trigger another request
|
||||
// and we need to ensure these values are already reset before that happens.
|
||||
this.referencesCaneledByUser = false;
|
||||
this.referencesCanceled = false;
|
||||
this.referencesRequestPending = false;
|
||||
this.symbolSearchInProgress = false;
|
||||
|
||||
if (this.referencesProgressBarStartTime !== 0) {
|
||||
referencesProgressBarDuration = Date.now() - this.referencesProgressBarStartTime;
|
||||
this.referencesProgressBarStartTime = 0;
|
||||
}
|
||||
if (this.referencesDelayProgress) {
|
||||
clearInterval(this.referencesDelayProgress);
|
||||
}
|
||||
if (this.currentUpdateProgressTimer) {
|
||||
if (this.currentUpdateProgressTimer) {
|
||||
clearInterval(this.currentUpdateProgressTimer);
|
||||
}
|
||||
if (this.currentUpdateProgressResolve) {
|
||||
this.currentUpdateProgressResolve(undefined);
|
||||
}
|
||||
this.currentUpdateProgressResolve = undefined;
|
||||
this.currentUpdateProgressTimer = undefined;
|
||||
}
|
||||
this.client.setReferencesCommandMode(ReferencesCommandMode.None);
|
||||
|
||||
// Execute the callback.
|
||||
if (this.callHierarchyResultsCallback) {
|
||||
this.callHierarchyResultsCallback(referencesCanceled ? null : callHierarchyResult,
|
||||
referenceCanceledByUser, referencesProgressBarDuration);
|
||||
}
|
||||
}
|
||||
|
||||
public setCallHierarchyResultsCallback(callback: CallHierarchyResultCallback): void {
|
||||
this.symbolSearchInProgress = true;
|
||||
this.callHierarchyResultsCallback = callback;
|
||||
return referencesProgressBarDuration;
|
||||
}
|
||||
|
||||
public clearViews(): void {
|
||||
|
||||
@@ -15,7 +15,10 @@ export class ReferencesModel {
|
||||
this.originalSymbol = resultsInput.text;
|
||||
this.groupByFile = groupByFile;
|
||||
|
||||
const results: ReferenceInfo[] = resultsInput.referenceInfos.filter(r => r.type !== ReferenceType.Confirmed);
|
||||
// Only filter out confirmed references when operation has finished.
|
||||
// Otherwise, show all results in the "Other References" view while previewing or if the request was canceled.
|
||||
const results: ReferenceInfo[] = resultsInput.isFinished ?
|
||||
resultsInput.referenceInfos.filter(r => r.type !== ReferenceType.Confirmed) : resultsInput.referenceInfos;
|
||||
|
||||
// Build a single flat list of all leaf nodes
|
||||
// Currently, the hierarchy is built each time referencesTreeDataProvider requests nodes.
|
||||
|
||||
@@ -30,12 +30,13 @@ export class FindAllRefsView {
|
||||
vscode.commands.executeCommand('setContext', 'cpptools.hasReferencesResults', hasResults);
|
||||
}
|
||||
|
||||
setData(results: ReferencesResult, isCanceled: boolean, groupByFile: boolean): void {
|
||||
this.referencesModel = new ReferencesModel(results, isCanceled, groupByFile, () => { this.referenceViewProvider.refresh(); });
|
||||
setData(results: ReferencesResult, groupByFile: boolean): void {
|
||||
this.referencesModel = new ReferencesModel(results, results.isCanceled, groupByFile, () => { this.referenceViewProvider.refresh(); });
|
||||
this.referenceViewProvider.setModel(this.referencesModel);
|
||||
}
|
||||
|
||||
clearData(): void {
|
||||
this.referencesModel = undefined;
|
||||
this.referenceViewProvider.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -210,6 +210,11 @@ class Settings {
|
||||
}
|
||||
}
|
||||
|
||||
function changeBlankStringToUndefined(input: string | undefined): string | undefined {
|
||||
// Although null is not a valid type, user could enter a null anyway.
|
||||
return (input === undefined || input === null || input.trim() === "") ? undefined : input;
|
||||
}
|
||||
|
||||
export class CppSettings extends Settings {
|
||||
/**
|
||||
* Create the CppSettings object.
|
||||
@@ -248,19 +253,20 @@ export class CppSettings extends Settings {
|
||||
}
|
||||
|
||||
private getClangPath(isFormat: boolean): string | undefined {
|
||||
let path: string | undefined | null = super.Section.get<string>(isFormat ? "clang_format_path" : "codeAnalysis.clangTidy.path");
|
||||
let path: string | undefined = changeBlankStringToUndefined(super.Section.get<string>(isFormat ? "clang_format_path" : "codeAnalysis.clangTidy.path"));
|
||||
if (!path) {
|
||||
const cachedClangPath: string | null | undefined = isFormat ? getCachedClangFormatPath() : getCachedClangTidyPath();
|
||||
const cachedClangPath: string | undefined = isFormat ? getCachedClangFormatPath() : getCachedClangTidyPath();
|
||||
if (cachedClangPath !== undefined) {
|
||||
if (cachedClangPath === null) {
|
||||
return undefined;
|
||||
}
|
||||
return cachedClangPath;
|
||||
}
|
||||
const clangStr: string = isFormat ? this.clangFormatStr : this.clangTidyStr;
|
||||
const clangName: string = isFormat ? this.clangFormatName : this.clangTidyName;
|
||||
const setCachedClangPath: (path: string | null) => void = isFormat ? setCachedClangFormatPath : setCachedClangTidyPath;
|
||||
path = which.sync(clangName, { nothrow: true });
|
||||
const setCachedClangPath: (path: string) => void = isFormat ? setCachedClangFormatPath : setCachedClangTidyPath;
|
||||
const whichPath: string | null = which.sync(clangName, { nothrow: true });
|
||||
if (whichPath === null) {
|
||||
return undefined;
|
||||
}
|
||||
path = whichPath;
|
||||
setCachedClangPath(path);
|
||||
if (!path) {
|
||||
return undefined;
|
||||
@@ -316,8 +322,8 @@ export class CppSettings extends Settings {
|
||||
public get codeAnalysisRunAutomatically(): boolean | undefined { return super.Section.get<boolean>("codeAnalysis.runAutomatically"); }
|
||||
public get codeAnalysisRunOnBuild(): boolean | undefined { return false; } // super.Section.get<boolean>("codeAnalysis.runOnBuild"); }
|
||||
public get clangTidyEnabled(): boolean | undefined { return super.Section.get<boolean>("codeAnalysis.clangTidy.enabled"); }
|
||||
public get clangTidyConfig(): string | undefined { return super.Section.get<string>("codeAnalysis.clangTidy.config"); }
|
||||
public get clangTidyFallbackConfig(): string | undefined { return super.Section.get<string>("codeAnalysis.clangTidy.fallbackConfig"); }
|
||||
public get clangTidyConfig(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("codeAnalysis.clangTidy.config")); }
|
||||
public get clangTidyFallbackConfig(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("codeAnalysis.clangTidy.fallbackConfig")); }
|
||||
public get clangTidyFixWarnings(): boolean | undefined { return false; } // super.Section.get<boolean>("codeAnalysis.clangTidy.fix.warnings"); }
|
||||
public get clangTidyFixErrors(): boolean | undefined { return false; } // super.Section.get<boolean>("codeAnalysis.clangTidy.fix.errors"); }
|
||||
public get clangTidyFixNotes(): boolean | undefined { return false; } // super.Section.get<boolean>("codeAnalysis.clangTidy.fix.notes"); }
|
||||
@@ -338,21 +344,21 @@ export class CppSettings extends Settings {
|
||||
checks.push(value);
|
||||
super.Section.update("codeAnalysis.clangTidy.checks.disabled", checks, vscode.ConfigurationTarget.WorkspaceFolder);
|
||||
}
|
||||
public get clangFormatStyle(): string | undefined { return super.Section.get<string>("clang_format_style"); }
|
||||
public get clangFormatFallbackStyle(): string | undefined { return super.Section.get<string>("clang_format_fallbackStyle"); }
|
||||
public get clangFormatStyle(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("clang_format_style")); }
|
||||
public get clangFormatFallbackStyle(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("clang_format_fallbackStyle")); }
|
||||
public get clangFormatSortIncludes(): boolean | undefined | null { return super.Section.get<boolean | null>("clang_format_sortIncludes"); }
|
||||
public get experimentalFeatures(): boolean | undefined { return super.Section.get<string>("experimentalFeatures")?.toLowerCase() === "enabled"; }
|
||||
public get suggestSnippets(): boolean | undefined { return super.Section.get<boolean>("suggestSnippets"); }
|
||||
public get intelliSenseEngine(): string | undefined { return super.Section.get<string>("intelliSenseEngine")?.toLowerCase(); }
|
||||
public get intelliSenseEngineFallback(): boolean | undefined { return super.Section.get<string>("intelliSenseEngineFallback")?.toLowerCase() === "enabled"; }
|
||||
public get intelliSenseCachePath(): string | undefined { return super.Section.get<string>("intelliSenseCachePath"); }
|
||||
public get intelliSenseCachePath(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("intelliSenseCachePath")); }
|
||||
public get intelliSenseCacheSize(): number | undefined { return super.Section.get<number>("intelliSenseCacheSize"); }
|
||||
public get intelliSenseMemoryLimit(): number | undefined { return super.Section.get<number>("intelliSenseMemoryLimit"); }
|
||||
public get intelliSenseUpdateDelay(): number | undefined { return super.Section.get<number>("intelliSenseUpdateDelay"); }
|
||||
public get errorSquiggles(): string | undefined { return super.Section.get<string>("errorSquiggles")?.toLowerCase(); }
|
||||
public get inactiveRegionOpacity(): number | undefined { return super.Section.get<number>("inactiveRegionOpacity"); }
|
||||
public get inactiveRegionForegroundColor(): string | undefined { return super.Section.get<string>("inactiveRegionForegroundColor"); }
|
||||
public get inactiveRegionBackgroundColor(): string | undefined { return super.Section.get<string>("inactiveRegionBackgroundColor"); }
|
||||
public get inactiveRegionForegroundColor(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("inactiveRegionForegroundColor")); }
|
||||
public get inactiveRegionBackgroundColor(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("inactiveRegionBackgroundColor")); }
|
||||
public get autocomplete(): string | undefined { return super.Section.get<string>("autocomplete"); }
|
||||
public get autocompleteAddParentheses(): boolean | undefined { return super.Section.get<boolean>("autocompleteAddParentheses"); }
|
||||
public get loggingLevel(): string | undefined { return super.Section.get<string>("loggingLevel"); }
|
||||
@@ -373,10 +379,10 @@ export class CppSettings extends Settings {
|
||||
public get filesExclude(): vscode.WorkspaceConfiguration | undefined { return super.Section.get<vscode.WorkspaceConfiguration>("files.exclude"); }
|
||||
public get defaultIncludePath(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.includePath"); }
|
||||
public get defaultDefines(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.defines"); }
|
||||
public get defaultDotconfig(): string | undefined { return super.Section.get<string>("default.dotConfig"); }
|
||||
public get defaultDotconfig(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("default.dotConfig")); }
|
||||
public get defaultMacFrameworkPath(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.macFrameworkPath"); }
|
||||
public get defaultWindowsSdkVersion(): string | undefined { return super.Section.get<string>("default.windowsSdkVersion"); }
|
||||
public get defaultCompileCommands(): string | undefined { return super.Section.get<string>("default.compileCommands"); }
|
||||
public get defaultWindowsSdkVersion(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("default.windowsSdkVersion")); }
|
||||
public get defaultCompileCommands(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("default.compileCommands")); }
|
||||
public get defaultForcedInclude(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.forcedInclude"); }
|
||||
public get defaultIntelliSenseMode(): string | undefined { return super.Section.get<string>("default.intelliSenseMode"); }
|
||||
public get defaultCompilerPath(): string | undefined { return super.Section.get<string | null>("default.compilerPath") ?? undefined; }
|
||||
@@ -403,17 +409,17 @@ export class CppSettings extends Settings {
|
||||
public get defaultCompilerArgs(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.compilerArgs"); }
|
||||
public get defaultCStandard(): string | undefined { return super.Section.get<string>("default.cStandard"); }
|
||||
public get defaultCppStandard(): string | undefined { return super.Section.get<string>("default.cppStandard"); }
|
||||
public get defaultConfigurationProvider(): string | undefined { return super.Section.get<string>("default.configurationProvider"); }
|
||||
public get defaultConfigurationProvider(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("default.configurationProvider")); }
|
||||
public get defaultMergeConfigurations(): boolean | undefined { return super.Section.get<boolean>("default.mergeConfigurations"); }
|
||||
public get defaultBrowsePath(): string[] | undefined { return super.getWithUndefinedDefault<string[] | null>("default.browse.path") ?? undefined; }
|
||||
public get defaultDatabaseFilename(): string | undefined { return super.Section.get<string>("default.browse.databaseFilename"); }
|
||||
public get defaultDatabaseFilename(): string | undefined { return changeBlankStringToUndefined(super.Section.get<string>("default.browse.databaseFilename")); }
|
||||
public get defaultLimitSymbolsToIncludedHeaders(): boolean | undefined { return super.Section.get<boolean>("default.browse.limitSymbolsToIncludedHeaders"); }
|
||||
public get defaultSystemIncludePath(): string[] | undefined { return super.getWithUndefinedDefault<string[]>("default.systemIncludePath"); }
|
||||
public get defaultEnableConfigurationSquiggles(): boolean | undefined { return super.Section.get<boolean>("default.enableConfigurationSquiggles"); }
|
||||
public get defaultCustomConfigurationVariables(): { [key: string]: string } | undefined { return super.Section.get<{ [key: string]: string }>("default.customConfigurationVariables"); }
|
||||
public get useBacktickCommandSubstitution(): boolean | undefined { return super.Section.get<boolean>("debugger.useBacktickCommandSubstitution"); }
|
||||
public get codeFolding(): boolean { return super.Section.get<string>("codeFolding")?.toLowerCase() === "enabled"; }
|
||||
public get caseSensitiveFileSupport(): boolean { return !isWindows() || super.Section.get<string>("caseSensitiveFileSupport") === "enabled" ; }
|
||||
public get caseSensitiveFileSupport(): boolean { return !isWindows() || super.Section.get<string>("caseSensitiveFileSupport") === "enabled"; }
|
||||
public get doxygenSectionTags(): string[] | undefined { return super.Section.get<string[]>("doxygen.sectionTags"); }
|
||||
public get hover(): string | undefined { return super.Section.get<string>("hover"); }
|
||||
public get legacyCompilerArgsBehavior(): boolean | undefined { return super.Section.get<boolean>("legacyCompilerArgsBehavior"); }
|
||||
@@ -897,7 +903,7 @@ export class CppSettings extends Settings {
|
||||
if (this.formattingEngine !== "default") {
|
||||
return this.formattingEngine === "vcformat";
|
||||
}
|
||||
if (this.clangFormatStyle !== "file") {
|
||||
if (this.clangFormatStyle && this.clangFormatStyle !== "file") {
|
||||
// If a clang-format style other than file is specified, don't try to switch to vcFormat.
|
||||
return false;
|
||||
}
|
||||
@@ -913,14 +919,18 @@ export class CppSettings extends Settings {
|
||||
const keys: string[] = Object.keys(editorConfigSettings);
|
||||
for (let i: number = 0; i < keys.length; ++i) {
|
||||
if (keys[i].startsWith("cpp_")) {
|
||||
foundEditorConfigWithVcFormatSettings = true;
|
||||
const didEditorConfigNotice: PersistentState<boolean> = new PersistentState<boolean>("Cpp.didEditorConfigNotice", false);
|
||||
if (!didEditorConfigNotice.Value) {
|
||||
vscode.window.showInformationMessage(localize({ key: "editorconfig.default.behavior", comment: ["Single-quotes are used here, as this message is displayed in a context that does not render markdown. Do not change them to back-ticks. Do not change the contents of the single-quoted text."] },
|
||||
"Code formatting is using settings from .editorconfig instead of .clang-format. For more information, see the documentation for the 'default' value of the 'C_Cpp.formatting' setting."));
|
||||
didEditorConfigNotice.Value = true;
|
||||
const cppCheck: string = keys[i].substring(4);
|
||||
if (cppCheck.startsWith("indent_") || cppCheck.startsWith("new_line_") ||
|
||||
cppCheck.startsWith("space_") || cppCheck.startsWith("wrap_")) {
|
||||
foundEditorConfigWithVcFormatSettings = true;
|
||||
const didEditorConfigNotice: PersistentState<boolean> = new PersistentState<boolean>("Cpp.didEditorConfigNotice", false);
|
||||
if (!didEditorConfigNotice.Value) {
|
||||
vscode.window.showInformationMessage(localize({ key: "editorconfig.default.behavior", comment: ["Single-quotes are used here, as this message is displayed in a context that does not render markdown. Do not change them to back-ticks. Do not change the contents of the single-quoted text."] },
|
||||
"Code formatting is using settings from .editorconfig instead of .clang-format. For more information, see the documentation for the 'default' value of the 'C_Cpp.formatting' setting."));
|
||||
didEditorConfigNotice.Value = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
switch (typeof editorConfigSettings.root) {
|
||||
@@ -990,7 +1000,7 @@ export class OtherSettings {
|
||||
public get editorInlayHintsEnabled(): boolean { return vscode.workspace.getConfiguration("editor.inlayHints").get<string>("enabled") !== "off"; }
|
||||
public get editorParameterHintsEnabled(): boolean | undefined { return vscode.workspace.getConfiguration("editor.parameterHints").get<boolean>("enabled"); }
|
||||
public get searchExclude(): vscode.WorkspaceConfiguration | undefined { return vscode.workspace.getConfiguration("search", this.resource).get("exclude"); }
|
||||
public get workbenchSettingsEditor (): string | undefined { return vscode.workspace.getConfiguration("workbench.settings").get<string>("editor"); }
|
||||
public get workbenchSettingsEditor(): string | undefined { return vscode.workspace.getConfiguration("workbench.settings").get<string>("editor"); }
|
||||
|
||||
public get colorTheme(): string | undefined { return vscode.workspace.getConfiguration("workbench").get<string>("colorTheme"); }
|
||||
|
||||
|
||||
+278
-141
@@ -7,35 +7,17 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { Client } from './client';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { NewUI } from './ui_new';
|
||||
import { ReferencesCommandMode, referencesCommandModeToString } from './references';
|
||||
import { getCustomConfigProviders, CustomConfigurationProviderCollection, isSameProviderExtensionId } from './customProviders';
|
||||
import * as telemetry from '../telemetry';
|
||||
import * as util from '../common';
|
||||
import { CppSettings } from './settings';
|
||||
|
||||
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
let uiPromise: Promise<UI> | undefined;
|
||||
let ui: UI;
|
||||
|
||||
export interface UI {
|
||||
isNewUI: boolean;
|
||||
activeDocumentChanged(): void;
|
||||
bind(client: Client): void;
|
||||
showConfigurations(configurationNames: string[]): Promise<number>;
|
||||
ShowConfigureIntelliSenseButton(show: boolean, client?: Client): Promise<void>;
|
||||
showConfigurationProviders(currentProvider?: string): Promise<string | undefined>;
|
||||
showCompileCommands(paths: string[]): Promise<number>;
|
||||
showWorkspaces(workspaceNames: { name: string; key: string }[]): Promise<string>;
|
||||
showParsingCommands(): Promise<number>;
|
||||
showActiveCodeAnalysisCommands(): Promise<number>;
|
||||
showIdleCodeAnalysisCommands(): Promise<number>;
|
||||
showConfigureIncludePathMessage(prompt: () => Promise<boolean>, onSkip: () => void): void;
|
||||
showConfigureCompileCommandsMessage(prompt: () => Promise<boolean>, onSkip: () => void): void;
|
||||
showConfigureCustomProviderMessage(prompt: () => Promise<boolean>, onSkip: () => void): void;
|
||||
dispose(): void;
|
||||
}
|
||||
let uiPromise: Promise<LanguageStatusUI> | undefined;
|
||||
let ui: LanguageStatusUI;
|
||||
|
||||
interface IndexableQuickPickItem extends vscode.QuickPickItem {
|
||||
index: number;
|
||||
@@ -56,32 +38,60 @@ interface ConfigurationStatus {
|
||||
priority: ConfigurationPriority;
|
||||
}
|
||||
|
||||
const commandArguments: string[] = ['oldUI']; // We report the sender of the command
|
||||
enum LanguageStatusPriority {
|
||||
First = 0,
|
||||
High = 1,
|
||||
Mid = 2,
|
||||
Low = 3
|
||||
}
|
||||
|
||||
export class OldUI implements UI {
|
||||
export enum ConfigurationType {
|
||||
AutoConfigProvider = "autoConfigProvider",
|
||||
ConfigProvider = "configProvider",
|
||||
CompileCommands = "compileCommands",
|
||||
AutoCompilerPath = "autoCompilerPath",
|
||||
CompilerPath = "compilerPath",
|
||||
NotConfigured = "notConfigured"
|
||||
}
|
||||
|
||||
const commandArguments: string[] = []; // We report the sender of the command
|
||||
|
||||
export class LanguageStatusUI {
|
||||
private currentClient: Client | undefined;
|
||||
private configStatusBarItem: vscode.StatusBarItem;
|
||||
private browseEngineStatusBarItem: vscode.StatusBarItem;
|
||||
private intelliSenseStatusBarItem: vscode.StatusBarItem;
|
||||
private browseEngineStatusItem: vscode.LanguageStatusItem;
|
||||
private intelliSenseStatusItem: vscode.LanguageStatusItem;
|
||||
private configureIntelliSenseStatusItem: vscode.StatusBarItem;
|
||||
private referencesStatusBarItem: vscode.StatusBarItem;
|
||||
private codeAnalysisStatusItem: vscode.LanguageStatusItem;
|
||||
/** **************************************************** */
|
||||
private curConfigurationStatus?: Promise<ConfigurationStatus>;
|
||||
private isParsingWorkspace: boolean = false;
|
||||
private isParsingWorkspacePaused: boolean = false;
|
||||
private isParsingFiles: boolean = false;
|
||||
private isUpdatingIntelliSense: boolean = false;
|
||||
private isRunningCodeAnalysis: boolean = false;
|
||||
private isCodeAnalysisPaused: boolean = false;
|
||||
private codeAnalysisProcessed: number = 0;
|
||||
private codeAnalysisTotal: number = 0;
|
||||
private readonly workspaceParsingRunningText: string = localize("running.tagparser.text", "Parsing Workspace");
|
||||
private readonly workspaceParsingPausedText: string = localize("paused.tagparser.text", "Parsing Workspace: Paused");
|
||||
private readonly workspaceParsingDoneText: string = localize("complete.tagparser.text", "Parsing Complete");
|
||||
private readonly workspaceParsingInitializing: string = localize("initializing.tagparser.text", "Initializing Workspace");
|
||||
private readonly workspaceParsingIndexing: string = localize("indexing.tagparser.text", "Indexing Workspace");
|
||||
private workspaceParsingStatus: string = "";
|
||||
private codeAnalysisProgram: string = "";
|
||||
private readonly parsingFilesTooltip: string = localize("c.cpp.parsing.open.files.tooltip", "Parsing open files");
|
||||
private workspaceParsingProgress: string = "";
|
||||
private readonly workspaceRescanText = localize("rescan.tagparse.text", "Rescan Workspace");
|
||||
private readonly parsingFilesTooltip: string = localize("c.cpp.parsing.open.files.tooltip", "Parsing Open Files");
|
||||
private readonly referencesPreviewTooltip: string = ` (${localize("click.to.preview", "click to preview results")})`;
|
||||
private readonly updatingIntelliSenseTooltip: string = localize("updating.intellisense.tooltip", "Updating IntelliSense");
|
||||
private runningCodeAnalysisTooltip: string = "";
|
||||
private codeAnalysisPausedTooltip: string = "";
|
||||
get isNewUI(): boolean { return false; };
|
||||
private readonly updatingIntelliSenseText: string = localize("updating.intellisense.text", "IntelliSense: Updating");
|
||||
private readonly idleIntelliSenseText: string = localize("idle.intellisense.text", "IntelliSense: Ready");
|
||||
private readonly missingIntelliSenseText: string = localize("absent.intellisense.text", "IntelliSense: Not configured");
|
||||
private readonly codeAnalysisRunningText: string = localize("running.analysis.text", "Code Analysis: Running");
|
||||
private readonly codeAnalysisPausedText: string = localize("paused.analysis.text", "Code Analysis: Paused");
|
||||
private readonly codeAnalysisModePrefix: string = localize("mode.analysis.prefix", "Code Analysis Mode: ");
|
||||
private codeAnalysProgress: string = "";
|
||||
// Prevent icons from appearing too often and for too short of a time.
|
||||
private readonly iconDelayTime: number = 1000;
|
||||
private readonly configureIntelliSenseText: string = localize("c.cpp.configureIntelliSenseStatus.text", "Configure IntelliSense");
|
||||
private readonly cppConfigureIntelliSenseText: string = localize("c.cpp.configureIntelliSenseStatus.cppText", "C/C++ Configure IntelliSense");
|
||||
|
||||
@@ -97,7 +107,7 @@ export class OldUI implements UI {
|
||||
this.configStatusBarItem.tooltip = configTooltip;
|
||||
this.ShowConfiguration = true;
|
||||
|
||||
this.referencesStatusBarItem = vscode.window.createStatusBarItem("c.cpp.references.statusbar", vscode.StatusBarAlignment.Right, 0);
|
||||
this.referencesStatusBarItem = vscode.window.createStatusBarItem(`c.cpp.references.statusbar`, vscode.StatusBarAlignment.Right, 901);
|
||||
this.referencesStatusBarItem.name = localize("c.cpp.references.statusbar", "C/C++ References Status");
|
||||
this.referencesStatusBarItem.tooltip = "";
|
||||
this.referencesStatusBarItem.command = {
|
||||
@@ -107,7 +117,7 @@ export class OldUI implements UI {
|
||||
};
|
||||
this.ShowReferencesIcon = false;
|
||||
|
||||
this.configureIntelliSenseStatusItem = vscode.window.createStatusBarItem(`c.cpp.configureIntelliSenseStatus.statusbar`, vscode.StatusBarAlignment.Right, 901);
|
||||
this.configureIntelliSenseStatusItem = vscode.window.createStatusBarItem(`c.cpp.configureIntelliSenseStatus.statusbar`, vscode.StatusBarAlignment.Right, 0);
|
||||
this.configureIntelliSenseStatusItem.name = this.cppConfigureIntelliSenseText;
|
||||
this.configureIntelliSenseStatusItem.tooltip = this.cppConfigureIntelliSenseText;
|
||||
this.configureIntelliSenseStatusItem.text = `$(warning) ${this.configureIntelliSenseText}`;
|
||||
@@ -119,90 +129,226 @@ export class OldUI implements UI {
|
||||
};
|
||||
this.ShowConfigureIntelliSenseButton(false, this.currentClient);
|
||||
|
||||
this.intelliSenseStatusBarItem = vscode.window.createStatusBarItem("c.cpp.intellisense.statusbar", vscode.StatusBarAlignment.Right, 903);
|
||||
this.intelliSenseStatusBarItem.name = localize("c.cpp.intellisense.statusbar", "C/C++ IntelliSense Status");
|
||||
this.intelliSenseStatusBarItem.tooltip = this.updatingIntelliSenseTooltip;
|
||||
this.ShowFlameIcon = false;
|
||||
this.intelliSenseStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.intellisense`, util.documentSelector);
|
||||
this.intelliSenseStatusItem.name = localize("cpptools.status.intellisense", "C/C++ IntelliSense Status");
|
||||
this.intelliSenseStatusItem.text = this.idleIntelliSenseText;
|
||||
|
||||
this.browseEngineStatusBarItem = vscode.window.createStatusBarItem("c.cpp.tagparser.statusbar", vscode.StatusBarAlignment.Right, 902);
|
||||
this.browseEngineStatusBarItem.name = localize("c.cpp.tagparser.statusbar", "C/C++ Tag Parser Status");
|
||||
this.browseEngineStatusBarItem.tooltip = localize("discovering.files.tooltip", "Discovering files");
|
||||
this.ShowDBIcon = false;
|
||||
this.browseEngineStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.tagparser`, util.documentSelector);
|
||||
this.browseEngineStatusItem.name = localize("cpptools.status.tagparser", "C/C++ Tag Parser Status");
|
||||
this.browseEngineStatusItem.detail = localize("cpptools.detail.tagparser", "Initializing...");
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.browseEngineStatusItem.command = {
|
||||
command: "C_Cpp.RescanWorkspace",
|
||||
title: this.workspaceRescanText,
|
||||
arguments: commandArguments
|
||||
};
|
||||
this.workspaceParsingStatus = this.workspaceParsingRunningText;
|
||||
|
||||
this.codeAnalysisProgram = "clang-tidy";
|
||||
this.runningCodeAnalysisTooltip = localize(
|
||||
{ key: "running.analysis.tooltip", comment: ["{0} is a program name, such as clang-tidy"] }, "Running {0}", this.codeAnalysisProgram);
|
||||
this.codeAnalysisPausedTooltip = localize(
|
||||
{ key: "code.analysis.paused.tooltip", comment: ["{0} is a program name, such as clang-tidy"] }, "{0} paused", this.codeAnalysisProgram);
|
||||
this.codeAnalysisStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Low}.codeanalysis`, util.documentSelector);
|
||||
this.codeAnalysisStatusItem.name = localize("cpptools.status.codeanalysis", "C/C++ Code Analysis Status");
|
||||
this.codeAnalysisStatusItem.text = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode();
|
||||
this.codeAnalysisStatusItem.command = {
|
||||
command: "C_Cpp.ShowIdleCodeAnalysisCommands",
|
||||
title: localize("c.cpp.codeanalysis.statusbar.runNow", "Run Now"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private set TagParseStatus(label: string) {
|
||||
this.workspaceParsingProgress = label;
|
||||
if (this.browseEngineStatusItem.command) {
|
||||
// Currently needed in order to update hover tooltip
|
||||
this.browseEngineStatusItem.command.tooltip = (this.isParsingFiles ? `${this.parsingFilesTooltip} | ` : "") + this.workspaceParsingProgress;
|
||||
this.browseEngineStatusItem.text = this.browseEngineStatusItem.text;
|
||||
}
|
||||
}
|
||||
|
||||
private setIsInitializingWorkspace(val: boolean): void {
|
||||
if (val) {
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.browseEngineStatusItem.detail = this.workspaceParsingInitializing;
|
||||
}
|
||||
}
|
||||
private setIsIndexingWorkspace(val: boolean): void {
|
||||
if (val) {
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.browseEngineStatusItem.detail = this.workspaceParsingIndexing;
|
||||
this.browseEngineStatusItem.busy = true;
|
||||
}
|
||||
}
|
||||
|
||||
private set ActiveConfig(label: string) {
|
||||
this.configStatusBarItem.text = label;
|
||||
}
|
||||
|
||||
private set TagParseStatus(label: string) {
|
||||
this.workspaceParsingStatus = label;
|
||||
this.browseEngineStatusBarItem.tooltip = (this.isParsingFiles ? `${this.parsingFilesTooltip} | ` : "") + label;
|
||||
}
|
||||
|
||||
private dbTimeout?: NodeJS.Timeout;
|
||||
private setIsParsingWorkspace(val: boolean): void {
|
||||
if (!val && this.isParsingWorkspacePaused) {
|
||||
// Unpause before handling the no longer parsing state.
|
||||
this.setIsParsingWorkspacePaused(false);
|
||||
}
|
||||
this.isParsingWorkspace = val;
|
||||
const showIcon: boolean = val || this.isParsingFiles;
|
||||
const twoStatus: boolean = val && this.isParsingFiles;
|
||||
this.ShowDBIcon = showIcon;
|
||||
this.browseEngineStatusBarItem.text = showIcon ? "$(database)" : "";
|
||||
this.browseEngineStatusBarItem.tooltip = (this.isParsingFiles ? this.parsingFilesTooltip : "")
|
||||
+ (twoStatus ? " | " : "")
|
||||
+ (val ? this.workspaceParsingStatus : "");
|
||||
|
||||
// Leave this outside for more real-time response
|
||||
this.browseEngineStatusItem.busy = showIcon;
|
||||
|
||||
if (showIcon) {
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.browseEngineStatusItem.detail = this.tagParseText();
|
||||
|
||||
if (this.dbTimeout) {
|
||||
clearTimeout(this.dbTimeout);
|
||||
this.dbTimeout = undefined;
|
||||
}
|
||||
} else {
|
||||
this.dbTimeout = setTimeout(() => {
|
||||
this.browseEngineStatusItem.text = this.workspaceParsingDoneText;
|
||||
this.browseEngineStatusItem.detail = "";
|
||||
this.browseEngineStatusItem.command = {
|
||||
command: "C_Cpp.RescanWorkspace",
|
||||
title: this.workspaceRescanText,
|
||||
arguments: commandArguments
|
||||
};
|
||||
}, this.iconDelayTime);
|
||||
}
|
||||
}
|
||||
|
||||
private tagParseText(): string {
|
||||
if (this.isParsingWorkspacePaused) {
|
||||
const twoStatus: boolean = this.isParsingFiles && this.isParsingWorkspace;
|
||||
return (this.isParsingFiles ? this.parsingFilesTooltip : "")
|
||||
+ (twoStatus ? " | " : "")
|
||||
+ (this.isParsingWorkspace ? this.workspaceParsingStatus : "");
|
||||
} else {
|
||||
return this.isParsingWorkspace ? this.workspaceParsingStatus : this.parsingFilesTooltip;
|
||||
}
|
||||
}
|
||||
|
||||
private setIsParsingWorkspacePausable(val: boolean): void {
|
||||
if (val) {
|
||||
this.browseEngineStatusBarItem.command = {
|
||||
command: "C_Cpp.ShowParsingCommands",
|
||||
title: this.browseEngineStatusBarItem.name ?? '',
|
||||
if (val && this.isParsingWorkspace) {
|
||||
this.browseEngineStatusItem.command = {
|
||||
command: "C_Cpp.PauseParsing",
|
||||
title: localize("tagparser.pause.text", "Pause"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
} else {
|
||||
this.browseEngineStatusBarItem.command = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
private setIsParsingWorkspacePaused(val: boolean): void {
|
||||
if (!this.isParsingFiles && !this.isParsingWorkspace) {
|
||||
// Ignore a pause change if no parsing is actually happening.
|
||||
return;
|
||||
}
|
||||
this.isParsingWorkspacePaused = val;
|
||||
this.browseEngineStatusItem.busy = !val || this.isParsingFiles;
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.workspaceParsingStatus = val ? this.workspaceParsingPausedText : this.workspaceParsingRunningText;
|
||||
this.browseEngineStatusItem.detail = this.tagParseText();
|
||||
this.browseEngineStatusItem.command = val ? {
|
||||
command: "C_Cpp.ResumeParsing",
|
||||
title: localize("tagparser.resume.text", "Resume"),
|
||||
arguments: commandArguments
|
||||
} : {
|
||||
command: "C_Cpp.PauseParsing",
|
||||
title: localize("tagparser.pause.text", "Pause"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
}
|
||||
|
||||
private set ShowConfiguration(show: boolean) {
|
||||
if (show) {
|
||||
this.configStatusBarItem.show();
|
||||
} else {
|
||||
this.configStatusBarItem.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private setIsCodeAnalysisPaused(val: boolean): void {
|
||||
if (!this.isRunningCodeAnalysis) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isCodeAnalysisPaused = val;
|
||||
const twoStatus: boolean = val && this.isUpdatingIntelliSense;
|
||||
this.intelliSenseStatusBarItem.tooltip = (this.isUpdatingIntelliSense ? this.updatingIntelliSenseTooltip : "")
|
||||
+ (twoStatus ? " | " : "")
|
||||
+ (val ? this.codeAnalysisPausedTooltip : this.runningCodeAnalysisTooltip);
|
||||
this.codeAnalysisStatusItem.busy = !val;
|
||||
this.codeAnalysisStatusItem.text = val ? this.codeAnalysisPausedText : this.codeAnalysisRunningText;
|
||||
}
|
||||
|
||||
private setIsParsingFiles(val: boolean): void {
|
||||
this.isParsingFiles = val;
|
||||
const showIcon: boolean = val || this.isParsingWorkspace;
|
||||
const twoStatus: boolean = val && this.isParsingWorkspace;
|
||||
this.ShowDBIcon = showIcon;
|
||||
this.browseEngineStatusBarItem.text = showIcon ? "$(database)" : "";
|
||||
this.browseEngineStatusBarItem.tooltip = (val ? this.parsingFilesTooltip : "")
|
||||
+ (twoStatus ? " | " : "")
|
||||
+ (this.isParsingWorkspace ? this.workspaceParsingStatus : "");
|
||||
|
||||
// Leave this outside for more real-time response
|
||||
this.browseEngineStatusItem.busy = val || (!this.isParsingWorkspacePaused && this.isParsingWorkspace);
|
||||
|
||||
if (showIcon) {
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.browseEngineStatusItem.detail = this.tagParseText();
|
||||
|
||||
if (this.dbTimeout) {
|
||||
clearTimeout(this.dbTimeout);
|
||||
this.dbTimeout = undefined;
|
||||
}
|
||||
} else {
|
||||
this.dbTimeout = setTimeout(() => {
|
||||
this.browseEngineStatusItem.text = this.workspaceParsingDoneText;
|
||||
this.browseEngineStatusItem.detail = "";
|
||||
this.browseEngineStatusItem.command = {
|
||||
command: "C_Cpp.RescanWorkspace",
|
||||
title: this.workspaceRescanText,
|
||||
arguments: commandArguments
|
||||
};
|
||||
}, this.iconDelayTime);
|
||||
}
|
||||
}
|
||||
|
||||
private flameTimeout?: NodeJS.Timeout;
|
||||
private setIsUpdatingIntelliSense(val: boolean): void {
|
||||
this.isUpdatingIntelliSense = val;
|
||||
const showIcon: boolean = val || this.isRunningCodeAnalysis;
|
||||
const twoStatus: boolean = val && this.isRunningCodeAnalysis;
|
||||
this.ShowFlameIcon = showIcon;
|
||||
this.intelliSenseStatusBarItem.text = showIcon ? "$(flame)" : "";
|
||||
this.intelliSenseStatusBarItem.tooltip = (val ? this.updatingIntelliSenseTooltip : "")
|
||||
+ (twoStatus ? " | " : "")
|
||||
+ (this.isRunningCodeAnalysis ? this.runningCodeAnalysisTooltip : "");
|
||||
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
|
||||
|
||||
if (settings.intelliSenseEngine === "disabled") {
|
||||
this.intelliSenseStatusItem.text = this.missingIntelliSenseText;
|
||||
this.intelliSenseStatusItem.command = {
|
||||
command: "C_Cpp.SelectDefaultCompiler",
|
||||
title: localize("intellisense.select.text", "Select a Compiler"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
this.intelliSenseStatusItem.busy = val;
|
||||
|
||||
if (this.flameTimeout) {
|
||||
clearTimeout(this.flameTimeout);
|
||||
}
|
||||
|
||||
if (val) {
|
||||
this.intelliSenseStatusItem.text = "$(flame)";
|
||||
this.intelliSenseStatusItem.detail = this.updatingIntelliSenseText;
|
||||
this.flameTimeout = undefined;
|
||||
} else {
|
||||
this.flameTimeout = setTimeout(() => {
|
||||
if (this.intelliSenseStatusItem) {
|
||||
this.intelliSenseStatusItem.text = this.idleIntelliSenseText;
|
||||
this.intelliSenseStatusItem.detail = "";
|
||||
}
|
||||
}, this.iconDelayTime);
|
||||
}
|
||||
this.intelliSenseStatusItem.command = {
|
||||
command: "C_Cpp.RestartIntelliSenseForFile",
|
||||
title: localize("rescan.intellisense.text", "Rescan"),
|
||||
tooltip: localize("rescan.intellisense.tooltip", "Rescan IntelliSense"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
}
|
||||
|
||||
private codeAnalysisCurrentMode(): string {
|
||||
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
|
||||
const state: string = (settings.codeAnalysisRunAutomatically && settings.clangTidyEnabled)
|
||||
? localize("mode.codeanalysis.status.automatic", "Automatic")
|
||||
: localize("mode.codeanalysis.status.manual", "Manual");
|
||||
return state;
|
||||
}
|
||||
|
||||
private setIsRunningCodeAnalysis(val: boolean): void {
|
||||
@@ -212,23 +358,32 @@ export class OldUI implements UI {
|
||||
this.isCodeAnalysisPaused = false;
|
||||
}
|
||||
this.isRunningCodeAnalysis = val;
|
||||
const showIcon: boolean = val || this.isUpdatingIntelliSense;
|
||||
const twoStatus: boolean = val && this.isUpdatingIntelliSense;
|
||||
this.ShowFlameIcon = showIcon;
|
||||
this.intelliSenseStatusBarItem.text = showIcon ? "$(flame)" : "";
|
||||
this.intelliSenseStatusBarItem.tooltip = (this.isUpdatingIntelliSense ? this.updatingIntelliSenseTooltip : "")
|
||||
+ (twoStatus ? " | " : "")
|
||||
+ (val ? this.runningCodeAnalysisTooltip : "");
|
||||
this.intelliSenseStatusBarItem.command = val ? {
|
||||
this.codeAnalysisStatusItem.busy = val;
|
||||
const activeText: string = this.isCodeAnalysisPaused ? this.codeAnalysisPausedText : this.codeAnalysisRunningText;
|
||||
const idleText: string = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode();
|
||||
this.codeAnalysisStatusItem.text = val ? activeText : idleText;
|
||||
this.codeAnalysisStatusItem.command = val ? {
|
||||
command: "C_Cpp.ShowActiveCodeAnalysisCommands",
|
||||
title: this.intelliSenseStatusBarItem.name ?? '',
|
||||
title: localize("c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions", "Options"),
|
||||
// Make sure not to overwrite current progress
|
||||
tooltip: this.codeAnalysisStatusItem.command?.tooltip ?? localize("startup.codeanalysis.status", "Starting..."),
|
||||
arguments: commandArguments
|
||||
} : undefined;
|
||||
} : {
|
||||
command: "C_Cpp.ShowIdleCodeAnalysisCommands",
|
||||
title: localize("c.cpp.codeanalysis.statusbar.showRunNowOptions", "Run Now"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
}
|
||||
|
||||
private updateCodeAnalysisTooltip(): void {
|
||||
this.runningCodeAnalysisTooltip = localize({ key: "running.analysis.processed.tooltip", comment: ["{0} is a program name, such as clang-tidy"] }, "Running {0}: {1} / {2} ({3}%)", this.codeAnalysisProgram,
|
||||
this.codeAnalysProgress = localize("running.analysis.processed.tooltip", "Running: {0} / {1} ({2}%)",
|
||||
this.codeAnalysisProcessed, Math.max(this.codeAnalysisTotal, 1), Math.floor(100 * this.codeAnalysisProcessed / Math.max(this.codeAnalysisTotal, 1)));
|
||||
|
||||
if (this.codeAnalysisStatusItem.command) {
|
||||
this.codeAnalysisStatusItem.command.tooltip = this.codeAnalysProgress;
|
||||
this.codeAnalysisStatusItem.text = this.codeAnalysisStatusItem.text;
|
||||
|
||||
}
|
||||
this.setIsRunningCodeAnalysis(true);
|
||||
}
|
||||
|
||||
@@ -269,33 +424,6 @@ export class OldUI implements UI {
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent icons from appearing too often and for too short of a time.
|
||||
private readonly iconDelayTime: number = 1000;
|
||||
|
||||
private dbTimeout?: NodeJS.Timeout;
|
||||
private set ShowDBIcon(show: boolean) {
|
||||
if (this.dbTimeout) {
|
||||
clearTimeout(this.dbTimeout);
|
||||
}
|
||||
if (show && (this.isParsingWorkspace || this.isParsingFiles)) {
|
||||
this.dbTimeout = setTimeout(() => { this.browseEngineStatusBarItem.show(); }, this.iconDelayTime);
|
||||
} else {
|
||||
this.dbTimeout = setTimeout(() => { this.browseEngineStatusBarItem.hide(); }, this.iconDelayTime);
|
||||
}
|
||||
}
|
||||
|
||||
private flameTimeout?: NodeJS.Timeout;
|
||||
private set ShowFlameIcon(show: boolean) {
|
||||
if (this.flameTimeout) {
|
||||
clearTimeout(this.flameTimeout);
|
||||
}
|
||||
if (show && (this.isUpdatingIntelliSense || this.isRunningCodeAnalysis)) {
|
||||
this.flameTimeout = setTimeout(() => { this.intelliSenseStatusBarItem.show(); }, this.iconDelayTime);
|
||||
} else {
|
||||
this.flameTimeout = setTimeout(() => { this.intelliSenseStatusBarItem.hide(); }, this.iconDelayTime);
|
||||
}
|
||||
}
|
||||
|
||||
private set ShowReferencesIcon(show: boolean) {
|
||||
if (show && this.ReferencesCommand !== ReferencesCommandMode.None) {
|
||||
this.referencesStatusBarItem.show();
|
||||
@@ -304,24 +432,23 @@ export class OldUI implements UI {
|
||||
}
|
||||
}
|
||||
|
||||
private set ShowConfiguration(show: boolean) {
|
||||
if (show) {
|
||||
this.configStatusBarItem.show();
|
||||
} else {
|
||||
this.configStatusBarItem.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private showConfigureIntelliSenseButton: boolean = false;
|
||||
|
||||
private configureIntelliSenseTimeout?: NodeJS.Timeout;
|
||||
|
||||
public async ShowConfigureIntelliSenseButton(show: boolean, client?: Client): Promise<void> {
|
||||
if (!await telemetry.showStatusBarIntelliSenseButton() || client !== this.currentClient) {
|
||||
public async ShowConfigureIntelliSenseButton(show: boolean, client?: Client, configurationType?: ConfigurationType, sender?: string): Promise<void> {
|
||||
if (client !== this.currentClient) {
|
||||
return;
|
||||
}
|
||||
if (configurationType !== undefined && sender !== undefined) {
|
||||
const showButton: string = show ? 'true' : 'false';
|
||||
telemetry.logLanguageServerEvent('showConfigureIntelliSenseButton', { configurationType, sender, showButton });
|
||||
}
|
||||
|
||||
if (!await telemetry.showStatusBarIntelliSenseButton()) {
|
||||
return;
|
||||
}
|
||||
this.showConfigureIntelliSenseButton = show;
|
||||
if (client) {
|
||||
if (client !== undefined) {
|
||||
client.setShowConfigureIntelliSenseButton(show);
|
||||
}
|
||||
if (show) {
|
||||
@@ -381,6 +508,8 @@ export class OldUI implements UI {
|
||||
}
|
||||
|
||||
public bind(client: Client): void {
|
||||
client.InitializingWorkspaceChanged(value => { this.setIsInitializingWorkspace(value); });
|
||||
client.IndexingWorkspaceChanged(value => { this.setIsIndexingWorkspace(value); });
|
||||
client.ParsingWorkspaceChanged(value => { this.setIsParsingWorkspace(value); });
|
||||
client.ParsingWorkspacePausableChanged(value => { this.setIsParsingWorkspacePausable(value); });
|
||||
client.ParsingWorkspacePausedChanged(value => { this.setIsParsingWorkspacePaused(value); });
|
||||
@@ -491,7 +620,17 @@ export class OldUI implements UI {
|
||||
return (selection) ? selection.index : -1;
|
||||
}
|
||||
|
||||
public async showIdleCodeAnalysisCommands(): Promise<number> { return -1; }
|
||||
public async showIdleCodeAnalysisCommands(): Promise<number> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = this.selectACommandString;
|
||||
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
items.push({ label: localize("active.analysis", "Run Code Analysis on Active File"), description: "", index: 0 });
|
||||
items.push({ label: localize("all.analysis", "Run Code Analysis on All Files"), description: "", index: 1 });
|
||||
items.push({ label: localize("open.analysis", "Run Code Analysis on Open Files"), description: "", index: 2 });
|
||||
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
|
||||
return (selection) ? selection.index : -1;
|
||||
}
|
||||
|
||||
public showConfigureIncludePathMessage(prompt: () => Promise<boolean>, onSkip: () => void): void {
|
||||
setTimeout(() => {
|
||||
@@ -538,23 +677,21 @@ export class OldUI implements UI {
|
||||
|
||||
public dispose(): void {
|
||||
this.configStatusBarItem.dispose();
|
||||
this.browseEngineStatusBarItem.dispose();
|
||||
this.intelliSenseStatusBarItem.dispose();
|
||||
this.browseEngineStatusItem.dispose();
|
||||
this.intelliSenseStatusItem.dispose();
|
||||
this.referencesStatusBarItem.dispose();
|
||||
this.codeAnalysisStatusItem.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
export async function getUI(): Promise<UI> {
|
||||
export async function getUI(): Promise<LanguageStatusUI> {
|
||||
if (!uiPromise) {
|
||||
uiPromise = _getUI();
|
||||
}
|
||||
return uiPromise;
|
||||
}
|
||||
|
||||
async function _getUI(): Promise<UI> {
|
||||
if (!ui) {
|
||||
const useNewUI: boolean = await telemetry.showLanguageStatusExperiment();
|
||||
ui = useNewUI ? new NewUI() : new OldUI();
|
||||
}
|
||||
async function _getUI(): Promise<LanguageStatusUI> {
|
||||
ui = new LanguageStatusUI();
|
||||
return ui;
|
||||
}
|
||||
|
||||
@@ -1,670 +0,0 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { Client } from './client';
|
||||
import { ReferencesCommandMode, referencesCommandModeToString } from './references';
|
||||
import { getCustomConfigProviders, CustomConfigurationProviderCollection, isSameProviderExtensionId } from './customProviders';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { setTimeout } from 'timers';
|
||||
import { CppSettings } from './settings';
|
||||
import { UI } from './ui';
|
||||
import * as telemetry from '../telemetry';
|
||||
import * as util from '../common';
|
||||
|
||||
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
interface IndexableQuickPickItem extends vscode.QuickPickItem {
|
||||
index: number;
|
||||
}
|
||||
interface KeyedQuickPickItem extends vscode.QuickPickItem {
|
||||
key: string;
|
||||
}
|
||||
|
||||
// Higher numbers mean greater priority.
|
||||
enum ConfigurationPriority {
|
||||
IncludePath = 1,
|
||||
CompileCommands = 2,
|
||||
CustomProvider = 3,
|
||||
}
|
||||
|
||||
interface ConfigurationStatus {
|
||||
configured: boolean;
|
||||
priority: ConfigurationPriority;
|
||||
}
|
||||
|
||||
enum LanguageStatusPriority {
|
||||
First = 0,
|
||||
High = 1,
|
||||
Mid = 2,
|
||||
Low = 3
|
||||
}
|
||||
|
||||
const commandArguments: string[] = ['newUI']; // We report the sender of the command
|
||||
|
||||
export class NewUI implements UI {
|
||||
private currentClient: Client | undefined;
|
||||
private configStatusBarItem: vscode.StatusBarItem;
|
||||
private browseEngineStatusItem: vscode.LanguageStatusItem;
|
||||
private intelliSenseStatusItem: vscode.LanguageStatusItem;
|
||||
private configureIntelliSenseStatusItem: vscode.StatusBarItem;
|
||||
private referencesStatusBarItem: vscode.StatusBarItem;
|
||||
private codeAnalysisStatusItem: vscode.LanguageStatusItem;
|
||||
/** **************************************************** */
|
||||
private curConfigurationStatus?: Promise<ConfigurationStatus>;
|
||||
private isParsingWorkspace: boolean = false;
|
||||
private isParsingWorkspacePaused: boolean = false;
|
||||
private isParsingFiles: boolean = false;
|
||||
private isRunningCodeAnalysis: boolean = false;
|
||||
private isCodeAnalysisPaused: boolean = false;
|
||||
private codeAnalysisProcessed: number = 0;
|
||||
private codeAnalysisTotal: number = 0;
|
||||
private readonly workspaceParsingRunningText: string = localize("running.tagparser.text", "Parsing Workspace");
|
||||
private readonly workspaceParsingPausedText: string = localize("paused.tagparser.text", "Parsing Workspace: Paused");
|
||||
private readonly workspaceParsingDoneText: string = localize("complete.tagparser.text", "Parsing Complete");
|
||||
private readonly workspaceParsingInitializing: string = localize("initializing.tagparser.text", "Initializing Workspace");
|
||||
private readonly workspaceParsingIndexing: string = localize("indexing.tagparser.text", "Indexing Workspace");
|
||||
private workspaceParsingStatus: string = "";
|
||||
private workspaceParsingProgress: string = "";
|
||||
private readonly workspaceRescanText = localize("rescan.tagparse.text", "Rescan Workspace");
|
||||
private readonly parsingFilesTooltip: string = localize("c.cpp.parsing.open.files.tooltip", "Parsing Open Files");
|
||||
private readonly referencesPreviewTooltip: string = ` (${localize("click.to.preview", "click to preview results")})`;
|
||||
private readonly updatingIntelliSenseText: string = localize("updating.intellisense.text", "IntelliSense: Updating");
|
||||
private readonly idleIntelliSenseText: string = localize("idle.intellisense.text", "IntelliSense: Ready");
|
||||
private readonly missingIntelliSenseText: string = localize("absent.intellisense.text", "IntelliSense: Not configured");
|
||||
private readonly codeAnalysisRunningText: string = localize("running.analysis.text", "Code Analysis: Running");
|
||||
private readonly codeAnalysisPausedText: string = localize("paused.analysis.text", "Code Analysis: Paused");
|
||||
private readonly codeAnalysisModePrefix: string = localize("mode.analysis.prefix", "Code Analysis Mode: ");
|
||||
private codeAnalysProgress: string = "";
|
||||
// Prevent icons from appearing too often and for too short of a time.
|
||||
private readonly iconDelayTime: number = 1000;
|
||||
get isNewUI(): boolean { return true; };
|
||||
private readonly configureIntelliSenseText: string = localize("c.cpp.configureIntelliSenseStatus.text", "Configure IntelliSense");
|
||||
private readonly cppConfigureIntelliSenseText: string = localize("c.cpp.configureIntelliSenseStatus.cppText", "C/C++ Configure IntelliSense");
|
||||
|
||||
constructor() {
|
||||
const configTooltip: string = localize("c.cpp.configuration.tooltip", "C/C++ Configuration");
|
||||
this.configStatusBarItem = vscode.window.createStatusBarItem("c.cpp.configuration.tooltip", vscode.StatusBarAlignment.Right, 0);
|
||||
this.configStatusBarItem.name = configTooltip;
|
||||
this.configStatusBarItem.command = {
|
||||
command: "C_Cpp.ConfigurationSelect",
|
||||
title: configTooltip,
|
||||
arguments: commandArguments
|
||||
};
|
||||
this.configStatusBarItem.tooltip = configTooltip;
|
||||
this.ShowConfiguration = true;
|
||||
|
||||
this.referencesStatusBarItem = vscode.window.createStatusBarItem(`c.cpp.references.statusbar`, vscode.StatusBarAlignment.Right, 901);
|
||||
this.referencesStatusBarItem.name = localize("c.cpp.references.statusbar", "C/C++ References Status");
|
||||
this.referencesStatusBarItem.tooltip = "";
|
||||
this.referencesStatusBarItem.command = {
|
||||
command: "C_Cpp.ShowReferencesProgress",
|
||||
title: this.referencesStatusBarItem.name,
|
||||
arguments: commandArguments
|
||||
};
|
||||
this.ShowReferencesIcon = false;
|
||||
|
||||
this.configureIntelliSenseStatusItem = vscode.window.createStatusBarItem(`c.cpp.configureIntelliSenseStatus.statusbar`, vscode.StatusBarAlignment.Right, 0);
|
||||
this.configureIntelliSenseStatusItem.name = this.cppConfigureIntelliSenseText;
|
||||
this.configureIntelliSenseStatusItem.tooltip = this.cppConfigureIntelliSenseText;
|
||||
this.configureIntelliSenseStatusItem.text = `$(warning) ${this.configureIntelliSenseText}`;
|
||||
this.configureIntelliSenseStatusItem.backgroundColor = new vscode.ThemeColor('statusBarItem.warningBackground');
|
||||
this.configureIntelliSenseStatusItem.command = {
|
||||
command: "C_Cpp.SelectIntelliSenseConfiguration",
|
||||
title: this.configureIntelliSenseStatusItem.name,
|
||||
arguments: ['statusBar']
|
||||
};
|
||||
this.ShowConfigureIntelliSenseButton(false, this.currentClient);
|
||||
|
||||
this.intelliSenseStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.intellisense`, util.documentSelector);
|
||||
this.intelliSenseStatusItem.name = localize("cpptools.status.intellisense", "C/C++ IntelliSense Status");
|
||||
this.intelliSenseStatusItem.text = this.idleIntelliSenseText;
|
||||
|
||||
this.browseEngineStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.tagparser`, util.documentSelector);
|
||||
this.browseEngineStatusItem.name = localize("cpptools.status.tagparser", "C/C++ Tag Parser Status");
|
||||
this.browseEngineStatusItem.detail = localize("cpptools.detail.tagparser", "Initializing...");
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.browseEngineStatusItem.command = {
|
||||
command: "C_Cpp.RescanWorkspace",
|
||||
title: this.workspaceRescanText,
|
||||
arguments: commandArguments
|
||||
};
|
||||
this.workspaceParsingStatus = this.workspaceParsingRunningText;
|
||||
|
||||
this.codeAnalysisStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Low}.codeanalysis`, util.documentSelector);
|
||||
this.codeAnalysisStatusItem.name = localize("cpptools.status.codeanalysis", "C/C++ Code Analysis Status");
|
||||
this.codeAnalysisStatusItem.text = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode();
|
||||
this.codeAnalysisStatusItem.command = {
|
||||
command: "C_Cpp.ShowIdleCodeAnalysisCommands",
|
||||
title: localize("c.cpp.codeanalysis.statusbar.runNow", "Run Now"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private set TagParseStatus(label: string) {
|
||||
this.workspaceParsingProgress = label;
|
||||
if (this.browseEngineStatusItem.command) {
|
||||
// Currently needed in order to update hover tooltip
|
||||
this.browseEngineStatusItem.command.tooltip = (this.isParsingFiles ? `${this.parsingFilesTooltip} | ` : "") + this.workspaceParsingProgress;
|
||||
this.browseEngineStatusItem.text = this.browseEngineStatusItem.text;
|
||||
}
|
||||
}
|
||||
|
||||
private setIsInitializingWorkspace(val: boolean): void {
|
||||
if (val) {
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.browseEngineStatusItem.detail = this.workspaceParsingInitializing;
|
||||
}
|
||||
}
|
||||
private setIsIndexingWorkspace(val: boolean): void {
|
||||
if (val) {
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.browseEngineStatusItem.detail = this.workspaceParsingIndexing;
|
||||
this.browseEngineStatusItem.busy = true;
|
||||
}
|
||||
}
|
||||
|
||||
private set ActiveConfig(label: string) {
|
||||
this.configStatusBarItem.text = label;
|
||||
}
|
||||
|
||||
private dbTimeout?: NodeJS.Timeout;
|
||||
private setIsParsingWorkspace(val: boolean): void {
|
||||
if (!val && this.isParsingWorkspacePaused) {
|
||||
// Unpause before handling the no longer parsing state.
|
||||
this.setIsParsingWorkspacePaused(false);
|
||||
}
|
||||
this.isParsingWorkspace = val;
|
||||
const showIcon: boolean = val || this.isParsingFiles;
|
||||
|
||||
// Leave this outside for more real-time response
|
||||
this.browseEngineStatusItem.busy = showIcon;
|
||||
|
||||
if (showIcon) {
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.browseEngineStatusItem.detail = this.tagParseText();
|
||||
|
||||
if (this.dbTimeout) {
|
||||
clearTimeout(this.dbTimeout);
|
||||
this.dbTimeout = undefined;
|
||||
}
|
||||
} else {
|
||||
this.dbTimeout = setTimeout(() => {
|
||||
this.browseEngineStatusItem.text = this.workspaceParsingDoneText;
|
||||
this.browseEngineStatusItem.detail = "";
|
||||
this.browseEngineStatusItem.command = {
|
||||
command: "C_Cpp.RescanWorkspace",
|
||||
title: this.workspaceRescanText,
|
||||
arguments: commandArguments
|
||||
};
|
||||
}, this.iconDelayTime);
|
||||
}
|
||||
}
|
||||
|
||||
private tagParseText(): string {
|
||||
if (this.isParsingWorkspacePaused) {
|
||||
const twoStatus: boolean = this.isParsingFiles && this.isParsingWorkspace;
|
||||
return (this.isParsingFiles ? this.parsingFilesTooltip : "")
|
||||
+ (twoStatus ? " | " : "")
|
||||
+ (this.isParsingWorkspace ? this.workspaceParsingStatus : "");
|
||||
} else {
|
||||
return this.isParsingWorkspace ? this.workspaceParsingStatus : this.parsingFilesTooltip;
|
||||
}
|
||||
}
|
||||
|
||||
private setIsParsingWorkspacePausable(val: boolean): void {
|
||||
if (val && this.isParsingWorkspace) {
|
||||
this.browseEngineStatusItem.command = {
|
||||
command: "C_Cpp.PauseParsing",
|
||||
title: localize("tagparser.pause.text", "Pause"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private setIsParsingWorkspacePaused(val: boolean): void {
|
||||
if (!this.isParsingFiles && !this.isParsingWorkspace) {
|
||||
// Ignore a pause change if no parsing is actually happening.
|
||||
return;
|
||||
}
|
||||
this.isParsingWorkspacePaused = val;
|
||||
this.browseEngineStatusItem.busy = !val || this.isParsingFiles;
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.workspaceParsingStatus = val ? this.workspaceParsingPausedText : this.workspaceParsingRunningText;
|
||||
this.browseEngineStatusItem.detail = this.tagParseText();
|
||||
this.browseEngineStatusItem.command = val ? {
|
||||
command: "C_Cpp.ResumeParsing",
|
||||
title: localize("tagparser.resume.text", "Resume"),
|
||||
arguments: commandArguments
|
||||
} : {
|
||||
command: "C_Cpp.PauseParsing",
|
||||
title: localize("tagparser.pause.text", "Pause"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
}
|
||||
|
||||
private set ShowConfiguration(show: boolean) {
|
||||
if (show) {
|
||||
this.configStatusBarItem.show();
|
||||
} else {
|
||||
this.configStatusBarItem.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private setIsCodeAnalysisPaused(val: boolean): void {
|
||||
if (!this.isRunningCodeAnalysis) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isCodeAnalysisPaused = val;
|
||||
this.codeAnalysisStatusItem.busy = !val;
|
||||
this.codeAnalysisStatusItem.text = val ? this.codeAnalysisPausedText : this.codeAnalysisRunningText;
|
||||
}
|
||||
|
||||
private setIsParsingFiles(val: boolean): void {
|
||||
this.isParsingFiles = val;
|
||||
const showIcon: boolean = val || this.isParsingWorkspace;
|
||||
|
||||
// Leave this outside for more real-time response
|
||||
this.browseEngineStatusItem.busy = val || (!this.isParsingWorkspacePaused && this.isParsingWorkspace);
|
||||
|
||||
if (showIcon) {
|
||||
this.browseEngineStatusItem.text = "$(database)";
|
||||
this.browseEngineStatusItem.detail = this.tagParseText();
|
||||
|
||||
if (this.dbTimeout) {
|
||||
clearTimeout(this.dbTimeout);
|
||||
this.dbTimeout = undefined;
|
||||
}
|
||||
} else {
|
||||
this.dbTimeout = setTimeout(() => {
|
||||
this.browseEngineStatusItem.text = this.workspaceParsingDoneText;
|
||||
this.browseEngineStatusItem.detail = "";
|
||||
this.browseEngineStatusItem.command = {
|
||||
command: "C_Cpp.RescanWorkspace",
|
||||
title: this.workspaceRescanText,
|
||||
arguments: commandArguments
|
||||
};
|
||||
}, this.iconDelayTime);
|
||||
}
|
||||
}
|
||||
|
||||
private flameTimeout?: NodeJS.Timeout;
|
||||
private setIsUpdatingIntelliSense(val: boolean): void {
|
||||
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
|
||||
|
||||
// TODO: Integrate with Tarik's feature to determine if compiler/bare-IntelliSense is configured
|
||||
if (settings.intelliSenseEngine === "disabled") {
|
||||
this.intelliSenseStatusItem.text = this.missingIntelliSenseText;
|
||||
this.intelliSenseStatusItem.command = {
|
||||
command: "C_Cpp.SelectDefaultCompiler",
|
||||
title: localize("intellisense.select.text", "Select a Compiler"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
this.intelliSenseStatusItem.busy = val;
|
||||
|
||||
if (this.flameTimeout) {
|
||||
clearTimeout(this.flameTimeout);
|
||||
}
|
||||
|
||||
if (val) {
|
||||
this.intelliSenseStatusItem.text = "$(flame)";
|
||||
this.intelliSenseStatusItem.detail = this.updatingIntelliSenseText;
|
||||
this.flameTimeout = undefined;
|
||||
} else {
|
||||
this.flameTimeout = setTimeout(() => {
|
||||
if (this.intelliSenseStatusItem) {
|
||||
this.intelliSenseStatusItem.text = this.idleIntelliSenseText;
|
||||
this.intelliSenseStatusItem.detail = "";
|
||||
}
|
||||
}, this.iconDelayTime);
|
||||
}
|
||||
this.intelliSenseStatusItem.command = {
|
||||
command: "C_Cpp.RestartIntelliSenseForFile",
|
||||
title: localize("rescan.intellisense.text", "Rescan"),
|
||||
tooltip: localize("rescan.intellisense.tooltip", "Rescan IntelliSense"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
}
|
||||
|
||||
private codeAnalysisCurrentMode(): string {
|
||||
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
|
||||
const state: string = (settings.codeAnalysisRunAutomatically && settings.clangTidyEnabled)
|
||||
? localize("mode.codeanalysis.status.automatic", "Automatic")
|
||||
: localize("mode.codeanalysis.status.manual", "Manual");
|
||||
return state;
|
||||
}
|
||||
|
||||
private setIsRunningCodeAnalysis(val: boolean): void {
|
||||
if (this.isRunningCodeAnalysis && !val) {
|
||||
this.codeAnalysisTotal = 0;
|
||||
this.codeAnalysisProcessed = 0;
|
||||
this.isCodeAnalysisPaused = false;
|
||||
}
|
||||
this.isRunningCodeAnalysis = val;
|
||||
this.codeAnalysisStatusItem.busy = val;
|
||||
const activeText: string = this.isCodeAnalysisPaused ? this.codeAnalysisPausedText : this.codeAnalysisRunningText;
|
||||
const idleText: string = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode();
|
||||
this.codeAnalysisStatusItem.text = val ? activeText : idleText;
|
||||
this.codeAnalysisStatusItem.command = val ? {
|
||||
command: "C_Cpp.ShowActiveCodeAnalysisCommands",
|
||||
title: localize("c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions", "Options"),
|
||||
// Make sure not to overwrite current progress
|
||||
tooltip: this.codeAnalysisStatusItem.command?.tooltip ?? localize("startup.codeanalysis.status", "Starting..."),
|
||||
arguments: commandArguments
|
||||
} : {
|
||||
command: "C_Cpp.ShowIdleCodeAnalysisCommands",
|
||||
title: localize("c.cpp.codeanalysis.statusbar.showRunNowOptions", "Run Now"),
|
||||
arguments: commandArguments
|
||||
};
|
||||
}
|
||||
|
||||
private updateCodeAnalysisTooltip(): void {
|
||||
this.codeAnalysProgress = localize("running.analysis.processed.tooltip", "Running: {0} / {1} ({2}%)",
|
||||
this.codeAnalysisProcessed, Math.max(this.codeAnalysisTotal, 1), Math.floor(100 * this.codeAnalysisProcessed / Math.max(this.codeAnalysisTotal, 1)));
|
||||
|
||||
if (this.codeAnalysisStatusItem.command) {
|
||||
this.codeAnalysisStatusItem.command.tooltip = this.codeAnalysProgress;
|
||||
this.codeAnalysisStatusItem.text = this.codeAnalysisStatusItem.text;
|
||||
|
||||
}
|
||||
this.setIsRunningCodeAnalysis(true);
|
||||
}
|
||||
|
||||
private setCodeAnalysisProcessed(processed: number): void {
|
||||
if (!this.isRunningCodeAnalysis) {
|
||||
return; // Occurs when a multi-root workspace is activated.
|
||||
}
|
||||
this.codeAnalysisProcessed = processed;
|
||||
if (this.codeAnalysisProcessed > this.codeAnalysisTotal) {
|
||||
this.codeAnalysisTotal = this.codeAnalysisProcessed + 1;
|
||||
}
|
||||
this.updateCodeAnalysisTooltip();
|
||||
}
|
||||
|
||||
private setCodeAnalysisTotal(total: number): void {
|
||||
if (!this.isRunningCodeAnalysis) {
|
||||
return; // Occurs when a multi-root workspace is activated.
|
||||
}
|
||||
this.codeAnalysisTotal = total;
|
||||
this.updateCodeAnalysisTooltip();
|
||||
}
|
||||
|
||||
private get ReferencesCommand(): ReferencesCommandMode {
|
||||
return this.referencesStatusBarItem.tooltip === "" ? ReferencesCommandMode.None :
|
||||
(this.referencesStatusBarItem.tooltip === referencesCommandModeToString(ReferencesCommandMode.Find) ? ReferencesCommandMode.Find :
|
||||
(this.referencesStatusBarItem.tooltip === referencesCommandModeToString(ReferencesCommandMode.Rename) ? ReferencesCommandMode.Rename :
|
||||
ReferencesCommandMode.Peek));
|
||||
}
|
||||
|
||||
private set ReferencesCommand(val: ReferencesCommandMode) {
|
||||
if (val === ReferencesCommandMode.None) {
|
||||
this.referencesStatusBarItem.text = "";
|
||||
this.ShowReferencesIcon = false;
|
||||
} else {
|
||||
this.referencesStatusBarItem.text = "$(search)";
|
||||
this.referencesStatusBarItem.tooltip = referencesCommandModeToString(val) + (val !== ReferencesCommandMode.Find ? "" : this.referencesPreviewTooltip);
|
||||
this.ShowReferencesIcon = true;
|
||||
}
|
||||
}
|
||||
|
||||
private set ShowReferencesIcon(show: boolean) {
|
||||
if (show && this.ReferencesCommand !== ReferencesCommandMode.None) {
|
||||
this.referencesStatusBarItem.show();
|
||||
} else {
|
||||
this.referencesStatusBarItem.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private showConfigureIntelliSenseButton: boolean = false;
|
||||
private configureIntelliSenseTimeout?: NodeJS.Timeout;
|
||||
|
||||
public async ShowConfigureIntelliSenseButton(show: boolean, client?: Client): Promise<void> {
|
||||
if (!await telemetry.showStatusBarIntelliSenseButton() || client !== this.currentClient) {
|
||||
return;
|
||||
}
|
||||
this.showConfigureIntelliSenseButton = show;
|
||||
if (client) {
|
||||
client.setShowConfigureIntelliSenseButton(show);
|
||||
}
|
||||
if (show) {
|
||||
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
telemetry.logLanguageServerEvent('configureIntelliSenseStatusBar');
|
||||
if (activeEditor && util.isCppOrRelated(activeEditor.document)) {
|
||||
this.configureIntelliSenseStatusItem.show();
|
||||
if (!this.configureIntelliSenseTimeout) {
|
||||
this.configureIntelliSenseTimeout = setTimeout(() => {
|
||||
this.configureIntelliSenseStatusItem.text = "$(warning)";
|
||||
}, 15000);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.configureIntelliSenseStatusItem.hide();
|
||||
if (this.configureIntelliSenseTimeout) {
|
||||
clearTimeout(this.configureIntelliSenseTimeout);
|
||||
this.configureIntelliSenseStatusItem.text = `$(warning) ${this.configureIntelliSenseText}`;
|
||||
this.configureIntelliSenseTimeout = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public activeDocumentChanged(): void {
|
||||
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
|
||||
if (!activeEditor) {
|
||||
this.ShowConfiguration = false;
|
||||
if (this.showConfigureIntelliSenseButton) {
|
||||
this.configureIntelliSenseStatusItem.hide();
|
||||
}
|
||||
} else {
|
||||
const isCppPropertiesJson: boolean = util.isCppPropertiesJson(activeEditor.document);
|
||||
if (isCppPropertiesJson) {
|
||||
vscode.languages.setTextDocumentLanguage(activeEditor.document, "jsonc");
|
||||
}
|
||||
const isCppOrRelated: boolean = isCppPropertiesJson || util.isCppOrRelated(activeEditor.document);
|
||||
|
||||
// It's sometimes desirable to see the config and icons when making changes to files with C/C++-related content.
|
||||
// TODO: Check some "AlwaysShow" setting here.
|
||||
this.ShowConfiguration = isCppOrRelated || (util.getWorkspaceIsCpp() &&
|
||||
(activeEditor.document.fileName.endsWith("tasks.json") ||
|
||||
activeEditor.document.fileName.endsWith("launch.json")));
|
||||
|
||||
if (this.showConfigureIntelliSenseButton) {
|
||||
if (isCppOrRelated && !!this.currentClient && this.currentClient.getShowConfigureIntelliSenseButton()) {
|
||||
this.configureIntelliSenseStatusItem.show();
|
||||
if (!this.configureIntelliSenseTimeout) {
|
||||
this.configureIntelliSenseTimeout = setTimeout(() => {
|
||||
this.configureIntelliSenseStatusItem.text = "$(warning)";
|
||||
}, 15000);
|
||||
}
|
||||
} else {
|
||||
this.configureIntelliSenseStatusItem.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bind(client: Client): void {
|
||||
client.InitializingWorkspaceChanged(value => { this.setIsInitializingWorkspace(value); });
|
||||
client.IndexingWorkspaceChanged(value => { this.setIsIndexingWorkspace(value); });
|
||||
client.ParsingWorkspaceChanged(value => { this.setIsParsingWorkspace(value); });
|
||||
client.ParsingWorkspacePausableChanged(value => { this.setIsParsingWorkspacePausable(value); });
|
||||
client.ParsingWorkspacePausedChanged(value => { this.setIsParsingWorkspacePaused(value); });
|
||||
client.ParsingFilesChanged(value => { this.setIsParsingFiles(value); });
|
||||
client.IntelliSenseParsingChanged(value => { this.setIsUpdatingIntelliSense(value); });
|
||||
client.RunningCodeAnalysisChanged(value => { this.setIsRunningCodeAnalysis(value); });
|
||||
client.CodeAnalysisPausedChanged(value => { this.setIsCodeAnalysisPaused(value); });
|
||||
client.CodeAnalysisProcessedChanged(value => { this.setCodeAnalysisProcessed(value); });
|
||||
client.CodeAnalysisTotalChanged(value => { this.setCodeAnalysisTotal(value); });
|
||||
client.ReferencesCommandModeChanged(value => { this.ReferencesCommand = value; });
|
||||
client.TagParserStatusChanged(value => { this.TagParseStatus = value; });
|
||||
client.ActiveConfigChanged(value => {
|
||||
this.ActiveConfig = value;
|
||||
this.currentClient = client;
|
||||
this.ShowConfigureIntelliSenseButton(client.getShowConfigureIntelliSenseButton(), client);
|
||||
});
|
||||
}
|
||||
|
||||
public async showConfigurations(configurationNames: string[]): Promise<number> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.a.configuration", "Select a Configuration...");
|
||||
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
for (let i: number = 0; i < configurationNames.length; i++) {
|
||||
items.push({ label: configurationNames[i], description: "", index: i });
|
||||
}
|
||||
items.push({ label: localize("edit.configuration.ui", "Edit Configurations (UI)"), description: "", index: configurationNames.length });
|
||||
items.push({ label: localize("edit.configuration.json", "Edit Configurations (JSON)"), description: "", index: configurationNames.length + 1 });
|
||||
|
||||
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
|
||||
return (selection) ? selection.index : -1;
|
||||
}
|
||||
|
||||
public async showConfigurationProviders(currentProvider?: string): Promise<string | undefined> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.configuration.provider", "Select a Configuration Provider...");
|
||||
const providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
|
||||
const items: KeyedQuickPickItem[] = [];
|
||||
providers.forEach(provider => {
|
||||
let label: string = provider.name;
|
||||
if (isSameProviderExtensionId(currentProvider, provider.extensionId)) {
|
||||
label += ` (${localize("active", "active")})`;
|
||||
}
|
||||
items.push({ label: label, description: "", key: provider.extensionId });
|
||||
});
|
||||
items.push({ label: `(${localize("none", "none")})`, description: localize("disable.configuration.provider", "Disable the active configuration provider, if applicable."), key: "" });
|
||||
|
||||
const selection: KeyedQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
|
||||
return (selection) ? selection.key : undefined;
|
||||
}
|
||||
|
||||
public async showCompileCommands(paths: string[]): Promise<number> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.compile.commands", "Select a compile_commands.json...");
|
||||
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
for (let i: number = 0; i < paths.length; i++) {
|
||||
items.push({ label: paths[i], description: "", index: i });
|
||||
}
|
||||
|
||||
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
|
||||
return (selection) ? selection.index : -1;
|
||||
}
|
||||
|
||||
public async showWorkspaces(workspaceNames: { name: string; key: string }[]): Promise<string> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = localize("select.workspace", "Select a workspace folder...");
|
||||
|
||||
const items: KeyedQuickPickItem[] = [];
|
||||
workspaceNames.forEach(name => items.push({ label: name.name, description: "", key: name.key }));
|
||||
|
||||
const selection: KeyedQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
|
||||
return (selection) ? selection.key : "";
|
||||
}
|
||||
|
||||
private readonly selectACommandString: string = localize("select.command", "Select a command...");
|
||||
private readonly selectACodeAnalysisCommandString: string = localize("select.code.analysis.command", "Select a code analysis command...");
|
||||
|
||||
public async showParsingCommands(): Promise<number> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = this.selectACommandString;
|
||||
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
if (this.isParsingWorkspacePaused) {
|
||||
items.push({ label: localize("resume.parsing", "Resume Workspace Parsing"), description: "", index: 1 });
|
||||
} else {
|
||||
items.push({ label: localize("pause.parsing", "Pause Workspace Parsing"), description: "", index: 0 });
|
||||
}
|
||||
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
|
||||
return (selection) ? selection.index : -1;
|
||||
}
|
||||
|
||||
public async showActiveCodeAnalysisCommands(): Promise<number> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = this.selectACodeAnalysisCommandString;
|
||||
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
items.push({ label: localize("cancel.analysis", "Cancel"), description: "", index: 0 });
|
||||
|
||||
if (this.isCodeAnalysisPaused) {
|
||||
items.push({ label: localize("resume.analysis", "Resume"), description: "", index: 2 });
|
||||
} else {
|
||||
items.push({ label: localize("pause.analysis", "Pause"), description: "", index: 1 });
|
||||
}
|
||||
items.push({ label: localize("another.analysis", "Start Another..."), description: "", index: 3 });
|
||||
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
|
||||
return (selection) ? selection.index : -1;
|
||||
}
|
||||
|
||||
public async showIdleCodeAnalysisCommands(): Promise<number> {
|
||||
const options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = this.selectACommandString;
|
||||
|
||||
const items: IndexableQuickPickItem[] = [];
|
||||
items.push({ label: localize("active.analysis", "Run Code Analysis on Active File"), description: "", index: 0 });
|
||||
items.push({ label: localize("all.analysis", "Run Code Analysis on All Files"), description: "", index: 1 });
|
||||
items.push({ label: localize("open.analysis", "Run Code Analysis on Open Files"), description: "", index: 2 });
|
||||
const selection: IndexableQuickPickItem | undefined = await vscode.window.showQuickPick(items, options);
|
||||
return (selection) ? selection.index : -1;
|
||||
}
|
||||
|
||||
public showConfigureIncludePathMessage(prompt: () => Promise<boolean>, onSkip: () => void): void {
|
||||
setTimeout(() => {
|
||||
this.showConfigurationPrompt(ConfigurationPriority.IncludePath, prompt, onSkip);
|
||||
}, 10000);
|
||||
}
|
||||
|
||||
public showConfigureCompileCommandsMessage(prompt: () => Promise<boolean>, onSkip: () => void): void {
|
||||
setTimeout(() => {
|
||||
this.showConfigurationPrompt(ConfigurationPriority.CompileCommands, prompt, onSkip);
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
public showConfigureCustomProviderMessage(prompt: () => Promise<boolean>, onSkip: () => void): void {
|
||||
this.showConfigurationPrompt(ConfigurationPriority.CustomProvider, prompt, onSkip);
|
||||
}
|
||||
|
||||
private showConfigurationPrompt(priority: ConfigurationPriority, prompt: () => Thenable<boolean>, onSkip: () => void): void {
|
||||
const showPrompt: () => Promise<ConfigurationStatus> = async () => {
|
||||
const configured: boolean = await prompt();
|
||||
return Promise.resolve({
|
||||
priority: priority,
|
||||
configured: configured
|
||||
});
|
||||
};
|
||||
|
||||
if (this.curConfigurationStatus) {
|
||||
this.curConfigurationStatus = this.curConfigurationStatus.then(result => {
|
||||
if (priority > result.priority) {
|
||||
return showPrompt();
|
||||
} else if (!result.configured) {
|
||||
return showPrompt();
|
||||
}
|
||||
onSkip();
|
||||
return Promise.resolve({
|
||||
priority: result.priority,
|
||||
configured: true
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.curConfigurationStatus = showPrompt();
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.configStatusBarItem.dispose();
|
||||
this.browseEngineStatusItem.dispose();
|
||||
this.intelliSenseStatusItem.dispose();
|
||||
this.referencesStatusBarItem.dispose();
|
||||
this.codeAnalysisStatusItem.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,19 +41,19 @@ export function setExtensionPath(path: string): void {
|
||||
extensionPath = path;
|
||||
}
|
||||
|
||||
let cachedClangFormatPath: string | null | undefined;
|
||||
export function getCachedClangFormatPath(): string | null | undefined {
|
||||
let cachedClangFormatPath: string | undefined;
|
||||
export function getCachedClangFormatPath(): string | undefined {
|
||||
return cachedClangFormatPath;
|
||||
}
|
||||
export function setCachedClangFormatPath(path: string | null): void {
|
||||
export function setCachedClangFormatPath(path: string): void {
|
||||
cachedClangFormatPath = path;
|
||||
}
|
||||
|
||||
let cachedClangTidyPath: string | null | undefined;
|
||||
export function getCachedClangTidyPath(): string | null | undefined {
|
||||
let cachedClangTidyPath: string | undefined;
|
||||
export function getCachedClangTidyPath(): string | undefined {
|
||||
return cachedClangTidyPath;
|
||||
}
|
||||
export function setCachedClangTidyPath(path: string | null): void {
|
||||
export function setCachedClangTidyPath(path: string): void {
|
||||
cachedClangTidyPath = path;
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ export function isOptionalArrayOfString(input: any): input is string[] | undefin
|
||||
|
||||
export function resolveCachePath(input: string | undefined, additionalEnvironment: { [key: string]: string | string[] }): string {
|
||||
let resolvedPath: string = "";
|
||||
if (!input) {
|
||||
if (!input || input.trim() === "") {
|
||||
// If no path is set, return empty string to language service process, where it will set the default path as
|
||||
// Windows: %LocalAppData%/Microsoft/vscode-cpptools/
|
||||
// Linux and Mac: ~/.vscode-cpptools/
|
||||
|
||||
@@ -874,6 +874,11 @@
|
||||
"description": "%c_cpp.debuggers.miDebuggerPath.description%",
|
||||
"default": "/usr/bin/gdb"
|
||||
},
|
||||
"miDebuggerArgs": {
|
||||
"type": "string",
|
||||
"description": "%c_cpp.debuggers.miDebuggerArgs.description%",
|
||||
"default": ""
|
||||
},
|
||||
"miDebuggerServerAddress": {
|
||||
"type": "string",
|
||||
"description": "%c_cpp.debuggers.miDebuggerServerAddress.description%",
|
||||
|
||||
+26
-11
@@ -517,6 +517,15 @@
|
||||
resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44"
|
||||
integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==
|
||||
|
||||
"@vscode/dts@^0.4.0":
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@vscode/dts/-/dts-0.4.0.tgz#76b7b215c3094a919e244db024d08c64483528f7"
|
||||
integrity sha512-m28fZnyS9PlzVvYHppyC3Q98U2RFIZO2srnBMvyupPBY5QkSxoNIjTV9roLaU7kE+gc+HXczH8XHPETUkt9IAA==
|
||||
dependencies:
|
||||
https-proxy-agent "^7.0.0"
|
||||
minimist "^1.2.8"
|
||||
prompts "^2.4.2"
|
||||
|
||||
"@vscode/extension-telemetry@^0.6.2":
|
||||
version "0.6.2"
|
||||
resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.6.2.tgz#b86814ee680615730da94220c2b03ea9c3c14a8e"
|
||||
@@ -718,6 +727,13 @@ agent-base@6:
|
||||
dependencies:
|
||||
debug "4"
|
||||
|
||||
agent-base@^7.0.2:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.0.tgz#536802b76bc0b34aa50195eb2442276d613e3434"
|
||||
integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==
|
||||
dependencies:
|
||||
debug "^4.3.4"
|
||||
|
||||
ajv-keywords@^3.5.2:
|
||||
version "3.5.2"
|
||||
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d"
|
||||
@@ -3015,6 +3031,14 @@ https-proxy-agent@^5.0.0:
|
||||
agent-base "6"
|
||||
debug "4"
|
||||
|
||||
https-proxy-agent@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.0.tgz#75cb70d04811685667183b31ab158d006750418a"
|
||||
integrity sha512-0euwPCRyAPSgGdzD1IVN9nJYHtBhJwb6XPfbpQcYbPCwrBidX6GzxmchnaF4sfF/jPb74Ojx5g4yTg3sixlyPw==
|
||||
dependencies:
|
||||
agent-base "^7.0.2"
|
||||
debug "4"
|
||||
|
||||
human-signals@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
|
||||
@@ -3858,7 +3882,7 @@ [email protected], minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
[email protected], minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.7:
|
||||
[email protected], minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.7, minimist@^1.2.8:
|
||||
version "1.2.7"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
|
||||
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==
|
||||
@@ -4535,7 +4559,7 @@ progress@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
|
||||
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
|
||||
|
||||
prompts@^2.1.0:
|
||||
prompts@^2.4.2:
|
||||
version "2.4.2"
|
||||
resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069"
|
||||
integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==
|
||||
@@ -5915,15 +5939,6 @@ [email protected], vscode-debugprotocol@^1.35.0:
|
||||
resolved "https://registry.yarnpkg.com/vscode-debugprotocol/-/vscode-debugprotocol-1.38.0.tgz#7a9bcd457e6642f48fabef114c0fa1c25a2fb1e7"
|
||||
integrity sha512-oam9iSjNfXSn71a8bmNsXv8k/rIKSOcllIPrFnNgxd1EMBpfnum+gb7lmRpcH0zSjGb+OH8Ncn8B5tv8srWbNQ==
|
||||
|
||||
vscode-dts@^0.3.2:
|
||||
version "0.3.3"
|
||||
resolved "https://registry.yarnpkg.com/vscode-dts/-/vscode-dts-0.3.3.tgz#e5ef3afe76182875b252cca7f449938e4a0bf28a"
|
||||
integrity sha512-JfOsWL0NvfVw0UF9bcTjlv1Onz3Ted7cgpPWKWMnHGB+72t/tn8WFDeKLZO42l2k9KJq/NGS9rFC5gZbyI4FTg==
|
||||
dependencies:
|
||||
minimist "^1.2.0"
|
||||
prompts "^2.1.0"
|
||||
rimraf "^3.0.0"
|
||||
|
||||
[email protected]:
|
||||
version "8.1.0-next.5"
|
||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.5.tgz#93fede04082a05268c735b77dae1edbb31708f33"
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
Additional binary files may be downloaded at runtime after the initial
|
||||
installation; these are governed by the more restrictive proprietary license
|
||||
terms found at [RuntimeLicenses](RuntimeLicenses).
|
||||
Additional binary files are included in the official VSIX files built and
|
||||
distributed by Microsoft; these are governed by the more restrictive proprietary
|
||||
license terms found at [RuntimeLicenses](RuntimeLicenses).
|
||||
|
||||
MIT License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user