31 lines
489 B
Go

package analyzer
import (
"config-lsp/handlers/fstab/shared"
protocol "github.com/tliron/glsp/protocol_3_16"
)
type analyzerContext struct {
document *shared.FstabDocument
diagnostics []protocol.Diagnostic
}
func Analyze(
document *shared.FstabDocument,
) []protocol.Diagnostic {
ctx := analyzerContext{
document: document,
}
analyzeFieldAreFilled(&ctx)
if len(ctx.diagnostics) > 0 {
return ctx.diagnostics
}
analyzeValuesAreValid(&ctx)
return ctx.diagnostics
}