Search in sources :

Example 1 with Exportable

use of com.github._1c_syntax.bsl.languageserver.context.symbol.Exportable in project bsl-language-server by 1c-syntax.

the class ReferenceIndex method isReferenceAccessible.

private static boolean isReferenceAccessible(Reference reference) {
    if (!reference.isSourceDefinedSymbolReference()) {
        return true;
    }
    SourceDefinedSymbol to = reference.getSourceDefinedSymbol().orElseThrow();
    SourceDefinedSymbol from = reference.getFrom();
    if (to.getOwner().equals(from.getOwner())) {
        return true;
    }
    if (to instanceof Exportable) {
        return ((Exportable) to).isExport();
    }
    return true;
}
Also used : Exportable(com.github._1c_syntax.bsl.languageserver.context.symbol.Exportable) SourceDefinedSymbol(com.github._1c_syntax.bsl.languageserver.context.symbol.SourceDefinedSymbol)

Aggregations

Exportable (com.github._1c_syntax.bsl.languageserver.context.symbol.Exportable)1 SourceDefinedSymbol (com.github._1c_syntax.bsl.languageserver.context.symbol.SourceDefinedSymbol)1