ClangFormat: Replace checks widget with editor

The existing approach utilizing the widget poses maintenance
challenges, primarily due to the dynamic nature of clang-format
settings across versions. The widget necessitates regeneration
for each new version, and compatibility issues arise when users
have different clang-format versions on their devices.

The updated solution adopts an Editor integrated with a yaml
language server, offering the ability to highlight and provide
code completion for the .clang-format file. This resolves the
widget regeneration issue and ensures compatibility with various
clang-format versions.

- Replaced the checks widget with an editor
- Introduced a line for yaml language server schema
in .clang-format files to enable autocompletion.
ToDo: Enhance schema accessibility without relying on this line.
- Added Ctrl+Space shortcut for autocompletion
- Added Ctrl+S shortcut for saving
- Eliminated outdated logic related to the checks widget
- Fixed copying and removal of clang-format settings

Change-Id: I2e3fbf19abe2f4df031f6ba5faffd47e07274346
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Artem Sokolovskii
2024-01-03 14:56:54 +01:00
committed by hjk
parent 78a909390c
commit e1f7469afb
20 changed files with 288 additions and 1892 deletions

View File

@@ -165,6 +165,7 @@ void CodeStyleSelectorWidget::slotCopyClicked()
ICodeStylePreferences *copy = codeStylePool->cloneCodeStyle(currentPreferences);
if (copy) {
copy->setDisplayName(newName);
emit m_codeStyle->aboutToBeCopied(currentPreferences, copy);
m_codeStyle->setCurrentDelegate(copy);
}
}