forked from qt-creator/qt-creator
		
	ClangCodeModel: reuse Id for restarted clients
This is needed to keep annotations hidden after the restart of clangd if the user disabled them in the text mark tooltip. Change-Id: I69a668f2ba71f1dda83eca74a064af7ec1f92e77 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
		@@ -494,9 +494,12 @@ void ClangModelManagerSupport::updateLanguageClient(ProjectExplorer::Project *pr
 | 
			
		||||
                        .arg(result.error));
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        if (Client * const oldClient = clientForProject(project))
 | 
			
		||||
        Utils::Id previousId;
 | 
			
		||||
        if (Client * const oldClient = clientForProject(project)) {
 | 
			
		||||
            previousId = oldClient->id();
 | 
			
		||||
            LanguageClientManager::shutdownClient(oldClient);
 | 
			
		||||
        ClangdClient * const client = new ClangdClient(project, jsonDbDir);
 | 
			
		||||
        }
 | 
			
		||||
        ClangdClient * const client = new ClangdClient(project, jsonDbDir, previousId);
 | 
			
		||||
        connect(client, &Client::shadowDocumentSwitched, this, [](const Utils::FilePath &fp) {
 | 
			
		||||
            ClangdClient::handleUiHeaderChange(fp.fileName());
 | 
			
		||||
        });
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user