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

Duplication #18

Closed
joshuaharrison opened this issue May 11, 2016 · 13 comments
Closed

Duplication #18

joshuaharrison opened this issue May 11, 2016 · 13 comments

Comments

@joshuaharrison
Copy link

When formatting code via context menu > 'Format Code', the last line of the file is being duplicated.

This was occurring in both html and js files.

Had to uninstall the extension so can't provide any examples

@HookyQR
Copy link
Owner

HookyQR commented May 11, 2016

It's not likely that this extension is the cause as VS Code runs it's own formatter for js files. When was the last time you updated the extension? A new version was issued a few days ago.

@joshuaharrison
Copy link
Author

Well i noticed this issue yesterday, I had thought the context menu was running the built-in formatter so didn't think it was the extension. But after removing this extension the issue was gone (tested on same files).

Sorry can't confirm what version i was using... not much help i know :)

@HookyQR
Copy link
Owner

HookyQR commented May 11, 2016

Are you running the insider version (1.1.0) of VS Code? There has been a change in the way the system handles ranges. The extension has been updated in the last few days to allow for the change. If you haven't (re-)installed the extension since Sunday you may be catching that issue.

@joshuaharrison
Copy link
Author

joshuaharrison commented May 11, 2016

I've reinstalled the extension and I'm getting the issue i described

VS Code 1.1.0
Beautify: 0.1.4

image

@HookyQR
Copy link
Owner

HookyQR commented May 11, 2016

My VS Code just updated and I'm now having the same problem. I can look into it now.

@joshuaharrison
Copy link
Author

Okay thanks.

@themre
Copy link

themre commented May 11, 2016

Hi,
I was also having this problem and I did uninstall some plugins and also beautify and then reinstalled beautify and now it works ok. So maybe there is some clash with some of the existing extensions.

@joshuaharrison
Copy link
Author

joshuaharrison commented May 11, 2016

These are the only extensions i have installed

image

@themre
Copy link

themre commented May 11, 2016

oh, I just uninstalled javscript code snippets. try that.

@joshuaharrison
Copy link
Author

Just uninstalled all1 by 1 same issue until i had no extensions. Reinstalled beautify alone and it came back 😢

@themre
Copy link

themre commented May 11, 2016

strange. well, my problem was that it was duplicating a whole stack, which was even more weird. perhaps there is a problem with the HTML. Because i've beautified many htmls and it worked ok. you can send me your html so i can try to beautify it and see if it's a problem in html or beautifier.

@HookyQR
Copy link
Owner

HookyQR commented May 11, 2016

Fixed. New version released.

@HookyQR
Copy link
Owner

HookyQR commented May 11, 2016

The problem was (again) caused by VS Code changing the way it handled infinite ranges. Previously they were set to the final character of the document, they are now set to the first (zero), so when the replacement is called, the new data is _placed_ (rather than replacing the original segment) at the start of the segment.

Ranges are now validated before being passed to the replace function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants