Skip to content

Commit

Permalink
remove RegionProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl committed Jun 10, 2023
1 parent e04de63 commit cbad0c2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
10 changes: 0 additions & 10 deletions plugin/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
from .typing import Callable, Optional, Dict, Any, Iterable, List, Union, Tuple, cast
from .url import parse_uri
from .workspace import is_subpath_of
from abc import ABCMeta
from abc import abstractmethod
import html
import itertools
import linecache
Expand Down Expand Up @@ -281,14 +279,6 @@
}


class RegionProvider(metaclass=ABCMeta):

@classmethod
@abstractmethod
def initialize_region_keys(cls) -> None:
raise NotImplementedError()


class InvalidUriSchemeException(Exception):
def __init__(self, uri: str) -> None:
self.uri = uri
Expand Down
9 changes: 1 addition & 8 deletions plugin/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from .core.views import diagnostic_severity
from .core.views import format_diagnostics_for_annotation
from .core.views import range_to_region
from .core.views import RegionProvider
from itertools import chain
import html
import sublime
Expand Down Expand Up @@ -313,15 +312,9 @@ def _generate_center(self, overlap: bool, multi: int, diagnostic: Diagnostic) ->
]


class DiagnosticsView(RegionProvider):
class DiagnosticsView():
ANNOTATIONS_REGION_KEY = "lsp_d-annotations"

@classmethod
def initialize_region_keys(cls, view: sublime.View) -> None:
r = [sublime.Region(0, 0)]
for severity in DIAGNOSTIC_KINDS.keys():
view.add_regions(cls._annotation_key(severity), r)

@classmethod
def _annotation_key(cls, severity: DiagnosticSeverity) -> str:
return '{}-{}'.format(cls.ANNOTATIONS_REGION_KEY, severity)
Expand Down
1 change: 0 additions & 1 deletion plugin/session_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ def _initialize_region_keys(self) -> None:
self.view.add_regions("lsp_highlight_{}{}".format(kind, mode), r)
if hover_highlight_style in ("underline", "stippled"):
self.view.add_regions(HOVER_HIGHLIGHT_KEY, r)
DiagnosticsView.initialize_region_keys(self.view)

def _clear_auto_complete_triggers(self, settings: sublime.Settings) -> None:
'''Remove all of our modifications to the view's "auto_complete_triggers"'''
Expand Down

0 comments on commit cbad0c2

Please sign in to comment.