From 88ca49092aeb49de8ca382b54ac0db1e581d191d Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Thu, 12 Dec 2024 17:08:34 -0600 Subject: [PATCH] Rename suppressFutureWarnings -> paranoidWarnings Signed-off-by: Ben Sherman --- .../nextflow/lsp/NextflowLanguageServer.java | 16 ++++++++-------- .../nextflow/lsp/services/LanguageService.java | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/language-server/src/main/java/nextflow/lsp/NextflowLanguageServer.java b/modules/language-server/src/main/java/nextflow/lsp/NextflowLanguageServer.java index c5e6cfe..051e510 100644 --- a/modules/language-server/src/main/java/nextflow/lsp/NextflowLanguageServer.java +++ b/modules/language-server/src/main/java/nextflow/lsp/NextflowLanguageServer.java @@ -124,7 +124,7 @@ public static void main(String[] args) { private List excludePatterns; private boolean harshilAlignment; - private boolean suppressFutureWarnings; + private boolean paranoidWarnings; // -- LanguageServer @@ -430,9 +430,9 @@ public void didChangeConfiguration(DidChangeConfigurationParams params) { if( harshilAlignment != null ) this.harshilAlignment = harshilAlignment; - var suppressFutureWarnings = getJsonBoolean(params.getSettings(), "nextflow.suppressFutureWarnings"); - if( suppressFutureWarnings != null && this.suppressFutureWarnings != suppressFutureWarnings ) { - this.suppressFutureWarnings = suppressFutureWarnings; + var paranoidWarnings = getJsonBoolean(params.getSettings(), "nextflow.paranoidWarnings"); + if( paranoidWarnings != null && this.paranoidWarnings != paranoidWarnings ) { + this.paranoidWarnings = paranoidWarnings; shouldInitialize = true; } @@ -451,8 +451,8 @@ public void didChangeConfiguration(DidChangeConfigurationParams params) { count++; var uri = workspaceRoots.get(name); - scriptServices.get(name).initialize(uri, this.excludePatterns, this.suppressFutureWarnings); - configServices.get(name).initialize(uri, this.excludePatterns, this.suppressFutureWarnings); + scriptServices.get(name).initialize(uri, this.excludePatterns, this.paranoidWarnings); + configServices.get(name).initialize(uri, this.excludePatterns, this.paranoidWarnings); } progressEnd(progressToken); @@ -502,8 +502,8 @@ public void didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParams params) { var uri = workspaceFolder.getUri(); log.debug("workspace/didChangeWorkspaceFolders add " + name + " " + uri); addWorkspaceFolder(name, uri); - scriptServices.get(name).initialize(uri, excludePatterns, suppressFutureWarnings); - configServices.get(name).initialize(uri, excludePatterns, suppressFutureWarnings); + scriptServices.get(name).initialize(uri, excludePatterns, paranoidWarnings); + configServices.get(name).initialize(uri, excludePatterns, paranoidWarnings); } } diff --git a/modules/language-server/src/main/java/nextflow/lsp/services/LanguageService.java b/modules/language-server/src/main/java/nextflow/lsp/services/LanguageService.java index 1a0d5c2..56721cf 100644 --- a/modules/language-server/src/main/java/nextflow/lsp/services/LanguageService.java +++ b/modules/language-server/src/main/java/nextflow/lsp/services/LanguageService.java @@ -120,12 +120,12 @@ public LanguageService() { private volatile boolean initialized; - private volatile boolean suppressFutureWarnings; + private volatile boolean paranoidWarnings; - public void initialize(String rootUri, List excludes, boolean suppressFutureWarnings) { + public void initialize(String rootUri, List excludes, boolean paranoidWarnings) { synchronized (this) { this.initialized = false; - this.suppressFutureWarnings = suppressFutureWarnings; + this.paranoidWarnings = paranoidWarnings; var uris = rootUri != null ? getWorkspaceFiles(rootUri, excludes) @@ -384,7 +384,7 @@ protected void publishDiagnostics(Set changedUris) { } for( var warning : astCache.getWarnings(uri) ) { - if( suppressFutureWarnings && warning instanceof FutureWarning ) + if( !paranoidWarnings && warning instanceof FutureWarning ) continue; var message = warning.getMessage();