Skip to content

Commit 84dd0b3

Browse files
committed
Merge branch 'updatedeps' into lintfix
2 parents c76bfd5 + 1886569 commit 84dd0b3

File tree

6 files changed

+29
-13
lines changed

6 files changed

+29
-13
lines changed

detekt.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ exceptions:
2424
- NumberFormatException
2525
- ParseException
2626
- MissingPropertyException
27+
TooGenericExceptionCaught:
28+
active: false
2729

2830
naming:
2931
excludes: *standardExcludes

gradle/libs.versions.toml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[versions]
22
kotlinVersion = "2.1.0"
3-
lsp4jVersion = "0.21.2"
4-
exposedVersion = "0.37.3"
3+
lsp4jVersion = "0.23.1"
4+
exposedVersion = "0.58.0"
55
jmhVersion = "1.20"
6-
guavaVersion = "33.3.0-jre"
6+
slf4j = "2.0.16"
7+
guavaVersion = "33.4.0-jre"
78

89
[libraries]
910
org-jetbrains-kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlinVersion" }
@@ -41,12 +42,17 @@ com-beust-jcommander = { module = "com.beust:jcommander", version = "1.78" }
4142
org-openjdk-jmh-generator-annprocess = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmhVersion" }
4243
org-openjdk-jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmhVersion" }
4344

44-
org-xerial-sqlite-jdbc = { module = "org.xerial:sqlite-jdbc", version = "3.41.2.1" }
45+
org-xerial-sqlite-jdbc = { module = "org.xerial:sqlite-jdbc", version = "3.48.0.0" }
4546

4647
# buildSrc
47-
org-jetbrains-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin",version.ref = "kotlinVersion" }
48+
org-jetbrains-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" }
49+
50+
# this is used to remove the error info in console log
51+
org-slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
52+
org-slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }
53+
4854

4955
[plugins]
50-
com-github-jk1-tcdeps = { id = "com.github.jk1.tcdeps", version = "1.2" }
51-
com-jaredsburrows-license = { id = "com.jaredsburrows.license", version = "0.8.42" }
56+
com-github-jk1-tcdeps = { id = "com.github.jk1.tcdeps", version = "1.6.2" }
57+
com-jaredsburrows-license = { id = "com.jaredsburrows.license", version = "0.9.8" }
5258
io-gitlab-arturbosch-detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.22.0" }

server/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ dependencies {
4444
implementation(libs.org.eclipse.lsp4j.lsp4j)
4545
implementation(libs.org.eclipse.lsp4j.jsonrpc)
4646

47+
// used to clear the error during console log
48+
implementation(libs.org.slf4j.api)
49+
implementation(libs.org.slf4j.simple)
50+
4751
implementation(kotlin("compiler"))
4852
implementation(kotlin("scripting-compiler"))
4953
implementation(kotlin("scripting-jvm-host-unshaded"))

server/src/main/kotlin/org/javacs/kt/KotlinLanguageServer.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,7 @@ class KotlinLanguageServer(
124124
serverCapabilities.renameProvider = Either.forRight(RenameOptions(false))
125125
}
126126

127-
@Suppress("DEPRECATION")
128127
val folders = params.workspaceFolders?.takeIf { it.isNotEmpty() }
129-
?: params.rootUri?.let(::WorkspaceFolder)?.let(::listOf)
130-
?: params.rootPath?.let(Paths::get)?.toUri()?.toString()?.let(::WorkspaceFolder)?.let(::listOf)
131128
?: listOf()
132129

133130
val progress = params.workDoneToken?.let { LanguageClientProgress("Workspace folders", it, client) }

server/src/main/kotlin/org/javacs/kt/index/SymbolIndex.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import org.jetbrains.exposed.dao.id.EntityID
1515
import org.jetbrains.exposed.dao.id.IntIdTable
1616
import org.jetbrains.exposed.sql.*
1717
import kotlin.sequences.Sequence
18+
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
1819

1920
private const val MAX_FQNAME_LENGTH = 255
2021
private const val MAX_SHORT_NAME_LENGTH = 80
@@ -110,7 +111,7 @@ class SymbolIndex(
110111
addDeclarations(allDescriptors(module, exclusions))
111112

112113
val finished = System.currentTimeMillis()
113-
val count = Symbols.slice(Symbols.fqName.count()).selectAll().first()[Symbols.fqName.count()]
114+
val count = Symbols.selectAll().first()[Symbols.fqName.count()]
114115
LOG.info("Updated full symbol index in ${finished - started} ms! (${count} symbol(s))")
115116
}
116117
} catch (e: Exception) {
@@ -133,7 +134,7 @@ class SymbolIndex(
133134
addDeclarations(add)
134135

135136
val finished = System.currentTimeMillis()
136-
val count = Symbols.slice(Symbols.fqName.count()).selectAll().first()[Symbols.fqName.count()]
137+
val count = Symbols.selectAll().first()[Symbols.fqName.count()]
137138
LOG.info("Updated symbol index in ${finished - started} ms! (${count} symbol(s))")
138139
}
139140
} catch (e: Exception) {

shared/src/main/kotlin/org/javacs/kt/classpath/CachedClassPathResolver.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ internal class CachedClassPathResolver(
116116
LOG.info("Cached classpath is outdated or not found. Resolving again")
117117

118118
val newClasspath = wrapped.classpath
119-
updateClasspathCache(newClasspath, false)
119+
// We need to make sure the cache resolve won't throw error here, make deps can be loaded successfully
120+
try {
121+
// in old exposed this will throw error, but I do not know if it will throw again, so I catch here
122+
updateClasspathCache(newClasspath, false)
123+
} catch (e: Exception) {
124+
LOG.warn("Something error during update database, error: ${e.message}")
125+
}
120126

121127
return newClasspath
122128
}

0 commit comments

Comments
 (0)