Skip to content

Commit

Permalink
смена формата генерации конфигурации bsl ls по умолчанию
Browse files Browse the repository at this point in the history
  • Loading branch information
otymko committed Jun 1, 2020
1 parent 2ba4897 commit 284ed02
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 11 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/org/github/otymko/phoenixbsl/core/PhoenixApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}

0 comments on commit 284ed02

Please sign in to comment.