mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-19 07:25:27 +02:00
fix(aliases): Improve file value
This commit is contained in:
parent
4254e0a8fe
commit
3a1b38400c
@ -124,6 +124,23 @@ func checkValue(
|
|||||||
Err: ers.New("An error message is required"),
|
Err: ers.New("An error message is required"),
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
case ast.AliasValueInclude:
|
||||||
|
incldueValue := value.(ast.AliasValueInclude)
|
||||||
|
|
||||||
|
if incldueValue.Path == nil {
|
||||||
|
return []common.LSPError{{
|
||||||
|
Range: incldueValue.Location,
|
||||||
|
Err: ers.New("A path is required"),
|
||||||
|
}}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Again, I'm not sure if the path really needs to be absolute
|
||||||
|
if !path.IsAbs(string(incldueValue.Path.Path)) {
|
||||||
|
return []common.LSPError{{
|
||||||
|
Range: incldueValue.Path.Location,
|
||||||
|
Err: ers.New("This path must be absolute"),
|
||||||
|
}}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ func (s *aliasesParserListener) EnterFile(ctx *parser.FileContext) {
|
|||||||
|
|
||||||
// Set the path
|
// Set the path
|
||||||
include := rawValue.(AliasValueInclude)
|
include := rawValue.(AliasValueInclude)
|
||||||
include.Path = AliasValueIncludePath{
|
include.Path = &AliasValueIncludePath{
|
||||||
Location: location,
|
Location: location,
|
||||||
Path: path(ctx.GetText()),
|
Path: path(ctx.GetText()),
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ type AliasValueIncludePath struct {
|
|||||||
|
|
||||||
type AliasValueInclude struct {
|
type AliasValueInclude struct {
|
||||||
AliasValue
|
AliasValue
|
||||||
Path AliasValueIncludePath
|
Path *AliasValueIncludePath
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a AliasValueInclude) CheckIsValid() []common.LSPError {
|
func (a AliasValueInclude) CheckIsValid() []common.LSPError {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user