Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS: Support value access paths in MaD type columns #16037

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Mar 25, 2024

A type string of form (package).accessPath is now interpreted as value access path, that is, an access path interpreted as a value rather than a type. This is useful to have whenever we generate models from source code, as opposed to from .d.ts files.

The syntax is chosen to coincide with the FQN format, see backlink.

@github-actions github-actions bot added the JS label Mar 25, 2024
Comment on lines +150 to +152
[
"(global).fqnSource;;test-source", //
]

Check warning

Code scanning / CodeQL

Singleton set literal Warning test

Singleton set literal can be replaced by its member.
@asgerf asgerf added the no-change-note-required This PR does not need a change note label Mar 25, 2024
@asgerf asgerf marked this pull request as ready for review March 25, 2024 14:16
@asgerf asgerf requested a review from a team as a code owner March 25, 2024 14:16
@asgerf asgerf marked this pull request as draft April 2, 2024 09:02
@asgerf
Copy link
Contributor Author

asgerf commented Apr 2, 2024

Taking back into draft as I'm starting to have second thoughts about this approach.

The problem is that the logic in getExtraNodeFromType for a type (foo).bar.baz does not take into account other type models that contribute to a prefix of the type string, such as (foo).bar;(blah);. Any row starting from (foo).bar.baz would therefore miss an expression like require('blah').baz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JS no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant