Skip to content

Commit

Permalink
Add conditional cancel checker setting
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeeshaan committed Sep 21, 2021
1 parent 424339b commit 81b156d
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -76,6 +76,8 @@ public class AbstractDocumentServiceContext implements DocumentServiceContext {
private final LanguageServerContext languageServerContext;

private CancelChecker cancelChecker;

private static final boolean ON_DEBUG_MODE = System.getenv("BAL_JAVA_DEBUG") != null;

AbstractDocumentServiceContext(LSOperation operation,
String fileUri,
Expand All @@ -98,7 +100,10 @@ public class AbstractDocumentServiceContext implements DocumentServiceContext {
LanguageServerContext serverContext,
CancelChecker cancelChecker) {
this(operation, fileUri, wsManager, serverContext);
this.cancelChecker = cancelChecker;
// This is to facilitate the development in debug mode.
if (!ON_DEBUG_MODE) {
this.cancelChecker = cancelChecker;
}
}

/**
Expand Down

0 comments on commit 81b156d

Please sign in to comment.