Skip to content

fix: workspace/executeCommand with async handlers#535

Merged
alcarney merged 1 commit into
openlawlibrary:mainfrom
alcarney:fix-async-commands
May 28, 2025
Merged

fix: workspace/executeCommand with async handlers#535
alcarney merged 1 commit into
openlawlibrary:mainfrom
alcarney:fix-async-commands

Conversation

@alcarney

Copy link
Copy Markdown
Collaborator

Description (e.g. "Related to ...", etc.)

Turns out I forgot to handle async command handlers when implementing #527!

When wrapping an async handler with the language server instance, set the func attribute on the resulting handler. This allows the code that processes the result of functools.partial() to be reused. This ensures the workspace/executeCommand code can obtain the correct function signature to map values onto.

Code review checklist (for code reviewer to complete)

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Commit messages are meaningful (see this for details)
  • Tests have been included and/or updated, as appropriate
  • Docstrings have been included and/or updated, as appropriate
  • Standalone docs have been updated accordingly

Automated linters

You can run the lints that are run on CI locally with:

poetry install --all-extras --with dev
poetry run poe lint

When wrapping an async handler with the language server instance,
set the `func` attribute on the resulting handler. This allows the
code that processes the result of `functools.partial()` to be reused.
@alcarney alcarney force-pushed the fix-async-commands branch from 7cc3604 to c6d4cf3 Compare May 27, 2025 19:32
@alcarney alcarney requested a review from tombh May 27, 2025 19:37
@tombh

tombh commented May 28, 2025

Copy link
Copy Markdown
Collaborator

Was the Windows build just flaking?

@alcarney

Copy link
Copy Markdown
Collaborator Author

Thanks!

Was the Windows build just flaking?

Yes... not sure what was going on there, the test suite got stuck for some reason and the job timed out. Something to keep an eye on I guess.

@alcarney alcarney merged commit 390867e into openlawlibrary:main May 28, 2025
29 of 30 checks passed
@alcarney alcarney deleted the fix-async-commands branch May 28, 2025 20:59
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.

2 participants