Improve backwards compat for async RPC callback#810
Open
mmrwoods wants to merge 5 commits into
Open
Conversation
Use v:stacktrace to check call site if available, added in Vim 9.1.0984 Presumably more reliable than pattern matching on v:throwpoint Note: this only checks the filepath, not the function name, which should be fine, the fallback is for external calling code, not lsp plugin code
Contributor
Author
|
@yegappan I decided to re-open this (well, create a new issue as I don't have permission to re-open) after having a second look this morning. The code does add complexity, so I am not fully convinced it is worth it for the likely small number of users or collaborating plugins affected, but I'll let you be the judge. |
Avoid confusion with built-in getstacktrace() function
d8cdd4e to
0f00edd
Compare
yegappan
reviewed
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Summary
Use
v:stacktraceif available to check call site when handling "Too many arguments" error and support previously async RPC callback function signature.🔍 Related Issues
🧪 What This PR Improves
More reliably checks that the "Too many arguments" error occurred within the LSP server code rather than in the callback code itself when falling back to using the old function signature.
🛠️ Changes Made
v:stacktraceexists, confirm that the current script path matches the last filepath in the stacktrace before falling back to the old callback function signaturev:stacktracedoes not exist, continue to pattern match onv:throwpoint, as before🧪 Testing
Manually tested locally with fuzzbox-lsp.vim using Vim 9.0.0000 and 9.2.0421
📦 Breaking Changes
Does this PR introduce any breaking changes?
📚 Documentation
Does this PR require documentation updates?
✔️ Checklist