Skip to content

Commit e5aaabb

Browse files
authored
Merge pull request #406 from ihsankursadunal/common-approach-to-workspace-folder-change-handling
The handling of workspace folder changes has been standardized by swi…
2 parents cf5fda0 + 3b0b28a commit e5aaabb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,24 +147,24 @@ class KotlinWorkspaceService(
147147
}
148148

149149
override fun didChangeWorkspaceFolders(params: DidChangeWorkspaceFoldersParams) {
150-
for (change in params.event.added) {
151-
LOG.info("Adding workspace {} to source path", change.uri)
150+
for (change in params.event.removed) {
151+
LOG.info("Dropping workspace {} from source path", change.uri)
152152

153153
val root = Paths.get(parseURI(change.uri))
154154

155-
sf.addWorkspaceRoot(root)
156-
val refreshed = cp.addWorkspaceRoot(root)
155+
sf.removeWorkspaceRoot(root)
156+
val refreshed = cp.removeWorkspaceRoot(root)
157157
if (refreshed) {
158158
sp.refresh()
159159
}
160160
}
161-
for (change in params.event.removed) {
162-
LOG.info("Dropping workspace {} from source path", change.uri)
161+
for (change in params.event.added) {
162+
LOG.info("Adding workspace {} to source path", change.uri)
163163

164164
val root = Paths.get(parseURI(change.uri))
165165

166-
sf.removeWorkspaceRoot(root)
167-
val refreshed = cp.removeWorkspaceRoot(root)
166+
sf.addWorkspaceRoot(root)
167+
val refreshed = cp.addWorkspaceRoot(root)
168168
if (refreshed) {
169169
sp.refresh()
170170
}

0 commit comments

Comments
 (0)