Skip to content

Suppress indentation when inserting newline after ''' #3780

Closed

Description

@bsutton

The lint
leading_newlines_in_multiline_strings Start multiline strings with a newline.

tells us to place a new line after '''

  const sql = '''select *
from...
''';

The fix is easy. Just insert the cursor after the first set of ''' and hit return.

The problem is the resulting indentation is:

  const sql = '''
  select *
from...
''';

Note the two spaces before select.

Instead the indent should place select hard against the left hand border.

  const sql = '''
select *
from...
''';

The current method results in a changing of the format of the string (it goes from having no leading spaces to having two leading spaces).

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Jan 14, 2022
  2. added this to the v3.34.0 milestone on Jan 17, 2022
  3. added
    in editorRelates to code editing or language features
    on Jan 17, 2022
  4. changed the title [-]changed indent when inserting newline after '''[/-] [+]Suppress indentation when inserting newline after '''[/+] on Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions