use of com.github._1c_syntax.mdclasses.Configuration in project bsl-language-server by 1c-syntax.
the class ServerContextTest method testConfigurationMetadata.
@Test
void testConfigurationMetadata() {
Path path = Absolute.path(PATH_TO_METADATA);
serverContext.setConfigurationRoot(path);
Configuration configurationMetadata = serverContext.getConfiguration();
assertThat(configurationMetadata).isNotNull();
assertThat(configurationMetadata.getScriptVariant()).isEqualTo(ScriptVariant.RUSSIAN);
assertThat(configurationMetadata.getConfigurationSource()).isEqualTo(ConfigurationSource.DESIGNER);
assertThat(configurationMetadata.getCompatibilityMode().getMinor()).isEqualTo(3);
assertThat(configurationMetadata.getCompatibilityMode().getVersion()).isEqualTo(10);
File file = new File(PATH_TO_METADATA, PATH_TO_MODULE_FILE);
ModuleType type = configurationMetadata.getModuleType(Absolute.uri(file.toURI()));
assertThat(type).isEqualTo(ModuleType.CommonModule);
}
use of com.github._1c_syntax.mdclasses.Configuration in project bsl-language-server by 1c-syntax.
the class CachedPublicDiagnosticTest method getDocumentContextFromFile.
@SneakyThrows
void getDocumentContextFromFile(Path testFile) {
Path path = Absolute.path(PATH_TO_METADATA);
Path moduleFile = Paths.get(PATH_TO_MODULE_FILE).toAbsolutePath();
initServerContext(path);
var configuration = context.getConfiguration();
documentContext = spy(TestUtils.getDocumentContext(testFile.toUri(), FileUtils.readFileToString(testFile.toFile(), StandardCharsets.UTF_8), context));
module = spy((MDCommonModule) configuration.getModulesByObject().get(moduleFile.toUri()));
}
use of com.github._1c_syntax.mdclasses.Configuration in project bsl-language-server by 1c-syntax.
the class CommonModuleInvalidTypeDiagnosticTest method getDocumentContextFromFile.
@SneakyThrows
void getDocumentContextFromFile() {
Path path = Absolute.path(PATH_TO_METADATA);
Path testFile = Paths.get(PATH_TO_MODULE_FILE).toAbsolutePath();
initServerContext(path);
var configuration = context.getConfiguration();
documentContext = spy(TestUtils.getDocumentContext(testFile.toUri(), FileUtils.readFileToString(testFile.toFile(), StandardCharsets.UTF_8), context));
module = spy((MDCommonModule) configuration.getModulesByObject().get(documentContext.getUri()));
}
use of com.github._1c_syntax.mdclasses.Configuration in project bsl-language-server by 1c-syntax.
the class CommonModuleNameCachedDiagnosticTest method getDocumentContextFromFile.
@SneakyThrows
void getDocumentContextFromFile() {
Path path = Absolute.path(PATH_TO_METADATA);
Path testFile = Paths.get(PATH_TO_MODULE_FILE).toAbsolutePath();
initServerContext(path);
var configuration = context.getConfiguration();
documentContext = spy(TestUtils.getDocumentContext(testFile.toUri(), FileUtils.readFileToString(testFile.toFile(), StandardCharsets.UTF_8), context));
module = spy((MDCommonModule) configuration.getModulesByObject().get(documentContext.getUri()));
}
use of com.github._1c_syntax.mdclasses.Configuration in project bsl-language-server by 1c-syntax.
the class CommonModuleNameClientServerDiagnosticTest method getDocumentContextFromFile.
@SneakyThrows
void getDocumentContextFromFile() {
Path path = Absolute.path(PATH_TO_METADATA);
Path testFile = Paths.get(PATH_TO_MODULE_FILE).toAbsolutePath();
initServerContext(path);
var configuration = context.getConfiguration();
documentContext = spy(TestUtils.getDocumentContext(testFile.toUri(), FileUtils.readFileToString(testFile.toFile(), StandardCharsets.UTF_8), context));
module = spy((MDCommonModule) configuration.getModulesByObject().get(documentContext.getUri()));
}
Aggregations