Skip to content

Autocomplete does not take escaped identifiers into account #598

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

Open
cknitt opened this issue Oct 8, 2022 · 3 comments
Open

Autocomplete does not take escaped identifiers into account #598

cknitt opened this issue Oct 8, 2022 · 3 comments

Comments

@cknitt
Copy link
Member

cknitt commented Oct 8, 2022

E.g.

module X = {
  let \"Foo" = "foo"
}

let x = X.

completes to X.Foo instead of X.\"Foo".

@cristianoc
Copy link
Collaborator

It would be nice to move in the opposite direction, even though it's not so obvious how exactly to do that.
There are cases where upper case ids, or non-standard ids, are necessary, such as for components.

Wondering whether there is a way to legitimise the legitimate use cases without the free-for-all quoted thing which is really not recommended unless there's no other way.

@cristianoc
Copy link
Collaborator

cristianoc commented Oct 8, 2022

For example, this

let foo = (x,y) => x+y

does two things: it defines an anonymous function, and binds it to variable foo.
One could imagine some mechanism to specify the name of the function seen by console.log(foo.name).

@cknitt
Copy link
Member Author

cknitt commented Jan 18, 2023

This affects hover, too, not just completion.

Hovering on the above module X incorrectly shows

module X = {
  let Foo: string
}

Escaped identifiers also occur for prop names in both the React Native and the Material-UI bindings, e.g.

<Mui.Dialog \"open"=true>
  ...

or

<FlatList
  \"ItemSeparatorComponent"={_ => <Separator />}
  ...

where they are not completed correctly either.

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

No branches or pull requests

2 participants