mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-19 07:25:27 +02:00
fix(sshd_config): Fix hover for match blocks
This commit is contained in:
parent
9b1a5af2d0
commit
1bda1f76e0
@ -12,11 +12,13 @@ import (
|
|||||||
func GetHoverInfoForOption(
|
func GetHoverInfoForOption(
|
||||||
option *ast.SSHOption,
|
option *ast.SSHOption,
|
||||||
matchBlock *ast.SSHMatchBlock,
|
matchBlock *ast.SSHMatchBlock,
|
||||||
|
line uint32,
|
||||||
cursor uint32,
|
cursor uint32,
|
||||||
) (*protocol.Hover, error) {
|
) (*protocol.Hover, error) {
|
||||||
var docValue *docvalues.DocumentationValue
|
var docValue *docvalues.DocumentationValue
|
||||||
|
|
||||||
if matchBlock == nil {
|
// Either root level or in the line of a match block
|
||||||
|
if matchBlock == nil || matchBlock.Start.Line == line {
|
||||||
val := fields.Options[option.Key.Value]
|
val := fields.Options[option.Key.Value]
|
||||||
docValue = &val
|
docValue = &val
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
package lsp
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/tliron/glsp"
|
|
||||||
protocol "github.com/tliron/glsp/protocol_3_16"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TextDocumentCodeAction(context *glsp.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error) {
|
|
||||||
// document := hosts.DocumentParserMap[params.TextDocument.URI]
|
|
||||||
//
|
|
||||||
// actions := make([]protocol.CodeAction, 0, 1)
|
|
||||||
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
@ -24,5 +24,10 @@ func TextDocumentHover(
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return handlers.GetHoverInfoForOption(option, matchBlock, cursor)
|
return handlers.GetHoverInfoForOption(
|
||||||
|
option,
|
||||||
|
matchBlock,
|
||||||
|
line,
|
||||||
|
cursor,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
package lsp
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/tliron/glsp"
|
|
||||||
protocol "github.com/tliron/glsp/protocol_3_16"
|
|
||||||
)
|
|
||||||
|
|
||||||
func WorkspaceExecuteCommand(context *glsp.Context, params *protocol.ExecuteCommandParams) (*protocol.ApplyWorkspaceEditParams, error) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
@ -3,7 +3,6 @@ package roothandler
|
|||||||
import (
|
import (
|
||||||
aliases "config-lsp/handlers/aliases/lsp"
|
aliases "config-lsp/handlers/aliases/lsp"
|
||||||
hosts "config-lsp/handlers/hosts/lsp"
|
hosts "config-lsp/handlers/hosts/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"
|
||||||
@ -29,7 +28,7 @@ func TextDocumentCodeAction(context *glsp.Context, params *protocol.CodeActionPa
|
|||||||
case LanguageHosts:
|
case LanguageHosts:
|
||||||
return hosts.TextDocumentCodeAction(context, params)
|
return hosts.TextDocumentCodeAction(context, params)
|
||||||
case LanguageSSHDConfig:
|
case LanguageSSHDConfig:
|
||||||
return sshdconfig.TextDocumentCodeAction(context, params)
|
return nil, nil
|
||||||
case LanguageWireguard:
|
case LanguageWireguard:
|
||||||
return wireguard.TextDocumentCodeAction(context, params)
|
return wireguard.TextDocumentCodeAction(context, params)
|
||||||
case LanguageAliases:
|
case LanguageAliases:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user