use of com.github._1c_syntax.bsl.languageserver.configuration.Language.DEFAULT_LANGUAGE in project bsl-language-server by 1c-syntax.
the class LanguageServerConfigurationTest method testPartialInitialization.
@Test
void testPartialInitialization() {
// given
File configurationFile = new File(PATH_TO_PARTIAL_CONFIGURATION_FILE);
configuration.update(configurationFile);
// when
CodeLensOptions codeLensOptions = configuration.getCodeLensOptions();
DiagnosticsOptions diagnosticsOptions = configuration.getDiagnosticsOptions();
// then
assertThat(codeLensOptions.isShowCognitiveComplexity()).isTrue();
assertThat(codeLensOptions.isShowCyclomaticComplexity()).isFalse();
assertThat(configuration.getLanguage()).isEqualTo(DEFAULT_LANGUAGE);
assertThat(diagnosticsOptions.getMode()).isEqualTo(Mode.ON);
assertThat(diagnosticsOptions.getSkipSupport()).isEqualTo(SkipSupport.NEVER);
assertThat(diagnosticsOptions.getParameters()).isEmpty();
}
use of com.github._1c_syntax.bsl.languageserver.configuration.Language.DEFAULT_LANGUAGE in project bsl-language-server by 1c-syntax.
the class LanguageServerConfigurationTest method createFromEmptyFile.
@Test
void createFromEmptyFile() {
// given
File configurationFile = new File(PATH_TO_EMPTY_CONFIGURATION_FILE);
// when
configuration.update(configurationFile);
// then
DiagnosticsOptions diagnosticsOptions = configuration.getDiagnosticsOptions();
Language language = configuration.getLanguage();
Map<String, Either<Boolean, Map<String, Object>>> parameters = diagnosticsOptions.getParameters();
assertThat(language).isEqualTo(DEFAULT_LANGUAGE);
assertThat(parameters).isEmpty();
}
Aggregations