mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +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(
|
||||
option *ast.SSHOption,
|
||||
matchBlock *ast.SSHMatchBlock,
|
||||
line uint32,
|
||||
cursor uint32,
|
||||
) (*protocol.Hover, error) {
|
||||
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]
|
||||
docValue = &val
|
||||
} 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 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 (
|
||||
aliases "config-lsp/handlers/aliases/lsp"
|
||||
hosts "config-lsp/handlers/hosts/lsp"
|
||||
sshdconfig "config-lsp/handlers/sshd_config/lsp"
|
||||
wireguard "config-lsp/handlers/wireguard/lsp"
|
||||
|
||||
"github.com/tliron/glsp"
|
||||
@ -29,7 +28,7 @@ func TextDocumentCodeAction(context *glsp.Context, params *protocol.CodeActionPa
|
||||
case LanguageHosts:
|
||||
return hosts.TextDocumentCodeAction(context, params)
|
||||
case LanguageSSHDConfig:
|
||||
return sshdconfig.TextDocumentCodeAction(context, params)
|
||||
return nil, nil
|
||||
case LanguageWireguard:
|
||||
return wireguard.TextDocumentCodeAction(context, params)
|
||||
case LanguageAliases:
|
||||
|
Loading…
x
Reference in New Issue
Block a user