File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
server/src/main/kotlin/org/javacs/kt Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,9 @@ class KotlinTextDocumentService(
47
47
val lintTodo = mutableSetOf<URI >()
48
48
var lintCount = 0
49
49
50
- fun connect ( client : LanguageClient ) {
51
- this .client = client
52
- }
50
+ var lintRecompilationCallback : () -> Unit
51
+ get() = sp.beforeCompileCallback
52
+ set(callback) { sp.beforeCompileCallback = callback }
53
53
54
54
private val TextDocumentItem .filePath: Path ?
55
55
get() = parseURI(uri).filePath
@@ -63,6 +63,10 @@ class KotlinTextDocumentService(
63
63
private val TextDocumentIdentifier .content: String
64
64
get() = uriContentProvider.contentOf(parseURI(uri))
65
65
66
+ fun connect (client : LanguageClient ) {
67
+ this .client = client
68
+ }
69
+
66
70
private enum class Recompile {
67
71
ALWAYS , AFTER_DOT , NEVER
68
72
}
@@ -302,9 +306,6 @@ class KotlinTextDocumentService(
302
306
override fun close () {
303
307
shutdownExecutors(awaitTermination = true )
304
308
}
305
-
306
- var lintRecompilationCallback: () -> Unit = {}
307
- set(callback) { sp.beforeCompileCallback = callback }
308
309
}
309
310
310
311
private inline fun <T > reportTime (block : () -> T ): T {
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ class SourcePath(
19
19
private val files = mutableMapOf<URI , SourceFile >()
20
20
private val parseDataWriteLock = ReentrantLock ()
21
21
22
+ var beforeCompileCallback: () -> Unit = {};
23
+
22
24
private inner class SourceFile (
23
25
val uri : URI ,
24
26
var content : String ,
@@ -141,8 +143,6 @@ class SourcePath(
141
143
fun latestCompiledVersion (uri : URI ): CompiledFile =
142
144
sourceFile(uri).prepareCompiledFile()
143
145
144
- var beforeCompileCallback: () -> Unit = { };
145
-
146
146
/* *
147
147
* Compile changed files
148
148
*/
You can’t perform that action at this time.
0 commit comments