Skip to content

Commit 9483ffc

Browse files
committed
микрофиксы
1 parent c5b8dd5 commit 9483ffc

38 files changed

+84
-78
lines changed

src/main/java/com/github/_1c_syntax/bsl/languageserver/BSLLanguageServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public class BSLLanguageServer implements LanguageServer, ProtocolExtension {
8787
public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
8888

8989
clientCapabilitiesHolder.setCapabilities(params.getCapabilities());
90-
90+
9191
setConfigurationRoot(params);
9292
CompletableFuture.runAsync(context::populateContext);
9393

src/main/java/com/github/_1c_syntax/bsl/languageserver/BSLWorkspaceService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class BSLWorkspaceService implements WorkspaceService {
4747

4848
@Override
4949
@SuppressWarnings("deprecation")
50-
public CompletableFuture<Either<List<? extends SymbolInformation>,List<? extends WorkspaceSymbol>>> symbol(WorkspaceSymbolParams params) {
50+
public CompletableFuture<Either<List<? extends SymbolInformation>, List<? extends WorkspaceSymbol>>> symbol(WorkspaceSymbolParams params) {
5151
return CompletableFuture.supplyAsync(() -> Either.forRight(symbolProvider.getSymbols(params)));
5252
}
5353

src/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/BasicBlockVertex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void addStatement(BSLParserRuleContext statement) {
4141

4242
@Override
4343
public Optional<BSLParserRuleContext> getAst() {
44-
if(statements.isEmpty()) {
44+
if (statements.isEmpty()) {
4545
return super.getAst();
4646
}
4747

src/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ControlFlowGraphWalker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public CfgEdge walkNext(CfgEdgeType edgeType) {
6060
.filter(x -> x.getType() == edgeType)
6161
.findAny();
6262

63-
if(edgeOrNot.isPresent()) {
63+
if (edgeOrNot.isPresent()) {
6464
currentNode = graph.getEdgeTarget(edgeOrNot.get());
6565
return edgeOrNot.get();
6666
}

src/main/java/com/github/_1c_syntax/bsl/languageserver/cli/FormatCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private List<File> findFilesForFormatting(String[] filePaths) {
134134
continue;
135135
}
136136

137-
if(srcDir.toFile().isDirectory()) {
137+
if (srcDir.toFile().isDirectory()) {
138138
files.addAll(FileUtils.listFiles(srcDir.toFile(), new String[]{"bsl", "os"}, true));
139139
} else {
140140
files.add(srcDir.toFile());

src/main/java/com/github/_1c_syntax/bsl/languageserver/codeactions/DisableDiagnosticTriggeringSupplier.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ public List<CodeAction> getCodeActions(CodeActionParams params, DocumentContext
8484
.filter(token -> token.getLine() == selectedLineNumber)
8585
.max(Comparator.comparingInt(Token::getCharPositionInLine))
8686
.ifPresent(token -> {
87-
if (params.getRange().getStart().getLine() == params.getRange().getEnd().getLine()) {
88-
result.addAll(getDisableActionForLine(params, documentContext, token));
89-
} else {
90-
result.addAll(getDisableActionForRange(params, documentContext, token));
87+
if (params.getRange().getStart().getLine() == params.getRange().getEnd().getLine()) {
88+
result.addAll(getDisableActionForLine(params, documentContext, token));
89+
} else {
90+
result.addAll(getDisableActionForRange(params, documentContext, token));
91+
}
9192
}
92-
}
93-
);
93+
);
9494
}
9595

9696
result.addAll(

src/main/java/com/github/_1c_syntax/bsl/languageserver/codeactions/QuickFixSupplier.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public <T extends Either<String, Integer>> Optional<Class<? extends QuickFixProv
4949
T diagnosticCode
5050
) {
5151
return Optional.ofNullable(
52-
diagnosticInfos.get(DiagnosticCode.getStringValue(diagnosticCode))
53-
)
52+
diagnosticInfos.get(DiagnosticCode.getStringValue(diagnosticCode))
53+
)
5454
.map(DiagnosticInfo::getDiagnosticClass)
5555
.filter(QuickFixProvider.class::isAssignableFrom)
5656
.map(aClass -> (Class<? extends QuickFixProvider>) aClass);

src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/databind/ParametersDeserializer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ private static Map<String, Object> getParameterConfiguration(
7878
) {
7979
Map<String, Object> parameterConfiguration;
8080
try {
81-
JavaType type = mapper.getTypeFactory().constructType(new TypeReference<Map<String, Object>>() {});
81+
JavaType type = mapper.getTypeFactory().constructType(new TypeReference<Map<String, Object>>() {
82+
});
8283
parameterConfiguration = mapper.readValue(mapper.treeAsTokens(parameterConfig), type);
8384
} catch (IOException e) {
8485
LOGGER.error("Can't deserialize parameter configuration", e);

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/ModuleTypeComputer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is a part of BSL Language Server.
33
*
4-
* Copyright (c) 2018-2022
4+
* Copyright (c) 2018-2023
55
* Alexey Sosnoviy <labotamy@gmail.com>, Nikita Fedkin <nixel2007@gmail.com> and contributors
66
*
77
* SPDX-License-Identifier: LGPL-3.0-or-later

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class VariableSymbolComputer extends BSLParserBaseVisitor<ParseTree> impl
6262

6363
private SourceDefinedSymbol currentMethod;
6464

65-
public VariableSymbolComputer(DocumentContext documentContext, ModuleSymbol module, List<MethodSymbol> methods) {
65+
public VariableSymbolComputer(DocumentContext documentContext, ModuleSymbol module, List<MethodSymbol> methods) {
6666
this.documentContext = documentContext;
6767
this.module = module;
6868
this.methods = methods.stream().collect(toMap(MethodSymbol::getSubNameRange, Function.identity()));
@@ -176,7 +176,7 @@ public ParseTree visitAssignment(BSLParser.AssignmentContext ctx) {
176176
public ParseTree visitForStatement(BSLParser.ForStatementContext ctx) {
177177
if (
178178
currentMethodVariables.containsKey(ctx.IDENTIFIER().getText())
179-
|| moduleVariables.containsKey(ctx.IDENTIFIER().getText())
179+
|| moduleVariables.containsKey(ctx.IDENTIFIER().getText())
180180
) {
181181
return super.visitForStatement(ctx);
182182
}
@@ -189,7 +189,7 @@ public ParseTree visitForStatement(BSLParser.ForStatementContext ctx) {
189189
public ParseTree visitForEachStatement(BSLParser.ForEachStatementContext ctx) {
190190
if (
191191
currentMethodVariables.containsKey(ctx.IDENTIFIER().getText())
192-
|| moduleVariables.containsKey(ctx.IDENTIFIER().getText())
192+
|| moduleVariables.containsKey(ctx.IDENTIFIER().getText())
193193
) {
194194
return super.visitForEachStatement(ctx);
195195
}
@@ -208,16 +208,16 @@ private SourceDefinedSymbol getVariableScope(BSLParser.SubVarDeclarationContext
208208
}
209209

210210
private SourceDefinedSymbol getVariableScope(BSLParser.SubContext ctx) {
211-
BSLParserRuleContext subNameNode;
212-
if (Trees.nodeContainsErrors(ctx)) {
213-
return module;
214-
} else if (ctx.function() != null) {
215-
subNameNode = ctx.function().funcDeclaration().subName();
216-
} else {
217-
subNameNode = ctx.procedure().procDeclaration().subName();
218-
}
211+
BSLParserRuleContext subNameNode;
212+
if (Trees.nodeContainsErrors(ctx)) {
213+
return module;
214+
} else if (ctx.function() != null) {
215+
subNameNode = ctx.function().funcDeclaration().subName();
216+
} else {
217+
subNameNode = ctx.procedure().procDeclaration().subName();
218+
}
219219

220-
return methods.getOrDefault(Ranges.create(subNameNode), module);
220+
return methods.getOrDefault(Ranges.create(subNameNode), module);
221221
}
222222

223223
private Optional<VariableDescription> createDescription(BSLParser.LValueContext ctx) {

0 commit comments

Comments
 (0)