Skip to content
Open
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
14 changes: 12 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ val commonmarkVersion = "0.27.1"
dependencies {
compileOnly("org.sonarsource.api.plugin", "sonar-plugin-api", "11.3.0.2824")

implementation("io.github.1c-syntax", "bsl-language-server", "0.28.5") {
implementation("io.github.1c-syntax", "bsl-language-server", "0.29.0-rc.1") {
exclude("com.contrastsecurity", "java-sarif")
exclude("io.sentry", "sentry-logback")
exclude("info.picocli", "picocli-spring-boot-starter")
Expand Down Expand Up @@ -142,7 +142,17 @@ tasks.jar {
}

tasks.shadowJar {
mergeServiceFiles() // Критично для плагинов Sonar
duplicatesStrategy = DuplicatesStrategy.INCLUDE
mergeServiceFiles()
transform(com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer::class.java) {
resource.set("META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports")
separator.set("\n")
}
transform(com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTransformer::class.java) {
paths.set(setOf("META-INF/org/languagetool/language-module.properties"))
mergeStrategy.set(com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTransformer.MergeStrategy.Append)
mergeSeparator.set(",")
}
configurations = listOf(project.configurations["runtimeClasspath"])
archiveClassifier.set("")
}
41 changes: 22 additions & 19 deletions src/main/java/com/github/_1c_syntax/bsl/sonar/BSLHighlighter.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public void highlightToken(

var line = token.getLine();
var charPositionInLine = token.getCharPositionInLine();
String tokenText = token.getText();
var tokenText = token.getText().stripTrailing();

var range = Ranges.create(
line,
Expand Down Expand Up @@ -533,20 +533,21 @@ private static Set<Integer> createSdblFunctions() {
SDBLLexer.STOREDDATASIZE,
SDBLLexer.UUID,
SDBLLexer.STRFIND,
SDBLLexer.STRREPLACE
SDBLLexer.STRREPLACE,
SDBLLexer.UNIQUE
);
}

private static Set<Integer> createSdblKeywords() {
return Set.of(
SDBLLexer.ALL,
SDBLLexer.ADD,
SDBLLexer.ALLOWED,
SDBLLexer.AND,
SDBLLexer.AS,
SDBLLexer.ASC,
SDBLLexer.AUTOORDER,
SDBLLexer.BETWEEN,
SDBLLexer.BY_EN,
SDBLLexer.BY,
SDBLLexer.CASE,
SDBLLexer.CAST,
SDBLLexer.DESC,
Expand All @@ -556,46 +557,48 @@ private static Set<Integer> createSdblKeywords() {
SDBLLexer.END,
SDBLLexer.ESCAPE,
SDBLLexer.FALSE,
SDBLLexer.FOR,
SDBLLexer.FOR_UPDATE,
SDBLLexer.FROM,
SDBLLexer.FULL,
SDBLLexer.GROUP,
SDBLLexer.FULL_JOIN,
SDBLLexer.FULL_OUTER_JOIN,
SDBLLexer.GROUP_BY,
SDBLLexer.GROUP_BY_GROUPING_SETS,
SDBLLexer.HAVING,
SDBLLexer.HIERARCHY,
SDBLLexer.HIERARCHY_FOR_IN,
SDBLLexer.IN_HIERARCHY,
SDBLLexer.IN,
SDBLLexer.INDEX,
SDBLLexer.INNER,
SDBLLexer.INDEX_BY,
SDBLLexer.INDEX_BY_SETS,
SDBLLexer.INNER_JOIN,
SDBLLexer.INTO,
SDBLLexer.IS,
SDBLLexer.ISNULL,
SDBLLexer.JOIN,
SDBLLexer.LEFT,
SDBLLexer.LEFT_JOIN,
SDBLLexer.LEFT_OUTER_JOIN,
SDBLLexer.LIKE,
SDBLLexer.NOT,
SDBLLexer.OF,
SDBLLexer.ONLY,
SDBLLexer.ON_EN,
SDBLLexer.ONLY_HIERARCHY,
SDBLLexer.OR,
SDBLLexer.ORDER,
SDBLLexer.ORDER_BY,
SDBLLexer.OVERALL,
SDBLLexer.OUTER,
SDBLLexer.PERIODS,
SDBLLexer.PO_RU,
SDBLLexer.REFS,
SDBLLexer.RIGHT,
SDBLLexer.RIGHT_JOIN,
SDBLLexer.RIGHT_OUTER_JOIN,
SDBLLexer.SELECT,
SDBLLexer.SET,
SDBLLexer.THEN,
SDBLLexer.TOP,
SDBLLexer.TOTALS,
SDBLLexer.UNION,
SDBLLexer.UPDATE,
SDBLLexer.UNION_ALL,
SDBLLexer.WHEN,
SDBLLexer.WHERE,
SDBLLexer.EMPTYREF,
SDBLLexer.GROUPEDBY,
SDBLLexer.GROUPING
SDBLLexer.GROUPEDBY
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,14 @@ private Map<String, TypeOfText> getHighlightingMapBSL(Vocabulary vocabulary) {
private Map<String, TypeOfText> getHighlightingMapSDBL(Vocabulary vocabulary) {

Set<String> keywords = Set.of(
"ALL",
"ADD",
"ALLOWED",
"AND",
"AS",
"ASC",
"AUTOORDER",
"BETWEEN",
"BY_EN",
"BY",
"CASE",
"CAST",
"DESC",
Expand All @@ -307,45 +307,47 @@ private Map<String, TypeOfText> getHighlightingMapSDBL(Vocabulary vocabulary) {
"ESCAPE",
"EMPTYREF",
"FALSE",
"FOR",
"FOR_UPDATE",
"FROM",
"FULL",
"GROUP",
"FULL_JOIN",
"FULL_OUTER_JOIN",
"GROUP_BY",
"GROUP_BY_GROUPING_SETS",
"GROUPEDBY",
"GROUPING",
"HAVING",
"HIERARCHY",
"HIERARCHY_FOR_IN",
"IN_HIERARCHY",
"IN",
"INDEX",
"INNER",
"INDEX_BY",
"INDEX_BY_SETS",
"INNER_JOIN",
"INTO",
"IS",
"ISNULL",
"JOIN",
"LEFT",
"LEFT_JOIN",
"LEFT_OUTER_JOIN",
"LIKE",
"NOT",
"OF",
"ON_EN",
"ONLY_HIERARCHY",
"OR",
"ORDER",
"ORDER_BY",
"OVERALL",
"OUTER",
"PO_RU",
"PERIODS",
"REFS",
"RIGHT",
"RIGHT_JOIN",
"RIGHT_OUTER_JOIN",
"SELECT",
"SET",
"THEN",
"TOP",
"TOTALS",
"UNION",
"UNION_ALL",
"WHEN",
"WHERE",
"ONLY",
"PERIODS",
"REFS",
"UPDATE"
"WHERE"
);

Set<String> functions = Set.of(
Expand Down Expand Up @@ -405,7 +407,8 @@ private Map<String, TypeOfText> getHighlightingMapSDBL(Vocabulary vocabulary) {
"STOREDDATASIZE",
"UUID",
"STRFIND",
"STRREPLACE"
"STRREPLACE",
"UNIQUE"
);

Set<String> metadataTypes = Set.of(
Expand Down Expand Up @@ -479,9 +482,7 @@ private Map<String, TypeOfText> getHighlightingMapSDBL(Vocabulary vocabulary) {
"ROUTEPOINT_FIELD",
"IDENTIFIER",
"INCORRECT_IDENTIFIER",
"BRACE_IDENTIFIER",
"UNKNOWN",
"BAR" // TODO: Убрать из лексера
"UNKNOWN"
);

Set<String> eds = Set.of(
Expand Down