Skip to content

Commit

Permalink
fix: infinite indexing / intellisense blocked
Browse files Browse the repository at this point in the history
  • Loading branch information
denbezrukov committed Nov 14, 2024
1 parent dc9d3ef commit 45b9b75
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@ package com.github.biomejs.intellijbiome.services

import com.github.biomejs.intellijbiome.BiomeBundle
import com.github.biomejs.intellijbiome.listeners.BiomeEditorPanelListener
import com.github.biomejs.intellijbiome.lsp.BiomeLspServerManagerListener
import com.github.biomejs.intellijbiome.lsp.BiomeLspServerSupportProvider
import com.intellij.notification.NotificationGroupManager
import com.intellij.notification.NotificationType
import com.intellij.openapi.components.Service
import com.intellij.openapi.fileEditor.FileEditorManagerListener
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Disposer
import com.intellij.platform.lsp.api.LspServerManager

@Service(Service.Level.PROJECT)
class BiomeServerService(private val project: Project) {
private val editorPanelListener: BiomeEditorPanelListener

init {
addBiomeLspListener()
editorPanelListener = BiomeEditorPanelListener(project)
project.messageBus.connect().subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, editorPanelListener)
}
Expand All @@ -30,11 +27,6 @@ class BiomeServerService(private val project: Project) {
LspServerManager.getInstance(project).stopAndRestartIfNeeded(BiomeLspServerSupportProvider::class.java)
}

fun addBiomeLspListener() {
LspServerManager.getInstance(project)
.addLspServerManagerListener(BiomeLspServerManagerListener(project), Disposer.newDisposable(), true)
}

fun stopBiomeServer() {
LspServerManager.getInstance(project).stopServers(BiomeLspServerSupportProvider::class.java)
}
Expand Down

0 comments on commit 45b9b75

Please sign in to comment.