Skip to content

Commit

Permalink
parse: fix position
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 committed May 31, 2024
1 parent b9d2255 commit 0989da4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions ide-lsp/src/test/java/org/aya/lsp/LspTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,20 @@ public class LspTest {

var param = new TextDocumentPositionParams(new TextDocumentIdentifier(
TEST_LIB.resolve("src/Nat/Core.aya").toUri()),
new Position(0, 18)
new Position(0, 23)
);

var result0 = client.service.hover(param);
assertTrue(result0.isPresent());
assertEquals("<a href=\"#Nat-Core-Nat\"><span style=\"color:#218c21;\">Nat</span></a>", result0.get().contents.getFirst().value);
assertEquals("<a href=\"#Nat-Core-Nat\"><span style=\"color:#218c21;\">Nat</span></a>",
result0.get().contents.getFirst().value);

client.service.updateServerOptions(new ServerOptions(new ServerRenderOptions("IntelliJ", null, RenderOptions.OutputTarget.HTML)));

var result1 = client.service.hover(param);
assertTrue(result1.isPresent());
assertEquals("<a href=\"#Nat-Core-Nat\"><span style=\"color:#000000;\">Nat</span></a>", result1.get().contents.getFirst().value);
assertEquals("<a href=\"#Nat-Core-Nat\"><span style=\"color:#000000;\">Nat</span></a>",
result1.get().contents.getFirst().value);
}

private void logTime(long time) {
Expand Down
2 changes: 1 addition & 1 deletion pretty/src/test/java/org/aya/pretty/MdStyleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class MdStyleTest {
Doc.styled(MdStyle.GFM.Paragraph, "I love Java"),
Doc.styled(MdStyle.GFM.Paragraph, "I love Aya"),
Doc.styled(MdStyle.GFM.Paragraph, "I love Aya's pretty printer."),
Doc.codeBlock(Language.Builtin.Aya, "data Nat | zero | suc Nat"),
Doc.codeBlock(Language.Builtin.Aya, "inductive Nat | zero | suc Nat"),
Doc.styled(MdStyle.GFM.Paragraph, "Look! She is beautiful")
);
}
Expand Down

0 comments on commit 0989da4

Please sign in to comment.