Skip to content

Old pony 5300#169

Merged
IgorDeepakM merged 5 commits intomasterfrom
old_pony_5300
May 4, 2026
Merged

Old pony 5300#169
IgorDeepakM merged 5 commits intomasterfrom
old_pony_5300

Conversation

@IgorDeepakM
Copy link
Copy Markdown
Owner

No description provided.

orien and others added 5 commits May 4, 2026 12:08
Implements the three call hierarchy operations in pony-lsp:
- textDocument/prepareCallHierarchy
- callHierarchy/incomingCalls
- callHierarchy/outgoingCalls
- Expand single-line `if ... then ... end` guards to multi-line form
- Expand inline `try ... else ... end` expressions to multi-line form
- Remove trailing blank line in selection_ranges.pony
- Tighten multi-line string concatenations in workspace_manager.pony that were split at the `+` operator
…#5299)

Each AST test called FilePath.mkdtemp("pony-lint-ast-test") and never
removed the directory. Over local development the cwd accumulated
hundreds of these dirs (1200+ / 9.4MB reported on the issue).

Wrap the compile match in a try/else so tmp.remove() runs on every
exit -- success and error paths -- before the function returns.
SourceFile holds the source content in-memory after construction
(tools/pony-lint/source_file.pony), so removing the underlying tmpdir
after compile() does not affect the returned (program, sf) pair.

Update the docstring -- "the directory persists" no longer holds.

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
- Fix supertype dedup: replace Set[USize]/digestof with Set[AST val] so
  deduplication uses raw pointer identity via AST.hash()/eq(), matching
  the invariant stated in the comment
- Add name prefilter to _SubtypeCollector to skip the expensive
  definitions() call when no nominal in the provides clause matches the
  target entity name, mirroring _IncomingCallCollector in call_hierarchy
- Add _find_entity_node helper to WorkspaceManager, paralleling
  _find_method_node: negative-coord guard + entity resolution at the
  workspace boundary; use it in type_hierarchy_supertypes/subtypes
- Delegate _is_entity to TokenIds.is_entity, excluding tk_object, so
  new compiler entity tokens are picked up automatically
- Annotate _provides_defs return type as Array[AST val]
- Correct stale function name in isectype test docstring
- Correct misleading comment about tk_uniontype in _append_provides_defs

* Extend type hierarchy integration tests

Add subtypes_isect test exercising the tk_isecttype recursion path in
_provides_mentions from the subtypes direction. Add supertypes_dedupe
test with a diamond-provides fixture to make the Set[AST val] dedup in
_collect_supertypes counterfactually testable. Clarify the conservative
fallback comment in _provides_mentions.
A followup to #5299. Use `h.assert_true(tmp.remove(), ...)` so that
silent removal failures surface as test failures rather than going
undetected. Update the docstring to accurately describe cleanup on both
return and error paths.
@IgorDeepakM IgorDeepakM merged commit e1cde1a into master May 4, 2026
3 of 4 checks passed
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.

4 participants