Myzel394 eb076dbf53
refactor(server): Improve Wireguard analyzer
Signed-off-by: Myzel394 <github.7a2op@simplelogin.co>
2025-03-16 00:23:54 +01:00

19 lines
453 B
Go

package analyzer
import (
"config-lsp/common"
protocol "github.com/tliron/glsp/protocol_3_16"
)
func analyzeInterfaceSection(ctx *analyzerContext) {
sections := ctx.document.Indexes.SectionsByName["Interface"]
if len(sections) > 1 {
ctx.diagnostics = append(ctx.diagnostics, protocol.Diagnostic{
Message: "Only one [Interface] section is allowed",
Severity: &common.SeverityError,
Range: sections[1].Header.ToLSPRange(),
})
}
}