microsoft / nodejstools

Node.js Tools for Visual Studio
http://aka.ms/explorentvs
Apache License 2.0
1.8k stars 359 forks source link

VS Reformats my source code when I type, even though I told it not to #179

Closed LegalizeAdulthood closed 9 years ago

LegalizeAdulthood commented 9 years ago

Even though I have this turned off in Tools / Options, since installing the nodejs tools for VS, VS is now reformatting my code (changing indentation, adding whitespace) whenever I type ; and during other operations.

This is very annoying. My code is written the way I want and VS should never be fiddling around with my code simply because I'm typing.

I tried toggling the option in case it simply ignored the setting on first time install, but that didn't help.

This is really, really, really annoying. Now I have to undo every time VS decides to reformat my code which is all the time that I'm typing. Grrr.

mousetraps commented 9 years ago

Did you turn it off in JavaScript formatting options or Node.js formatting options? They are confusinfly in different spots at the moment.

LegalizeAdulthood commented 9 years ago

You've got all the formatting options duplicated?!?!?

If you're going to duplicate them, you should seed your settings from my existing JavaScript settings.

mousetraps commented 9 years ago

Yeeeahhhh... its pretty non-ideal... To provide a little more context...

They diverged when we stopped using the JS language service available in the rest of VS in favor of our own Node.js engine that does static analysis because JSLS didn't scale well to the large node projects people were building. So our formatter and intellisense actually behaves differently and requires different options.

See #67 for more info (and please contribute to the discussion there.)

LegalizeAdulthood commented 9 years ago

Is this also why Ctrl+SPACE doesn't show intellisense suggestions if I delete all the characters in the "complete intellisense when I type these characters" box?

I just want to type my code and only use intellisense when I ask for it. I find the constant popping up of "suggestions" annoying and distracting. I certainly don't want to be typing code, such as calling a method that doesn't yet exist because I'm about to write it, and have the open paren on my as-yet-non-existing method call tell intellisense to change my existing correct code into incorrect code. This is the most annoying thing about intellisense in IDEs, is that they don't let me simply write correct code without constantly molesting it along the way.

When I've done training classes, it was uniformly the case that people who relied on intellisense to "complete" their code every step of the way took the longest to complete any given exercise. Intellisense should be an assistant, not a crutch and certainly not a backseat driver constantly nagging me to turn here or turn there when I know exactly where I'm going.

LegalizeAdulthood commented 9 years ago

Also, apparently, once I've deleted all those characters from that box, there's no way to reset it to the default without resetting all my options to the defaults globally? that sucks. But maybe that's just VS sucking.

LegalizeAdulthood commented 9 years ago

Hrm... suggestions for fs module are not being provided, but it is providing suggestions for async module.

mousetraps commented 9 years ago

I can't reproduce the issue you mentioned with ctrl+space after removing the commit characters - do you have a consistent repro on your end?

The 'fs' issue may be related to #63, so try deleting the ntvs_analysis.dat file in your project folder to fix the 'fs' not experiencing completions issue.

Thanks for explaining your philosophy on IntelliSense. What we have now (showing completions on dot) is indeed consistent with the experience in the rest of Visual Studio, but that doesn't necessarily mean we can't add an option to only show IntelliSense on ctrl+space, so we'd need to investigate further if we wanted to change that behavior.

Re: commit characters - good call - this setting makes more sense in C# than it does in javascript. Would you be happy if we just simplified it to enter/tab to commit by default?

mousetraps commented 9 years ago

@LegalizeAdulthood Also - totally random comment since I just realized you work for Daz 3D. Thank you so much for your work - Bryce and Daz Studio were my favorite applications and sparked my interest in computer graphics when I was growing up :smiley:

LegalizeAdulthood commented 9 years ago

@mousetraps Does it commit on TAB/ENTER? From the way the settings box is worded, it looks as if it only commits on those special characters. I'm a bit more anti-intellisense than most people, so I'm probably not the person to decide what the defaults should be; if most people want the intellisense crutch and want that box populated with basically every punctuation character, then the defaults should cater to the most popular request IMO.

I saw it while working on a nodejs script to convert some homebrew help files to RST format for use with Sphinx. The code should be here: https://github.com/LegalizeAdulthood/iterated-dynamics/commit/7c22b1454eb48bf7c9264cf13e46341b79709bd4

mousetraps commented 9 years ago

By the way, I just realized there's already an option for this - if you uncheck "auto list members" and also remove the commit characters, you should get the behavior you're looking for. image

mousetraps commented 9 years ago

Thx again for the feedback. See #310. We are planning to make tab/enter the default commit characters, and include no other commit characters as the default.

mousetraps commented 9 years ago

@LegalizeAdulthood check out the latest dev build, which defaults to requiring tab/enter to trigger a completion: https://github.com/Microsoft/nodejstools/releases

To get the settings you want (no isense appearing), you'll want to uncheck: