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

Completion for a type which is an alias to some record type? #311

Closed
cannorin opened this issue Nov 9, 2021 · 1 comment · Fixed by #319
Closed

Completion for a type which is an alias to some record type? #311

cannorin opened this issue Nov 9, 2021 · 1 comment · Fixed by #319

Comments

@cannorin
Copy link

cannorin commented Nov 9, 2021

Suppose we have the following code:

type foo<'a> = { content: 'a }
type intFoo = foo<int>

let x1: foo<int> = { content: 42 }
let x2: intFoo = { content: 42 }

If I type Js.log(x1., autocompletion is triggered and the field content is suggested. However, if I type Js.log(x2., autocompletion is not triggered.

Is this an intended behavior? I think it would be more convenient if autocompletion is triggered for x2 too.

@cannorin
Copy link
Author

cannorin commented Nov 9, 2021

sorry, I realized this issue should be placed to bsc instead.

I double-checked and I found the autocompletion is actually provided by ./analysis. Sorry for closing and reopening due to my confusion.

@cannorin cannorin closed this as completed Nov 9, 2021
@cannorin cannorin reopened this Nov 9, 2021
cristianoc added a commit that referenced this issue Nov 25, 2021
The current function to extract record types looks for a type definition, and expect it to be a record.
The new one keeps on expanding type definitions until it finds a record. In this way, it handles type aliases.

Fixes #311
cristianoc added a commit that referenced this issue Nov 25, 2021
The current function to extract record types looks for a type definition, and expect it to be a record.
The new one keeps on expanding type definitions until it finds a record. In this way, it handles type aliases.

Fixes #311
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 a pull request may close this issue.

1 participant