Skip to content

Conversation

@jngyuamz
Copy link
Contributor

@jngyuamz jngyuamz commented Jun 27, 2025

Problem

  • Server could not receive onDidSaveTextDocument event from VSCode
  • Servers receive duplicated onDidSaveTextDocument events.

Solution

Update


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jngyuamz jngyuamz requested a review from a team as a code owner June 27, 2025 21:53
@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@jngyuamz jngyuamz requested a review from ege0zcan June 27, 2025 21:53
@jngyuamz jngyuamz changed the title fix: incorrect onDidSaveTextDocument notification method name fix(amazonq): incorrect onDidSaveTextDocument notification method name Jun 27, 2025
@jngyuamz jngyuamz closed this Jun 27, 2025
@jngyuamz jngyuamz reopened this Jun 27, 2025
@jngyuamz jngyuamz changed the title fix(amazonq): incorrect onDidSaveTextDocument notification method name fix(amazonq): duplicated onDidSaveTextDocument notification Jun 30, 2025
Copy link
Contributor

@leigaol leigaol left a comment

Choose a reason for hiding this comment

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

1/ Can there be any other duplicate events?

  1. If user is using old vsc plugin with new Flare LSP, what happens? I assume the duplicate will exist

@jngyuamz
Copy link
Contributor Author

jngyuamz commented Jul 1, 2025

1/ Can there be any other duplicate events?

There are 4 events from TextDocObserver: onDidOpenTextDocument, onDidCloseTextDocument, onWillSaveTextDocument, onDidSaveTextDocument, only onDidSaveTextDocument has duplicated events.

If user is using old vsc plugin with new Flare LSP, what happens? I assume the duplicate will exist

No, because this client.sendNotification('workspace/didSaveTextDocument') actually never worked, because VS Code doesn't have this method name 'workspace/didSaveTextDocument'. It should be textDocument/didSave. Duplicated events only happened in my first revision of this PR, I changed workspace/didSaveTextDocument to textDocument/didSave

@jngyuamz jngyuamz merged commit 8e870bf into aws:master Jul 9, 2025
45 of 46 checks passed
@jngyuamz jngyuamz deleted the fix-did-save branch July 9, 2025 17:41
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

Successfully merging this pull request may close these issues.

3 participants