-
Notifications
You must be signed in to change notification settings - Fork 339
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
improvement: Don't sent text on didSave #7015
Conversation
@@ -884,9 +884,6 @@ abstract class MetalsLspService( | |||
): CompletableFuture[Unit] = { | |||
val path = params.getTextDocument.getUri.toAbsolutePath | |||
savedFiles.add(path) | |||
// read file from disk, we only remove files from buffers on didClose. | |||
val text = path.toInput.text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem necessary and for large files might actually be problematic.
9fd01d9
to
af3b81b
Compare
_.replace("n + 1", "n + 2") | ||
) | ||
_ <- server.didSave("a/src/main/scala/a/Util.scala")(identity) | ||
_ <- server.didFocus("a/src/main/scala/a/Main.worksheet.sc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should ever need didFocus
, since it may not be supported, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just focus switched to Util.scala and the worksheet doesn't evaluate. This will work in VS Code, though wonder what happens if did focus is not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can create a followup for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metals/src/main/scala/scala/meta/internal/metals/MetalsLspService.scala
Outdated
Show resolved
Hide resolved
Previously, we would have clients send us full text on didSave, which was never used. Now, we removed that option. I also removed reading the file from disk to buffers since that file should already be up to date form didChanged
…editor behaviour better
Previously, we would have clients send us full text on didSave, which was never used.
Now, we removed that option.
I also removed reading the file from disk to buffers since that file should already be up to date form didChanged