mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +02:00
fix(ssh_config): Improve include behavior
This commit is contained in:
parent
b4aaa2cc3a
commit
b0d8e80736
@ -26,7 +26,7 @@ func analyzeIncludeValues(
|
|||||||
) {
|
) {
|
||||||
for _, include := range ctx.document.Indexes.Includes {
|
for _, include := range ctx.document.Indexes.Includes {
|
||||||
for _, value := range include.Values {
|
for _, value := range include.Values {
|
||||||
if isImpossibleToVerify(value.Value) {
|
if !canBeAnalyzed(value.Value) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,20 +47,20 @@ func analyzeIncludeValues(
|
|||||||
|
|
||||||
// We can't evaluate environmental variables or tokens as we don't know the actual
|
// We can't evaluate environmental variables or tokens as we don't know the actual
|
||||||
// values
|
// values
|
||||||
func isImpossibleToVerify(
|
func canBeAnalyzed(
|
||||||
path string,
|
path string,
|
||||||
) bool {
|
) bool {
|
||||||
if environmtalVariablePattern.MatchString(path) {
|
if environmtalVariablePattern.MatchString(path) {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, token := range fields.AvailableTokens {
|
for token := range fields.AvailableTokens {
|
||||||
if strings.Contains(path, token) {
|
if strings.Contains(path, token) {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func createIncludePaths(
|
func createIncludePaths(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user