From 014d9ebe94bb51ef2a622e5db33e743ec9e377a5 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Mon, 29 Jul 2024 21:27:06 +0200 Subject: [PATCH] chore: Make openssh its own package --- handlers/index.go | 0 handlers/openssh/documentation-values.go | 2 +- handlers/openssh/documentation.go | 13 ++++++++----- handlers/openssh/shared.go | 2 +- handlers/openssh/text-document-completion.go | 7 ++++++- handlers/openssh/text-document-did-change.go | 2 +- handlers/openssh/text-document-did-open.go | 2 +- 7 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 handlers/index.go diff --git a/handlers/index.go b/handlers/index.go new file mode 100644 index 0000000..e69de29 diff --git a/handlers/openssh/documentation-values.go b/handlers/openssh/documentation-values.go index 53e9a14..1bd5d6f 100644 --- a/handlers/openssh/documentation-values.go +++ b/handlers/openssh/documentation-values.go @@ -1,4 +1,4 @@ -package handlers +package openssh import ( "os/exec" diff --git a/handlers/openssh/documentation.go b/handlers/openssh/documentation.go index f850289..fe7731a 100644 --- a/handlers/openssh/documentation.go +++ b/handlers/openssh/documentation.go @@ -1,4 +1,4 @@ -package handlers +package openssh import ( "config-lsp/common" @@ -380,13 +380,16 @@ See PATTERNS in ssh_config(5) for more information on patterns. This keyword may ), "IPQoS": common.NewOption(`Specifies the IPv4 type-of-service or DSCP class for the connection. Accepted values are af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, cs0, cs1, cs2, cs3, cs4, cs5, cs6, cs7, ef, le, lowdelay, throughput, reliability, a numeric value, or none to use the operating system default. This option may take one or two arguments, separated by whitespace. If one argument is specified, it is used as the packet class unconditionally. If two values are specified, the first is automatically selected for interactive sessions and the second for non-interactive sessions. The default is af21 (Low-Latency Data) for interactive sessions and cs1 (Lower Effort) for non-interactive sessions.`, - common.ArrayValue{ - AllowDuplicates: true, - Separator: " ", - SubValue: common.OrValue{ + common.OrValue{ Values: []common.Value{ common.PositiveNumberValue{}, common.EnumValue{ + Values: []string{"none"}, + }, + common.ArrayValue{ + AllowDuplicates: true, + Separator: " ", + SubValue: common.EnumValue{ EnforceValues: true, Values: []string{ "af11", "af12", "af13", diff --git a/handlers/openssh/shared.go b/handlers/openssh/shared.go index 90386c1..10e4ccf 100644 --- a/handlers/openssh/shared.go +++ b/handlers/openssh/shared.go @@ -1,4 +1,4 @@ -package handlers +package openssh import ( "config-lsp/common" diff --git a/handlers/openssh/text-document-completion.go b/handlers/openssh/text-document-completion.go index 7e04aae..dcd91d2 100644 --- a/handlers/openssh/text-document-completion.go +++ b/handlers/openssh/text-document-completion.go @@ -1,4 +1,4 @@ -package handlers +package openssh import ( "config-lsp/common" @@ -37,12 +37,15 @@ func getRootCompletions() []protocol.CompletionItem { insertText := label + " " + "${1:value}" format := protocol.InsertTextFormatSnippet + kind := protocol.CompletionItemKindField + completions[index] = protocol.CompletionItem{ Label: label, Documentation: common.GetDocumentation(&option), InsertText: &insertText, InsertTextFormat: &format, + Kind: &kind, } } @@ -57,10 +60,12 @@ func getCompletionsFromValue(value common.Value) []protocol.CompletionItem { for index, value := range enumValue.Values { textFormat := protocol.InsertTextFormatPlainText + kind := protocol.CompletionItemKindEnum completions[index] = protocol.CompletionItem{ Label: value, InsertTextFormat: &textFormat, + Kind: &kind, } } diff --git a/handlers/openssh/text-document-did-change.go b/handlers/openssh/text-document-did-change.go index 4168db3..072c19d 100644 --- a/handlers/openssh/text-document-did-change.go +++ b/handlers/openssh/text-document-did-change.go @@ -1,4 +1,4 @@ -package handlers +package openssh import ( "config-lsp/common" diff --git a/handlers/openssh/text-document-did-open.go b/handlers/openssh/text-document-did-open.go index 2f89156..2e1b520 100644 --- a/handlers/openssh/text-document-did-open.go +++ b/handlers/openssh/text-document-did-open.go @@ -1,4 +1,4 @@ -package handlers +package openssh import ( "config-lsp/common"