Skip to content

refactor(hir): intern subroutine ids#11

Merged
roife merged 76 commits into
pascal-lab:completionfrom
hongjr03:refactor/consolidate-subroutine-container-id
Apr 14, 2026
Merged

refactor(hir): intern subroutine ids#11
roife merged 76 commits into
pascal-lab:completionfrom
hongjr03:refactor/consolidate-subroutine-container-id

Conversation

@hongjr03
Copy link
Copy Markdown
Member

@hongjr03 hongjr03 commented Jan 17, 2026

Previously, subroutines had split representations depending on whether they were declared in a module or at file scope (and callers needed to branch on that). Now subroutines are represented by a single SubroutineId that can be lookup’d to recover its SubroutineLoc { cont_id, src }, eliminating the need for a separate SubroutineLocation-style discriminator.

@hongjr03 hongjr03 marked this pull request as draft January 17, 2026 05:20
@hongjr03 hongjr03 force-pushed the refactor/consolidate-subroutine-container-id branch from fd011e0 to ac8323a Compare January 17, 2026 05:59
@hongjr03 hongjr03 changed the title refactor(hir): consolidate SubroutineId and FileSubroutineId refactor(hir): intern subroutine ids Jan 17, 2026
@hongjr03 hongjr03 marked this pull request as ready for review January 17, 2026 06:04
hongjr03 and others added 29 commits January 17, 2026 20:01
…clarator names

- Add `in_decl_name` field to CompletionContext to detect when cursor is
  at a new symbol name position (e.g., after type in port declaration)
- Fix line comment detection when comment appears before preprocessor
  directives like `timescale - now checks nested trivia inside directive
- Change trivia_at_offset to return TriviaKind instead of SyntaxTrivia
  to avoid lifetime issues with nested trivia
- Add comprehensive tests for line comment detection in various positions
…letion

- Distinguish between value names and subroutine names in completion
- Generate snippet with placeholder for subroutine calls: func(${1:args})
@roife roife merged commit 5b3b07d into pascal-lab:completion Apr 14, 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.

2 participants