fix(aliases): Fix values

This commit is contained in:
Myzel394 2024-09-07 11:51:37 +02:00
parent 3538a37203
commit 77cf960559
No known key found for this signature in database
GPG Key ID: DEC4AAB876F73185
3 changed files with 4 additions and 3 deletions

View File

@ -177,7 +177,7 @@ func (s *aliasesParserListener) EnterEmail(ctx *parser.EmailContext) {
rawEntry, _ := s.Parser.Aliases.Get(location.Start.Line)
entry := rawEntry.(*AliasEntry)
entry.Values.Values = append(entry.Values.Values, &email)
entry.Values.Values = append(entry.Values.Values, email)
}
func (s *aliasesParserListener) EnterError(ctx *parser.ErrorContext) {

View File

@ -20,11 +20,11 @@ func GetValueAtCursor(
value := entry.GetAliasValue()
if pos > value.Location.End.Character {
return 1
return -1
}
if pos < value.Location.Start.Character {
return -1
return 1
}
return 0

View File

@ -95,6 +95,7 @@ func GetAliasValueHoverInfo(
func GetAliasValueTypeInfo(
value ast.AliasValueInterface,
) []string {
println(fmt.Sprintf("value: %v, value type: %T", value, value))
switch value.(type) {
case ast.AliasValueUser:
return []string{