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

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

Closed
LegalizeAdulthood opened this issue Jun 6, 2015 · 12 comments

Comments

@LegalizeAdulthood
Copy link

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
Copy link
Contributor

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

@LegalizeAdulthood
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@mousetraps
Copy link
Contributor

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
Copy link
Contributor

@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 😃

@LegalizeAdulthood
Copy link
Author

@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:
LegalizeAdulthood/iterated-dynamics@7c22b14

@mousetraps
Copy link
Contributor

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
Copy link
Contributor

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 mousetraps self-assigned this Sep 13, 2015
mousetraps added a commit that referenced this issue Sep 14, 2015
#310 Default to requiring tab to trigger a completion
Remove the custom committed-by characters setting and also default to
requiring tab/enter triggering a completion. This simplifies settings,
is consistent with both C# and JS projects in VS2015, and makes it easier
to work with identifiers that don't appear in the completions list.

Fix #310, related to #179
@mousetraps
Copy link
Contributor

@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:

  • Text Editor > Node.js > Statement Completion > Auto list members

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

2 participants