Skip to content

Commit 1f9c667

Browse files
committed
Roll back compilation cancellation in WIP language server
1 parent 9561d3d commit 1f9c667

File tree

1 file changed

+0
-17
lines changed
  • YarnSpinner.LanguageServer/src/Server/Workspace

1 file changed

+0
-17
lines changed

YarnSpinner.LanguageServer/src/Server/Workspace/Project.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ internal class Project
2121
public DocumentUri? Uri { get; init; }
2222
public bool IsImplicitProject { get; init; }
2323

24-
CancellationTokenSource? currentCompilationCTS = null;
25-
2624
internal IEnumerable<Yarn.Compiler.Declaration> Variables
2725
{
2826
get
@@ -274,14 +272,6 @@ public struct CompileProjectOptions
274272

275273
public async Task<Yarn.Compiler.CompilationResult> CompileProjectAsync(bool notifyOnComplete, Yarn.Compiler.CompilationJob.Type compilationType, CancellationToken cancellationToken)
276274
{
277-
// If there's an existing cancellation token source for this project, cancel it now
278-
if (currentCompilationCTS != null)
279-
{
280-
await currentCompilationCTS.CancelAsync();
281-
currentCompilationCTS.Dispose();
282-
}
283-
284-
currentCompilationCTS = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
285275

286276
var functionDeclarations = Functions.Select(f => f.Declaration).NonNull().ToArray();
287277

@@ -306,9 +296,6 @@ public struct CompileProjectOptions
306296
return compilationResult;
307297
}).ConfigureAwait(ConfigureAwaitOptions.ContinueOnCapturedContext);
308298

309-
// This compilation is cancelled. Early out.
310-
cancellationToken.ThrowIfCancellationRequested();
311-
312299
this.LastCompilationResult = compilationResult;
313300

314301

@@ -319,7 +306,6 @@ public struct CompileProjectOptions
319306
.Where(n => n.SourceTitle != null))
320307
.ToLookup(n => n.SourceTitle!);
321308

322-
323309
foreach (var file in this.Files)
324310
{
325311
foreach (var jump in file.NodeJumps)
@@ -333,9 +319,6 @@ public struct CompileProjectOptions
333319
{
334320
OnProjectCompiled?.Invoke(compilationResult);
335321
}
336-
currentCompilationCTS.Dispose();
337-
currentCompilationCTS = null;
338-
339322
return compilationResult;
340323
}
341324

0 commit comments

Comments
 (0)