Prettier-vscode: In lastest version vscode, cause semicolon autocomplete problem

Created on 7 Nov 2017  路  8Comments  路  Source: prettier/prettier-vscode

kapture 2017-11-07 at 14 55 08

osx: 10.12.6
vscode: 1.17.2 (1.17.2) b813d12980308015bcd2b3a2f6efa5c810c33ba5

After I disable this extension, no longer have this issue

bug locked

Most helpful comment

Strangly it's working with TS and Flow

Edit:

  • Babylon - JSON: StringLiteral
  • Flow - TypeScript: Literal

All 8 comments

What are you doing here exactly? Copy paste test

Can you share your settings ?

I can't reproduce that (even with formatOnPaste)

I found out.
I was in a typescript file ...
Format selection is not working here by selecting the string.
Directive vs Literal??

You can reproduce by this step:

  • configuration "editor.formatOnPaste": true
  • Open a .js file, write some code like console.log('test');
  • Copy paste test, then you will get a extra semicolon.

@CiGit

Could it be doing a range format on that string as if it were a directive ("use strict";)?

It's fixed in prettier 1.8, 1.7 accepted a string as Source Element (JS was mixed with JSON) prettier/prettier#3069

Strangly it's working with TS and Flow

Edit:

  • Babylon - JSON: StringLiteral
  • Flow - TypeScript: Literal

This should be fixed in prettier 1.8 (version we are now bundling)

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DanielHabenicht picture DanielHabenicht  路  4Comments

sebastijandumancic picture sebastijandumancic  路  4Comments

Connorelsea picture Connorelsea  路  4Comments

FlorianWendelborn picture FlorianWendelborn  路  3Comments

Glinkis picture Glinkis  路  4Comments