Skip to content

Add IntelliSense option "Only use tab or enter to commit" #315

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

Closed
RandScullard opened this issue Jul 30, 2014 · 34 comments
Closed

Add IntelliSense option "Only use tab or enter to commit" #315

RandScullard opened this issue Jul 30, 2014 · 34 comments
Labels
Suggestion An idea for TypeScript Visual Studio Integration with Visual Studio

Comments

@RandScullard
Copy link

In Visual Studio 2013, in Options, Text Editor, JavaScript, IntelliSense, there is a checkbox labeled "Only use tab or enter to commit". Currently, TypeScript always behaves the way JavaScript does with this option turned ON, and provides no similar option to turn it off.

For those of us who have been working in C# and JavaScript for years with this option turned off -- and who need to work in all three languages in a single project -- it's frustrating that TypeScript doesn't work the same way. It would be a huge improvement to let us set this option.

See also: http://typescript.codeplex.com/workitem/965

@stkb
Copy link

stkb commented Nov 4, 2014

+1 I find it frustrating too to have to press tab every time. It would be very nice to have the option to turn this off.

@Peter-Juhasz
Copy link

+1 Please take a look at this: http://www.peterjuhasz.net/Articles/Details/the-devolution-of-the-code-completion-experience And fix this bug ASAP, this is an essential part of the developer experience. Ridiculous that you can't implement this feature after many years (and if I can tell you a secret: the whole experience had to be designed with correct auto completion behavior in mind we used to...). This is very frustrating like most of the other development environments, and that's why most of us choose Visual Studio (and Microsoft technologies, so do not forget Monaco!), the experience and productivity it gives. Having to hit Enter after every single word is not productive at all... Have you ever tried to write at least a few lines of code with this behavior!? It seems like you do not.

@mhegazy mhegazy added this to the TypeScript 1.3 milestone Nov 4, 2014
@CyrusNajmabadi
Copy link
Contributor

@RandScullard This behavior is coming in the next version of VS.
@Peter-Juhasz Please provide this feedback through the Visual Studio user voice site. That way others can vote on your feedback. TypeScript does not control the VS IntelliSense experience. We simply provide the data that VS (and tools like Monoco) use when they present completion. Thanks!

@Peter-Juhasz
Copy link

@CyrusNajmabadi And what about Monaco? Are you going to support this behavior in short term?

@RandScullard
Copy link
Author

@CyrusNajmabadi Just to clarify, when you say "the next version of VS", do you mean that the only way to get this functionality will be via the next Visual Studio release, and not via an interim update to TypeScript?

@Peter-Juhasz
Copy link

As far as I know, this behavior is not controlled by the Visual Studio, but the extension developer. I have already developed some extensions and I am also interested in language service development. Even the latest SDK samples contain ugly OLE command base implementations to commit completion in specific cases manually. And in common sense, the development environment can not implement this functionality generally, because it should know nothing about the programming languages, its syntax rules and the context the caret is currently in. Please correct me if I am wrong, or the new SDK contains some new APIs to support these kind of scenarios.

On the other hand, the new web based editor should be completely under your control, so please do not break this essential behavior after tens of years.

@jseanxu
Copy link

jseanxu commented Nov 12, 2014

This behavior is coming in the next version of VS.

Hi @CyrusNajmabadi, TS 1.3 and VS2015 Preview were released today and I don't see this feature in the text editor options. Are there any updates on this issue?

@CyrusNajmabadi
Copy link
Contributor

@jseanxu Hey Sean, right now TypeScript has aligned with C# and VB on how they do this sort of completion. We commit in the same way as them (literally using the same code that they do). Right now, JavaScript is the odd man out. But i hope we'll be unifying javascript with C#/VB/TS in a future release. Thanks!

@jseanxu
Copy link

jseanxu commented Nov 12, 2014

Could you elaborate on TS aligning with C# and VB?

My issue (and that many other caring about this issue) is that we come from the .NET C# world where this behavior was on by default - for the past decade. To clarify, in C# since at least VS6 partially typing a keyword or known symbol followed by a grammatical token such as . ( ) ; < > & | etc, and even space would autocomplete it. This is the missing behavior in question and there is no way of enabling it in TS today, so this sort of completion does not appear to be aligned with C#.

@CyrusNajmabadi
Copy link
Contributor

Hey @jseanxu The behavior yo're talking about for C# is the behavior you should now see with TypeScript. i.e. if you partially type something, and you follow it with punctuation, or space, or tab, you should see it completed.

If you're not seeing that in VS2015, please let me know with a repro case and we can def take a look!

@jseanxu
Copy link

jseanxu commented Nov 12, 2014

@CyrusNajmabadi I am not seeing the autocompletion behavior. Create a new TS project, in the app.ts file that gets opened upon project creation, type doc followed by a period, which should autocomplete to document. but it doesn't.

This is on VS version 14.0.22310.1 DP

@CyrusNajmabadi
Copy link
Contributor

@jseanxu Yup. Definitely a bug. Will fix right away!

@danquirk danquirk added Bug A bug in TypeScript and removed Suggestion An idea for TypeScript labels Nov 12, 2014
@mhegazy mhegazy modified the milestones: TypeScript 1.5, TypeScript 1.4 Dec 2, 2014
@Peter-Juhasz
Copy link

It seems like we will never get this essential (again: essential) functionality which we are used to and loved for years before since Visual Studio exists...

Even Visual Studio '97 could complete the selected item while writing the next few characters. All language (JavaScript, T-SQL) has this option, which works this way by default. Or take a look at the HTML editor: when the caret is in this position:
<script type="|"
...and you have a selected completion, you can even press a '>' and it will take care of everything: activate the selected completion, insert the typed '>' after (!) the closing '"', close the tag automatically and position the caret into the correct place, so you get:
<script type="text/javascript">|</script>

@jseanxu
Copy link

jseanxu commented Jan 13, 2015

@CyrusNajmabadi

@jseanxu Yup. Definitely a bug. Will fix right away!

Could we get an update on this issue? I see the fix has been postponed 3 times :(

@danquirk
Copy link
Member

Status is this:

Previously TS in VS only commit completions on tab and enter so there was no need for an option to toggle what keystrokes commit completions. The intention was to move to the C# style behavior where space and punctuation characters also commit completion lists. This behavior was turned on recently but has some unfavorable interactions with certain completion list scenarios (see #1629). I want to make sure we clean up some of these experiences or else the new completion commit characters can be more annoying than helpful in a lot of cases. In any case we should provide the toggle that JS has for commit keystroke options.

@danquirk danquirk added Suggestion An idea for TypeScript and removed Fixed A PR has been merged for this issue Bug A bug in TypeScript labels Feb 6, 2015
@Pilchie
Copy link
Member

Pilchie commented Feb 9, 2015

Roslyn is NOT currently planning on bringing back the options to control individual commit characters. Looking at the telemetry we put in place back in VS2005, we can see evidence of anyone ever actually changing that list, so we don't feel it's necessary. If TS wants to offer it, we can make sure the APIs support it, but we don't plan to add it for C# (or VB).

@Peter-Juhasz
Copy link

Personally, I am completely happy with the current solution and I do not want to change the commit characters or keys. I think the point of this request was that you always had to press Enter to commit the selected completion which was exceptionally annoying - but it has been finally fixed.

@jseanxu
Copy link

jseanxu commented Mar 22, 2015

Just installed CTP6 and this feature is gone again... was this deliberate?

@danquirk
Copy link
Member

By 'this feature' do you mean the checkbox to toggle "Only use tab or enter to commit"? Because yeah, that never existed in the first place. I meant to re-open this when I added the Suggestion label back in February... my bad. As far as the actual completion behavior, it appears correct to me in CTP6.

@danquirk danquirk reopened this Mar 24, 2015
@DanielRosenwasser
Copy link
Member

Hey guys, for the record, I started working on this today.

@jseanxu
Copy link

jseanxu commented Mar 24, 2015

As far as the actual completion behavior, it appears correct to me in CTP6.

Sorry, I was not referring to the checkbox toggle but on how completion works.

Typing document.bo followed by a period again yields document.bo. instead of document.body.

@danquirk
Copy link
Member

Ah, yeah, you're right, I just quickly checked some fat arrow completion. It is working on some newer internal builds but I've logged #2482 to make sure we verify that it's definitely working correctly in what will be shipped next.

@csicky
Copy link

csicky commented Jul 14, 2016

Hi all, this just came back. VS 2015 update 3 removed the autocomplete on period character. Now I have to use tab or enter again. Before this update it was working OK.

VS 14.0.25422.01 Update 3
TypeScript 1.8.35.0

@Peter-Juhasz
Copy link

I have already opened a new issue on this one #9424 (for version 1.8.34) but it looks like they don't really understand what the problem is...

@paulvanbrenk
Copy link
Contributor

@csicky This will be fixed in 2.0. autocompletion on most characters... the original issue this bug was created for (i.e. give the user the option to disable that, will be in VS "15")

@RyanCavanaugh
Copy link
Member

Given the lack of recent noise here, I'm going to assume (instead of installing an old version of VS) that this has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Suggestion An idea for TypeScript Visual Studio Integration with Visual Studio
Projects
None yet
Development

No branches or pull requests