Skip to content

Commit e3fc9df

Browse files
committed
Use appropriate cancellation method for each
1 parent 95f7105 commit e3fc9df

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/PowerShellEditorServices.Test/Language/CompletionHandlerTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ public async Task CompletesFilePath()
130130
public async Task CompletionResolveHandlesTaskCanceledException()
131131
{
132132
using CancellationTokenSource cancellationTokenSource = new();
133+
#if NET5_0_OR_GREATER
133134
await cancellationTokenSource.CancelAsync();
134-
135+
#else
136+
cancellationTokenSource.Cancel();
137+
#endif
135138
CompletionItem request = new()
136139
{
137140
Kind = CompletionItemKind.Function,

0 commit comments

Comments
 (0)