mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +02:00
feat(ssh_config): Add LSP glue to ssh_config
This commit is contained in:
parent
78661e3c2e
commit
6608375b9e
12
handlers/ssh_config/analyzer/analyzer.go
Normal file
12
handlers/ssh_config/analyzer/analyzer.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package analyzer
|
||||||
|
|
||||||
|
import (
|
||||||
|
sshconfig "config-lsp/handlers/ssh_config"
|
||||||
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Analyze(
|
||||||
|
d *sshconfig.SSHDocument,
|
||||||
|
) []protocol.Diagnostic {
|
||||||
|
return nil
|
||||||
|
}
|
7
handlers/ssh_config/lsp/README.md
Normal file
7
handlers/ssh_config/lsp/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# /sshd_config/lsp
|
||||||
|
|
||||||
|
This folder is the glue between our language server and the LSP
|
||||||
|
clients.
|
||||||
|
This folder only contains LSP commands.
|
||||||
|
It only handles very little actual logic, and instead calls
|
||||||
|
the handlers from `../handlers`.
|
10
handlers/ssh_config/lsp/text-document-completion.go
Normal file
10
handlers/ssh_config/lsp/text-document-completion.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package lsp
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/tliron/glsp"
|
||||||
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TextDocumentCompletion(context *glsp.Context, params *protocol.CompletionParams) (any, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
10
handlers/ssh_config/lsp/text-document-definition.go
Normal file
10
handlers/ssh_config/lsp/text-document-definition.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package lsp
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/tliron/glsp"
|
||||||
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TextDocumentDefinition(context *glsp.Context, params *protocol.DefinitionParams) ([]protocol.Location, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
42
handlers/ssh_config/lsp/text-document-did-change.go
Normal file
42
handlers/ssh_config/lsp/text-document-did-change.go
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package lsp
|
||||||
|
|
||||||
|
import (
|
||||||
|
"config-lsp/common"
|
||||||
|
sshconfig "config-lsp/handlers/ssh_config"
|
||||||
|
"config-lsp/handlers/ssh_config/analyzer"
|
||||||
|
"config-lsp/utils"
|
||||||
|
|
||||||
|
"github.com/tliron/glsp"
|
||||||
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TextDocumentDidChange(
|
||||||
|
context *glsp.Context,
|
||||||
|
params *protocol.DidChangeTextDocumentParams,
|
||||||
|
) error {
|
||||||
|
content := params.ContentChanges[0].(protocol.TextDocumentContentChangeEventWhole).Text
|
||||||
|
common.ClearDiagnostics(context, params.TextDocument.URI)
|
||||||
|
|
||||||
|
document := sshconfig.DocumentParserMap[params.TextDocument.URI]
|
||||||
|
document.Config.Clear()
|
||||||
|
|
||||||
|
diagnostics := make([]protocol.Diagnostic, 0)
|
||||||
|
errors := document.Config.Parse(content)
|
||||||
|
|
||||||
|
if len(errors) > 0 {
|
||||||
|
diagnostics = append(diagnostics, utils.Map(
|
||||||
|
errors,
|
||||||
|
func(err common.LSPError) protocol.Diagnostic {
|
||||||
|
return err.ToDiagnostic()
|
||||||
|
},
|
||||||
|
)...)
|
||||||
|
}
|
||||||
|
|
||||||
|
diagnostics = append(diagnostics, analyzer.Analyze(document)...)
|
||||||
|
|
||||||
|
if len(diagnostics) > 0 {
|
||||||
|
common.SendDiagnostics(context, params.TextDocument.URI, diagnostics)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
13
handlers/ssh_config/lsp/text-document-did-close.go
Normal file
13
handlers/ssh_config/lsp/text-document-did-close.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package lsp
|
||||||
|
|
||||||
|
import (
|
||||||
|
"config-lsp/handlers/ssh_config"
|
||||||
|
"github.com/tliron/glsp"
|
||||||
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TextDocumentDidClose(context *glsp.Context, params *protocol.DidCloseTextDocumentParams) error {
|
||||||
|
delete(sshconfig.DocumentParserMap, params.TextDocument.URI)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
51
handlers/ssh_config/lsp/text-document-did-open.go
Normal file
51
handlers/ssh_config/lsp/text-document-did-open.go
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
package lsp
|
||||||
|
|
||||||
|
import (
|
||||||
|
"config-lsp/common"
|
||||||
|
"config-lsp/handlers/ssh_config"
|
||||||
|
"config-lsp/handlers/ssh_config/ast"
|
||||||
|
"config-lsp/handlers/ssh_config/analyzer"
|
||||||
|
"config-lsp/utils"
|
||||||
|
|
||||||
|
"github.com/tliron/glsp"
|
||||||
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TextDocumentDidOpen(
|
||||||
|
context *glsp.Context,
|
||||||
|
params *protocol.DidOpenTextDocumentParams,
|
||||||
|
) error {
|
||||||
|
common.ClearDiagnostics(context, params.TextDocument.URI)
|
||||||
|
|
||||||
|
var document *sshconfig.SSHDocument
|
||||||
|
|
||||||
|
if foundDocument, ok := sshconfig.DocumentParserMap[params.TextDocument.URI]; ok {
|
||||||
|
document = foundDocument
|
||||||
|
} else {
|
||||||
|
config := ast.NewSSHConfig()
|
||||||
|
document = &sshconfig.SSHDocument{
|
||||||
|
Config: config,
|
||||||
|
}
|
||||||
|
sshconfig.DocumentParserMap[params.TextDocument.URI] = document
|
||||||
|
}
|
||||||
|
|
||||||
|
errors := document.Config.Parse(params.TextDocument.Text)
|
||||||
|
|
||||||
|
diagnostics := utils.Map(
|
||||||
|
errors,
|
||||||
|
func(err common.LSPError) protocol.Diagnostic {
|
||||||
|
return err.ToDiagnostic()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
diagnostics = append(
|
||||||
|
diagnostics,
|
||||||
|
analyzer.Analyze(document)...,
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(diagnostics) > 0 {
|
||||||
|
common.SendDiagnostics(context, params.TextDocument.URI, diagnostics)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
13
handlers/ssh_config/lsp/text-document-hover.go
Normal file
13
handlers/ssh_config/lsp/text-document-hover.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package lsp
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/tliron/glsp"
|
||||||
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TextDocumentHover(
|
||||||
|
context *glsp.Context,
|
||||||
|
params *protocol.HoverParams,
|
||||||
|
) (*protocol.Hover, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
13
handlers/ssh_config/lsp/text-document-range-formatting.go
Normal file
13
handlers/ssh_config/lsp/text-document-range-formatting.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package lsp
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/tliron/glsp"
|
||||||
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TextDocumentRangeFormatting(
|
||||||
|
context *glsp.Context,
|
||||||
|
params *protocol.DocumentRangeFormattingParams,
|
||||||
|
) ([]protocol.TextEdit, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
10
handlers/ssh_config/lsp/text-document-signature-help.go
Normal file
10
handlers/ssh_config/lsp/text-document-signature-help.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package lsp
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/tliron/glsp"
|
||||||
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TextDocumentSignatureHelp(context *glsp.Context, params *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
@ -13,6 +13,7 @@ import (
|
|||||||
type SupportedLanguage string
|
type SupportedLanguage string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
LanguageSSHConfig SupportedLanguage = "ssh_config"
|
||||||
LanguageSSHDConfig SupportedLanguage = "sshd_config"
|
LanguageSSHDConfig SupportedLanguage = "sshd_config"
|
||||||
LanguageFstab SupportedLanguage = "fstab"
|
LanguageFstab SupportedLanguage = "fstab"
|
||||||
LanguageWireguard SupportedLanguage = "languagewireguard"
|
LanguageWireguard SupportedLanguage = "languagewireguard"
|
||||||
@ -21,6 +22,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var AllSupportedLanguages = []string{
|
var AllSupportedLanguages = []string{
|
||||||
|
string(LanguageSSHConfig),
|
||||||
string(LanguageSSHDConfig),
|
string(LanguageSSHDConfig),
|
||||||
string(LanguageFstab),
|
string(LanguageFstab),
|
||||||
string(LanguageWireguard),
|
string(LanguageWireguard),
|
||||||
@ -54,8 +56,12 @@ func (e LanguageUndetectableError) Error() string {
|
|||||||
var valueToLanguageMap = map[string]SupportedLanguage{
|
var valueToLanguageMap = map[string]SupportedLanguage{
|
||||||
"sshd_config": LanguageSSHDConfig,
|
"sshd_config": LanguageSSHDConfig,
|
||||||
"sshdconfig": LanguageSSHDConfig,
|
"sshdconfig": LanguageSSHDConfig,
|
||||||
"ssh_config": LanguageSSHDConfig,
|
|
||||||
"sshconfig": LanguageSSHDConfig,
|
"ssh_config": LanguageSSHConfig,
|
||||||
|
"sshconfig": LanguageSSHConfig,
|
||||||
|
|
||||||
|
".ssh/config": LanguageSSHConfig,
|
||||||
|
"~/.ssh/config": LanguageSSHConfig,
|
||||||
|
|
||||||
"fstab": LanguageFstab,
|
"fstab": LanguageFstab,
|
||||||
"etc/fstab": LanguageFstab,
|
"etc/fstab": LanguageFstab,
|
||||||
@ -124,5 +130,9 @@ func DetectLanguage(
|
|||||||
return LanguageWireguard, nil
|
return LanguageWireguard, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.HasSuffix(uri, ".ssh/config") {
|
||||||
|
return LanguageSSHConfig, nil
|
||||||
|
}
|
||||||
|
|
||||||
return "", undetectableError
|
return "", undetectableError
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,8 @@ func TextDocumentCodeAction(context *glsp.Context, params *protocol.CodeActionPa
|
|||||||
return hosts.TextDocumentCodeAction(context, params)
|
return hosts.TextDocumentCodeAction(context, params)
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return nil, nil
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
return wireguard.TextDocumentCodeAction(context, params)
|
return wireguard.TextDocumentCodeAction(context, params)
|
||||||
case LanguageAliases:
|
case LanguageAliases:
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
aliases "config-lsp/handlers/aliases/lsp"
|
aliases "config-lsp/handlers/aliases/lsp"
|
||||||
fstab "config-lsp/handlers/fstab/lsp"
|
fstab "config-lsp/handlers/fstab/lsp"
|
||||||
hosts "config-lsp/handlers/hosts/lsp"
|
hosts "config-lsp/handlers/hosts/lsp"
|
||||||
|
sshconfig "config-lsp/handlers/ssh_config/lsp"
|
||||||
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
||||||
wireguard "config-lsp/handlers/wireguard/lsp"
|
wireguard "config-lsp/handlers/wireguard/lsp"
|
||||||
|
|
||||||
@ -29,6 +30,8 @@ func TextDocumentCompletion(context *glsp.Context, params *protocol.CompletionPa
|
|||||||
return fstab.TextDocumentCompletion(context, params)
|
return fstab.TextDocumentCompletion(context, params)
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return sshdconfig.TextDocumentCompletion(context, params)
|
return sshdconfig.TextDocumentCompletion(context, params)
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return sshconfig.TextDocumentCompletion(context, params)
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
return wireguard.TextDocumentCompletion(context, params)
|
return wireguard.TextDocumentCompletion(context, params)
|
||||||
case LanguageHosts:
|
case LanguageHosts:
|
||||||
|
@ -2,6 +2,7 @@ package roothandler
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
aliases "config-lsp/handlers/aliases/lsp"
|
aliases "config-lsp/handlers/aliases/lsp"
|
||||||
|
sshconfig "config-lsp/handlers/ssh_config/lsp"
|
||||||
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
||||||
|
|
||||||
"github.com/tliron/glsp"
|
"github.com/tliron/glsp"
|
||||||
@ -26,6 +27,8 @@ func TextDocumentDefinition(context *glsp.Context, params *protocol.DefinitionPa
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return sshdconfig.TextDocumentDefinition(context, params)
|
return sshdconfig.TextDocumentDefinition(context, params)
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return sshconfig.TextDocumentDefinition(context, params)
|
||||||
case LanguageFstab:
|
case LanguageFstab:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
fstab "config-lsp/handlers/fstab/lsp"
|
fstab "config-lsp/handlers/fstab/lsp"
|
||||||
hosts "config-lsp/handlers/hosts/lsp"
|
hosts "config-lsp/handlers/hosts/lsp"
|
||||||
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
||||||
|
sshconfig "config-lsp/handlers/ssh_config/lsp"
|
||||||
wireguard "config-lsp/handlers/wireguard/lsp"
|
wireguard "config-lsp/handlers/wireguard/lsp"
|
||||||
|
|
||||||
"github.com/tliron/glsp"
|
"github.com/tliron/glsp"
|
||||||
@ -43,6 +44,8 @@ func TextDocumentDidChange(context *glsp.Context, params *protocol.DidChangeText
|
|||||||
return fstab.TextDocumentDidOpen(context, params)
|
return fstab.TextDocumentDidOpen(context, params)
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return sshdconfig.TextDocumentDidOpen(context, params)
|
return sshdconfig.TextDocumentDidOpen(context, params)
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return sshconfig.TextDocumentDidOpen(context, params)
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
return wireguard.TextDocumentDidOpen(context, params)
|
return wireguard.TextDocumentDidOpen(context, params)
|
||||||
case LanguageHosts:
|
case LanguageHosts:
|
||||||
@ -57,6 +60,8 @@ func TextDocumentDidChange(context *glsp.Context, params *protocol.DidChangeText
|
|||||||
return fstab.TextDocumentDidChange(context, params)
|
return fstab.TextDocumentDidChange(context, params)
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return sshdconfig.TextDocumentDidChange(context, params)
|
return sshdconfig.TextDocumentDidChange(context, params)
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return sshconfig.TextDocumentDidChange(context, params)
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
return wireguard.TextDocumentDidChange(context, params)
|
return wireguard.TextDocumentDidChange(context, params)
|
||||||
case LanguageHosts:
|
case LanguageHosts:
|
||||||
|
@ -4,6 +4,8 @@ import (
|
|||||||
aliases "config-lsp/handlers/aliases/lsp"
|
aliases "config-lsp/handlers/aliases/lsp"
|
||||||
fstab "config-lsp/handlers/fstab/lsp"
|
fstab "config-lsp/handlers/fstab/lsp"
|
||||||
hosts "config-lsp/handlers/hosts/lsp"
|
hosts "config-lsp/handlers/hosts/lsp"
|
||||||
|
sshconfig "config-lsp/handlers/ssh_config/lsp"
|
||||||
|
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
||||||
wireguard "config-lsp/handlers/wireguard/lsp"
|
wireguard "config-lsp/handlers/wireguard/lsp"
|
||||||
|
|
||||||
"github.com/tliron/glsp"
|
"github.com/tliron/glsp"
|
||||||
@ -28,6 +30,9 @@ func TextDocumentDidClose(context *glsp.Context, params *protocol.DidCloseTextDo
|
|||||||
|
|
||||||
switch *language {
|
switch *language {
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
|
return sshdconfig.TextDocumentDidClose(context, params)
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return sshconfig.TextDocumentDidClose(context, params)
|
||||||
case LanguageFstab:
|
case LanguageFstab:
|
||||||
return fstab.TextDocumentDidClose(context, params)
|
return fstab.TextDocumentDidClose(context, params)
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
aliases "config-lsp/handlers/aliases/lsp"
|
aliases "config-lsp/handlers/aliases/lsp"
|
||||||
fstab "config-lsp/handlers/fstab/lsp"
|
fstab "config-lsp/handlers/fstab/lsp"
|
||||||
hosts "config-lsp/handlers/hosts/lsp"
|
hosts "config-lsp/handlers/hosts/lsp"
|
||||||
|
sshconfig "config-lsp/handlers/ssh_config/lsp"
|
||||||
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
||||||
wireguard "config-lsp/handlers/wireguard/lsp"
|
wireguard "config-lsp/handlers/wireguard/lsp"
|
||||||
|
|
||||||
@ -35,6 +36,8 @@ func TextDocumentDidOpen(context *glsp.Context, params *protocol.DidOpenTextDocu
|
|||||||
return fstab.TextDocumentDidOpen(context, params)
|
return fstab.TextDocumentDidOpen(context, params)
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return sshdconfig.TextDocumentDidOpen(context, params)
|
return sshdconfig.TextDocumentDidOpen(context, params)
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return sshconfig.TextDocumentDidOpen(context, params)
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
return wireguard.TextDocumentDidOpen(context, params)
|
return wireguard.TextDocumentDidOpen(context, params)
|
||||||
case LanguageHosts:
|
case LanguageHosts:
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
aliases "config-lsp/handlers/aliases/lsp"
|
aliases "config-lsp/handlers/aliases/lsp"
|
||||||
fstab "config-lsp/handlers/fstab/lsp"
|
fstab "config-lsp/handlers/fstab/lsp"
|
||||||
hosts "config-lsp/handlers/hosts/lsp"
|
hosts "config-lsp/handlers/hosts/lsp"
|
||||||
|
sshconfig "config-lsp/handlers/ssh_config/lsp"
|
||||||
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
||||||
wireguard "config-lsp/handlers/wireguard/lsp"
|
wireguard "config-lsp/handlers/wireguard/lsp"
|
||||||
|
|
||||||
@ -29,6 +30,8 @@ func TextDocumentHover(context *glsp.Context, params *protocol.HoverParams) (*pr
|
|||||||
return hosts.TextDocumentHover(context, params)
|
return hosts.TextDocumentHover(context, params)
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return sshdconfig.TextDocumentHover(context, params)
|
return sshdconfig.TextDocumentHover(context, params)
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return sshconfig.TextDocumentHover(context, params)
|
||||||
case LanguageFstab:
|
case LanguageFstab:
|
||||||
return fstab.TextDocumentHover(context, params)
|
return fstab.TextDocumentHover(context, params)
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
|
@ -25,6 +25,8 @@ func TextDocumentPrepareRename(context *glsp.Context, params *protocol.PrepareRe
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return nil, nil
|
||||||
case LanguageFstab:
|
case LanguageFstab:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package roothandler
|
package roothandler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
sshconfig "config-lsp/handlers/ssh_config/lsp"
|
||||||
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
||||||
|
|
||||||
"github.com/tliron/glsp"
|
"github.com/tliron/glsp"
|
||||||
protocol "github.com/tliron/glsp/protocol_3_16"
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||||
)
|
)
|
||||||
@ -27,6 +29,8 @@ func TextDocumentRangeFormattingFunc(
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return sshdconfig.TextDocumentRangeFormatting(context, params)
|
return sshdconfig.TextDocumentRangeFormatting(context, params)
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return sshconfig.TextDocumentRangeFormatting(context, params)
|
||||||
case LanguageFstab:
|
case LanguageFstab:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
|
@ -24,6 +24,8 @@ func TextDocumentRename(context *glsp.Context, params *protocol.RenameParams) (*
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return nil, nil
|
||||||
case LanguageFstab:
|
case LanguageFstab:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
|
@ -26,6 +26,8 @@ func TextDocumentSignatureHelp(context *glsp.Context, params *protocol.Signature
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return sshdconfig.TextDocumentSignatureHelp(context, params)
|
return sshdconfig.TextDocumentSignatureHelp(context, params)
|
||||||
|
case LanguageSSHConfig:
|
||||||
|
return nil, nil
|
||||||
case LanguageFstab:
|
case LanguageFstab:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user