mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-19 15:35:28 +02:00
25 lines
662 B
Go
25 lines
662 B
Go
package roothandler
|
|
|
|
import (
|
|
"config-lsp/handlers/fstab"
|
|
wireguard "config-lsp/handlers/wireguard/lsp"
|
|
|
|
"github.com/tliron/glsp"
|
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
|
)
|
|
|
|
func TextDocumentDidChange(context *glsp.Context, params *protocol.DidChangeTextDocumentParams) error {
|
|
language := rootHandler.GetLanguageForDocument(params.TextDocument.URI)
|
|
|
|
switch language {
|
|
case LanguageFstab:
|
|
return fstab.TextDocumentDidChange(context, params)
|
|
case LanguageSSHDConfig:
|
|
return nil
|
|
case LanguageWireguard:
|
|
return wireguard.TextDocumentDidChange(context, params)
|
|
}
|
|
|
|
panic("root-handler/TextDocumentDidChange: unexpected language" + language)
|
|
}
|