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

We don't brace completion on '<' #95

Closed
fionafung opened this issue Mar 28, 2015 · 5 comments
Closed

We don't brace completion on '<' #95

fionafung opened this issue Mar 28, 2015 · 5 comments
Assignees

Comments

@fionafung
Copy link
Contributor

In writing generics, I notice that we don't brace complete on '<'. I got used to our great support of all the other types of braces :)

@DanielRosenwasser
Copy link
Member

This is a very weird case because < is actually a binary operator on its own; however, if we're sure we want this, it can be implemented by only completing if the previous character is part of an identifier (note, I said "part of an identifier", not "not whitespace"; for instance, << cannot result in <<>).

@steveluc
Copy link
Contributor

Looking into a safe way to do this. We could do a regex to look for an id token on left, but I don't think that's sufficient because I can say a<b and that can mean a less than b or type a<b... finished by a closing >.

@steveluc
Copy link
Contributor

Now with HTML escapes: I can say a<b and mean either a less than expression or the prefix of a<b>

@DanielRosenwasser
Copy link
Member

That's true, but that depends mostly on whether or not you tend to have whitespace around your operators. Again, I can see this being a point of contention for users.

@fionafung fionafung added Enhancement and removed Bug labels Apr 1, 2015
@fionafung fionafung removed this from the TypeScript Sublime Plugin 0.1 milestone Apr 1, 2015
@billti
Copy link
Member

billti commented Apr 16, 2015

Any final thoughts on this? Otherwise I think this is too ambiguous. There's a few heuristics we could try, but not sure if the cost justifies the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants