Skip to content

[ruby] Add indentationRules #10307

Closed
Closed

Description

@factormystic
  • VSCode Version: 1.4.0
  • OS Version: Windows 10 v1511 b10586.494

Steps to Reproduce:

  1. Open a ruby file
  2. Define a new method at normal indent level (eg, type def whatever
  3. Press enter to start a new line at the method body indent level
  4. Type end to end the method block

I expected the text end to be auto-de-indented 1 level, so it matches def whatever. What actually happened is nothing at all.

That's the request. The question is, is this expected to be core behavior, or something I need an extension for since it's language specific?

Activity

  1. factormystic commented on Aug 8, 2016

    @factormystic
    Author

    FYI this is real annoying when combined with #10197. I basically have to hit backspace n times instead of 0 times (this issue) or 1 times (related issue, if pre-indent whitespace was selectable.

  2. aeschli commented on Aug 9, 2016

    @aeschli
    Contributor

    As auto indenting in ruby is a bit more tricky that needs to be done in code, using
    indentationRules in the LanguageConfiguration.
    See https://github.com/Microsoft/vscode/blob/master/src/vs/vscode.d.ts#L2530.

    I see that the vscode-ruby does it.
    Have you tried that?

    I'm happy to take a pull request if you want that in the default-ruby plugin.

  3. added
    languages-basic
    feature-request
    on Aug 9, 2016
  4. changed the title [-]Request/Question: Auto de-indent when typing end (ruby)[/-] [+][ruby] Add indentationRules[/+] on Aug 9, 2016
  5. factormystic commented on Aug 9, 2016

    @factormystic
    Author

    I do have that ruby extension installed. I also uninstalled it to confirm it wasn't an extension problem.

  6. pharmmd-rich commented on Dec 15, 2016

    @pharmmd-rich

    +1

    Any luck with this? Makes it rather annoying to use VS Code for Ruby or Rails projects. Please fix end!

  7. rebornix commented on Jan 13, 2017

    @rebornix
    Contributor

    Dup of #2272 . Let's track it there. This sprint we'll at least indent end correctly when you press enter.

  8. added
    *duplicate
    on Jan 13, 2017
  9. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicatefeature-requestlanguages-basic

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions