CppEditor: FilePathify some of the refactoring operations

... and adjust surrounding code.

Change-Id: I1d36e5a0c6ba14a1d9b8fd59340f1bb2a1e45ad1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-11-24 17:00:52 +01:00
parent edd0e97ce1
commit e42d24fca9
18 changed files with 221 additions and 233 deletions

View File

@@ -52,6 +52,7 @@
using namespace CppEditor;
using namespace LanguageClient;
using namespace Utils;
namespace ClangCodeModel {
namespace Internal {
@@ -337,12 +338,11 @@ void ClangModelManagerSupport::findUsages(const CppEditor::CursorInEditor &curso
CppModelManager::findUsages(cursor, CppModelManager::Backend::Builtin);
}
void ClangModelManagerSupport::switchHeaderSource(const Utils::FilePath &filePath, bool inNextSplit)
void ClangModelManagerSupport::switchHeaderSource(const FilePath &filePath, bool inNextSplit)
{
if (ClangdClient * const client = clientForFile(filePath)) {
// The fast, synchronous approach works most of the time, so let's try that one first.
const auto otherFile = Utils::FilePath::fromString(
correspondingHeaderOrSource(filePath.toString()));
const FilePath otherFile = correspondingHeaderOrSource(filePath);
if (!otherFile.isEmpty())
openEditor(otherFile, inNextSplit);
else