Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pylsp/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sys
import threading
import time
from glob import glob
from typing import Any, Iterable, List, Optional

import docstring_to_markdown
Expand Down Expand Up @@ -96,7 +97,9 @@ def find_parents(root, path, names):
# Split the relative by directory, generate all the parent directories, then check each of them.
# This avoids running a loop that has different base-cases for unix/windows
# e.g. /a/b and /a/b/c/d/e.py -> ['/a/b', 'c', 'd']
dirs = [root] + os.path.relpath(os.path.dirname(path), root).split(os.path.sep)
if os.path.isfile(path):
path = os.path.dirname(path)
dirs = [root] + os.path.relpath(path, root).split(os.path.sep)

# Search each of /a/b/c, /a/b, /a
while dirs:
Expand Down
203 changes: 0 additions & 203 deletions pylsp/config/config.py

This file was deleted.

64 changes: 0 additions & 64 deletions pylsp/config/flake8_conf.py

This file was deleted.

31 changes: 31 additions & 0 deletions pylsp/config/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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 []

34 changes: 0 additions & 34 deletions pylsp/config/pycodestyle_conf.py

This file was deleted.

Loading
Loading