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

Visual Studio: Support "Automatic brace completion" #1484

Closed
Noah-Huppert opened this issue Dec 15, 2014 · 38 comments
Closed

Visual Studio: Support "Automatic brace completion" #1484

Noah-Huppert opened this issue Dec 15, 2014 · 38 comments
Assignees
Labels
Fixed A PR has been merged for this issue Suggestion An idea for TypeScript Visual Studio Integration with Visual Studio

Comments

@Noah-Huppert
Copy link

In Visual Studio if you go into the options for TypeScript(Tools > Options > Text Editor > TypeScript > General) the "Automatic brace completion" option is grayed out.

Automatic brace completion options grayed out

I was wondering why this is and if there is any way to turn this on.

Visual Studio Version: Visual Studio Express 2013 for Web v12.0.31101.00 Update 4
OS: *Windows 8.1

@CyrusNajmabadi
Copy link
Contributor

We don't currently support this feature in visual studio. It is on our backlog though.

@Noah-Huppert
Copy link
Author

@CyrusNajmabadi May I ask why? At least with my limited knowledge it seams that the brace completion would be similar to JavaScript's brace completion.

However I imagine there is probably a very good reason why it is not enabled

@CyrusNajmabadi
Copy link
Contributor

It was simply a matter of schedule and resources. Features are never really free, and this one simply hasn't made the cut so far. One issue is that this is a synchronous blocking feature that depends on needing to properly syntactically understand your code. Right now there are some limitations in our architecture that makes that hard. We could provide support for this, but its likely the performance would not be good enough and t the experience could feel chunky in large files.

Until we can provide the feature with great performance, I'm holding off on this.

Fortunately, we're making several architectural improvements that should make this more feasible in the next year.

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Visual Studio Integration with Visual Studio labels Dec 17, 2014
@nheinbaugh
Copy link

Any updates on this?

@mhegazy
Copy link
Contributor

mhegazy commented Jun 3, 2015

This is still on our backlog at the moment.

@yalexx
Copy link

yalexx commented Jun 5, 2015

I need this feature wow.

@DmitryEfimenko
Copy link

+1

1 similar comment
@gabguy
Copy link

gabguy commented Sep 5, 2015

+1

@ghost
Copy link

ghost commented Sep 23, 2015

Tho resharper adds the feature, I would preffer using vanilla studio when using pure JS code.
+1

@IntermittentlyRupert
Copy link

+1

@CyrusNajmabadi
Copy link
Contributor

For those talking about resharper, could you let me know what they do with something like this:

var foo = 0;
var v = foo<

as well as

function foo<T>(t: T) { }
var v = foo<

In the first example, you should not get automatic completion as you are typing an arithmetic expression. in the latter, you should, because you're typing generic type arguments.

However, to do this properly, you need both your syntax tree up to date, and you need your semantics to be accurate as well (so you can tell what 'foo' means). Getting that correct is easy. Getting it correct and fast is very very hard. And this feature needs to be fast as it interacts with typing in a blocking fashion.

Of course, we could just not have auto-completion on <. However, even for the other cases, i.e.:

  1. /
  2. "
  3. '
  4. (
  5. {
  6. [

We'd still need fairly accurate syntactic understanding of your file to ensure that we didn't, for example, autocomplete these guys inside a comment or a string.

@mhegazy If you did this, i'd actually recommend a dedicated thread just for this feature. Because it needs to be synchronous, but is also involved with typing it really needs to be uninterrupted when it runs. If you avoid completion on < then you don't need semantics and you can just have another syntactic thread.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 29, 2015

@mhegazy If you did this, i'd actually recommend a dedicated thread just for this feature. Because it needs to be synchronous, but is also involved with typing it really needs to be uninterrupted when it runs. If you avoid completion on < then you don't need semantics and you can just have another syntactic thread.

how about using the formatting thread? all these trigger characters are not formatting trigger characters, so we know the thread will be likely idle.

@CyrusNajmabadi
Copy link
Contributor

@mhegazy Ah, I think you're right. None of the characters should overlap. And because they're all synchronous, we'll essentially only ever have one in the queue at a time, so we don't have to worry about bottlenecks. So that thread should be a good choice here.

@danquirk
Copy link
Member

Many requests for this feature are coming from folks who use text editors that have nowhere near enough understanding of the code to be 100% correct in their completion behavior. Let's not let the perfect be the enemy of the good.

In Sublime < is not completed. Most of the others characters are completed in any non-string context. The closing element is skipped over when you type the closing element. It's immensely useful and the kind of feature that seems like a 'nice to have' for those who aren't used to it but an actual adoption blocker for people who are used to it.
bracecompletion

@DanielRosenwasser
Copy link
Member

See microsoft/TypeScript-Sublime-Plugin#95

Let's not let the perfect be the enemy of the good.

Agreed. I think we can just forget about < for now.

@jimior2
Copy link

jimior2 commented Oct 14, 2015

This is really a great feature, nice to have it. It could improvement productivity.

@jimior2
Copy link

jimior2 commented Oct 27, 2015

As I install visual studio code, and vs code have typescript auto brace, why didn't VS2015 didin't have...

image

@jonathansotoan
Copy link

+1
Any update on this issue? it's a little annoying having to close every brace manually

@CBuntrock
Copy link

+1 But guys please don't shout like "I pay money give me what I want". Still a young product, many features are requested...

@arangil
Copy link

arangil commented Mar 10, 2016

+1

1 similar comment
@BrianMikinski
Copy link

+1

@mhegazy mhegazy changed the title Visual Studio: "Automatic brace completion" option grayed out Visual Studio: Support "Automatic brace completion" Mar 11, 2016
@eijoac
Copy link

eijoac commented Mar 11, 2016

+1

@mhegazy
Copy link
Contributor

mhegazy commented Mar 11, 2016

With new reactions added to github issues I suggest adding the "+1" to the the main issue to indicate an "up vote"

@anmolg26
Copy link

+1

@pgorbas
Copy link

pgorbas commented Mar 17, 2016

+1
Also I still do not see split window support ( for ts => js )returned, despite several post saying it was...

@paulvanbrenk
Copy link
Contributor

@pgorbas were did you see the split window support mentioned? It never was a feature of TypeScript, but part of Web Essentials.

@Noah-Huppert
Copy link
Author

Dear anyone who is going to post "+1" in the future!

Please note that Github recently added reactions. Just scroll up to the top and click the little smiley button

Add a reaction

@abdu292
Copy link

abdu292 commented Apr 15, 2016

Wondering if there is an update?

Started with Angular 2 + TypeScript, and really looking for this feature on Visual Studio 2015 (Even not available with latest Update 2).

Thanks a bunch!

@paulvanbrenk
Copy link
Contributor

@abdu292 I checked in the script side changes, but there needs to be Visual Studio support to make this work, that should be in the next release for TypeScript.

@paulvanbrenk paulvanbrenk added this to the TypeScript 2.0 milestone Apr 15, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Apr 15, 2016
@brendon-colburn
Copy link

Yeah kind of crazy that this is in code but not enterprise, vs 2015 update 2 just came out and this still isn't there after being in the backlog for almost 2 years.

@paulvanbrenk
Copy link
Contributor

@brendon-colburn I feel your pain, and that's the reason I stick to pure VS. We're getting some breathing room to spend more time on features, by making improvements to our infrastructure. And hopefully we can publish nightly drops of the VS tools soon.

@brendon-colburn
Copy link

Interesting. Could you define "pure VS" for me? It's just a nuisance
really, but I felt a need to say something due to the length of time this
has been in backlog status. Not trying to be a nag, I understand that
certain development tasks take priority.

Thanks,

Brendon

On Mon, Apr 18, 2016 at 2:03 PM, Paul van Brenk notifications@github.com
wrote:

@brendon-colburn https://github.com/brendon-colburn I feel your pain,
and that's the reason I stick to pure VS. We're getting some breathing room
to spend more time on features, by making improvements to our
infrastructure. And hopefully we can publish nightly drops of the VS tools
soon.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#1484 (comment)

@paulvanbrenk
Copy link
Contributor

"pure vs" == no extensions like ReSharper etc.

@vsg24
Copy link

vsg24 commented Jun 14, 2016

This is nonsense. When are we going to get this?? How hard could it be to implement this???

@DanielRosenwasser
Copy link
Member

@vsg24 it's not the work itself, it's just that this will be part of a release. we should have it in TypeScript 2.0, but you'll have to be patient in the mean time.

@trollcop
Copy link

trollcop commented Sep 7, 2016

This is the first feature I turn OFF immediately if the editor does it. I know EXACTLY when and why I will add a closing brace to my code, and I don't need some dumb software appending it for me.

Hopefully this stays WONTFIX forever

@mhegazy
Copy link
Contributor

mhegazy commented Sep 7, 2016

Automatic brace completion should be supported with TS 2.0 RC and later. The feature can be enabled/disabled from tools options (as noted in the OP).

@pgorbas
Copy link

pgorbas commented Sep 7, 2016

Instead of saying won't fix for all the people that want it, wouldnt making it a toggle option be better?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fixed A PR has been merged for this issue Suggestion An idea for TypeScript Visual Studio Integration with Visual Studio
Projects
None yet
Development

No branches or pull requests