-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Pasting an array inserts a semicolon #3674
Comments
It looks similar to prettier/prettier-vscode#257, and I'm not able to reproduce, can you provide your versions/settings? |
It does seem similar, but I don't get that exact issue either, just when pasting an array. I'm on version 1.0.1 of prettier-vscode, which is Prettier 1.9. All prettier-vscode settings are default, but I do have Even if I set |
/cc @CiGit @josephfrazier |
Format on paste calls the range formatter. $ cat test.js
let myThings = {
group1: [1,2,3],
group2: [1,2],
thing: ''
}
$ npx prettier@1.5 --range-start 50 --range-end 55 test.js
let myThings = {
group1: [1, 2, 3],
group2: [1, 2],
thing: ""
};
$ npx prettier@1.7 --range-start 50 --range-end 55 test.js # [1.6 - 1.7]
let myThings = {
group1: [1,2,3],
group2: [1, 2];,
thing: ''
}
$ npx prettier@1.8 --range-start 50 --range-end 55 test.js # [1.8 - latest]
let myThings = {
group1: [1, 2, 3],
group2: [1, 2],
thing: ""
}; I suppose you have a prettier installed locally (range 1.6 - 1.7) which is the one taken by the extension. Over Prettier(Bottom right your editor) after having called the formatter to see which version it picked up. |
|
Just update your local prettier to 1.9 |
This doesn't reproduce in the playground, but in VS Code, if I disable every extension except Prettier, I see this issue, and if I disable Prettier, there is no semicolon insertion.
Input:
And if I copy
[1,2,3]
from the first item, select[1,2]
or''
in the second or third item and paste, it inserts a semicolon after the closing bracket:Output:
Expected behavior:
Pasting an array doesn't automatically add a semicolon at the end
The text was updated successfully, but these errors were encountered: