Skip to content

Add LSP hover integration tests#5106

Merged
SeanTAllen merged 1 commit intomainfrom
pony-lsp-test
Apr 4, 2026
Merged

Add LSP hover integration tests#5106
SeanTAllen merged 1 commit intomainfrom
pony-lsp-test

Conversation

@orien
Copy link
Copy Markdown
Member

@orien orien commented Apr 4, 2026

Context

The pony-lsp tool provides LSP hover functionality but has no integration tests that exercise the full server lifecycle — only unit tests for the hover formatter exist.

Changes

  • Adds _hover_integration_tests.pony: end-to-end hover tests covering classes, actors, traits, interfaces, primitives, aliases, type inference, receiver capabilities, complex types (union/tuple), generic types, and function signatures
  • Adds workspace fixture files under test/workspace/hover/ used by the integration tests
  • Renames _hover_tests.pony_hover_formatter_tests.pony (and _HoverTests_HoverFormatterTests) to distinguish the formatter unit tests from the new integration tests
  • Updates test name prefixes: formatter tests use hover/formatter/*, integration tests use hover/integration/*

Considerations

All integration tests share a single _HoverWorkspaceServer actor that initializes and compiles the workspace once, then dispatches individual hover requests to each test's TestHelper. This avoids repeated compilation overhead but means tests run sequentially through one server instance.

Adds end-to-end hover tests covering classes, actors, traits, interfaces,
primitives, aliases, type inference, receiver capabilities, complex types,
generic types, and function signatures. Tests share a single LSP server
instance that compiles the workspace once. Renames _hover_tests.pony to
_hover_formatter_tests.pony to distinguish unit tests from integration tests.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Apr 4, 2026
@SeanTAllen
Copy link
Copy Markdown
Member

Im merged this. Some thoughts on improvements to consider:

  • There are no negative tests. There are no tests for "hover at this position should return null" — e.g., hovering over whitespace, a keyword like fun, or a comment. A single negative test would verify that the LSP returns null/empty hover for non-hoverable positions, which guards against false-positive regressions.
  • _class.pony fixture is underutilized. The class test only hovers over the class name The fixture defines fields (field_name, mutable_field, embedded_field) and methods (simple_method, method_with_params, update_field) that aren't tested. Fields and methods are tested in other fixture files. Tje fixture is larger than the test requires. Either trim the fixture or add field/method hover checks to the class test. I'm not sure which is appropriate. I think that this plus the previous suggestion would mean "more hover checks".
  • _type_inference.pony has a leading blank line. can you clean this up commit? you can push straight to main for something so minor.

@SeanTAllen SeanTAllen merged commit 0a45551 into main Apr 4, 2026
14 checks passed
@SeanTAllen SeanTAllen deleted the pony-lsp-test branch April 4, 2026 02:49
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants