mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-19 15:35:28 +02:00
29 lines
559 B
Go
29 lines
559 B
Go
package common
|
|
|
|
import (
|
|
docvalues "config-lsp/doc-values"
|
|
)
|
|
|
|
func AnalyzeValues(
|
|
parser SimpleConfigParser,
|
|
availableOptions map[string]Option,
|
|
) []docvalues.ValueError {
|
|
errors := make([]docvalues.ValueError, 0)
|
|
|
|
for optionName, line := range parser.Lines {
|
|
documentationOption := availableOptions[optionName]
|
|
|
|
err := documentationOption.Value.CheckIsValid(line.Value)
|
|
|
|
if err != nil {
|
|
errors = append(errors, docvalues.ValueError{
|
|
Line: line.Position.Line,
|
|
Option: optionName,
|
|
Value: line.Value,
|
|
})
|
|
}
|
|
}
|
|
|
|
return errors
|
|
}
|