Skip to content

Commit

Permalink
-set ver
Browse files Browse the repository at this point in the history
-fix diagdnostic
  • Loading branch information
theshadowco committed Dec 18, 2023
1 parent fea6354 commit 60d56fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repositories {
mavenLocal()
mavenCentral()
maven(url = "https://jitpack.io")
maven(url = "https://projectlombok.org/edge-releases")
maven(url = "https://projectlombok.org/edge-releases")
}

group = "io.github.1c-syntax"
Expand Down Expand Up @@ -83,7 +83,7 @@ dependencies {
exclude("org.glassfish", "javax.json")
}
api("com.github.1c-syntax", "utils", "0.5.1")
api("com.github.1c-syntax", "mdclasses", "develop-SNAPSHOT")
api("io.github.1c-syntax", "mdclasses", "0.12.0-rc.5")
api("io.github.1c-syntax", "bsl-common-library", "0.5.0")
api("io.github.1c-syntax", "supportconf", "0.12.1")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticType;
import com.github._1c_syntax.bsl.languageserver.references.ReferenceIndex;
import com.github._1c_syntax.bsl.languageserver.references.model.Reference;
import com.github._1c_syntax.bsl.mdo.CommonModule;
import com.github._1c_syntax.bsl.types.ModuleType;
import com.github._1c_syntax.mdclasses.mdo.MDCommonModule;
import lombok.RequiredArgsConstructor;
import org.eclipse.lsp4j.SymbolKind;

Expand Down Expand Up @@ -64,10 +64,10 @@ public class PrivilegedModuleMethodCallDiagnostic extends AbstractDiagnostic {

@Override
protected void check() {
if (privilegedModuleSymbols.isEmpty()){
if (privilegedModuleSymbols.isEmpty()) {
privilegedModuleSymbols = getPrivilegedModuleSymbols();
}
if (privilegedModuleSymbols.isEmpty()){
if (privilegedModuleSymbols.isEmpty()) {
return;
}

Expand All @@ -78,20 +78,20 @@ protected void check() {

private List<ModuleSymbol> getPrivilegedModuleSymbols() {
return documentContext.getServerContext().getConfiguration().getCommonModules()
.values().stream()
.filter(MDCommonModule::isPrivileged)
.stream()
.filter(CommonModule::isPrivileged)
.flatMap(mdCommonModule -> getPrivilegedModuleSymbol(mdCommonModule).stream())
.toList();
}

private Optional<ModuleSymbol> getPrivilegedModuleSymbol(MDCommonModule mdCommonModule) {
private Optional<ModuleSymbol> getPrivilegedModuleSymbol(CommonModule mdCommonModule) {
return documentContext.getServerContext().getDocument(
mdCommonModule.getMdoReference().getMdoRef(), ModuleType.CommonModule)
.map(documentContext1 -> documentContext1.getSymbolTree().getModule());
}

private boolean isReferenceToModules(Reference reference) {
if (!validateNestedCalls && reference.getUri().equals(documentContext.getUri())){
if (!validateNestedCalls && reference.getUri().equals(documentContext.getUri())) {
return false;
}
return reference.getSourceDefinedSymbol()
Expand Down

0 comments on commit 60d56fd

Please sign in to comment.