mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-19 07:25:27 +02:00
apply linter
This commit is contained in:
parent
f6eb74f638
commit
68691c3016
@ -20,7 +20,6 @@ func AnalyzeValues(
|
|||||||
Line: line.Position.Line,
|
Line: line.Position.Line,
|
||||||
Option: optionName,
|
Option: optionName,
|
||||||
Value: line.Value,
|
Value: line.Value,
|
||||||
DocError: err,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ func SetUpRootHandler() {
|
|||||||
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