apply linter

This commit is contained in:
Myzel394 2024-08-05 22:51:04 +02:00
parent f6eb74f638
commit 68691c3016
No known key found for this signature in database
GPG Key ID: DEC4AAB876F73185
3 changed files with 31 additions and 10 deletions

View File

@ -17,10 +17,9 @@ func AnalyzeValues(
if err != nil {
errors = append(errors, docvalues.ValueError{
Line: line.Position.Line,
Option: optionName,
Value: line.Value,
DocError: err,
Line: line.Position.Line,
Option: optionName,
Value: line.Value,
})
}
}

View File

@ -17,12 +17,13 @@ var lspHandler protocol.Handler
func SetUpRootHandler() {
rootHandler = NewRootHandler()
lspHandler = protocol.Handler{
Initialize: initialize,
Initialized: initialized,
Shutdown: shutdown,
SetTrace: setTrace,
TextDocumentDidOpen: TextDocumentDidOpen,
TextDocumentDidChange: TextDocumentDidChange,
Initialize: initialize,
Initialized: initialized,
Shutdown: shutdown,
SetTrace: setTrace,
TextDocumentDidOpen: TextDocumentDidOpen,
TextDocumentDidChange: TextDocumentDidChange,
TextDocumentCompletion: TextDocumentCompletion,
}
server := server.NewServer(&lspHandler, lsName, false)

View File

@ -0,0 +1,21 @@
package roothandler
import (
"config-lsp/handlers/fstab"
"github.com/tliron/glsp"
protocol "github.com/tliron/glsp/protocol_3_16"
)
func TextDocumentCompletion(context *glsp.Context, params *protocol.CompletionParams) (any, error) {
language := rootHandler.GetLanguageForDocument(params.TextDocument.URI)
switch language {
case LanguageFstab:
return fstab.TextDocumentCompletion(context, params)
case LanguageSSHDConfig:
return nil, nil
}
panic("root-handler/TextDocumentCompletion: unexpected language" + language)
}