add SetSharpIdeFile activity

This commit is contained in:
Matt Parker
2025-10-25 12:02:37 +10:00
parent 20290d78f8
commit bcc3c7e2db

View File

@@ -342,6 +342,7 @@ public partial class SharpIdeCodeEdit : CodeEdit
public async Task SetSharpIdeFile(SharpIdeFile file, SharpIdeFileLinePosition? fileLinePosition = null)
{
await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); // get off the UI thread
using var __ = SharpIdeOtel.Source.StartActivity($"{nameof(SharpIdeCodeEdit)}.{nameof(SetSharpIdeFile)}");
_currentFile = file;
var readFileTask = _openTabsFileManager.GetFileTextAsync(file);
_currentFile.FileContentsChangedExternally.Subscribe(OnFileChangedExternally);