You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment if there's a single change made by prettier in a file then the whole files text is replaced, that means every line is shown as changed in VS, and for large files the syntax highlighting takes a little while to re-parse the file which can be a little jarring.
It'd be better if only the changed lines were updated, if possible.
That would be a really difficult optimization to make. Prettier doesn't
give the information we would need to do this, so we'd have to format with
prettier, then diff the current contents with that (using some other diff
tool) to figure out what lines changed and then swap out those lines.
I like the idea. Sounds like it would be painful to implement
On Sun, Jan 27, 2019, 5:21 PM Philip Cox ***@***.*** wrote:
At the moment if there's a single change made by prettier in a file then
the whole files text is replaced, that means every line is shown as changed
in VS, and for large files the syntax highlighting takes a little while to
re-parse the file which can be a little jarring.
It'd be better if only the changed lines were updated, if possible.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#26>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA77xaqXijlAzlT2Nt-kHmK06XVxIX_cks5vHiZmgaJpZM4aU-TV>
.
Well there's certainly plenty of diffing libraries in NuGet, though it might be a bit of work figuring out which one performs the best, and produces the best results. There's lots on NPM as well, it might turn out it's easier to do the diff on the Node side of things.
I am unsure of how you'd apply the changes back into the VS text editor, I'm no very familiar with it, but I'm assuming there's a cursor you can use to use to select and delete / change code.
Though maybe I'm oversimplifying the problem, I might give fork this repo and see what happens.
So here's a quick proof on concept, I haven't tested it with many edge cases (single line files or whatever), and I just picked the first NuGet package without any weird dependencies, and I'm guessing doing a bunch of TextBuffer.CreateEdit() / Apply() isn't super efficient.
But I don't think it'd take much to finish it up if others think there's value in it.
On Sun, Jan 27, 2019, 9:45 PM Philip Cox ***@***.*** wrote:
So here's a quick proof on concept, I haven't tested it with many edge
cases (single line files or whatever), and I just picked the first NuGet
package without any weird dependencies, and I'm guessing doing a bunch of
TextBuffer.CreateEdit() / Apply() isn't super efficient.
But I don't think it'd take much to finish it up if others think there's
value in it.
***@***.***
<neoGeneva@df89085>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA77xQtCz6lrU1aCRvFaxOsyh1QIWscSks5vHmRkgaJpZM4aU-TV>
.
Activity
tommck commentedon Jan 27, 2019
neoGeneva commentedon Jan 27, 2019
Well there's certainly plenty of diffing libraries in NuGet, though it might be a bit of work figuring out which one performs the best, and produces the best results. There's lots on NPM as well, it might turn out it's easier to do the diff on the Node side of things.
I am unsure of how you'd apply the changes back into the VS text editor, I'm no very familiar with it, but I'm assuming there's a cursor you can use to use to select and delete / change code.
Though maybe I'm oversimplifying the problem, I might give fork this repo and see what happens.
neoGeneva commentedon Jan 28, 2019
So here's a quick proof on concept, I haven't tested it with many edge cases (single line files or whatever), and I just picked the first NuGet package without any weird dependencies, and I'm guessing doing a bunch of TextBuffer.CreateEdit() / Apply() isn't super efficient.
But I don't think it'd take much to finish it up if others think there's value in it.
neoGeneva@df89085
tommck commentedon Jan 28, 2019
tommck commentedon Jun 10, 2019
@madskristensen would you be cool adding reference to a 3rd party library like in @neoGeneva's code referenced above?
ruffin-- commentedon Aug 27, 2020
Okay, I know bumps aren't kosher, but it's been a year, so @madskristensen whaddya think?