mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +02:00
fix(ssh_config): Fix formatter when match and host are not fully filled
This commit is contained in:
parent
2ea2c1eea8
commit
3d389eb53f
@ -59,6 +59,10 @@ func formatHostBlock(
|
|||||||
hostBlock *ast.SSHHostBlock,
|
hostBlock *ast.SSHHostBlock,
|
||||||
options protocol.FormattingOptions,
|
options protocol.FormattingOptions,
|
||||||
) []protocol.TextEdit {
|
) []protocol.TextEdit {
|
||||||
|
if hostBlock.HostValue == nil || hostBlock.HostValue.Hosts == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
edits := make([]protocol.TextEdit, 0)
|
edits := make([]protocol.TextEdit, 0)
|
||||||
|
|
||||||
key := fields.FieldsNameFormattedMap[hostBlock.GetEntryOption().Key.Key]
|
key := fields.FieldsNameFormattedMap[hostBlock.GetEntryOption().Key.Key]
|
||||||
@ -78,6 +82,10 @@ func formatMatchBlock(
|
|||||||
matchBlock *ast.SSHMatchBlock,
|
matchBlock *ast.SSHMatchBlock,
|
||||||
options protocol.FormattingOptions,
|
options protocol.FormattingOptions,
|
||||||
) []protocol.TextEdit {
|
) []protocol.TextEdit {
|
||||||
|
if matchBlock.MatchValue == nil || matchBlock.MatchValue.Entries == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
edits := make([]protocol.TextEdit, 0)
|
edits := make([]protocol.TextEdit, 0)
|
||||||
|
|
||||||
key := fields.FieldsNameFormattedMap[matchBlock.GetEntryOption().Key.Key]
|
key := fields.FieldsNameFormattedMap[matchBlock.GetEntryOption().Key.Key]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user