Skip to content

Commit

Permalink
Merge pull request #3322 from 1c-syntax/feature/optimyze110724
Browse files Browse the repository at this point in the history
фикс для обновления mdclasses
  • Loading branch information
theshadowco authored Jul 11, 2024
2 parents 52c9f43 + 82a076e commit 18d2b55
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
9 changes: 6 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ repositories {
mavenCentral()
maven(url = "https://jitpack.io")
maven(url = "https://projectlombok.org/edge-releases")
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots")
}

group = "io.github.1c-syntax"
Expand Down Expand Up @@ -88,9 +89,11 @@ dependencies {
exclude("org.antlr", "antlr-runtime")
}
api("io.github.1c-syntax", "utils", "0.6.1")
api("io.github.1c-syntax", "mdclasses", "0.13.0")
api("io.github.1c-syntax", "bsl-common-library", "0.6.0")
api("io.github.1c-syntax", "supportconf", "0.14.0")
api("io.github.1c-syntax", "mdclasses", "0.14.0")
api("io.github.1c-syntax", "bsl-common-library", "0.7.0")
api("io.github.1c-syntax", "supportconf", "0.14.0") {
exclude("io.github.1c-syntax", "bsl-common-library")
}
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 @@ -56,9 +56,9 @@ public void check() {
.filter(reference -> reference.getSymbol().isDeprecated())
.filter(reference -> !reference.getFrom().isDeprecated())
.forEach((Reference reference) -> {
Symbol deprecatedSymbol = reference.getSymbol();
String deprecationInfo = getDeprecationInfo(deprecatedSymbol);
String message = info.getMessage(deprecatedSymbol.getName(), deprecationInfo);
var deprecatedSymbol = reference.getSymbol();
var deprecationInfo = getDeprecationInfo(deprecatedSymbol);
var message = info.getMessage(deprecatedSymbol.getName(), deprecationInfo);
diagnosticStorage.addDiagnostic(reference.getSelectionRange(), message);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ private static class MethodCall {
Boolean[] parameters;
Range range;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
import com.github._1c_syntax.bsl.types.MdoReference;
import com.github._1c_syntax.utils.CaseInsensitivePattern;
import edu.umd.cs.findbugs.annotations.Nullable;
import lombok.AllArgsConstructor;
import lombok.Value;
import org.antlr.v4.runtime.tree.ParseTree;
import org.eclipse.lsp4j.Range;

Expand Down Expand Up @@ -160,8 +158,8 @@ private Map<String, List<String>> calcDataSourceWithTabularSectionNames(
.map(dataSourceContext -> new TabularSectionTable(getTableNameOrAlias(dataSourceContext),
getTabularSectionNames(dataSourceContext)))
.collect(Collectors.toMap(
TabularSectionTable::getTableNameOrAlias,
TabularSectionTable::getTabularSectionNames,
TabularSectionTable::tableNameOrAlias,
TabularSectionTable::tabularSectionNames,
(existing, replacement) -> existing));
}

Expand Down Expand Up @@ -322,10 +320,6 @@ private static List<ParseTree> extractFirstMetadataTypeName(SDBLParser.ColumnCon
return children.subList(1, children.size() - 1);
}

@Value
@AllArgsConstructor
private static class TabularSectionTable {
String tableNameOrAlias;
List<String> tabularSectionNames;
private record TabularSectionTable(String tableNameOrAlias, List<String> tabularSectionNames) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ public void check() {
documentContext.getSymbolTree().getVariables().stream()
.filter(variable -> CHECKING_VARIABLE_KINDS.contains(variable.getKind()))
.filter(variable -> !variable.isExport())
.filter(variable -> referenceIndex.getReferencesTo(variable).stream().filter(ref -> ref.getOccurrenceType() == OccurrenceType.REFERENCE).findFirst().isEmpty())
.forEach(variable -> diagnosticStorage.addDiagnostic(variable.getSelectionRange(), info.getMessage(variable.getName())));
.filter(variable -> referenceIndex.getReferencesTo(variable).stream()
.filter(ref -> ref.getOccurrenceType() == OccurrenceType.REFERENCE).findFirst().isEmpty()
)
.forEach(variable -> diagnosticStorage.addDiagnostic(
variable.getSelectionRange(), info.getMessage(variable.getName()))
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected void check() {
}

private static boolean wrongDataPath(FormItem formItem) {
return formItem.getDataPath().getSegments().startsWith("~");
return formItem.getDataPath().segments().startsWith("~");
}

private static boolean haveFormModules(Form form) {
Expand Down

0 comments on commit 18d2b55

Please sign in to comment.