Skip to content

Commit

Permalink
Pending changes exported from your codespace
Browse files Browse the repository at this point in the history
  • Loading branch information
nixel2007 committed May 15, 2023
1 parent 6a78d1d commit b6389c3
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 56 deletions.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"image":"mcr.microsoft.com/devcontainers/universal:2"}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ fabric.properties
*.ps1
target/
build/
bin/

# Scala compiler user settings
.idea/hydra.xml
Expand Down
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "automatic"
}
24 changes: 12 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ plugins {
jacoco
signing
id("org.cadixdev.licenser") version "0.6.1"
id("org.sonarqube") version "3.5.0.2730"
id("org.sonarqube") version "4.0.0.2929"
id("io.freefair.lombok") version "6.6.1"
id("io.freefair.javadoc-links") version "6.6.1"
id("io.freefair.javadoc-utf-8") version "6.6.1"
id("io.freefair.aspectj.post-compile-weaving") version "6.6.1"
id("io.freefair.maven-central.validate-poms") version "6.6.1"
id("me.qoomon.git-versioning") version "6.4.0"
id("com.github.ben-manes.versions") version "0.45.0"
id("org.springframework.boot") version "2.7.10"
id("me.qoomon.git-versioning") version "6.4.2"
id("com.github.ben-manes.versions") version "0.46.0"
id("org.springframework.boot") version "2.7.11"
id("io.spring.dependency-management") version "1.1.0"
id("io.github.1c-syntax.bslls-dev-tools") version "0.7.2"
id("ru.vyarus.pom") version "2.2.2"
id("com.gorylenko.gradle-git-properties") version "2.4.1"
id("io.codearte.nexus-staging") version "0.30.0"
id("me.champeau.jmh") version "0.6.8"
id("me.champeau.jmh") version "0.7.1"
}

repositories {
Expand Down Expand Up @@ -52,11 +52,11 @@ gitVersioning.apply {

val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG

val languageToolVersion = "5.6"
val languageToolVersion = "6.1"

dependencyManagement {
imports {
mavenBom("io.sentry:sentry-bom:6.13.1")
mavenBom("io.sentry:sentry-bom:6.18.1")
}
}

Expand All @@ -67,11 +67,11 @@ dependencies {
// spring
api("org.springframework.boot:spring-boot-starter")
api("org.springframework.boot:spring-boot-starter-websocket")
api("info.picocli:picocli-spring-boot-starter:4.7.1")
api("info.picocli:picocli-spring-boot-starter:4.7.3")

// lsp4j core
api("org.eclipse.lsp4j", "org.eclipse.lsp4j", "0.19.0")
api("org.eclipse.lsp4j", "org.eclipse.lsp4j.websocket", "0.19.0")
api("org.eclipse.lsp4j", "org.eclipse.lsp4j", "0.20.1")
api("org.eclipse.lsp4j", "org.eclipse.lsp4j.websocket", "0.20.1")

// 1c-syntax
api("com.github.1c-syntax", "bsl-parser", "167aaad827322e09ccde4658a71152dad234de4b") {
Expand All @@ -93,7 +93,7 @@ dependencies {
implementation("org.languagetool", "language-ru", languageToolVersion)

// AOP
implementation("org.aspectj", "aspectjrt", "1.9.9.1")
implementation("org.aspectj", "aspectjrt", "1.9.19")

// commons utils
implementation("commons-io", "commons-io", "2.11.0")
Expand All @@ -109,7 +109,7 @@ dependencies {
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")

// graphs
implementation("org.jgrapht", "jgrapht-core", "1.5.1")
implementation("org.jgrapht", "jgrapht-core", "1.5.2")

// SARIF serialization
implementation("com.contrastsecurity", "java-sarif", "2.0")
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
28 changes: 19 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,10 +32,10 @@
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
Expand All @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static void main(String[] args) {
}

@Override
public void run(String[] args) {
public void run(String... args) {
var cmd = new CommandLine(this, picocliFactory);

// проверка использования дефолтной команды
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import com.github._1c_syntax.bsl.languageserver.diagnostics.BSLDiagnostic;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
Expand All @@ -41,7 +40,6 @@
import java.util.Collection;

@Aspect
@Slf4j
@NoArgsConstructor
public class MeasuresAspect {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.lsp4j.jsonrpc.Launcher;
import org.eclipse.lsp4j.services.LanguageClient;
import org.eclipse.lsp4j.services.LanguageClientAware;
Expand All @@ -47,7 +46,6 @@
* Выводимая информация:
* Данный режим используется для взаимодействия с клиентом по протоколу LSP.
*/
@Slf4j
@Command(
name = "lsp",
aliases = {"--lsp"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package com.github._1c_syntax.bsl.languageserver.cli;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.lsp4j.ServerInfo;
import org.springframework.stereotype.Component;
import picocli.CommandLine.Command;
Expand All @@ -34,7 +33,6 @@
* Ключ команды:
* -v, (--version)
*/
@Slf4j
@Command(
name = "version",
aliases = {"-v", "--version"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.io.File;
Expand All @@ -48,7 +47,6 @@
* Данный режим используется для взаимодействия с клиентом по протоколу LSP через websocket.
*
*/
@Slf4j
@Command(
name = "websocket",
aliases = {"-w", "--websocket"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/
package com.github._1c_syntax.bsl.languageserver.cli.lsp;

import lombok.extern.slf4j.Slf4j;
import org.eclipse.lsp4j.jsonrpc.Launcher;
import org.eclipse.lsp4j.launch.LSPLauncher;
import org.eclipse.lsp4j.services.LanguageClient;
Expand All @@ -36,7 +35,6 @@
* Конфигурация для создания объектов из lsp4j-слоя.
*/
@Configuration
@Slf4j
public class LanguageServerLauncherConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface DiagnosticParameter {
Class type();
Class<?> type();

String defaultValue() default "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

public final class DiagnosticParameterInfo {

private final Class type;
private final Class<?> type;
private final String name;
private final String description;
private final Object defaultValue;
Expand All @@ -43,7 +43,7 @@ private DiagnosticParameterInfo(Field field, String description) {

}

public Class getType() {
public Class<?> getType() {
return type;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.github._1c_syntax.bsl.languageserver.LanguageClientHolder;
import com.github._1c_syntax.bsl.languageserver.context.DocumentContext;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.PublishDiagnosticsParams;
import org.springframework.stereotype.Component;
Expand All @@ -33,7 +32,6 @@
import java.util.List;
import java.util.function.Supplier;

@Slf4j
@Component
@RequiredArgsConstructor
public final class DiagnosticProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void runAnalysisIfEnabled() {
configuration.getDiagnosticsOptions().setAnalyzeOnStart(true);
languageClientHolder.connect(languageClient);

var documentContext = TestUtils.getDocumentContext("A = 0", serverContext);
TestUtils.getDocumentContext("A = 0", serverContext);

// when
analyzeProjectOnStart.handleEvent(new ServerContextPopulatedEvent(serverContext));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,6 @@ void testFormatUnaryMinus() {

// then
assertThat(textEdits).hasSize(1);

TextEdit textEdit = textEdits.get(0);
assertThat(textEdits.get(0).getNewText()).isEqualTo("Возврат -1 > -2");

}
Expand All @@ -290,15 +288,6 @@ private File getFormattedTestFile() {
return new File("./src/test/resources/providers/format_formatted.bsl");
}

private TextDocumentItem getTextDocumentItem() throws IOException {
File file = getTestFile();
String uri = file.toURI().toString();

String fileContent = FileUtils.readFileToString(file, StandardCharsets.UTF_8);

return new TextDocumentItem(uri, "bsl", 1, fileContent);
}

private TextDocumentIdentifier getTextDocumentIdentifier() {
// TODO: Переделать на TestUtils.getTextDocumentIdentifier();
File file = getTestFile();
Expand Down

0 comments on commit b6389c3

Please sign in to comment.