ClangCodeModel: Tr::tr

Change-Id: I60aeadd38471cc65de250f66f0f09ba2931b3da2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-01-19 09:51:10 +01:00
parent 0454e939e1
commit 117b6f1921
22 changed files with 139 additions and 284 deletions

View File

@@ -56017,7 +56017,7 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangProjectSettingsPropertiesPage</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Pre-compiled headers:</source> <source>Pre-compiled headers:</source>
<translation>Předpřeložené hlavičky:</translation> <translation>Předpřeložené hlavičky:</translation>
@@ -56427,30 +56427,21 @@ Vytvořte, prosím, aplikaci qmldump na stránce pro nastavení verze Qt.</trans
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangCompletionAssistProcessor</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Location: %1</source> <source>Location: %1</source>
<extracomment>Parent folder for proposed #include completion</extracomment> <extracomment>Parent folder for proposed #include completion</extracomment>
<translation>Umístění: %1</translation> <translation>Umístění: %1</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangIndexer</name>
<message> <message>
<source>C++ Indexing</source> <source>C++ Indexing</source>
<translation>Indexování C++</translation> <translation>Indexování C++</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ModelManagerSupport</name>
<message> <message>
<source>Clang</source> <source>Clang</source>
<extracomment>Display name</extracomment> <extracomment>Display name</extracomment>
<translation>Clang</translation> <translation>Clang</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangProjectSettingsWidget</name>
<message> <message>
<source>Clang Settings</source> <source>Clang Settings</source>
<translation>Nastavení pro Clang</translation> <translation>Nastavení pro Clang</translation>
@@ -56463,9 +56454,6 @@ Vytvořte, prosím, aplikaci qmldump na stránce pro nastavení verze Qt.</trans
<source>All Files (*)</source> <source>All Files (*)</source>
<translation>Všechny soubory (*)</translation> <translation>Všechny soubory (*)</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::CompletionProposalsBuilder</name>
<message> <message>
<source>Is deprecated</source> <source>Is deprecated</source>
<extracomment>deprecated C++ symbol</extracomment> <extracomment>deprecated C++ symbol</extracomment>
@@ -56479,9 +56467,6 @@ Vytvořte, prosím, aplikaci qmldump na stránce pro nastavení verze Qt.</trans
<source>Signal of %1, returns %2</source> <source>Signal of %1, returns %2</source>
<translation>Signál: %1, vrací %2</translation> <translation>Signál: %1, vrací %2</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Diagnostic</name>
<message> <message>
<source>ignored</source> <source>ignored</source>
<translation>Přehlíženo</translation> <translation>Přehlíženo</translation>
@@ -56502,9 +56487,6 @@ Vytvořte, prosím, aplikaci qmldump na stránce pro nastavení verze Qt.</trans
<source>fatal</source> <source>fatal</source>
<translation>Selhání</translation> <translation>Selhání</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::PchManager</name>
<message> <message>
<source>Successfully generated PCH file &quot;%1&quot;.</source> <source>Successfully generated PCH file &quot;%1&quot;.</source>
<translation>Soubor PCH &quot;%1&quot; byl úspěšně vytvořen.</translation> <translation>Soubor PCH &quot;%1&quot; byl úspěšně vytvořen.</translation>

View File

@@ -4589,7 +4589,7 @@ F.eks., vil &quot;Revision: 15&quot; efterlade grenen ved revision 15.</translat
</message> </message>
</context> </context>
<context> <context>
<name>Clang Code Model Marks</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Code Model Warning</source> <source>Code Model Warning</source>
<translation>Kodemodel advarsel</translation> <translation>Kodemodel advarsel</translation>
@@ -4598,9 +4598,6 @@ F.eks., vil &quot;Revision: 15&quot; efterlade grenen ved revision 15.</translat
<source>Code Model Error</source> <source>Code Model Error</source>
<translation>Kodemodel fejl</translation> <translation>Kodemodel fejl</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::BackendCommunicator</name>
<message> <message>
<source>Clang Code Model: Error: The clangbackend executable &quot;%1&quot; does not exist.</source> <source>Clang Code Model: Error: The clangbackend executable &quot;%1&quot; does not exist.</source>
<translation>Clang-kodemodel: Fejl: clangbackend-eksekverbaren &quot;%1&quot; findes ikke.</translation> <translation>Clang-kodemodel: Fejl: clangbackend-eksekverbaren &quot;%1&quot; findes ikke.</translation>
@@ -4613,24 +4610,15 @@ F.eks., vil &quot;Revision: 15&quot; efterlade grenen ved revision 15.</translat
<source>Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.</source> <source>Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.</source>
<translation>Clang-kodemodel: Fejl: clangbackend-processen har afsluttet uventet og blev genstartet.</translation> <translation>Clang-kodemodel: Fejl: clangbackend-processen har afsluttet uventet og blev genstartet.</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangCompletionAssistProcessor</name>
<message> <message>
<source>Location: %1</source> <source>Location: %1</source>
<extracomment>Parent folder for proposed #include completion</extracomment> <extracomment>Parent folder for proposed #include completion</extracomment>
<translation>Placering: %1</translation> <translation>Placering: %1</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangDiagnosticManager</name>
<message> <message>
<source>Inspect available fixits</source> <source>Inspect available fixits</source>
<translation>Inspicer tilgængelige fixits</translation> <translation>Inspicer tilgængelige fixits</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangProjectSettingsWidget</name>
<message> <message>
<source>Clang Code Model</source> <source>Clang Code Model</source>
<translation>Clang-kodemodel</translation> <translation>Clang-kodemodel</translation>
@@ -4653,9 +4641,6 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere
<source>Enable MSVC-compliant template parsing</source> <source>Enable MSVC-compliant template parsing</source>
<translation>Aktivér MSVC-kompatibel skabelon-parsing</translation> <translation>Aktivér MSVC-kompatibel skabelon-parsing</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ModelManagerSupport</name>
<message> <message>
<source>Clang</source> <source>Clang</source>
<extracomment>Display name</extracomment> <extracomment>Display name</extracomment>
@@ -40296,14 +40281,7 @@ Spordataene er tabt.</translation>
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangCodeModelPlugin</name> <name>::ClangCodeModel</name>
<message>
<source>Clang Code Model</source>
<translation>Clang-kodemodel</translation>
</message>
</context>
<context>
<name>ClangDiagnosticWidget</name>
<message> <message>
<source>Clazy Issue</source> <source>Clazy Issue</source>
<translation>Clazy-problemstilling</translation> <translation>Clazy-problemstilling</translation>

View File

@@ -41357,7 +41357,7 @@ Are you sure?</source>
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangCodeModelPlugin</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Generating Compilation DB</source> <source>Generating Compilation DB</source>
<translation>Erzeuge Kompilierungsdatenbank</translation> <translation>Erzeuge Kompilierungsdatenbank</translation>
@@ -41382,9 +41382,6 @@ Are you sure?</source>
<source>Generating Clang compilation database failed: %1</source> <source>Generating Clang compilation database failed: %1</source>
<translation>Erzeugen der Clang-Kompilierungsdatenbank fehlgeschlagen: %1</translation> <translation>Erzeugen der Clang-Kompilierungsdatenbank fehlgeschlagen: %1</translation>
</message> </message>
</context>
<context>
<name>ClangDiagnosticWidget</name>
<message> <message>
<source>Clazy Issue</source> <source>Clazy Issue</source>
<translation>Clang-Problem</translation> <translation>Clang-Problem</translation>
@@ -41397,9 +41394,6 @@ Are you sure?</source>
<source>[Source: %1]</source> <source>[Source: %1]</source>
<translation>[Quelle: %1]</translation> <translation>[Quelle: %1]</translation>
</message> </message>
</context>
<context>
<name>::ClangCodeModel</name>
<message> <message>
<source>Component</source> <source>Component</source>
<translation>Komponente</translation> <translation>Komponente</translation>
@@ -50904,7 +50898,7 @@ in &quot;%2&quot; aus.
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangdClient</name> <name>::ClangCodeModel</name>
<message> <message>
<source>clangd</source> <source>clangd</source>
<translation>clangd</translation> <translation>clangd</translation>
@@ -50934,9 +50928,6 @@ in &quot;%2&quot; aus.
<source>&lt;base declaration&gt;</source> <source>&lt;base declaration&gt;</source>
<translation>&lt;Basisdeklaration&gt;</translation> <translation>&lt;Basisdeklaration&gt;</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangdFindReferences</name>
<message> <message>
<source>C++ Usages:</source> <source>C++ Usages:</source>
<translation>C++ Referenzen:</translation> <translation>C++ Referenzen:</translation>
@@ -50954,9 +50945,6 @@ in &quot;%2&quot; aus.
<translation>Dateien: <translation>Dateien:
%1</translation> %1</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangModelManagerSupport</name>
<message> <message>
<source>The use of clangd for the C/C++ code model was disabled, because it is likely that its memory requirements would be higher than what your system can handle.</source> <source>The use of clangd for the C/C++ code model was disabled, because it is likely that its memory requirements would be higher than what your system can handle.</source>
<translation>Clangd wurde für das C/C++-Codemodell deaktiviert, da dessen Speicheranforderung wahrscheinlich die Leistungsfähigkeit Ihres Systems übersteigt.</translation> <translation>Clangd wurde für das C/C++-Codemodell deaktiviert, da dessen Speicheranforderung wahrscheinlich die Leistungsfähigkeit Ihres Systems übersteigt.</translation>
@@ -50975,9 +50963,6 @@ in &quot;%2&quot; aus.
<translation>Kann Clangd nicht nutzen: Erstellen der Kompilierungsdatenbank fehlgeschlagen: <translation>Kann Clangd nicht nutzen: Erstellen der Kompilierungsdatenbank fehlgeschlagen:
%1</translation> %1</translation>
</message> </message>
</context>
<context>
<name>ClangdTextMark</name>
<message> <message>
<source>Code Model Error</source> <source>Code Model Error</source>
<translation>Codemodell-Fehler</translation> <translation>Codemodell-Fehler</translation>

View File

@@ -1718,7 +1718,7 @@ Na primjer, „Revizija: 15” će ostaviti granu na reviziji 15.</translation>
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangProjectSettingsWidget</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Global</source> <source>Global</source>
<translation>Globalno</translation> <translation>Globalno</translation>
@@ -15934,14 +15934,11 @@ Check the test environment.</source>
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::ClangAssistProposalItem</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Requires changing &quot;%1&quot; to &quot;%2&quot;</source> <source>Requires changing &quot;%1&quot; to &quot;%2&quot;</source>
<translation>Zahtijeva mijenjanje &quot;%1&quot; u &quot;%2&quot;</translation> <translation>Zahtijeva mijenjanje &quot;%1&quot; u &quot;%2&quot;</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::BackendCommunicator</name>
<message> <message>
<source>Clang Code Model: Error: The clangbackend executable &quot;%1&quot; does not exist.</source> <source>Clang Code Model: Error: The clangbackend executable &quot;%1&quot; does not exist.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -15954,13 +15951,6 @@ Check the test environment.</source>
<source>Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.</source> <source>Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangCodeModelPlugin</name>
<message>
<source>Clang Code Model</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Generate Compilation Database</source> <source>Generate Compilation Database</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -15969,17 +15959,11 @@ Check the test environment.</source>
<source>Generate Compilation Database for &quot;%1&quot;</source> <source>Generate Compilation Database for &quot;%1&quot;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangCompletionAssistProcessor</name>
<message> <message>
<source>Location: %1</source> <source>Location: %1</source>
<extracomment>Parent folder for proposed #include completion</extracomment> <extracomment>Parent folder for proposed #include completion</extracomment>
<translation>Mjesto: %1</translation> <translation>Mjesto: %1</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangDiagnosticManager</name>
<message> <message>
<source>Inspect available fixits</source> <source>Inspect available fixits</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -15993,15 +15977,12 @@ Check the test environment.</source>
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ModelManagerSupport</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Clang</source> <source>Clang</source>
<extracomment>Display name</extracomment> <extracomment>Display name</extracomment>
<translation>Clang</translation> <translation>Clang</translation>
</message> </message>
</context>
<context>
<name>::ClangCodeModel</name>
<message> <message>
<source>&lt;No Symbols&gt;</source> <source>&lt;No Symbols&gt;</source>
<translation>&lt;Bez simbola&gt;</translation> <translation>&lt;Bez simbola&gt;</translation>
@@ -16023,7 +16004,7 @@ Check the test environment.</source>
</message> </message>
</context> </context>
<context> <context>
<name>Clang Code Model Marks</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Code Model Warning</source> <source>Code Model Warning</source>
<translation>Code Model upozorenje</translation> <translation>Code Model upozorenje</translation>
@@ -16032,9 +16013,6 @@ Check the test environment.</source>
<source>Code Model Error</source> <source>Code Model Error</source>
<translation>Code Model greška</translation> <translation>Code Model greška</translation>
</message> </message>
</context>
<context>
<name>ClangDiagnosticWidget</name>
<message> <message>
<source>Clazy Issue</source> <source>Clazy Issue</source>
<translation>Clazy problem</translation> <translation>Clazy problem</translation>

View File

@@ -32208,15 +32208,12 @@ Qt バージョンオプションページで qmldump アプリケーション
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangCompletionAssistProcessor</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Location: %1</source> <source>Location: %1</source>
<extracomment>Parent folder for proposed #include completion</extracomment> <extracomment>Parent folder for proposed #include completion</extracomment>
<translation>: %1</translation> <translation>: %1</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ModelManagerSupport</name>
<message> <message>
<source>Clang</source> <source>Clang</source>
<extracomment>Display name</extracomment> <extracomment>Display name</extracomment>
@@ -34094,7 +34091,7 @@ Android 5 ではローカルの Qt ライブラリをデプロイできません
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangProjectSettingsWidget</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Warnings</source> <source>Warnings</source>
<translation></translation> <translation></translation>
@@ -42276,7 +42273,7 @@ Android パッケージソースディレクトリのファイルはビルドデ
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangDiagnosticManager</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Inspect available fixits</source> <source>Inspect available fixits</source>
<translation></translation> <translation></translation>
@@ -45186,14 +45183,11 @@ The name of the release build configuration created by default for a qmake proje
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::ClangAssistProposalItem</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Requires changing &quot;%1&quot; to &quot;%2&quot;</source> <source>Requires changing &quot;%1&quot; to &quot;%2&quot;</source>
<translation>&quot;%1&quot;&quot;%2 &quot;</translation> <translation>&quot;%1&quot;&quot;%2 &quot;</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::BackendCommunicator</name>
<message> <message>
<source>Clang Code Model: Error: The clangbackend executable &quot;%1&quot; does not exist.</source> <source>Clang Code Model: Error: The clangbackend executable &quot;%1&quot; does not exist.</source>
<translation>Clang コードモデル: エラー: clangbackend &quot;%1&quot; </translation> <translation>Clang コードモデル: エラー: clangbackend &quot;%1&quot; </translation>
@@ -45206,17 +45200,10 @@ The name of the release build configuration created by default for a qmake proje
<source>Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.</source> <source>Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.</source>
<translation>Clang コードモデル: エラー: clangbackend </translation> <translation>Clang コードモデル: エラー: clangbackend </translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangCodeModelPlugin</name>
<message> <message>
<source>Generating Compilation DB</source> <source>Generating Compilation DB</source>
<translation> DB </translation> <translation> DB </translation>
</message> </message>
<message>
<source>Clang Code Model</source>
<translation>Clang </translation>
</message>
<message> <message>
<source>Generate Compilation Database</source> <source>Generate Compilation Database</source>
<translation> DB </translation> <translation> DB </translation>
@@ -45268,7 +45255,7 @@ The name of the release build configuration created by default for a qmake proje
</message> </message>
</context> </context>
<context> <context>
<name>Clang Code Model Marks</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Code Model Warning</source> <source>Code Model Warning</source>
<translation></translation> <translation></translation>
@@ -45298,7 +45285,7 @@ The name of the release build configuration created by default for a qmake proje
</message> </message>
</context> </context>
<context> <context>
<name>ClangDiagnosticWidget</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Clazy Issue</source> <source>Clazy Issue</source>
<translation>Clazy </translation> <translation>Clazy </translation>

View File

@@ -27356,23 +27356,17 @@ Zbuduj aplikację qmldump na stronie z opcjami wersji Qt.</translation>
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangCompletionAssistProcessor</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Location: %1</source> <source>Location: %1</source>
<extracomment>Parent folder for proposed #include completion</extracomment> <extracomment>Parent folder for proposed #include completion</extracomment>
<translation>Położenie: %1</translation> <translation>Położenie: %1</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ModelManagerSupport</name>
<message> <message>
<source>Clang</source> <source>Clang</source>
<extracomment>Display name</extracomment> <extracomment>Display name</extracomment>
<translation>Clang</translation> <translation>Clang</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangProjectSettingsWidget</name>
<message> <message>
<source>Warnings</source> <source>Warnings</source>
<translation>Ostrzeżenia</translation> <translation>Ostrzeżenia</translation>
@@ -36832,7 +36826,7 @@ po naciśnięciu klawisza backspace</translation>
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangDiagnosticManager</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Inspect available fixits</source> <source>Inspect available fixits</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -37869,7 +37863,7 @@ Uwaga: podczas używania zwykłego formatu tekstowego może brakować niektóryc
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::IpcCommunicator</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Clang Code Model: Error: The clangbackend executable &quot;%1&quot; does not exist.</source> <source>Clang Code Model: Error: The clangbackend executable &quot;%1&quot; does not exist.</source>
<translation>Model kodu Clang: Błąd: Plik wykonywalny &quot;%1&quot; clangbackendu nie istnieje.</translation> <translation>Model kodu Clang: Błąd: Plik wykonywalny &quot;%1&quot; clangbackendu nie istnieje.</translation>
@@ -37882,9 +37876,6 @@ Uwaga: podczas używania zwykłego formatu tekstowego może brakować niektóryc
<source>Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.</source> <source>Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.</source>
<translation>Model kodu Clang: Błąd: Proces clangbackend nieoczekiwanie zakończony i zrestartowany.</translation> <translation>Model kodu Clang: Błąd: Proces clangbackend nieoczekiwanie zakończony i zrestartowany.</translation>
</message> </message>
</context>
<context>
<name>Clang Code Model Marks</name>
<message> <message>
<source>Code Model Warning</source> <source>Code Model Warning</source>
<translation>Ostrzeżenie modelu kodu</translation> <translation>Ostrzeżenie modelu kodu</translation>

View File

@@ -6318,7 +6318,7 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
</message> </message>
</context> </context>
<context> <context>
<name>Clang Code Model Marks</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Code Model Warning</source> <source>Code Model Warning</source>
<translation>Предупреждение модели кода</translation> <translation>Предупреждение модели кода</translation>
@@ -6327,9 +6327,6 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<source>Code Model Error</source> <source>Code Model Error</source>
<translation>Ошибка модели кода</translation> <translation>Ошибка модели кода</translation>
</message> </message>
</context>
<context>
<name>::ClangCodeModel</name>
<message> <message>
<source>&lt;No Symbols&gt;</source> <source>&lt;No Symbols&gt;</source>
<translation>&lt;Нет символов&gt;</translation> <translation>&lt;Нет символов&gt;</translation>
@@ -6338,16 +6335,10 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<source>&lt;Select Symbol&gt;</source> <source>&lt;Select Symbol&gt;</source>
<translation>&lt;Выберите символ&gt;</translation> <translation>&lt;Выберите символ&gt;</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::ClangAssistProposalItem</name>
<message> <message>
<source>Requires changing &quot;%1&quot; to &quot;%2&quot;</source> <source>Requires changing &quot;%1&quot; to &quot;%2&quot;</source>
<translation>Требует изменить «%1» на «%2»</translation> <translation>Требует изменить «%1» на «%2»</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::BackendCommunicator</name>
<message> <message>
<source>Clang Code Model: Error: The clangbackend executable &quot;%1&quot; does not exist.</source> <source>Clang Code Model: Error: The clangbackend executable &quot;%1&quot; does not exist.</source>
<translation>Модель кода Clang: Ошибка: Программа clangbackend «%1» отсутствует.</translation> <translation>Модель кода Clang: Ошибка: Программа clangbackend «%1» отсутствует.</translation>
@@ -6360,9 +6351,6 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<source>Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.</source> <source>Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.</source>
<translation>Модель кода Clang: Ошибка: Программа clangbackend неожиданно завершилась и была перезапущена.</translation> <translation>Модель кода Clang: Ошибка: Программа clangbackend неожиданно завершилась и была перезапущена.</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangCodeModelPlugin</name>
<message> <message>
<source>Generating Compilation DB</source> <source>Generating Compilation DB</source>
<translation>Создание БД компиляции</translation> <translation>Создание БД компиляции</translation>
@@ -6387,28 +6375,15 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<source>Generating Clang compilation database failed: %1</source> <source>Generating Clang compilation database failed: %1</source>
<translation>Clang: не удалось создать БД компиляции: %1</translation> <translation>Clang: не удалось создать БД компиляции: %1</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangCompletionAssistProcessor</name>
<message> <message>
<source>Location: %1</source> <source>Location: %1</source>
<extracomment>Parent folder for proposed #include completion</extracomment> <extracomment>Parent folder for proposed #include completion</extracomment>
<translation>Находится в %1</translation> <translation>Находится в %1</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangDiagnosticManager</name>
<message> <message>
<source>Inspect available fixits</source> <source>Inspect available fixits</source>
<translation>Проверить доступные запросы на исправление</translation> <translation>Проверить доступные запросы на исправление</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangProjectSettingsWidget</name>
<message>
<source>Clang Code Model</source>
<translation>Модель кода Clang</translation>
</message>
<message> <message>
<source>Parse templates in a MSVC-compliant way. This helps to parse headers for example from Active Template Library (ATL) or Windows Runtime Library (WRL). <source>Parse templates in a MSVC-compliant way. This helps to parse headers for example from Active Template Library (ATL) or Windows Runtime Library (WRL).
However, using the relaxed and extended rules means also that no highlighting/completion can be provided within template functions.</source> However, using the relaxed and extended rules means also that no highlighting/completion can be provided within template functions.</source>
@@ -6431,9 +6406,6 @@ However, using the relaxed and extended rules means also that no highlighting/co
<source>&lt;a href=&quot;target&quot;&gt;Open Global Settings&lt;/a&gt;</source> <source>&lt;a href=&quot;target&quot;&gt;Open Global Settings&lt;/a&gt;</source>
<translation>&lt;a href=&quot;target&quot;&gt;Открыть глобальные настройки&lt;/a&gt;</translation> <translation>&lt;a href=&quot;target&quot;&gt;Открыть глобальные настройки&lt;/a&gt;</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ModelManagerSupport</name>
<message> <message>
<source>Clang</source> <source>Clang</source>
<extracomment>Display name</extracomment> <extracomment>Display name</extracomment>
@@ -6475,7 +6447,7 @@ However, using the relaxed and extended rules means also that no highlighting/co
</message> </message>
</context> </context>
<context> <context>
<name>ClangDiagnosticWidget</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Clazy Issue</source> <source>Clazy Issue</source>
<translation>Проблема Clazy</translation> <translation>Проблема Clazy</translation>

View File

@@ -35284,7 +35284,7 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangProjectSettingsPropertiesPage</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Pre-compiled headers:</source> <source>Pre-compiled headers:</source>
<translation type="vanished">Попередньо скомпільовані заголовки:</translation> <translation type="vanished">Попередньо скомпільовані заголовки:</translation>
@@ -35721,15 +35721,12 @@ Please build the qmldump application on the Qt version options page.</source>
</message> </message>
</context> </context>
<context> <context>
<name>ClangCodeModel::Internal::ClangCompletionAssistProcessor</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Location: %1</source> <source>Location: %1</source>
<extracomment>Parent folder for proposed #include completion</extracomment> <extracomment>Parent folder for proposed #include completion</extracomment>
<translation>Розташування: %1</translation> <translation>Розташування: %1</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangIndexer</name>
<message> <message>
<source>C++ Indexing</source> <source>C++ Indexing</source>
<translation type="vanished">Індексування C++</translation> <translation type="vanished">Індексування C++</translation>
@@ -35738,17 +35735,11 @@ Please build the qmldump application on the Qt version options page.</source>
<source>Parsing C/C++/ObjC Files</source> <source>Parsing C/C++/ObjC Files</source>
<translation type="vanished">Розбір файлів C/C++/ObjC</translation> <translation type="vanished">Розбір файлів C/C++/ObjC</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ModelManagerSupport</name>
<message> <message>
<source>Clang</source> <source>Clang</source>
<extracomment>Display name</extracomment> <extracomment>Display name</extracomment>
<translation>Clang</translation> <translation>Clang</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangProjectSettingsWidget</name>
<message> <message>
<source>Clang Settings</source> <source>Clang Settings</source>
<translation type="vanished">Налаштування Clang</translation> <translation type="vanished">Налаштування Clang</translation>
@@ -35773,9 +35764,6 @@ Please build the qmldump application on the Qt version options page.</source>
<source>Global setting (%1)</source> <source>Global setting (%1)</source>
<translation>Глобальні налаштування (%1)</translation> <translation>Глобальні налаштування (%1)</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::CompletionProposalsBuilder</name>
<message> <message>
<source>Is deprecated</source> <source>Is deprecated</source>
<extracomment>deprecated C++ symbol</extracomment> <extracomment>deprecated C++ symbol</extracomment>
@@ -35789,9 +35777,6 @@ Please build the qmldump application on the Qt version options page.</source>
<source>Signal of %1, returns %2</source> <source>Signal of %1, returns %2</source>
<translation type="vanished">Сигнал %1, повертає %2</translation> <translation type="vanished">Сигнал %1, повертає %2</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Diagnostic</name>
<message> <message>
<source>ignored</source> <source>ignored</source>
<translation type="vanished">проігноровано</translation> <translation type="vanished">проігноровано</translation>
@@ -35812,9 +35797,6 @@ Please build the qmldump application on the Qt version options page.</source>
<source>fatal</source> <source>fatal</source>
<translation type="vanished">фатальне</translation> <translation type="vanished">фатальне</translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::PchManager</name>
<message> <message>
<source>Successfully generated PCH file &quot;%1&quot;.</source> <source>Successfully generated PCH file &quot;%1&quot;.</source>
<translation type="vanished">Файл PCH &quot;%1&quot; було успішно створено.</translation> <translation type="vanished">Файл PCH &quot;%1&quot; було успішно створено.</translation>

View File

@@ -6829,9 +6829,6 @@ Make sure that CMAKE_BUILD_TYPE variable matches the &quot;Build type&quot; fiel
<source>Update</source> <source>Update</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangCodeModelPlugin</name>
<message> <message>
<source>Generating Compilation DB</source> <source>Generating Compilation DB</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -6856,9 +6853,6 @@ Make sure that CMAKE_BUILD_TYPE variable matches the &quot;Build type&quot; fiel
<source>Generating Clang compilation database failed: %1</source> <source>Generating Clang compilation database failed: %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangModelManagerSupport</name>
<message> <message>
<source>The use of clangd for the C/C++ code model was disabled, because it is likely that its memory requirements would be higher than what your system can handle.</source> <source>The use of clangd for the C/C++ code model was disabled, because it is likely that its memory requirements would be higher than what your system can handle.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -6876,9 +6870,6 @@ Make sure that CMAKE_BUILD_TYPE variable matches the &quot;Build type&quot; fiel
%1</source> %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangProjectSettingsWidget</name>
<message> <message>
<source>Parse templates in a MSVC-compliant way. This helps to parse headers for example from Active Template Library (ATL) or Windows Runtime Library (WRL). <source>Parse templates in a MSVC-compliant way. This helps to parse headers for example from Active Template Library (ATL) or Windows Runtime Library (WRL).
However, using the relaxed and extended rules means also that no highlighting/completion can be provided within template functions.</source> However, using the relaxed and extended rules means also that no highlighting/completion can be provided within template functions.</source>
@@ -6888,9 +6879,6 @@ However, using the relaxed and extended rules means also that no highlighting/co
<source>Enable MSVC-compliant template parsing</source> <source>Enable MSVC-compliant template parsing</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangdClient</name>
<message> <message>
<source>clangd</source> <source>clangd</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -6920,9 +6908,6 @@ However, using the relaxed and extended rules means also that no highlighting/co
<source>&lt;base declaration&gt;</source> <source>&lt;base declaration&gt;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangdFindReferences</name>
<message> <message>
<source>C++ Usages:</source> <source>C++ Usages:</source>
<translation type="unfinished">C++ 使:</translation> <translation type="unfinished">C++ 使:</translation>
@@ -6966,7 +6951,7 @@ However, using the relaxed and extended rules means also that no highlighting/co
</message> </message>
</context> </context>
<context> <context>
<name>ClangDiagnosticWidget</name> <name>::ClangCodeModel</name>
<message> <message>
<source>[Source: %1]</source> <source>[Source: %1]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -7739,7 +7724,7 @@ Set a valid executable first.</source>
</message> </message>
</context> </context>
<context> <context>
<name>ClangdTextMark</name> <name>::ClangCodeModel</name>
<message> <message>
<source>Code Model Error</source> <source>Code Model Error</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

View File

@@ -3,6 +3,7 @@
#include "clangcodemodelplugin.h" #include "clangcodemodelplugin.h"
#include "clangcodemodeltr.h"
#include "clangconstants.h" #include "clangconstants.h"
#include "clangmodelmanagersupport.h" #include "clangmodelmanagersupport.h"
#include "clangutils.h" #include "clangutils.h"
@@ -38,6 +39,8 @@
#include <utils/runextensions.h> #include <utils/runextensions.h>
#include <utils/temporarydirectory.h> #include <utils/temporarydirectory.h>
using namespace Core;
using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
namespace ClangCodeModel { namespace ClangCodeModel {
@@ -47,7 +50,7 @@ void ClangCodeModelPlugin::generateCompilationDB()
{ {
using namespace CppEditor; using namespace CppEditor;
ProjectExplorer::Target *target = ProjectExplorer::SessionManager::startupTarget(); Target *target = SessionManager::startupTarget();
if (!target) if (!target)
return; return;
@@ -64,7 +67,7 @@ void ClangCodeModelPlugin::generateCompilationDB()
warningsConfigForProject(target->project()), warningsConfigForProject(target->project()),
globalClangOptions(), globalClangOptions(),
FilePath()); FilePath());
Core::ProgressManager::addTask(task, tr("Generating Compilation DB"), "generate compilation db"); ProgressManager::addTask(task, Tr::tr("Generating Compilation DB"), "generate compilation db");
m_generatorWatcher.setFuture(task); m_generatorWatcher.setFuture(task);
} }
@@ -78,11 +81,11 @@ bool ClangCodeModelPlugin::initialize(const QStringList &arguments, QString *err
Q_UNUSED(arguments) Q_UNUSED(arguments)
Q_UNUSED(errorMessage) Q_UNUSED(errorMessage)
ProjectExplorer::TaskHub::addCategory(Constants::TASK_CATEGORY_DIAGNOSTICS, TaskHub::addCategory(Constants::TASK_CATEGORY_DIAGNOSTICS,
tr("Clang Code Model")); Tr::tr("Clang Code Model"));
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), connect(ProjectExplorerPlugin::instance(),
&ProjectExplorer::ProjectExplorerPlugin::finishedInitialization, &ProjectExplorerPlugin::finishedInitialization,
this, this,
&ClangCodeModelPlugin::maybeHandleBatchFileAndExit); &ClangCodeModelPlugin::maybeHandleBatchFileAndExit);
@@ -98,15 +101,15 @@ void ClangCodeModelPlugin::createCompilationDBAction()
{ {
// generate compile_commands.json // generate compile_commands.json
m_generateCompilationDBAction = new ParameterAction( m_generateCompilationDBAction = new ParameterAction(
tr("Generate Compilation Database"), Tr::tr("Generate Compilation Database"),
tr("Generate Compilation Database for \"%1\""), Tr::tr("Generate Compilation Database for \"%1\""),
ParameterAction::AlwaysEnabled, this); ParameterAction::AlwaysEnabled, this);
ProjectExplorer::Project *startupProject = ProjectExplorer::SessionManager::startupProject(); Project *startupProject = SessionManager::startupProject();
if (startupProject) if (startupProject)
m_generateCompilationDBAction->setParameter(startupProject->displayName()); m_generateCompilationDBAction->setParameter(startupProject->displayName());
Core::Command *command = Core::ActionManager::registerAction(m_generateCompilationDBAction, Command *command = ActionManager::registerAction(m_generateCompilationDBAction,
Constants::GENERATE_COMPILATION_DB); Constants::GENERATE_COMPILATION_DB);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDescription(m_generateCompilationDBAction->text()); command->setDescription(m_generateCompilationDBAction->text());
connect(&m_generatorWatcher, &QFutureWatcher<GenerateCompilationDbResult>::finished, connect(&m_generatorWatcher, &QFutureWatcher<GenerateCompilationDbResult>::finished,
@@ -114,31 +117,30 @@ void ClangCodeModelPlugin::createCompilationDBAction()
const GenerateCompilationDbResult result = m_generatorWatcher.result(); const GenerateCompilationDbResult result = m_generatorWatcher.result();
QString message; QString message;
if (result.error.isEmpty()) { if (result.error.isEmpty()) {
message = tr("Clang compilation database generated at \"%1\".") message = Tr::tr("Clang compilation database generated at \"%1\".")
.arg(QDir::toNativeSeparators(result.filePath)); .arg(QDir::toNativeSeparators(result.filePath));
} else { } else {
message = tr("Generating Clang compilation database failed: %1").arg(result.error); message = Tr::tr("Generating Clang compilation database failed: %1").arg(result.error);
} }
Core::MessageManager::writeFlashing(message); MessageManager::writeFlashing(message);
m_generateCompilationDBAction->setEnabled(true); m_generateCompilationDBAction->setEnabled(true);
}); });
connect(m_generateCompilationDBAction, &QAction::triggered, this, [this] { connect(m_generateCompilationDBAction, &QAction::triggered, this, [this] {
if (!m_generateCompilationDBAction->isEnabled()) { if (!m_generateCompilationDBAction->isEnabled()) {
Core::MessageManager::writeDisrupting("Cannot generate compilation database: " MessageManager::writeDisrupting("Cannot generate compilation database: "
"Generator is already running."); "Generator is already running.");
return; return;
} }
ProjectExplorer::Project * const project Project * const project = SessionManager::startupProject();
= ProjectExplorer::SessionManager::startupProject();
if (!project) { if (!project) {
Core::MessageManager::writeDisrupting("Cannot generate compilation database: " MessageManager::writeDisrupting("Cannot generate compilation database: "
"No active project."); "No active project.");
return; return;
} }
const CppEditor::ProjectInfo::ConstPtr projectInfo = CppEditor::CppModelManager::instance() const CppEditor::ProjectInfo::ConstPtr projectInfo = CppEditor::CppModelManager::instance()
->projectInfo(project); ->projectInfo(project);
if (!projectInfo || projectInfo->projectParts().isEmpty()) { if (!projectInfo || projectInfo->projectParts().isEmpty()) {
Core::MessageManager::writeDisrupting("Cannot generate compilation database: " MessageManager::writeDisrupting("Cannot generate compilation database: "
"Project has no C/C++ project parts."); "Project has no C/C++ project parts.");
return; return;
} }
@@ -146,28 +148,23 @@ void ClangCodeModelPlugin::createCompilationDBAction()
generateCompilationDB(); generateCompilationDB();
}); });
connect(CppEditor::CppModelManager::instance(), &CppEditor::CppModelManager::projectPartsUpdated, connect(CppEditor::CppModelManager::instance(), &CppEditor::CppModelManager::projectPartsUpdated,
this, [this](ProjectExplorer::Project *project) { this, [this](Project *project) {
if (project != ProjectExplorer::SessionManager::startupProject()) if (project != SessionManager::startupProject())
return; return;
m_generateCompilationDBAction->setParameter(project->displayName()); m_generateCompilationDBAction->setParameter(project->displayName());
}); });
connect(ProjectExplorer::SessionManager::instance(), connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
&ProjectExplorer::SessionManager::startupProjectChanged, this, [this](Project *project) {
this,
[this](ProjectExplorer::Project *project) {
m_generateCompilationDBAction->setParameter(project ? project->displayName() : ""); m_generateCompilationDBAction->setParameter(project ? project->displayName() : "");
}); });
connect(ProjectExplorer::SessionManager::instance(), connect(SessionManager::instance(), &SessionManager::projectDisplayNameChanged,
&ProjectExplorer::SessionManager::projectDisplayNameChanged, this, [this](Project *project) {
this, if (project != SessionManager::startupProject())
[this](ProjectExplorer::Project *project) {
if (project != ProjectExplorer::SessionManager::startupProject())
return; return;
m_generateCompilationDBAction->setParameter(project->displayName()); m_generateCompilationDBAction->setParameter(project->displayName());
}); });
connect(ProjectExplorer::SessionManager::instance(), connect(SessionManager::instance(), &SessionManager::projectAdded,
&ProjectExplorer::SessionManager::projectAdded, this, this, [this](Project *project) {
[this](ProjectExplorer::Project *project) {
project->registerGenerator(Constants::GENERATE_COMPILATION_DB, project->registerGenerator(Constants::GENERATE_COMPILATION_DB,
m_generateCompilationDBAction->text(), m_generateCompilationDBAction->text(),
[this] { m_generateCompilationDBAction->trigger(); }); [this] { m_generateCompilationDBAction->trigger(); });

View File

@@ -3,6 +3,7 @@
#include "clangdclient.h" #include "clangdclient.h"
#include "clangcodemodeltr.h"
#include "clangconstants.h" #include "clangconstants.h"
#include "clangdast.h" #include "clangdast.h"
#include "clangdcompletion.h" #include "clangdcompletion.h"
@@ -359,7 +360,7 @@ static void addCompilationDb(QJsonObject &parentObject, const QJsonObject &cdb)
ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir, const Id &id) ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir, const Id &id)
: Client(clientInterface(project, jsonDbDir), id), d(new Private(this, project)) : Client(clientInterface(project, jsonDbDir), id), d(new Private(this, project))
{ {
setName(tr("clangd")); setName(Tr::tr("clangd"));
LanguageFilter langFilter; LanguageFilter langFilter;
langFilter.mimeTypes = QStringList{"text/x-chdr", "text/x-csrc", langFilter.mimeTypes = QStringList{"text/x-chdr", "text/x-csrc",
"text/x-c++hdr", "text/x-c++src", "text/x-objc++src", "text/x-objcsrc"}; "text/x-c++hdr", "text/x-c++src", "text/x-objc++src", "text/x-objcsrc"};
@@ -415,8 +416,8 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir, c
setLocatorsEnabled(false); setLocatorsEnabled(false);
setAutoRequestCodeActions(false); // clangd sends code actions inside diagnostics setAutoRequestCodeActions(false); // clangd sends code actions inside diagnostics
progressManager()->setTitleForToken(indexingToken(), progressManager()->setTitleForToken(indexingToken(),
project ? tr("Indexing %1 with clangd").arg(project->displayName()) project ? Tr::tr("Indexing %1 with clangd").arg(project->displayName())
: tr("Indexing session with clangd")); : Tr::tr("Indexing session with clangd"));
progressManager()->setClickHandlerForToken(indexingToken(), [] { progressManager()->setClickHandlerForToken(indexingToken(), [] {
// don't directly open modal dialog from click handler, because that would mess // don't directly open modal dialog from click handler, because that would mess
// up the stack // up the stack
@@ -602,7 +603,7 @@ QTextCursor ClangdClient::adjustedCursorForHighlighting(const QTextCursor &curso
const LanguageClient::Client::CustomInspectorTabs ClangdClient::createCustomInspectorTabs() const LanguageClient::Client::CustomInspectorTabs ClangdClient::createCustomInspectorTabs()
{ {
return {{new ClangdMemoryUsageWidget(this), tr("Memory Usage")}}; return {{new ClangdMemoryUsageWidget(this), Tr::tr("Memory Usage")}};
} }
class ClangdDiagnosticManager : public LanguageClient::DiagnosticManager class ClangdDiagnosticManager : public LanguageClient::DiagnosticManager

View File

@@ -3,6 +3,7 @@
#include "clangdcompletion.h" #include "clangdcompletion.h"
#include "clangcodemodeltr.h"
#include "clangcompletioncontextanalyzer.h" #include "clangcompletioncontextanalyzer.h"
#include "clangdclient.h" #include "clangdclient.h"
#include "clangpreprocessorassistproposalitem.h" #include "clangpreprocessorassistproposalitem.h"
@@ -18,12 +19,16 @@
#include <cppeditor/projectpart.h> #include <cppeditor/projectpart.h>
#include <cplusplus/Icons.h> #include <cplusplus/Icons.h>
#include <cplusplus/MatchingText.h> #include <cplusplus/MatchingText.h>
#include <languageclient/languageclientfunctionhint.h> #include <languageclient/languageclientfunctionhint.h>
#include <projectexplorer/headerpath.h> #include <projectexplorer/headerpath.h>
#include <texteditor/codeassist/assistinterface.h> #include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/genericproposal.h> #include <texteditor/codeassist/genericproposal.h>
#include <texteditor/codeassist/genericproposalmodel.h> #include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/texteditorsettings.h> #include <texteditor/texteditorsettings.h>
#include <utils/utilsicons.h> #include <utils/utilsicons.h>
using namespace CppEditor; using namespace CppEditor;
@@ -35,10 +40,12 @@ using namespace TextEditor;
using namespace Utils; using namespace Utils;
namespace ClangCodeModel::Internal { namespace ClangCodeModel::Internal {
static Q_LOGGING_CATEGORY(clangdLogCompletion, "qtc.clangcodemodel.clangd.completion", static Q_LOGGING_CATEGORY(clangdLogCompletion, "qtc.clangcodemodel.clangd.completion",
QtWarningMsg); QtWarningMsg);
enum class CustomAssistMode { Doxygen, Preprocessor, IncludePath }; enum class CustomAssistMode { Doxygen, Preprocessor, IncludePath };
class CustomAssistProcessor : public IAssistProcessor class CustomAssistProcessor : public IAssistProcessor
{ {
public: public:
@@ -532,7 +539,7 @@ QList<AssistProposalItemInterface *> CustomAssistProcessor::completeIncludePath(
QList<AssistProposalItemInterface *> completions; QList<AssistProposalItemInterface *> completions;
QDirIterator i(realPath, QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot); QDirIterator i(realPath, QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
//: Parent folder for proposed #include completion //: Parent folder for proposed #include completion
const QString hint = ClangdClient::tr("Location: %1") const QString hint = Tr::tr("Location: %1")
.arg(QDir::toNativeSeparators(QDir::cleanPath(realPath))); .arg(QDir::toNativeSeparators(QDir::cleanPath(realPath)));
while (i.hasNext()) { while (i.hasNext()) {
const QString fileName = i.next(); const QString fileName = i.next();

View File

@@ -3,24 +3,29 @@
#include "clangdfindreferences.h" #include "clangdfindreferences.h"
#include "clangcodemodeltr.h"
#include "clangdast.h" #include "clangdast.h"
#include "clangdclient.h" #include "clangdclient.h"
#include <coreplugin/documentmanager.h> #include <coreplugin/documentmanager.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/find/searchresultwindow.h> #include <coreplugin/find/searchresultwindow.h>
#include <cplusplus/FindUsages.h> #include <cplusplus/FindUsages.h>
#include <cppeditor/cppcodemodelsettings.h> #include <cppeditor/cppcodemodelsettings.h>
#include <cppeditor/cppfindreferences.h> #include <cppeditor/cppfindreferences.h>
#include <cppeditor/cpptoolsreuse.h> #include <cppeditor/cpptoolsreuse.h>
#include <languageclient/languageclientsymbolsupport.h> #include <languageclient/languageclientsymbolsupport.h>
#include <languageserverprotocol/lsptypes.h> #include <languageserverprotocol/lsptypes.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectnodes.h> #include <projectexplorer/projectnodes.h>
#include <projectexplorer/projecttree.h> #include <projectexplorer/projecttree.h>
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <texteditor/basefilefind.h> #include <texteditor/basefilefind.h>
#include <utils/filepath.h>
#include <QCheckBox> #include <QCheckBox>
#include <QFile> #include <QFile>
@@ -119,7 +124,7 @@ ClangdFindReferences::ClangdFindReferences(ClangdClient *client, TextDocument *d
} }
d->search = SearchResultWindow::instance()->startNewSearch( d->search = SearchResultWindow::instance()->startNewSearch(
tr("C++ Usages:"), Tr::tr("C++ Usages:"),
{}, {},
searchTerm, searchTerm,
replacement ? SearchResultWindow::SearchAndReplace : SearchResultWindow::SearchOnly, replacement ? SearchResultWindow::SearchAndReplace : SearchResultWindow::SearchOnly,
@@ -354,10 +359,10 @@ void ClangdFindReferences::Private::finishSearch()
search->additionalReplaceWidget()); search->additionalReplaceWidget());
QTC_CHECK(renameCheckBox); QTC_CHECK(renameCheckBox);
const QSet<Utils::FilePath> files = replacementData->fileRenameCandidates; const QSet<Utils::FilePath> files = replacementData->fileRenameCandidates;
renameCheckBox->setText(tr("Re&name %n files", nullptr, files.size())); renameCheckBox->setText(Tr::tr("Re&name %n files", nullptr, files.size()));
const QStringList filesForUser = Utils::transform<QStringList>(files, const QStringList filesForUser = Utils::transform<QStringList>(files,
[](const Utils::FilePath &fp) { return fp.toUserOutput(); }); [](const Utils::FilePath &fp) { return fp.toUserOutput(); });
renameCheckBox->setToolTip(tr("Files:\n%1").arg(filesForUser.join('\n'))); renameCheckBox->setToolTip(Tr::tr("Files:\n%1").arg(filesForUser.join('\n')));
renameCheckBox->setVisible(true); renameCheckBox->setVisible(true);
search->setUserData(QVariant::fromValue(*replacementData)); search->setUserData(QVariant::fromValue(*replacementData));
} }

View File

@@ -3,15 +3,18 @@
#include "clangdfollowsymbol.h" #include "clangdfollowsymbol.h"
#include "clangcodemodeltr.h"
#include "clangdast.h" #include "clangdast.h"
#include "clangdclient.h" #include "clangdclient.h"
#include <cppeditor/cppeditorwidget.h> #include <cppeditor/cppeditorwidget.h>
#include <cppeditor/cppvirtualfunctionassistprovider.h> #include <cppeditor/cppvirtualfunctionassistprovider.h>
#include <cppeditor/cppvirtualfunctionproposalitem.h> #include <cppeditor/cppvirtualfunctionproposalitem.h>
#include <languageclient/languageclientsymbolsupport.h> #include <languageclient/languageclientsymbolsupport.h>
#include <languageserverprotocol/lsptypes.h> #include <languageserverprotocol/lsptypes.h>
#include <languageserverprotocol/jsonrpcmessages.h> #include <languageserverprotocol/jsonrpcmessages.h>
#include <texteditor/codeassist/assistinterface.h> #include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/iassistprocessor.h> #include <texteditor/codeassist/iassistprocessor.h>
#include <texteditor/codeassist/iassistprovider.h> #include <texteditor/codeassist/iassistprovider.h>
@@ -26,6 +29,7 @@ using namespace TextEditor;
using namespace Utils; using namespace Utils;
namespace ClangCodeModel::Internal { namespace ClangCodeModel::Internal {
using SymbolData = QPair<QString, Link>; using SymbolData = QPair<QString, Link>;
using SymbolDataList = QList<SymbolData>; using SymbolDataList = QList<SymbolData>;
@@ -318,7 +322,7 @@ ClangdFollowSymbol::VirtualFunctionAssistProcessor::createProposal(bool final) c
items << createEntry({}, m_followSymbol->d->defLink); items << createEntry({}, m_followSymbol->d->defLink);
if (!final) { if (!final) {
const auto infoItem = new VirtualFunctionProposalItem({}, false); const auto infoItem = new VirtualFunctionProposalItem({}, false);
infoItem->setText(ClangdClient::tr("collecting overrides ...")); infoItem->setText(Tr::tr("collecting overrides ..."));
infoItem->setOrder(-1); infoItem->setOrder(-1);
items << infoItem; items << infoItem;
} }
@@ -336,7 +340,7 @@ ClangdFollowSymbol::VirtualFunctionAssistProcessor::createEntry(const QString &n
if (link == m_followSymbol->d->defLink) { if (link == m_followSymbol->d->defLink) {
item->setOrder(1000); // Ensure base declaration is on top. item->setOrder(1000); // Ensure base declaration is on top.
if (text.isEmpty()) { if (text.isEmpty()) {
text = ClangdClient::tr("<base declaration>"); text = Tr::tr("<base declaration>");
} else if (m_followSymbol->d->defLinkNode.isPureVirtualDeclaration() } else if (m_followSymbol->d->defLinkNode.isPureVirtualDeclaration()
|| m_followSymbol->d->defLinkNode.isPureVirtualDefinition()) { || m_followSymbol->d->defLinkNode.isPureVirtualDefinition()) {
text += " = 0"; text += " = 0";

View File

@@ -3,6 +3,7 @@
#include "clangdiagnostictooltipwidget.h" #include "clangdiagnostictooltipwidget.h"
#include "clangcodemodeltr.h"
#include "clangfixitoperation.h" #include "clangfixitoperation.h"
#include "clangutils.h" #include "clangutils.h"
@@ -132,8 +133,7 @@ public:
if (!source.isEmpty()) { if (!source.isEmpty()) {
text.append(QString::fromUtf8("<tr><td colspan='2' align='left'>" text.append(QString::fromUtf8("<tr><td colspan='2' align='left'>"
"<font color='gray'>%1</font></td></tr>") "<font color='gray'>%1</font></td></tr>")
.arg(QCoreApplication::translate("ClangDiagnosticWidget", .arg(Tr::tr("[Source: %1]").arg(source)));
"[Source: %1]").arg(source)));
} }
text.append("</table>"); text.append("</table>");

View File

@@ -199,7 +199,7 @@ ClangFunctionsFilter::ClangFunctionsFilter()
: ClangGlobalSymbolFilter(new CppFunctionsFilter, new LspFunctionsFilter) : ClangGlobalSymbolFilter(new CppFunctionsFilter, new LspFunctionsFilter)
{ {
setId(CppEditor::Constants::FUNCTIONS_FILTER_ID); setId(CppEditor::Constants::FUNCTIONS_FILTER_ID);
setDisplayName(QCoreApplication::translate(":CppEditor", setDisplayName(QCoreApplication::translate("::CppEditor",
CppEditor::Constants::FUNCTIONS_FILTER_DISPLAY_NAME)); CppEditor::Constants::FUNCTIONS_FILTER_DISPLAY_NAME));
setDefaultShortcutString("m"); setDefaultShortcutString("m");
setDefaultIncludedByDefault(false); setDefaultIncludedByDefault(false);

View File

@@ -3,9 +3,11 @@
#include "clangdmemoryusagewidget.h" #include "clangdmemoryusagewidget.h"
#include "clangcodemodeltr.h"
#include "clangdclient.h" #include "clangdclient.h"
#include <languageserverprotocol/jsonobject.h> #include <languageserverprotocol/jsonobject.h>
#include <utils/itemviews.h> #include <utils/itemviews.h>
#include <utils/treemodel.h> #include <utils/treemodel.h>
@@ -52,7 +54,6 @@ private:
class MemoryTreeItem : public TreeItem class MemoryTreeItem : public TreeItem
{ {
Q_DECLARE_TR_FUNCTIONS(ClangCodeModel)
public: public:
MemoryTreeItem(const QString &displayName, const MemoryTree &tree) MemoryTreeItem(const QString &displayName, const MemoryTree &tree)
: m_displayName(displayName), m_bytesUsed(tree.total()) : m_displayName(displayName), m_bytesUsed(tree.total())
@@ -102,8 +103,7 @@ class MemoryTreeModel : public BaseTreeModel
public: public:
MemoryTreeModel() MemoryTreeModel()
{ {
setHeader({ClangdMemoryUsageWidget::tr("Component"), setHeader({Tr::tr("Component"), Tr::tr("Total Memory")});
ClangdMemoryUsageWidget::tr("Total Memory")});
} }
void update(const MemoryTree &tree) void update(const MemoryTree &tree)
@@ -154,7 +154,7 @@ void ClangdMemoryUsageWidget::Private::setupUi()
layout->addWidget(&view); layout->addWidget(&view);
QObject::connect(&view, &QWidget::customContextMenuRequested, q, [this](const QPoint &pos) { QObject::connect(&view, &QWidget::customContextMenuRequested, q, [this](const QPoint &pos) {
QMenu menu; QMenu menu;
menu.addAction(tr("Update"), [this] { getMemoryTree(); }); menu.addAction(Tr::tr("Update"), [this] { getMemoryTree(); });
menu.exec(view.mapToGlobal(pos)); menu.exec(view.mapToGlobal(pos));
}); });
} }

View File

@@ -3,15 +3,14 @@
#pragma once #pragma once
#include <QCoreApplication>
#include <QWidget> #include <QWidget>
namespace ClangCodeModel::Internal { namespace ClangCodeModel::Internal {
class ClangdClient; class ClangdClient;
class ClangdMemoryUsageWidget : public QWidget class ClangdMemoryUsageWidget : public QWidget
{ {
Q_DECLARE_TR_FUNCTIONS(::ClangCodeModel)
public: public:
explicit ClangdMemoryUsageWidget(ClangdClient *client); explicit ClangdMemoryUsageWidget(ClangdClient *client);
~ClangdMemoryUsageWidget(); ~ClangdMemoryUsageWidget();
@@ -20,5 +19,5 @@ public:
Private * const d; Private * const d;
}; };
} // namespace ClangCodeModel::Internal } // ClangCodeModel::Internal

View File

@@ -3,6 +3,7 @@
#include "clangmodelmanagersupport.h" #include "clangmodelmanagersupport.h"
#include "clangcodemodeltr.h"
#include "clangconstants.h" #include "clangconstants.h"
#include "clangdclient.h" #include "clangdclient.h"
#include "clangdquickfixes.h" #include "clangdquickfixes.h"
@@ -54,8 +55,7 @@ using namespace CppEditor;
using namespace LanguageClient; using namespace LanguageClient;
using namespace Utils; using namespace Utils;
namespace ClangCodeModel { namespace ClangCodeModel::Internal {
namespace Internal {
static CppEditor::CppModelManager *cppModelManager() static CppEditor::CppModelManager *cppModelManager()
{ {
@@ -97,7 +97,7 @@ static const QList<ProjectExplorer::Project *> projectsForClient(const Client *c
return projects; return projects;
} }
static bool fileIsProjectBuildArtifact(const Client *client, const Utils::FilePath &filePath) static bool fileIsProjectBuildArtifact(const Client *client, const FilePath &filePath)
{ {
for (const ProjectExplorer::Project * const p : projectsForClient(client)) { for (const ProjectExplorer::Project * const p : projectsForClient(client)) {
if (const auto t = p->activeTarget()) { if (const auto t = p->activeTarget()) {
@@ -110,7 +110,7 @@ static bool fileIsProjectBuildArtifact(const Client *client, const Utils::FilePa
return false; return false;
} }
static Client *clientForGeneratedFile(const Utils::FilePath &filePath) static Client *clientForGeneratedFile(const FilePath &filePath)
{ {
for (Client * const client : LanguageClientManager::clients()) { for (Client * const client : LanguageClientManager::clients()) {
if (qobject_cast<ClangdClient *>(client) && client->reachable() if (qobject_cast<ClangdClient *>(client) && client->reachable()
@@ -129,13 +129,13 @@ static void checkSystemForClangdSuitability()
return; return;
ClangdSettings::setUseClangdAndSave(false); ClangdSettings::setUseClangdAndSave(false);
const QString warnStr = ClangModelManagerSupport::tr("The use of clangd for the C/C++ " const QString warnStr = Tr::tr("The use of clangd for the C/C++ "
"code model was disabled, because it is likely that its memory requirements " "code model was disabled, because it is likely that its memory requirements "
"would be higher than what your system can handle."); "would be higher than what your system can handle.");
const Utils::Id clangdWarningSetting("WarnAboutClangd"); const Id clangdWarningSetting("WarnAboutClangd");
Utils::InfoBarEntry info(clangdWarningSetting, warnStr); InfoBarEntry info(clangdWarningSetting, warnStr);
info.setDetailsWidgetCreator([] { info.setDetailsWidgetCreator([] {
const auto label = new QLabel(ClangModelManagerSupport::tr( const auto label = new QLabel(Tr::tr(
"With clangd enabled, Qt Creator fully supports modern C++ " "With clangd enabled, Qt Creator fully supports modern C++ "
"when highlighting code, completing symbols and so on.<br>" "when highlighting code, completing symbols and so on.<br>"
"This comes at a higher cost in terms of CPU load and memory usage compared " "This comes at a higher cost in terms of CPU load and memory usage compared "
@@ -148,7 +148,7 @@ static void checkSystemForClangdSuitability()
}); });
return label; return label;
}); });
info.addCustomButton(ClangModelManagerSupport::tr("Enable Anyway"), [clangdWarningSetting] { info.addCustomButton(Tr::tr("Enable Anyway"), [clangdWarningSetting] {
ClangdSettings::setUseClangdAndSave(true); ClangdSettings::setUseClangdAndSave(true);
Core::ICore::infoBar()->removeInfo(clangdWarningSetting); Core::ICore::infoBar()->removeInfo(clangdWarningSetting);
}); });
@@ -162,7 +162,7 @@ static void updateParserConfig(ClangdClient *client)
if (const auto editor = TextEditor::BaseTextEditor::currentTextEditor()) { if (const auto editor = TextEditor::BaseTextEditor::currentTextEditor()) {
if (!client->documentOpen(editor->textDocument())) if (!client->documentOpen(editor->textDocument()))
return; return;
const Utils::FilePath filePath = editor->textDocument()->filePath(); const FilePath filePath = editor->textDocument()->filePath();
if (const auto processor = ClangEditorDocumentProcessor::get(filePath)) if (const auto processor = ClangEditorDocumentProcessor::get(filePath))
client->updateParserConfig(filePath, processor->parserConfig()); client->updateParserConfig(filePath, processor->parserConfig());
} }
@@ -257,7 +257,7 @@ ClangModelManagerSupport::~ClangModelManagerSupport()
} }
void ClangModelManagerSupport::followSymbol(const CppEditor::CursorInEditor &data, void ClangModelManagerSupport::followSymbol(const CppEditor::CursorInEditor &data,
const Utils::LinkHandler &processLinkCallback, bool resolveTarget, const LinkHandler &processLinkCallback, bool resolveTarget,
bool inNextSplit) bool inNextSplit)
{ {
if (ClangdClient * const client = clientForFile(data.filePath()); if (ClangdClient * const client = clientForFile(data.filePath());
@@ -272,7 +272,7 @@ void ClangModelManagerSupport::followSymbol(const CppEditor::CursorInEditor &dat
} }
void ClangModelManagerSupport::followSymbolToType(const CppEditor::CursorInEditor &data, void ClangModelManagerSupport::followSymbolToType(const CppEditor::CursorInEditor &data,
const Utils::LinkHandler &processLinkCallback, const LinkHandler &processLinkCallback,
bool inNextSplit) bool inNextSplit)
{ {
if (ClangdClient * const client = clientForFile(data.filePath())) { if (ClangdClient * const client = clientForFile(data.filePath())) {
@@ -285,7 +285,7 @@ void ClangModelManagerSupport::followSymbolToType(const CppEditor::CursorInEdito
} }
void ClangModelManagerSupport::switchDeclDef(const CppEditor::CursorInEditor &data, void ClangModelManagerSupport::switchDeclDef(const CppEditor::CursorInEditor &data,
const Utils::LinkHandler &processLinkCallback) const LinkHandler &processLinkCallback)
{ {
if (ClangdClient * const client = clientForFile(data.filePath()); if (ClangdClient * const client = clientForFile(data.filePath());
client && client->isFullyIndexed()) { client && client->isFullyIndexed()) {
@@ -352,8 +352,8 @@ void ClangModelManagerSupport::switchHeaderSource(const FilePath &filePath, bool
CppModelManager::switchHeaderSource(inNextSplit, CppModelManager::Backend::Builtin); CppModelManager::switchHeaderSource(inNextSplit, CppModelManager::Backend::Builtin);
} }
void ClangModelManagerSupport::checkUnused(const Utils::Link &link, Core::SearchResult *search, void ClangModelManagerSupport::checkUnused(const Link &link, Core::SearchResult *search,
const Utils::LinkHandler &callback) const LinkHandler &callback)
{ {
if (const ProjectExplorer::Project * const project if (const ProjectExplorer::Project * const project
= ProjectExplorer::SessionManager::projectForFile(link.targetFilePath)) { = ProjectExplorer::SessionManager::projectForFile(link.targetFilePath)) {
@@ -377,7 +377,7 @@ CppEditor::BaseEditorDocumentProcessor *ClangModelManagerSupport::createEditorDo
TextEditor::TextDocument *baseTextDocument) TextEditor::TextDocument *baseTextDocument)
{ {
const auto processor = new ClangEditorDocumentProcessor(baseTextDocument); const auto processor = new ClangEditorDocumentProcessor(baseTextDocument);
const auto handleConfigChange = [](const Utils::FilePath &fp, const auto handleConfigChange = [](const FilePath &fp,
const BaseEditorDocumentParser::Configuration &config) { const BaseEditorDocumentParser::Configuration &config) {
if (const auto client = clientForFile(fp)) if (const auto client = clientForFile(fp))
client->updateParserConfig(fp, config); client->updateParserConfig(fp, config);
@@ -394,7 +394,7 @@ void ClangModelManagerSupport::onCurrentEditorChanged(Core::IEditor *editor)
if (!editor || !editor->document() || !cppModelManager()->isCppEditor(editor)) if (!editor || !editor->document() || !cppModelManager()->isCppEditor(editor))
return; return;
const ::Utils::FilePath filePath = editor->document()->filePath(); const FilePath filePath = editor->document()->filePath();
if (auto processor = ClangEditorDocumentProcessor::get(filePath)) { if (auto processor = ClangEditorDocumentProcessor::get(filePath)) {
processor->semanticRehighlight(); processor->semanticRehighlight();
if (const auto client = clientForFile(filePath)) { if (const auto client = clientForFile(filePath)) {
@@ -413,11 +413,11 @@ void ClangModelManagerSupport::connectToWidgetsMarkContextMenuRequested(QWidget
} }
} }
static Utils::FilePath getJsonDbDir(const ProjectExplorer::Project *project) static FilePath getJsonDbDir(const ProjectExplorer::Project *project)
{ {
static const QString dirName(".qtc_clangd"); static const QString dirName(".qtc_clangd");
if (!project) { if (!project) {
const QString sessionDirName = Utils::FileUtils::fileSystemFriendlyName( const QString sessionDirName = FileUtils::fileSystemFriendlyName(
ProjectExplorer::SessionManager::activeSession()); ProjectExplorer::SessionManager::activeSession());
return Core::ICore::userResourcePath() / dirName / sessionDirName; // TODO: Make configurable? return Core::ICore::userResourcePath() / dirName / sessionDirName; // TODO: Make configurable?
} }
@@ -427,12 +427,12 @@ static Utils::FilePath getJsonDbDir(const ProjectExplorer::Project *project)
return bc->buildDirectory() / dirName; return bc->buildDirectory() / dirName;
} }
} }
return Utils::FilePath(); return {};
} }
static bool isProjectDataUpToDate( static bool isProjectDataUpToDate(
ProjectExplorer::Project *project, ProjectInfoList projectInfo, ProjectExplorer::Project *project, ProjectInfoList projectInfo,
const Utils::FilePath &jsonDbDir) const FilePath &jsonDbDir)
{ {
if (project && !ProjectExplorer::SessionManager::hasProject(project)) if (project && !ProjectExplorer::SessionManager::hasProject(project))
return false; return false;
@@ -478,7 +478,7 @@ void ClangModelManagerSupport::updateLanguageClient(ProjectExplorer::Project *pr
return; return;
} }
const Utils::FilePath jsonDbDir = getJsonDbDir(project); const FilePath jsonDbDir = getJsonDbDir(project);
if (jsonDbDir.isEmpty()) if (jsonDbDir.isEmpty())
return; return;
const auto generatorWatcher = new QFutureWatcher<GenerateCompilationDbResult>; const auto generatorWatcher = new QFutureWatcher<GenerateCompilationDbResult>;
@@ -490,7 +490,7 @@ void ClangModelManagerSupport::updateLanguageClient(ProjectExplorer::Project *pr
const GenerateCompilationDbResult result = generatorWatcher->result(); const GenerateCompilationDbResult result = generatorWatcher->result();
if (!result.error.isEmpty()) { if (!result.error.isEmpty()) {
Core::MessageManager::writeDisrupting( Core::MessageManager::writeDisrupting(
tr("Cannot use clangd: Failed to generate compilation database:\n%1") Tr::tr("Cannot use clangd: Failed to generate compilation database:\n%1")
.arg(result.error)); .arg(result.error));
return; return;
} }
@@ -500,7 +500,7 @@ void ClangModelManagerSupport::updateLanguageClient(ProjectExplorer::Project *pr
LanguageClientManager::shutdownClient(oldClient); LanguageClientManager::shutdownClient(oldClient);
} }
ClangdClient * const client = new ClangdClient(project, jsonDbDir, previousId); ClangdClient * const client = new ClangdClient(project, jsonDbDir, previousId);
connect(client, &Client::shadowDocumentSwitched, this, [](const Utils::FilePath &fp) { connect(client, &Client::shadowDocumentSwitched, this, [](const FilePath &fp) {
ClangdClient::handleUiHeaderChange(fp.fileName()); ClangdClient::handleUiHeaderChange(fp.fileName());
}); });
connect(CppModelManager::instance(), connect(CppModelManager::instance(),
@@ -588,7 +588,7 @@ void ClangModelManagerSupport::updateLanguageClient(ProjectExplorer::Project *pr
}); });
}); });
const Utils::FilePath includeDir = settings.clangdIncludePath(); const FilePath includeDir = settings.clangdIncludePath();
auto future = Utils::runAsync(&Internal::generateCompilationDB, projectInfo, auto future = Utils::runAsync(&Internal::generateCompilationDB, projectInfo,
jsonDbDir, CompilationDbPurpose::CodeModel, jsonDbDir, CompilationDbPurpose::CodeModel,
warningsConfigForProject(project), warningsConfigForProject(project),
@@ -629,7 +629,7 @@ ClangdClient *ClangModelManagerSupport::clientWithProject(const ProjectExplorer:
return clients.empty() ? nullptr : qobject_cast<ClangdClient *>(clients.first()); return clients.empty() ? nullptr : qobject_cast<ClangdClient *>(clients.first());
} }
ClangdClient *ClangModelManagerSupport::clientForFile(const Utils::FilePath &file) ClangdClient *ClangModelManagerSupport::clientForFile(const FilePath &file)
{ {
return qobject_cast<ClangdClient *>(LanguageClientManager::clientForFilePath(file)); return qobject_cast<ClangdClient *>(LanguageClientManager::clientForFilePath(file));
} }
@@ -663,10 +663,10 @@ void ClangModelManagerSupport::claimNonProjectSources(ClangdClient *client)
void ClangModelManagerSupport::watchForExternalChanges() void ClangModelManagerSupport::watchForExternalChanges()
{ {
connect(Core::DocumentManager::instance(), &Core::DocumentManager::filesChangedExternally, connect(Core::DocumentManager::instance(), &Core::DocumentManager::filesChangedExternally,
this, [this](const QSet<Utils::FilePath> &files) { this, [this](const QSet<FilePath> &files) {
if (!LanguageClientManager::hasClients<ClangdClient>()) if (!LanguageClientManager::hasClients<ClangdClient>())
return; return;
for (const Utils::FilePath &file : files) { for (const FilePath &file : files) {
const ProjectFile::Kind kind = ProjectFile::classify(file.toString()); const ProjectFile::Kind kind = ProjectFile::classify(file.toString());
if (!ProjectFile::isSource(kind) && !ProjectFile::isHeader(kind)) if (!ProjectFile::isSource(kind) && !ProjectFile::isHeader(kind))
continue; continue;
@@ -691,8 +691,8 @@ void ClangModelManagerSupport::watchForExternalChanges()
void ClangModelManagerSupport::watchForInternalChanges() void ClangModelManagerSupport::watchForInternalChanges()
{ {
connect(Core::DocumentManager::instance(), &Core::DocumentManager::filesChangedInternally, connect(Core::DocumentManager::instance(), &Core::DocumentManager::filesChangedInternally,
this, [this](const Utils::FilePaths &filePaths) { this, [this](const FilePaths &filePaths) {
for (const Utils::FilePath &fp : filePaths) { for (const FilePath &fp : filePaths) {
const ProjectFile::Kind kind = ProjectFile::classify(fp.toString()); const ProjectFile::Kind kind = ProjectFile::classify(fp.toString());
if (!ProjectFile::isSource(kind) && !ProjectFile::isHeader(kind)) if (!ProjectFile::isSource(kind) && !ProjectFile::isHeader(kind))
continue; continue;
@@ -755,7 +755,7 @@ void ClangModelManagerSupport::onAbstractEditorSupportContentsUpdated(const QStr
if (content.size() == 0) if (content.size() == 0)
return; // Generation not yet finished. return; // Generation not yet finished.
const auto fp = Utils::FilePath::fromString(filePath); const auto fp = FilePath::fromString(filePath);
const QString stringContent = QString::fromUtf8(content); const QString stringContent = QString::fromUtf8(content);
if (Client * const client = clientForGeneratedFile(fp)) { if (Client * const client = clientForGeneratedFile(fp)) {
client->setShadowDocument(fp, stringContent); client->setShadowDocument(fp, stringContent);
@@ -770,7 +770,7 @@ void ClangModelManagerSupport::onAbstractEditorSupportRemoved(const QString &fil
{ {
QTC_ASSERT(!filePath.isEmpty(), return); QTC_ASSERT(!filePath.isEmpty(), return);
const auto fp = Utils::FilePath::fromString(filePath); const auto fp = FilePath::fromString(filePath);
if (Client * const client = clientForGeneratedFile(fp)) { if (Client * const client = clientForGeneratedFile(fp)) {
client->removeShadowDocument(fp); client->removeShadowDocument(fp);
ClangdClient::handleUiHeaderChange(fp.fileName()); ClangdClient::handleUiHeaderChange(fp.fileName());
@@ -809,7 +809,7 @@ void ClangModelManagerSupport::onTextMarkContextMenuRequested(TextEditor::TextEd
QTC_ASSERT(lineNumber >= 1, return); QTC_ASSERT(lineNumber >= 1, return);
QTC_ASSERT(menu, return); QTC_ASSERT(menu, return);
const Utils::FilePath filePath = widget->textDocument()->filePath(); const FilePath filePath = widget->textDocument()->filePath();
ClangEditorDocumentProcessor *processor = ClangEditorDocumentProcessor::get(filePath); ClangEditorDocumentProcessor *processor = ClangEditorDocumentProcessor::get(filePath);
if (processor) { if (processor) {
const auto assistInterface = createAssistInterface(widget, lineNumber); const auto assistInterface = createAssistInterface(widget, lineNumber);
@@ -916,5 +916,4 @@ void ClangModelManagerSupport::reinitializeBackendDocuments(const QStringList &p
} }
} }
} // Internal } // ClangCodeModel::Internal
} // ClangCodeModel

View File

@@ -3,6 +3,7 @@
#include "clangtextmark.h" #include "clangtextmark.h"
#include "clangcodemodeltr.h"
#include "clangconstants.h" #include "clangconstants.h"
#include "clangdclient.h" #include "clangdclient.h"
#include "clangdiagnostictooltipwidget.h" #include "clangdiagnostictooltipwidget.h"
@@ -10,6 +11,7 @@
#include "clangutils.h" #include "clangutils.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <cppeditor/clangdiagnosticconfigsmodel.h> #include <cppeditor/clangdiagnosticconfigsmodel.h>
#include <cppeditor/cppeditorconstants.h> #include <cppeditor/cppeditorconstants.h>
#include <cppeditor/cpptoolsreuse.h> #include <cppeditor/cpptoolsreuse.h>
@@ -283,7 +285,7 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
const bool isError = diagnostic.severity() const bool isError = diagnostic.severity()
&& *diagnostic.severity() == DiagnosticSeverity::Error; && *diagnostic.severity() == DiagnosticSeverity::Error;
setDefaultToolTip(isError ? tr("Code Model Error") : tr("Code Model Warning")); setDefaultToolTip(isError ? Tr::tr("Code Model Error") : Tr::tr("Code Model Warning"));
setPriority(isError ? TextEditor::TextMark::HighPriority setPriority(isError ? TextEditor::TextMark::HighPriority
: TextEditor::TextMark::NormalPriority); : TextEditor::TextMark::NormalPriority);
setIcon(isError ? Icons::CODEMODEL_ERROR.icon() : Icons::CODEMODEL_WARNING.icon()); setIcon(isError ? Icons::CODEMODEL_ERROR.icon() : Icons::CODEMODEL_WARNING.icon());
@@ -299,7 +301,7 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
QList<QAction *> actions; QList<QAction *> actions;
QAction *action = new QAction(); QAction *action = new QAction();
action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon())); action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon()));
action->setToolTip(tr("Copy to Clipboard", "Clang Code Model Marks")); action->setToolTip(Tr::tr("Copy to Clipboard", "Clang Code Model Marks"));
QObject::connect(action, &QAction::triggered, [diag] { QObject::connect(action, &QAction::triggered, [diag] {
const QString text = ClangDiagnosticWidget::createText({diag}, const QString text = ClangDiagnosticWidget::createText({diag},
ClangDiagnosticWidget::InfoBar); ClangDiagnosticWidget::InfoBar);
@@ -312,7 +314,7 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
if (project && isDiagnosticConfigChangable(project, diag)) { if (project && isDiagnosticConfigChangable(project, diag)) {
action = new QAction(); action = new QAction();
action->setIcon(Icons::BROKEN.icon()); action->setIcon(Icons::BROKEN.icon());
action->setToolTip(tr("Disable Diagnostic in Current Project")); action->setToolTip(Tr::tr("Disable Diagnostic in Current Project"));
QObject::connect(action, &QAction::triggered, [diag] { QObject::connect(action, &QAction::triggered, [diag] {
disableDiagnosticInCurrentProjectConfig(diag); disableDiagnosticInCurrentProjectConfig(diag);
}); });

View File

@@ -22,7 +22,6 @@ class ClangdClient;
class ClangdTextMark : public TextEditor::TextMark class ClangdTextMark : public TextEditor::TextMark
{ {
Q_DECLARE_TR_FUNCTIONS(ClangdTextMark)
public: public:
ClangdTextMark(const ::Utils::FilePath &filePath, ClangdTextMark(const ::Utils::FilePath &filePath,
const LanguageServerProtocol::Diagnostic &diagnostic, const LanguageServerProtocol::Diagnostic &diagnostic,

View File

@@ -3,6 +3,8 @@
#include "clangutils.h" #include "clangutils.h"
#include "clangcodemodeltr.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/idocument.h> #include <coreplugin/idocument.h>
#include <cppeditor/baseeditordocumentparser.h> #include <cppeditor/baseeditordocumentparser.h>
@@ -239,9 +241,9 @@ QString DiagnosticTextInfo::category() const
const int index = m_squareBracketStartIndex + 1; const int index = m_squareBracketStartIndex + 1;
if (isClazyOption(m_text.mid(index))) if (isClazyOption(m_text.mid(index)))
return QCoreApplication::translate("ClangDiagnosticWidget", "Clazy Issue"); return Tr::tr("Clazy Issue");
else else
return QCoreApplication::translate("ClangDiagnosticWidget", "Clang-Tidy Issue"); return Tr::tr("Clang-Tidy Issue");
} }
bool DiagnosticTextInfo::isClazyOption(const QString &option) bool DiagnosticTextInfo::isClazyOption(const QString &option)