@@ -65,7 +65,7 @@ class DottyLanguageServer extends LanguageServer
65
65
private [this ] var myDependentProjects : mutable.Map [ProjectConfig , mutable.Set [ProjectConfig ]] = _
66
66
67
67
def drivers : Map [ProjectConfig , InteractiveDriver ] = thisServer.synchronized {
68
- if myDrivers == null
68
+ if myDrivers == null then
69
69
assert(rootUri != null , " `drivers` cannot be called before `initialize`" )
70
70
val configFile = new File (new URI (rootUri + '/' + IDE_CONFIG_FILE ))
71
71
val configs : List [ProjectConfig ] = (new ObjectMapper ).readValue(configFile, classOf [Array [ProjectConfig ]]).toList
@@ -102,12 +102,12 @@ class DottyLanguageServer extends LanguageServer
102
102
System .gc()
103
103
for ((_, driver, opened) <- driverConfigs; (uri, source) <- opened)
104
104
driver.run(uri, source)
105
- if Memory .isCritical()
105
+ if Memory .isCritical() then
106
106
println(s " WARNING: Insufficient memory to run Scala language server on these projects. " )
107
107
}
108
108
109
109
private def checkMemory () =
110
- if Memory .isCritical()
110
+ if Memory .isCritical() then
111
111
CompletableFutures .computeAsync { _ => restart() }
112
112
113
113
/** The configuration of the project that owns `uri`. */
@@ -149,7 +149,7 @@ class DottyLanguageServer extends LanguageServer
149
149
150
150
/** A mapping from project `p` to the set of projects that transitively depend on `p`. */
151
151
def dependentProjects : Map [ProjectConfig , Set [ProjectConfig ]] = thisServer.synchronized {
152
- if myDependentProjects == null
152
+ if myDependentProjects == null then
153
153
val idToConfig = drivers.keys.map(k => k.id -> k).toMap
154
154
val allProjects = drivers.keySet
155
155
@@ -192,7 +192,7 @@ class DottyLanguageServer extends LanguageServer
192
192
throw ex
193
193
}
194
194
}
195
- if synchronize
195
+ if synchronize then
196
196
thisServer.synchronized { computation() }
197
197
else
198
198
computation()
@@ -829,15 +829,15 @@ object DottyLanguageServer {
829
829
def completionItemKind (sym : Symbol )(implicit ctx : Context ): lsp4j.CompletionItemKind = {
830
830
import lsp4j .{CompletionItemKind => CIK }
831
831
832
- if sym.is(Package ) || sym.is(Module )
832
+ if sym.is(Package ) || sym.is(Module ) then
833
833
CIK .Module // No CompletionItemKind.Package (https://github.com/Microsoft/language-server-protocol/issues/155)
834
- else if sym.isConstructor
834
+ else if sym.isConstructor then
835
835
CIK .Constructor
836
- else if sym.isClass
836
+ else if sym.isClass then
837
837
CIK .Class
838
- else if sym.is(Mutable )
838
+ else if sym.is(Mutable ) then
839
839
CIK .Variable
840
- else if sym.is(Method )
840
+ else if sym.is(Method ) then
841
841
CIK .Method
842
842
else
843
843
CIK .Field
0 commit comments