mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-19 15:35:28 +02:00
apply linter
This commit is contained in:
parent
f6eb74f638
commit
68691c3016
@ -17,10 +17,9 @@ func AnalyzeValues(
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errors = append(errors, docvalues.ValueError{
|
errors = append(errors, docvalues.ValueError{
|
||||||
Line: line.Position.Line,
|
Line: line.Position.Line,
|
||||||
Option: optionName,
|
Option: optionName,
|
||||||
Value: line.Value,
|
Value: line.Value,
|
||||||
DocError: err,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,12 +17,13 @@ var lspHandler protocol.Handler
|
|||||||
func SetUpRootHandler() {
|
func SetUpRootHandler() {
|
||||||
rootHandler = NewRootHandler()
|
rootHandler = NewRootHandler()
|
||||||
lspHandler = protocol.Handler{
|
lspHandler = protocol.Handler{
|
||||||
Initialize: initialize,
|
Initialize: initialize,
|
||||||
Initialized: initialized,
|
Initialized: initialized,
|
||||||
Shutdown: shutdown,
|
Shutdown: shutdown,
|
||||||
SetTrace: setTrace,
|
SetTrace: setTrace,
|
||||||
TextDocumentDidOpen: TextDocumentDidOpen,
|
TextDocumentDidOpen: TextDocumentDidOpen,
|
||||||
TextDocumentDidChange: TextDocumentDidChange,
|
TextDocumentDidChange: TextDocumentDidChange,
|
||||||
|
TextDocumentCompletion: TextDocumentCompletion,
|
||||||
}
|
}
|
||||||
|
|
||||||
server := server.NewServer(&lspHandler, lsName, false)
|
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