mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 15:05:28 +02:00
fix(ssh_config): Tag improvements
This commit is contained in:
parent
eda3a0e771
commit
3a15739033
@ -41,6 +41,7 @@ func Analyze(
|
||||
analyzeBlocks(ctx)
|
||||
analyzeMatchBlocks(ctx)
|
||||
analyzeHostBlock(ctx)
|
||||
analyzeBlocks(ctx)
|
||||
|
||||
return ctx.diagnostics
|
||||
}
|
||||
|
28
handlers/ssh_config/analyzer/tag.go
Normal file
28
handlers/ssh_config/analyzer/tag.go
Normal file
@ -0,0 +1,28 @@
|
||||
package analyzer
|
||||
|
||||
import (
|
||||
"config-lsp/common"
|
||||
"config-lsp/handlers/ssh_config/fields"
|
||||
"fmt"
|
||||
|
||||
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||
)
|
||||
|
||||
var tagOption = fields.CreateNormalizedName("Tag")
|
||||
|
||||
func analyzeTags(
|
||||
ctx *analyzerContext,
|
||||
) {
|
||||
// Check if the specified tags actually exist
|
||||
for _, options := range ctx.document.Indexes.AllOptionsPerName[tagOption] {
|
||||
for _, option := range options {
|
||||
if _, found := ctx.document.Indexes.Tags[option.OptionValue.Value.Value]; !found {
|
||||
ctx.diagnostics = append(ctx.diagnostics, protocol.Diagnostic{
|
||||
Range: option.OptionValue.ToLSPRange(),
|
||||
Message: fmt.Sprintf("Unknown tag: %s", option.OptionValue.Value.Value),
|
||||
Severity: &common.SeverityError,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -905,7 +905,6 @@ rsa-sha2-512,rsa-sha2-256
|
||||
To disable TCP keepalive messages, the value should be set to no. See also ServerAliveInterval for protocol-level keepalives.`,
|
||||
Value: booleanEnumValue,
|
||||
},
|
||||
// TODO: Add
|
||||
"tag": {
|
||||
Documentation: `Specify a configuration tag name that may be later used by a Match directive to select a block of configuration.`,
|
||||
Value: docvalues.StringValue{},
|
||||
|
Loading…
x
Reference in New Issue
Block a user