forked from qt-creator/qt-creator
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:
@@ -292,6 +292,8 @@ TextDocument *TextDocument::currentTextDocument()
|
||||
|
||||
TextDocument *TextDocument::textDocumentForFilePath(const Utils::FilePath &filePath)
|
||||
{
|
||||
if (filePath.isEmpty())
|
||||
return nullptr;
|
||||
return qobject_cast<TextDocument *>(DocumentModel::documentForFilePath(filePath));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user