Skip to content

fix(nes): only request if attached and notify on display#61

Merged
tris203 merged 1 commit into
mainfrom
flow
Dec 30, 2025
Merged

fix(nes): only request if attached and notify on display#61
tris203 merged 1 commit into
mainfrom
flow

Conversation

@tris203
Copy link
Copy Markdown
Collaborator

@tris203 tris203 commented Dec 17, 2025

Ensure NES requests are only sent if the client is attached to the current buffer. Notify the LSP client with "textDocument/didShowInlineEdit" only when a suggestion is actually displayed.

Ensure NES requests are only sent if the client is attached to the
current buffer. Notify the LSP client with "textDocument/didShowInlineEdit"
only when a suggestion is actually displayed.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the Next Edit Suggestion (NES) feature by adding two safety checks: ensuring LSP requests are only sent when the client is attached to the buffer, and only notifying the LSP client when a suggestion is actually displayed to the user.

Key changes:

  • Add buffer attachment check before sending NES requests
  • Make _display_next_suggestion return a boolean indicating display success
  • Send textDocument/didShowInlineEdit notification only when suggestion is displayed
  • Enable error notifications for better debugging

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lua/copilot-lsp/util.lua Removed unnecessary diagnostic suppression comment for type checking
lua/copilot-lsp/nes/ui.lua Modified _display_next_suggestion to return boolean indicating whether suggestion was displayed
lua/copilot-lsp/nes/init.lua Added buffer attachment check, enabled error notifications, and made LSP notification conditional on successful display

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AntoineGS
Copy link
Copy Markdown
Contributor

Hey random note 🤣
They officially documented the feature now: https://github.com/github/copilot-language-server-release/#next-edit-suggestions
The only difference I can see is the telemetry feedback.

@tris203 tris203 merged commit 1b6d827 into main Dec 30, 2025
15 checks passed
@tris203 tris203 deleted the flow branch December 30, 2025 22:57
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