-
Notifications
You must be signed in to change notification settings - Fork 233
Expand file tree
/
Copy pathplugin.py
More file actions
31 lines (23 loc) · 803 Bytes
/
plugin.py
File metadata and controls
31 lines (23 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
from __future__ import annotations
import logging
from collections.abc import Mapping, Sequence
import pluggy
from pluggy import HookImpl
log = logging.getLogger(__name__)
class PluginManager(pluggy.PluginManager):
def __init__(self, project_name: str):
super().__init__(project_name)
def _hookexec(
self,
hook_name: str,
methods: Sequence[HookImpl],
kwargs: Mapping[str, object],
firstresult: bool,
):
try:
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
except Exception as e:
log.warning(f"Failed to load hook {hook_name}: {e}", exc_info=True)
return []