mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +02:00
apply linter
This commit is contained in:
parent
f6eb74f638
commit
68691c3016
@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
21
root-handler/text-document-completion.go
Normal file
21
root-handler/text-document-completion.go
Normal 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)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user