config-lsp/server/handlers/wireguard/lsp/text-document-completion.go
Myzel394 a0dca94b9d
refactor(server): Refactor Wireguard config; Improve completions + bunch of other stuff
Signed-off-by: Myzel394 <github.7a2op@simplelogin.co>
2025-03-16 00:23:54 +01:00

19 lines
454 B
Go

package lsp
import (
"config-lsp/handlers/wireguard"
"config-lsp/handlers/wireguard/handlers"
"regexp"
"github.com/tliron/glsp"
protocol "github.com/tliron/glsp/protocol_3_16"
)
var headerPattern = regexp.MustCompile(`^\s*\[(\w+)?]?`)
func TextDocumentCompletion(context *glsp.Context, params *protocol.CompletionParams) (any, error) {
d := wireguard.DocumentParserMap[params.TextDocument.URI]
return handlers.SuggestCompletions(d, params)
}