Skip to content

Commit 1f7a38d

Browse files
committed
Удаление типа переменной из хранимых данных
1 parent bdde244 commit 1f7a38d

File tree

4 files changed

+2
-26
lines changed

4 files changed

+2
-26
lines changed

src/jmh/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/VariableSymbolCreate.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.github._1c_syntax.bsl.languageserver.context.symbol.variable.VariableKind;
2525
import com.github._1c_syntax.bsl.languageserver.utils.Ranges;
2626
import org.eclipse.lsp4j.Range;
27-
import org.eclipse.lsp4j.SymbolKind;
2827
import org.openjdk.jmh.annotations.Benchmark;
2928
import org.openjdk.jmh.annotations.Fork;
3029
import org.openjdk.jmh.annotations.Level;
@@ -96,7 +95,6 @@ private VariableSymbolBuilder getVariableSymbolBuilder() {
9695
.variableNameRange(variableNameRange)
9796
.export(true)
9897
.kind(VariableKind.MODULE)
99-
.symbolKind(SymbolKind.Variable)
10098
.description(Optional.empty())
10199
.scope(null);
102100
}

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/IntBasedVariableSymbol.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ public class IntBasedVariableSymbol implements VariableSymbol {
5858
*/
5959
SourceDefinedSymbol scope;
6060

61-
/**
62-
* Тип символа. По умолчанию переменная.
63-
*/
64-
@Builder.Default
65-
byte symbolKind = (byte) SymbolKind.Variable.ordinal();
66-
6761
/**
6862
* Файл в котором располагается переменная.
6963
*/
@@ -111,7 +105,7 @@ public class IntBasedVariableSymbol implements VariableSymbol {
111105
Optional<VariableDescription> description;
112106

113107
public SymbolKind getSymbolKind() {
114-
return SymbolKind.values()[symbolKind];
108+
return SymbolKind.Variable;
115109
}
116110

117111
@Override

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ShortBasedVariableSymbol.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ public class ShortBasedVariableSymbol implements VariableSymbol {
5858
*/
5959
SourceDefinedSymbol scope;
6060

61-
/**
62-
* Тип символа. По умолчанию переменная.
63-
*/
64-
@Builder.Default
65-
byte symbolKind = (byte) SymbolKind.Variable.ordinal();
66-
6761
/**
6862
* Файл в котором располагается переменная.
6963
*/
@@ -111,7 +105,7 @@ public class ShortBasedVariableSymbol implements VariableSymbol {
111105
Optional<VariableDescription> description;
112106

113107
public SymbolKind getSymbolKind() {
114-
return SymbolKind.values()[symbolKind];
108+
return SymbolKind.Variable;
115109
}
116110

117111
@Override

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/VariableSymbolBuilder.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.github._1c_syntax.bsl.languageserver.context.symbol.variable.VariableDescription;
2626
import com.github._1c_syntax.bsl.languageserver.context.symbol.variable.VariableKind;
2727
import org.eclipse.lsp4j.Range;
28-
import org.eclipse.lsp4j.SymbolKind;
2928

3029
import java.util.Collections;
3130
import java.util.List;
@@ -42,7 +41,6 @@ public class VariableSymbolBuilder {
4241
private VariableKind kind;
4342
private String name;
4443
private SourceDefinedSymbol scope;
45-
private SymbolKind symbolKind = SymbolKind.Variable;
4644
private DocumentContext owner;
4745
private Optional<SourceDefinedSymbol> parent = Optional.empty();
4846
private List<SourceDefinedSymbol> children = Collections.emptyList();
@@ -85,11 +83,6 @@ public VariableSymbolBuilder scope(SourceDefinedSymbol scope) {
8583
return this;
8684
}
8785

88-
public VariableSymbolBuilder symbolKind(SymbolKind symbolKind) {
89-
this.symbolKind = symbolKind;
90-
return this;
91-
}
92-
9386
public VariableSymbolBuilder owner(DocumentContext owner) {
9487
this.owner = owner;
9588
return this;
@@ -127,7 +120,6 @@ public VariableSymbol build() {
127120
return new ShortBasedVariableSymbol(
128121
name,
129122
scope,
130-
(byte) symbolKind.ordinal(),
131123
owner,
132124
(short) startLine,
133125
(short) startCharacter,
@@ -147,7 +139,6 @@ public VariableSymbol build() {
147139
return new IntBasedVariableSymbol(
148140
name,
149141
scope,
150-
(byte) symbolKind.ordinal(),
151142
owner,
152143
startLine,
153144
startCharacter,
@@ -169,7 +160,6 @@ public VariableSymbol buildInt() {
169160
return new IntBasedVariableSymbol(
170161
name,
171162
scope,
172-
(byte) symbolKind.ordinal(),
173163
owner,
174164
startLine,
175165
startCharacter,

0 commit comments

Comments
 (0)