diff --git a/CHANGELOG.md b/CHANGELOG.md index 722654fb..8c2839f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,10 +20,15 @@ and this project adheres to [Semantic Versioning][semver]. - Fix `__init__()` constructors in several interface types ([#125]) - Fix valueSet type in `SymbolKindAbstract` ([#125]) +### Fixed + +- `coroutine` deprecation warning - use async def instead ([#136]) + [#125]: https://github.com/openlawlibrary/pygls/pull/125 [#123]: https://github.com/openlawlibrary/pygls/pull/123 [#120]: https://github.com/openlawlibrary/pygls/pull/120 [#117]: https://github.com/openlawlibrary/pygls/pull/117 +[#136]: https://github.com/openlawlibrary/pygls/pull/136 ## [0.9.0] - 04/20/2020 diff --git a/pygls/feature_manager.py b/pygls/feature_manager.py index fc95d686..ac97ce5b 100644 --- a/pygls/feature_manager.py +++ b/pygls/feature_manager.py @@ -59,12 +59,14 @@ def wrap_with_server(f, server): return f if asyncio.iscoroutinefunction(f): - return asyncio.coroutine(functools.partial(f, server)) + async def wrapped(*args, **kwargs): + return await f(server, *args, **kwargs) else: wrapped = functools.partial(f, server) if is_thread_function(f): assign_thread_attr(wrapped) - return wrapped + + return wrapped class FeatureManager: