diff --git a/build.gradle.kts b/build.gradle.kts index 54014cd..16690f6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,6 +24,8 @@ version = "0.3.6" dependencies { testImplementation("com.hynnet", "jacob", "1.18") testImplementation("junit", "junit", "4.12") + testImplementation("org.assertj", "assertj-core", "3.16.1") + implementation("net.java.dev.jna:jna-platform:5.4.0") implementation("org.eclipse.lsp4j", "org.eclipse.lsp4j", "0.8.1") implementation("ch.qos.logback", "logback-classic", "1.2.3") diff --git a/src/main/java/org/github/otymko/phoenixbsl/core/PhoenixApp.java b/src/main/java/org/github/otymko/phoenixbsl/core/PhoenixApp.java index 97f3c4e..a194e6f 100644 --- a/src/main/java/org/github/otymko/phoenixbsl/core/PhoenixApp.java +++ b/src/main/java/org/github/otymko/phoenixbsl/core/PhoenixApp.java @@ -471,11 +471,15 @@ public void initBSLConfiguration() { public void createBSLConfigurationFile() { var bslConfiguration = new BSLConfiguration(); - bslConfiguration.setDiagnosticLanguage("ru"); - bslConfiguration.setShowCognitiveComplexityCodeLens(false); - bslConfiguration.setShowCyclomaticComplexityCodeLens(false); - bslConfiguration.setComputeDiagnosticsTrigger("onSave"); - bslConfiguration.setComputeDiagnosticsSkipSupport("withSupportLocked"); + bslConfiguration.setLanguage("ru"); + var codeLens = new BSLConfiguration.CodeLensOptions(); + codeLens.setShowCognitiveComplexity(false); + codeLens.setShowCyclomaticComplexity(false); + bslConfiguration.setCodeLens(codeLens); + var diagnosticsOptions = new BSLConfiguration.DiagnosticsOptions(); + diagnosticsOptions.setComputeTrigger("onSave"); + diagnosticsOptions.setSkipSupport("never"); + bslConfiguration.setDiagnostics(diagnosticsOptions); bslConfiguration.setConfigurationRoot("src"); pathToBSLConfigurationDefault.getParent().toFile().mkdirs(); diff --git a/src/main/java/org/github/otymko/phoenixbsl/lsp/BSLConfiguration.java b/src/main/java/org/github/otymko/phoenixbsl/lsp/BSLConfiguration.java index a51f31f..08c92a7 100644 --- a/src/main/java/org/github/otymko/phoenixbsl/lsp/BSLConfiguration.java +++ b/src/main/java/org/github/otymko/phoenixbsl/lsp/BSLConfiguration.java @@ -3,20 +3,41 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; @Slf4j @Data +@NoArgsConstructor @JsonIgnoreProperties(ignoreUnknown = true) public class BSLConfiguration { - private String diagnosticLanguage; - private boolean showCognitiveComplexityCodeLens; - private boolean showCyclomaticComplexityCodeLens; - @JsonIgnore - private String computeDiagnosticsTrigger = "onSave"; - private String computeDiagnosticsSkipSupport; + private String language; + private CodeLensOptions codeLens; + private DiagnosticsOptions diagnostics; + private DocumentLinkOptions documentLink; private String traceLog; private String configurationRoot; + @Data + @JsonIgnoreProperties(ignoreUnknown = true) + public static class CodeLensOptions { + private boolean showCognitiveComplexity = true; + private boolean showCyclomaticComplexity = true; + } + + @Data + @JsonIgnoreProperties(ignoreUnknown = true) + public static class DiagnosticsOptions { + @JsonIgnore + private String computeTrigger = "onSave"; + private String skipSupport = "never"; + } + + @Data + @JsonIgnoreProperties(ignoreUnknown = true) + public class DocumentLinkOptions { + private boolean useDevSite = false; + } + }