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

JavaScript - Indentation broken since 1 or 2 versions of vscode #36203

Closed
patrickjane opened this issue Oct 13, 2017 · 5 comments
Closed

JavaScript - Indentation broken since 1 or 2 versions of vscode #36203

patrickjane opened this issue Oct 13, 2017 · 5 comments
Assignees
Labels
*as-designed Described behavior is as designed editor-core Editor basic functionality javascript JavaScript support issues

Comments

@patrickjane
Copy link

patrickjane commented Oct 13, 2017

  • VSCode Version: Version 1.17.1 (1.17.1)
  • OS Version: MacOS 10.12.6

Steps to Reproduce:

  1. Type if (xxx)
  2. Press Enter
  3. New line should be indented, but it is not

and also:

  1. Type if (xxx)
  2. Press Enter
  3. Manually fix newline by adding tab/spaces in front
  4. Press Enter at the end of the new line
  5. Indentation should be reset, but it is not

In other words:

if (xxx)
console.log();

instead of

if (xxx)
   console.log();

This is for editing javascript code, haven't tried any other language.

Its especially annoying since vscode auto-formats indentation like this when moving lines (via c&p or alt+arrow).

The same issue was reported already here somewhat around the beginning of the year, and marked fixed. However I started having this issue since sept or maybe august (so the pre-pre-version of the current one).

Is there a new setting which is supposed to cover this, or is it a bug?

Reproduces without extensions: No idea how to do this

[edit]
Those are my settings:

{
	"editor.tabSize": 3,
 	"editor.insertSpaces": false,
	"editor.detectIndentation": false,
	"telemetry.enableTelemetry": false,
	"telemetry.enableCrashReporter": false,
	"update.channel": "default",  // none
	"workbench.iconTheme": "vscode-icons",
	"workbench.colorTheme": "BoxUK(710)",
	"editor.renderIndentGuides" : false,
	"editor.dragAndDrop" : false,
	"editor.minimap.maxColumn": 30,
	"editor.minimap.enabled": false
}
@vscodebot vscodebot bot added new release editor-core Editor basic functionality labels Oct 13, 2017
@egamma egamma added the info-needed Issue requires more information from poster label Oct 13, 2017
@egamma
Copy link
Member

egamma commented Oct 13, 2017

@patrickjane what language are you editing when this happens? It is not clear from your description.

Reproduces without extensions: No idea how to do this

start code with 'code --disable-extensions`

@patrickjane
Copy link
Author

what language are you editing when this happens? It is not clear from your description.

Sorry, I forgot to mention. Its javascript.

start code with 'code --disable-extensions`

Yes this what I could find out, however I am starting vscode with the icon in the applications folder, so I have no idea where code --disable-extensions shall be put.

I just "completely"(*) removed vscode and downloaded it again, without any change. Currently the only extension I have installed is a theme, but even after the fresh install w/o any extension I'll have the same problem.

--
*)

  1. removed vscode from /Applications
  2. deleted ~/.vscode
  3. deleted ~/Library/Application Support/Code
  4. deleted ~/Library/Application Support/com.microsoft.VSCode.ShipIt

@egamma egamma changed the title Indentation broken since 1 or 2 versions of vscode JavaScript - Indentation broken since 1 or 2 versions of vscode Oct 13, 2017
@egamma egamma removed info-needed Issue requires more information from poster new release labels Oct 13, 2017
@egamma egamma added the javascript JavaScript support issues label Oct 13, 2017
@egamma
Copy link
Member

egamma commented Oct 13, 2017

I can reproduce the problem when editing a JavaScript file. It looks like the indentation rules in the language configuration do not handle this case.

@mjbvz mjbvz added the *as-designed Described behavior is as designed label Oct 13, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Oct 13, 2017

We reverted the requested indentation behavior due to #30933. As it was very difficult to support all formatting and indentation styles, we opted to go with the least invasive one (even though it requires an extra tab in this instance)

Closing as as-designed

@mjbvz mjbvz closed this as completed Oct 13, 2017
@patrickjane
Copy link
Author

Very unsatisfying reply, to be honest. This is the first code editor I use which cannot handle indenting of a simple non-bracketed if (vim, emacs, xcode, qtcreator, atom can handle that, to name just a few).
A code editors primary job (in my opinion), next to syntax highlighting, would be to handle/ease the correct formatting of source code.
I know that there are tons of indenting styles, and different people prefer different styles, and its a pain to support them all. But in all the source code I've seen, I never/hardly saw something like

if (xxx)
console.log();

I would therefore consider this a bug in vscode. If its by design, then its a bug in design.

Maybe some more options regarding indentation would help. Or maybe predefined settings to support most major styles.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed editor-core Editor basic functionality javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

4 participants