Search in sources :

Example 1 with MDCommonModule

use of com.github._1c_syntax.mdclasses.mdo.MDCommonModule 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()));
}
Also used : Path(java.nio.file.Path) MDCommonModule(com.github._1c_syntax.mdclasses.mdo.MDCommonModule) SneakyThrows(lombok.SneakyThrows)

Example 2 with MDCommonModule

use of com.github._1c_syntax.mdclasses.mdo.MDCommonModule 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()));
}
Also used : Path(java.nio.file.Path) MDCommonModule(com.github._1c_syntax.mdclasses.mdo.MDCommonModule) SneakyThrows(lombok.SneakyThrows)

Example 3 with MDCommonModule

use of com.github._1c_syntax.mdclasses.mdo.MDCommonModule 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()));
}
Also used : Path(java.nio.file.Path) MDCommonModule(com.github._1c_syntax.mdclasses.mdo.MDCommonModule) SneakyThrows(lombok.SneakyThrows)

Example 4 with MDCommonModule

use of com.github._1c_syntax.mdclasses.mdo.MDCommonModule 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()));
}
Also used : Path(java.nio.file.Path) MDCommonModule(com.github._1c_syntax.mdclasses.mdo.MDCommonModule) SneakyThrows(lombok.SneakyThrows)

Example 5 with MDCommonModule

use of com.github._1c_syntax.mdclasses.mdo.MDCommonModule in project bsl-language-server by 1c-syntax.

the class CommonModuleNameGlobalDiagnosticTest 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()));
}
Also used : Path(java.nio.file.Path) MDCommonModule(com.github._1c_syntax.mdclasses.mdo.MDCommonModule) SneakyThrows(lombok.SneakyThrows)

Aggregations

MDCommonModule (com.github._1c_syntax.mdclasses.mdo.MDCommonModule)10 Path (java.nio.file.Path)10 SneakyThrows (lombok.SneakyThrows)10