Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
@NonFinal
@Builder(builderClassName = "Builder")
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@ToString(exclude = {"children", "parent"})
@ToString(exclude = {"parent"})
public abstract class AbstractVariableSymbol implements VariableSymbol {

/**
Expand Down Expand Up @@ -74,12 +74,6 @@ public abstract class AbstractVariableSymbol implements VariableSymbol {
@NonFinal
Optional<SourceDefinedSymbol> parent;

/**
* Список "детей" символа - символов, которые располагаются внутри данного символа.
*/
@Getter
List<SourceDefinedSymbol> children;

/**
* Тип переменной.
*/
Expand All @@ -95,6 +89,11 @@ public abstract class AbstractVariableSymbol implements VariableSymbol {
*/
Optional<VariableDescription> description;

@Override
public List<SourceDefinedSymbol> getChildren() {
return Collections.emptyList();
}

@Override
public SymbolKind getSymbolKind() {
return SymbolKind.Variable;
Expand Down Expand Up @@ -129,10 +128,6 @@ public static class Builder {
@Accessors(fluent = true, chain = true)
Optional<SourceDefinedSymbol> parent = Optional.empty();

@Setter
@Accessors(fluent = true, chain = true)
List<SourceDefinedSymbol> children = Collections.emptyList();

private int startLine;
private int startCharacter;
private int endLine;
Expand Down Expand Up @@ -179,7 +174,6 @@ public VariableSymbol build() {
scope,
owner,
parent,
children,
(byte) kind.ordinal(),
export,
description,
Expand All @@ -197,7 +191,6 @@ public VariableSymbol build() {
scope,
owner,
parent,
children,
(byte) kind.ordinal(),
export,
description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import lombok.experimental.NonFinal;
import org.eclipse.lsp4j.Range;

import java.util.List;
import java.util.Optional;

/**
Expand Down Expand Up @@ -65,7 +64,6 @@ public IntBasedVariableSymbol(
SourceDefinedSymbol scope,
DocumentContext owner,
Optional<SourceDefinedSymbol> parent,
List<SourceDefinedSymbol> children,
byte kind,
boolean export,
Optional<VariableDescription> description,
Expand All @@ -77,7 +75,7 @@ public IntBasedVariableSymbol(
int variableNameStartCharacter,
int variableNameEndCharacter
) {
super(name, scope, owner, parent, children, kind, export, description);
super(name, scope, owner, parent, kind, export, description);

this.startLine = startLine;
this.startCharacter = startCharacter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import lombok.experimental.NonFinal;
import org.eclipse.lsp4j.Range;

import java.util.List;
import java.util.Optional;

/**
Expand Down Expand Up @@ -65,7 +64,6 @@ public ShortBasedVariableSymbol(
SourceDefinedSymbol scope,
DocumentContext owner,
Optional<SourceDefinedSymbol> parent,
List<SourceDefinedSymbol> children,
byte kind,
boolean export,
Optional<VariableDescription> description,
Expand All @@ -77,7 +75,7 @@ public ShortBasedVariableSymbol(
short variableNameStartCharacter,
short variableNameEndCharacter
) {
super(name, scope, owner, parent, children, kind, export, description);
super(name, scope, owner, parent, kind, export, description);

this.startLine = startLine;
this.startCharacter = startCharacter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public final class DocumentSymbolProvider {

private static final Set<VariableKind> supportedVariableKinds = EnumSet.of(
VariableKind.MODULE,
VariableKind.LOCAL,
VariableKind.GLOBAL
);

Expand All @@ -64,6 +65,7 @@ private static DocumentSymbol toDocumentSymbol(SourceDefinedSymbol symbol) {
);

List<DocumentSymbol> children = symbol.getChildren().stream()
.filter(DocumentSymbolProvider::isSupported)
.map(DocumentSymbolProvider::toDocumentSymbol)
.collect(Collectors.toList());

Expand Down