Skip to content

Commit

Permalink
Fix enum test.
Browse files Browse the repository at this point in the history
  • Loading branch information
pherrymason committed Jan 13, 2024
1 parent f3fa445 commit 3f59475
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server/lsp/language_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ func createEnum(docId string, name string, variants []idx.Enumerator, idRange [4
return &enum
}

func createEnumerator(name string, pRange [4]uint) idx.Enumerator {
enumerator := idx.NewEnumerator(name, "", idx.NewRange(pRange[0], pRange[1], pRange[2], pRange[3]), "")
func createEnumerator(name string, docId string, pRange [4]uint) idx.Enumerator {
enumerator := idx.NewEnumerator(name, "", idx.NewRange(pRange[0], pRange[1], pRange[2], pRange[3]), docId)

return enumerator
}
Expand Down Expand Up @@ -148,17 +148,17 @@ func TestLanguage_FindSymbolDeclarationInWorkspace_symbol_same_scope(t *testing.
"Colors",
0, 36,
createEnum("x", "Colors", []idx.Enumerator{
idx.NewEnumerator("RED", "", idx.NewRange(0, 16, 0, 19), ""),
idx.NewEnumerator("BLUE", "", idx.NewRange(0, 21, 0, 25), ""),
idx.NewEnumerator("GREEN", "", idx.NewRange(0, 27, 0, 32), ""),
idx.NewEnumerator("RED", "", idx.NewRange(0, 16, 0, 19), "x"),
idx.NewEnumerator("BLUE", "", idx.NewRange(0, 21, 0, 25), "x"),
idx.NewEnumerator("GREEN", "", idx.NewRange(0, 27, 0, 32), "x"),
}, [4]uint{0, 5, 0, 11}, [4]uint{0, 0, 0, 34}),
},
{
"enum enumerator",
`enum Colors = { RED, BLUE, GREEN };Colors foo = RED;`,
"RED",
0, 49,
createEnumerator("RED", [4]uint{0, 16, 0, 19}),
createEnumerator("RED", "x", [4]uint{0, 16, 0, 19}),
},
{
"struct",
Expand Down

0 comments on commit 3f59475

Please sign in to comment.