Skip to content

Commit

Permalink
Merge pull request #3256 from 1c-syntax/feature/optimize240312
Browse files Browse the repository at this point in the history
фиксы для оптимизации выполнения
  • Loading branch information
theshadowco authored Mar 25, 2024
2 parents 0d3db6e + 4fa773a commit 17aeb72
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ public/
bsl-language-server/
bsl-language-server_*.zip
/.idea/misc.xml
*.log
*.hprof
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ dependencies {
exclude("org.abego.treelayout", "org.abego.treelayout.core")
exclude("org.antlr", "antlr-runtime")
}
api("com.github.1c-syntax", "utils", "0.5.2")
api("io.github.1c-syntax", "mdclasses", "0.13.0-rc.1")
api("io.github.1c-syntax", "utils", "0.6.0")
api("io.github.1c-syntax", "mdclasses", "0.13.0-rc.2")
api("io.github.1c-syntax", "bsl-common-library", "0.5.1")
api("io.github.1c-syntax", "supportconf", "0.13.1")
api("io.github.1c-syntax", "supportconf", "0.14.0")
api("io.github.1c-syntax", "bsl-parser-core", "0.1.0")

// JLanguageTool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.github._1c_syntax.bsl.languageserver.context.symbol.SymbolTree;
import com.github._1c_syntax.bsl.languageserver.utils.Trees;
import com.github._1c_syntax.bsl.mdo.MD;
import com.github._1c_syntax.bsl.mdo.Module;
import com.github._1c_syntax.bsl.mdo.support.ScriptVariant;
import com.github._1c_syntax.bsl.parser.BSLLexer;
import com.github._1c_syntax.bsl.parser.BSLParser;
Expand Down Expand Up @@ -366,10 +365,7 @@ private SymbolTree computeSymbolTree() {


private ModuleType computeModuleType() {
return context.getConfiguration()
.getModuleByUri(uri)
.map(Module::getModuleType)
.orElse(ModuleType.UNKNOWN);
return context.getConfiguration().getModuleTypeByURI(uri);
}

private ComplexityData computeCognitiveComplexity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticSeverity;
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticTag;
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticType;
import com.github._1c_syntax.bsl.mdo.AttributeOwner;
import com.github._1c_syntax.bsl.mdo.ChildrenOwner;
import com.github._1c_syntax.bsl.mdo.MD;
import com.github._1c_syntax.bsl.types.MdoReference;
Expand Down Expand Up @@ -136,8 +137,8 @@ protected void checkMetadata(MD mdo) {
checkName(mdo.getName(), mdo.getMdoReference());

// проверка имен реквизитов и табличных частей
if (mdo instanceof ChildrenOwner childrenOwner) {
childrenOwner.getMDOPlainChildren()
if (mdo instanceof AttributeOwner childrenOwner) {
childrenOwner.getPlainStorageFields()
.forEach(child -> checkName(child.getName(), child.getMdoReference()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void testCatalog() {
when(spyCatalog.getName()).thenReturn("Справочник");

List<MD> children = new ArrayList<>();
spyCatalog.getMDOPlainChildren()
spyCatalog.getPlainStorageFields()
.forEach(mdo -> {
var spyMDO = spy(mdo);
when(spyMDO.getName()).thenReturn("РегистрСведений");
Expand All @@ -74,7 +74,7 @@ void testCatalog() {
children.add(spyMDO);
});

when(spyCatalog.getMDOPlainChildren()).thenReturn(children);
when(spyCatalog.getPlainStorageFields()).thenReturn(children);
when(documentContext.getMdObject()).thenReturn(Optional.of(spyCatalog));

List<Diagnostic> diagnostics = diagnosticInstance.getDiagnostics(documentContext);
Expand Down

0 comments on commit 17aeb72

Please sign in to comment.