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

Fixes for Language Server sync server #8514

Merged
merged 17 commits into from
Dec 19, 2023
Merged

Fixes for Language Server sync server #8514

merged 17 commits into from
Dec 19, 2023

Conversation

somebody1234
Copy link
Contributor

@somebody1234 somebody1234 commented Dec 11, 2023

Pull Request Description

Important Notes

  • The original error caused by a failing text/openFile (openTextFile) is still present, but (seemingly?) harder to repro now

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@somebody1234 somebody1234 added CI: No changelog needed Do not require a changelog entry for this PR. --bug Type: bug -gui labels Dec 11, 2023
@somebody1234 somebody1234 marked this pull request as draft December 12, 2023 08:56
@somebody1234 somebody1234 marked this pull request as ready for review December 13, 2023 03:08
app/gui2/shared/retry.ts Outdated Show resolved Hide resolved
app/gui2/shared/retry.ts Outdated Show resolved Hide resolved
app/gui2/shared/retry.ts Outdated Show resolved Hide resolved
app/gui2/shared/languageServer.ts Outdated Show resolved Hide resolved
app/gui2/shared/languageServer.ts Outdated Show resolved Hide resolved
app/gui2/src/components/GraphEditor/upload.ts Outdated Show resolved Hide resolved
app/gui2/src/components/GraphEditor/upload.ts Outdated Show resolved Hide resolved
app/gui2/src/stores/visualization/index.ts Outdated Show resolved Hide resolved
app/gui2/ydoc-server/languageServerSession.ts Outdated Show resolved Hide resolved
app/gui2/shared/retry.ts Show resolved Hide resolved
app/gui2/shared/languageServer.ts Outdated Show resolved Hide resolved
@@ -386,9 +386,7 @@ export namespace response {
contentRoots: ContentRoot[]
}

export interface FileContents {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the FileReadResult type, but improperly named. According to docs it does have a nested contents field. So it was probably allright, bar the incorrect name.

https://github.com/enso-org/enso/blob/develop/docs/language-server/protocol-language-server.md#result-5

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually i discovered this was incorrect, when i was implementing this:

case LsSyncState.Synchronized: {
this.withState(LsSyncState.Reloading, async () => {
const promise = Promise.all([
this.ls.readFile(this.path),
this.ls.fileChecksum(this.path),
])
this.setLastAction(promise)
const [contents, checksum] = await promise
this.syncFileContents(contents.contents, checksum.checksum)
})
return
}

on that note... i'm not 100% sure about this. it doesn't affect the fix if it's removed - it's entirely possible that I've misunderstood what reload is supposed to do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that there is a FileContents type: https://github.com/enso-org/enso/blob/develop/docs/language-server/protocol-language-server.md#filecontents

also note that *Result types were basically only added so that the Result interfaces are valid TS code - in GUI2 these should correspond to response.*

@somebody1234 somebody1234 added the CI: Ready to merge This PR is eligible for automatic merge label Dec 18, 2023
@mergify mergify bot merged commit cbf7248 into develop Dec 19, 2023
29 of 30 checks passed
@mergify mergify bot deleted the wip/sb/ls-retries branch December 19, 2023 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -gui CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New IDE Backend Crash Opening Project
3 participants