Skip to content

More precise use-defs#48

Merged
PaulKlint merged 5 commits into
mainfrom
more-precise-usedefs
Jun 10, 2026
Merged

More precise use-defs#48
PaulKlint merged 5 commits into
mainfrom
more-precise-usedefs

Conversation

@sungshik

@sungshik sungshik commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This PR updates the signature of define (and defineInScope), so Typepal users can now pass the name of a definition as a tree (instead of a string). If so, then all uses of that definition are directed to the location of that tree (instead of the whole definition) by the useDef relation. This enables more precise Go To Definition support. The changes of this PR are fully backward-compatible (i.e., the name of a definition can still be defined as a string instead of a tree).

Technically, this PR adds a new define2id property to TModel for necessary bookkeeping.

Successful integration test: https://github.com/usethesource/rascal-core-big-tests/actions/runs/27205996870

@sungshik sungshik marked this pull request as ready for review June 10, 2026 06:32
@PaulKlint

Copy link
Copy Markdown
Member

Looks great. Only surgical changes to get the desired functionality.

@PaulKlint PaulKlint left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@PaulKlint PaulKlint merged commit bdf8e27 into main Jun 10, 2026
1 check passed
@PaulKlint PaulKlint deleted the more-precise-usedefs branch June 10, 2026 09:49
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