diff options
author | Miguel Costa <miguel.costa@qt.io> | 2022-02-25 18:07:40 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2022-03-01 12:14:05 +0000 |
commit | 2462e97dcd0ddaab4a80aae5f7c5ed81d6562332 (patch) | |
tree | e9c5158826cf5033cc8d21f3d64a5a0dbeef7e28 | |
parent | 87f3d1e099bc010b80547b5cc03c69228e12536d (diff) |
Fix ThrowIfNotOnUIThread exception
Change-Id: I178eccdef756167715e11d17e5d894651594501c
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
-rw-r--r-- | QtVsTools.Package/Editors/Editor.QtDesigner.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/QtVsTools.Package/Editors/Editor.QtDesigner.cs b/QtVsTools.Package/Editors/Editor.QtDesigner.cs index 087010d8..cddc7fa5 100644 --- a/QtVsTools.Package/Editors/Editor.QtDesigner.cs +++ b/QtVsTools.Package/Editors/Editor.QtDesigner.cs @@ -71,20 +71,23 @@ namespace QtVsTools.Editors var project = document.ProjectItem?.ContainingProject; if (project == null || !QtProjectTracker.IsTracked(project.FullName)) return; + string projectPath = project.FullName; string filePath = document.FullName; string[] itemId = new[] { document.ProjectItem?.Name }; var lastWriteTime = File.GetLastWriteTime(filePath); - _ = Task.Run(() => + _ = Task.Run(async () => { while (!process.WaitForExit(1000)) { var latestWriteTime = File.GetLastWriteTime(filePath); if (lastWriteTime != latestWriteTime) { lastWriteTime = latestWriteTime; - QtProjectIntellisense.Refresh(project, selectedFiles: itemId); + await QtProjectIntellisense.RefreshAsync( + project, projectPath, selectedFiles: itemId); } } if (lastWriteTime != File.GetLastWriteTime(filePath)) { - QtProjectIntellisense.Refresh(project, selectedFiles: itemId); + await QtProjectIntellisense.RefreshAsync( + project, projectPath, selectedFiles: itemId); } }); } |