Skip to content

Commit

Permalink
Use namespaced enum constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann authored and rchl committed Oct 26, 2024
1 parent d45f5fe commit d6815f5
Show file tree
Hide file tree
Showing 21 changed files with 141 additions and 127 deletions.
4 changes: 2 additions & 2 deletions plugin/code_lens.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ def render(self, mode: str) -> None:
phantom_region = self._get_phantom_region(region)
html = '<body id="lsp-code-lens">{}</body>'.format(
'\n<small style="font-family: system">|</small>\n'.join(lens.small_html for lens in group))
phantoms.append(sublime.Phantom(phantom_region, html, sublime.LAYOUT_BELOW))
phantoms.append(sublime.Phantom(phantom_region, html, sublime.PhantomLayout.BELOW))
self._phantom.update(phantoms)
else: # 'annotation'
self._clear_annotations()
flags = sublime.NO_UNDO
flags = sublime.RegionFlags.NO_UNDO
accent = self.view.style_for_scope("region.greenish markup.accent.codelens.lsp")["foreground"]
for index, lens in enumerate(self._flat_iteration()):
self.view.add_regions(
Expand Down
12 changes: 6 additions & 6 deletions plugin/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def format_completion(
annotation,
# Not using "sublime.format_command" in a hot path to avoid slow json.dumps.
f'lsp_select_completion {{"index":{index},"session_name":"{session_name}"}}',
sublime.COMPLETION_FORMAT_COMMAND,
sublime.CompletionFormat.COMMAND,
kind,
details=" | ".join(details)
)
Expand Down Expand Up @@ -215,9 +215,9 @@ def _resolve_completions_async(self, responses: list[ResolvedCompletions]) -> No
flags = sublime.AutoCompleteFlags.NONE
prefs = userprefs()
if prefs.inhibit_snippet_completions:
flags |= sublime.INHIBIT_EXPLICIT_COMPLETIONS
flags |= sublime.AutoCompleteFlags.INHIBIT_EXPLICIT_COMPLETIONS
if prefs.inhibit_word_completions:
flags |= sublime.INHIBIT_WORD_COMPLETIONS
flags |= sublime.AutoCompleteFlags.INHIBIT_WORD_COMPLETIONS
view_settings = self._view.settings()
include_snippets = view_settings.get("auto_complete_include_snippets") and \
(self._triggered_manually or view_settings.get("auto_complete_include_snippets_when_typing"))
Expand All @@ -233,7 +233,7 @@ def _resolve_completions_async(self, responses: list[ResolvedCompletions]) -> No
response_items = response["items"] or []
item_defaults = response.get('itemDefaults') or {}
if response.get("isIncomplete", False):
flags |= sublime.DYNAMIC_COMPLETIONS
flags |= sublime.AutoCompleteFlags.DYNAMIC_COMPLETIONS
elif isinstance(response, list):
response_items = response
response_items = sorted(response_items, key=lambda item: item.get("sortText") or item["label"])
Expand All @@ -246,7 +246,7 @@ def _resolve_completions_async(self, responses: list[ResolvedCompletions]) -> No
for index, response_item in enumerate(response_items)
if include_snippets or response_item.get("kind") != CompletionItemKind.Snippet)
if items:
flags |= sublime.INHIBIT_REORDER
flags |= sublime.AutoCompleteFlags.INHIBIT_REORDER
if errors:
error_messages = ", ".join(str(error) for error in errors)
sublime.status_message(f'Completion error: {error_messages}')
Expand Down Expand Up @@ -316,7 +316,7 @@ def run_main() -> None:
show_lsp_popup(
self.view,
minihtml_content,
flags=sublime.COOPERATE_WITH_AUTO_COMPLETE,
flags=sublime.PopupFlags.COOPERATE_WITH_AUTO_COMPLETE,
md=False,
on_navigate=self._on_navigate)

Expand Down
92 changes: 46 additions & 46 deletions plugin/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,55 +22,55 @@
SHOW_DEFINITIONS_KEY = 'show_definitions'

# Region flags
DOCUMENT_LINK_FLAGS = sublime.HIDE_ON_MINIMAP | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SOLID_UNDERLINE | sublime.NO_UNDO # noqa: E501
REGIONS_INITIALIZE_FLAGS = sublime.HIDDEN | sublime.NO_UNDO
SEMANTIC_TOKEN_FLAGS = sublime.DRAW_NO_OUTLINE | sublime.NO_UNDO
DOCUMENT_LINK_FLAGS = sublime.RegionFlags.HIDE_ON_MINIMAP | sublime.RegionFlags.DRAW_NO_FILL | sublime.RegionFlags.DRAW_NO_OUTLINE | sublime.RegionFlags.DRAW_SOLID_UNDERLINE | sublime.RegionFlags.NO_UNDO # noqa: E501
REGIONS_INITIALIZE_FLAGS = sublime.RegionFlags.HIDDEN | sublime.RegionFlags.NO_UNDO
SEMANTIC_TOKEN_FLAGS = sublime.RegionFlags.DRAW_NO_OUTLINE | sublime.RegionFlags.NO_UNDO

# sublime.Kind tuples for sublime.CompletionItem, sublime.QuickPanelItem, sublime.ListInputItem
# https://www.sublimetext.com/docs/api_reference.html#sublime.Kind
KIND_ARRAY = (sublime.KIND_ID_TYPE, "a", "Array")
KIND_BOOLEAN = (sublime.KIND_ID_VARIABLE, "b", "Boolean")
KIND_CLASS = (sublime.KIND_ID_TYPE, "c", "Class")
KIND_COLOR = (sublime.KIND_ID_MARKUP, "c", "Color")
KIND_CONSTANT = (sublime.KIND_ID_VARIABLE, "c", "Constant")
KIND_CONSTRUCTOR = (sublime.KIND_ID_FUNCTION, "c", "Constructor")
KIND_ENUM = (sublime.KIND_ID_TYPE, "e", "Enum")
KIND_ENUMMEMBER = (sublime.KIND_ID_VARIABLE, "e", "Enum Member")
KIND_EVENT = (sublime.KIND_ID_FUNCTION, "e", "Event")
KIND_FIELD = (sublime.KIND_ID_VARIABLE, "f", "Field")
KIND_FILE = (sublime.KIND_ID_NAVIGATION, "f", "File")
KIND_FOLDER = (sublime.KIND_ID_NAVIGATION, "f", "Folder")
KIND_FUNCTION = (sublime.KIND_ID_FUNCTION, "f", "Function")
KIND_INTERFACE = (sublime.KIND_ID_TYPE, "i", "Interface")
KIND_KEY = (sublime.KIND_ID_NAVIGATION, "k", "Key")
KIND_KEYWORD = (sublime.KIND_ID_KEYWORD, "k", "Keyword")
KIND_METHOD = (sublime.KIND_ID_FUNCTION, "m", "Method")
KIND_MODULE = (sublime.KIND_ID_NAMESPACE, "m", "Module")
KIND_NAMESPACE = (sublime.KIND_ID_NAMESPACE, "n", "Namespace")
KIND_NULL = (sublime.KIND_ID_VARIABLE, "n", "Null")
KIND_NUMBER = (sublime.KIND_ID_VARIABLE, "n", "Number")
KIND_OBJECT = (sublime.KIND_ID_TYPE, "o", "Object")
KIND_OPERATOR = (sublime.KIND_ID_KEYWORD, "o", "Operator")
KIND_PACKAGE = (sublime.KIND_ID_NAMESPACE, "p", "Package")
KIND_PROPERTY = (sublime.KIND_ID_VARIABLE, "p", "Property")
KIND_REFERENCE = (sublime.KIND_ID_NAVIGATION, "r", "Reference")
KIND_SNIPPET = (sublime.KIND_ID_SNIPPET, "s", "Snippet")
KIND_STRING = (sublime.KIND_ID_VARIABLE, "s", "String")
KIND_STRUCT = (sublime.KIND_ID_TYPE, "s", "Struct")
KIND_TEXT = (sublime.KIND_ID_MARKUP, "t", "Text")
KIND_TYPEPARAMETER = (sublime.KIND_ID_TYPE, "t", "Type Parameter")
KIND_UNIT = (sublime.KIND_ID_VARIABLE, "u", "Unit")
KIND_VALUE = (sublime.KIND_ID_VARIABLE, "v", "Value")
KIND_VARIABLE = (sublime.KIND_ID_VARIABLE, "v", "Variable")

KIND_ERROR = (sublime.KIND_ID_COLOR_REDISH, "e", "Error")
KIND_WARNING = (sublime.KIND_ID_COLOR_YELLOWISH, "w", "Warning")
KIND_INFORMATION = (sublime.KIND_ID_COLOR_BLUISH, "i", "Information")
KIND_HINT = (sublime.KIND_ID_COLOR_BLUISH, "h", "Hint")

KIND_QUICKFIX = (sublime.KIND_ID_COLOR_YELLOWISH, "f", "QuickFix")
KIND_REFACTOR = (sublime.KIND_ID_COLOR_CYANISH, "r", "Refactor")
KIND_SOURCE = (sublime.KIND_ID_COLOR_PURPLISH, "s", "Source")
KIND_ARRAY = (sublime.KindId.TYPE, "a", "Array")
KIND_BOOLEAN = (sublime.KindId.VARIABLE, "b", "Boolean")
KIND_CLASS = (sublime.KindId.TYPE, "c", "Class")
KIND_COLOR = (sublime.KindId.MARKUP, "c", "Color")
KIND_CONSTANT = (sublime.KindId.VARIABLE, "c", "Constant")
KIND_CONSTRUCTOR = (sublime.KindId.FUNCTION, "c", "Constructor")
KIND_ENUM = (sublime.KindId.TYPE, "e", "Enum")
KIND_ENUMMEMBER = (sublime.KindId.VARIABLE, "e", "Enum Member")
KIND_EVENT = (sublime.KindId.FUNCTION, "e", "Event")
KIND_FIELD = (sublime.KindId.VARIABLE, "f", "Field")
KIND_FILE = (sublime.KindId.NAVIGATION, "f", "File")
KIND_FOLDER = (sublime.KindId.NAVIGATION, "f", "Folder")
KIND_FUNCTION = (sublime.KindId.FUNCTION, "f", "Function")
KIND_INTERFACE = (sublime.KindId.TYPE, "i", "Interface")
KIND_KEY = (sublime.KindId.NAVIGATION, "k", "Key")
KIND_KEYWORD = (sublime.KindId.KEYWORD, "k", "Keyword")
KIND_METHOD = (sublime.KindId.FUNCTION, "m", "Method")
KIND_MODULE = (sublime.KindId.NAMESPACE, "m", "Module")
KIND_NAMESPACE = (sublime.KindId.NAMESPACE, "n", "Namespace")
KIND_NULL = (sublime.KindId.VARIABLE, "n", "Null")
KIND_NUMBER = (sublime.KindId.VARIABLE, "n", "Number")
KIND_OBJECT = (sublime.KindId.TYPE, "o", "Object")
KIND_OPERATOR = (sublime.KindId.KEYWORD, "o", "Operator")
KIND_PACKAGE = (sublime.KindId.NAMESPACE, "p", "Package")
KIND_PROPERTY = (sublime.KindId.VARIABLE, "p", "Property")
KIND_REFERENCE = (sublime.KindId.NAVIGATION, "r", "Reference")
KIND_SNIPPET = (sublime.KindId.SNIPPET, "s", "Snippet")
KIND_STRING = (sublime.KindId.VARIABLE, "s", "String")
KIND_STRUCT = (sublime.KindId.TYPE, "s", "Struct")
KIND_TEXT = (sublime.KindId.MARKUP, "t", "Text")
KIND_TYPEPARAMETER = (sublime.KindId.TYPE, "t", "Type Parameter")
KIND_UNIT = (sublime.KindId.VARIABLE, "u", "Unit")
KIND_VALUE = (sublime.KindId.VARIABLE, "v", "Value")
KIND_VARIABLE = (sublime.KindId.VARIABLE, "v", "Variable")

KIND_ERROR = (sublime.KindId.COLOR_REDISH, "e", "Error")
KIND_WARNING = (sublime.KindId.COLOR_YELLOWISH, "w", "Warning")
KIND_INFORMATION = (sublime.KindId.COLOR_BLUISH, "i", "Information")
KIND_HINT = (sublime.KindId.COLOR_BLUISH, "h", "Hint")

KIND_QUICKFIX = (sublime.KindId.COLOR_YELLOWISH, "f", "QuickFix")
KIND_REFACTOR = (sublime.KindId.COLOR_CYANISH, "r", "Refactor")
KIND_SOURCE = (sublime.KindId.COLOR_PURPLISH, "s", "Source")

COMPLETION_KINDS: dict[CompletionItemKind, SublimeKind] = {
CompletionItemKind.Text: KIND_TEXT,
Expand Down
6 changes: 3 additions & 3 deletions plugin/core/open.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ def _select_and_center(view: sublime.View | None, r: Range) -> sublime.View | No
def _return_existing_view(flags: int, existing_view_group: int, active_group: int, specified_group: int) -> bool:
if specified_group > -1:
return existing_view_group == specified_group
if bool(flags & (sublime.ADD_TO_SELECTION | sublime.REPLACE_MRU)):
if bool(flags & (sublime.NewFileFlags.ADD_TO_SELECTION | sublime.NewFileFlags.REPLACE_MRU)):
return False
if existing_view_group == active_group:
return True
return not bool(flags & sublime.FORCE_GROUP)
return not bool(flags & sublime.NewFileFlags.FORCE_GROUP)


def _find_open_file(window: sublime.Window, fname: str, group: int = -1) -> sublime.View | None:
Expand Down Expand Up @@ -101,7 +101,7 @@ def open_file(
was_already_open = view is not None
view = window.open_file(file, flags, group)
if not view.is_loading():
if was_already_open and (flags & sublime.SEMI_TRANSIENT):
if was_already_open and (flags & sublime.NewFileFlags.SEMI_TRANSIENT):
# workaround bug https://github.com/sublimehq/sublime_text/issues/2411 where transient view might not get
# its view listeners initialized.
sublime_plugin.check_view_event_listeners(view) # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions plugin/core/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ def run(
modifier_keys = event.get('modifier_keys')
if modifier_keys:
if 'primary' in modifier_keys:
flags |= sublime.ADD_TO_SELECTION | sublime.SEMI_TRANSIENT | sublime.CLEAR_TO_RIGHT
flags |= sublime.NewFileFlags.ADD_TO_SELECTION | sublime.NewFileFlags.SEMI_TRANSIENT | sublime.NewFileFlags.CLEAR_TO_RIGHT # noqa: E501
elif 'shift' in modifier_keys:
flags |= sublime.ADD_TO_SELECTION | sublime.SEMI_TRANSIENT
flags |= sublime.NewFileFlags.ADD_TO_SELECTION | sublime.NewFileFlags.SEMI_TRANSIENT
sublime.set_timeout_async(lambda: self._run_async(location, session_name, flags, group))

def want_event(self) -> bool:
Expand Down
18 changes: 9 additions & 9 deletions plugin/core/tree_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ def html(self, sheet_name: str, indent_level: int) -> str:

@staticmethod
def _kind_class_name(kind_id: int) -> str:
if kind_id == sublime.KIND_ID_KEYWORD:
if kind_id == sublime.KindId.KEYWORD:
return "kind kind_keyword"
if kind_id == sublime.KIND_ID_TYPE:
if kind_id == sublime.KindId.TYPE:
return "kind kind_type"
if kind_id == sublime.KIND_ID_FUNCTION:
if kind_id == sublime.KindId.FUNCTION:
return "kind kind_function"
if kind_id == sublime.KIND_ID_NAMESPACE:
if kind_id == sublime.KindId.NAMESPACE:
return "kind kind_namespace"
if kind_id == sublime.KIND_ID_NAVIGATION:
if kind_id == sublime.KindId.NAVIGATION:
return "kind kind_navigation"
if kind_id == sublime.KIND_ID_MARKUP:
if kind_id == sublime.KindId.MARKUP:
return "kind kind_markup"
if kind_id == sublime.KIND_ID_VARIABLE:
if kind_id == sublime.KindId.VARIABLE:
return "kind kind_variable"
if kind_id == sublime.KIND_ID_SNIPPET:
if kind_id == sublime.KindId.SNIPPET:
return "kind kind_snippet"
return "kind kind_ambiguous"

Expand Down Expand Up @@ -297,7 +297,7 @@ def new_tree_view_sheet(
sheet_id = tree_view_sheet.id()
if tree_view_sheet.window():
tree_view_sheet.set_provider(data_provider, header)
if flags & sublime.ADD_TO_SELECTION:
if flags & sublime.NewFileFlags.ADD_TO_SELECTION:
# add to selected sheets if not already selected
selected_sheets = window.selected_sheets()
for sheet in window.sheets():
Expand Down
20 changes: 10 additions & 10 deletions plugin/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,31 +327,31 @@ def r(name: str, default: bool | int | str | list | dict) -> None:
set_debug_logging(self.log_debug)

def highlight_style_region_flags(self, style_str: str) -> tuple[sublime.RegionFlags, sublime.RegionFlags]:
default = sublime.NO_UNDO
default = sublime.RegionFlags.NO_UNDO
if style_str in ("background", "fill"): # Backwards-compatible with "fill"
style = default | sublime.DRAW_NO_OUTLINE
style = default | sublime.RegionFlags.DRAW_NO_OUTLINE
return style, style
if style_str == "outline":
style = default | sublime.DRAW_NO_FILL
style = default | sublime.RegionFlags.DRAW_NO_FILL
return style, style
if style_str == "stippled":
return default | sublime.DRAW_NO_FILL, default | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_STIPPLED_UNDERLINE # noqa: E501
return default | sublime.DRAW_NO_FILL, default | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SOLID_UNDERLINE # noqa: E501
return default | sublime.RegionFlags.DRAW_NO_FILL, default | sublime.RegionFlags.DRAW_NO_FILL | sublime.RegionFlags.DRAW_NO_OUTLINE | sublime.RegionFlags.DRAW_STIPPLED_UNDERLINE # noqa: E501
return default | sublime.RegionFlags.DRAW_NO_FILL, default | sublime.RegionFlags.DRAW_NO_FILL | sublime.RegionFlags.DRAW_NO_OUTLINE | sublime.RegionFlags.DRAW_SOLID_UNDERLINE # noqa: E501

@staticmethod
def _style_str_to_flag(style_str: str) -> sublime.RegionFlags | None:
default = sublime.DRAW_EMPTY_AS_OVERWRITE | sublime.DRAW_NO_FILL | sublime.NO_UNDO
default = sublime.RegionFlags.DRAW_EMPTY_AS_OVERWRITE | sublime.RegionFlags.DRAW_NO_FILL | sublime.RegionFlags.NO_UNDO # noqa: E501
# This method could be a dict or lru_cache
if style_str == "":
return default | sublime.DRAW_NO_OUTLINE
return default | sublime.RegionFlags.DRAW_NO_OUTLINE
if style_str == "box":
return default
if style_str == "underline":
return default | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SOLID_UNDERLINE
return default | sublime.RegionFlags.DRAW_NO_OUTLINE | sublime.RegionFlags.DRAW_SOLID_UNDERLINE
if style_str == "stippled":
return default | sublime.DRAW_NO_OUTLINE | sublime.DRAW_STIPPLED_UNDERLINE
return default | sublime.RegionFlags.DRAW_NO_OUTLINE | sublime.RegionFlags.DRAW_STIPPLED_UNDERLINE
if style_str == "squiggly":
return default | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SQUIGGLY_UNDERLINE
return default | sublime.RegionFlags.DRAW_NO_OUTLINE | sublime.RegionFlags.DRAW_SQUIGGLY_UNDERLINE
# default style (includes NO_UNDO)
return None

Expand Down
14 changes: 7 additions & 7 deletions plugin/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@

MarkdownLangMap = Dict[str, Tuple[Tuple[str, ...], Tuple[str, ...]]]

_baseflags = sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_EMPTY_AS_OVERWRITE | sublime.NO_UNDO
_multilineflags = sublime.DRAW_NO_FILL | sublime.NO_UNDO
_baseflags = sublime.RegionFlags.DRAW_NO_FILL | sublime.RegionFlags.DRAW_NO_OUTLINE | sublime.RegionFlags.DRAW_EMPTY_AS_OVERWRITE | sublime.RegionFlags.NO_UNDO # noqa: E501
_multilineflags = sublime.RegionFlags.DRAW_NO_FILL | sublime.RegionFlags.NO_UNDO

DIAGNOSTIC_SEVERITY: list[tuple[str, str, str, str, sublime.RegionFlags, sublime.RegionFlags]] = [
# Kind CSS class Scope for color Icon resource add_regions flags for single-line diagnostic multi-line diagnostic # noqa: E501
("error", "errors", "region.redish markup.error.lsp", "Packages/LSP/icons/error.png", _baseflags | sublime.DRAW_SQUIGGLY_UNDERLINE, _multilineflags), # noqa: E501
("warning", "warnings", "region.yellowish markup.warning.lsp", "Packages/LSP/icons/warning.png", _baseflags | sublime.DRAW_SQUIGGLY_UNDERLINE, _multilineflags), # noqa: E501
("info", "info", "region.bluish markup.info.lsp", "Packages/LSP/icons/info.png", _baseflags | sublime.DRAW_STIPPLED_UNDERLINE, _multilineflags), # noqa: E501
("hint", "hints", "region.bluish markup.info.hint.lsp", "", _baseflags | sublime.DRAW_STIPPLED_UNDERLINE, _multilineflags), # noqa: E501
("error", "errors", "region.redish markup.error.lsp", "Packages/LSP/icons/error.png", _baseflags | sublime.RegionFlags.DRAW_SQUIGGLY_UNDERLINE, _multilineflags), # noqa: E501
("warning", "warnings", "region.yellowish markup.warning.lsp", "Packages/LSP/icons/warning.png", _baseflags | sublime.RegionFlags.DRAW_SQUIGGLY_UNDERLINE, _multilineflags), # noqa: E501
("info", "info", "region.bluish markup.info.lsp", "Packages/LSP/icons/info.png", _baseflags | sublime.RegionFlags.DRAW_STIPPLED_UNDERLINE, _multilineflags), # noqa: E501
("hint", "hints", "region.bluish markup.info.hint.lsp", "", _baseflags | sublime.RegionFlags.DRAW_STIPPLED_UNDERLINE, _multilineflags), # noqa: E501
]


Expand Down Expand Up @@ -676,7 +676,7 @@ def lsp_color_to_html(color_info: ColorInformation) -> str:

def lsp_color_to_phantom(view: sublime.View, color_info: ColorInformation) -> sublime.Phantom:
region = range_to_region(color_info['range'], view)
return sublime.Phantom(region, lsp_color_to_html(color_info), sublime.LAYOUT_INLINE)
return sublime.Phantom(region, lsp_color_to_html(color_info), sublime.PhantomLayout.INLINE)


def document_color_params(view: sublime.View) -> DocumentColorParams:
Expand Down
2 changes: 1 addition & 1 deletion plugin/core/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def _update_panel_main_thread(self, characters: str, prephantoms: list[tuple[int
for row, col, code, href in prephantoms:
point = panel.text_point(row, col)
region = sublime.Region(point, point)
phantoms.append(sublime.Phantom(region, f"({make_link(href, code)})", sublime.LAYOUT_INLINE))
phantoms.append(sublime.Phantom(region, f"({make_link(href, code)})", sublime.PhantomLayout.INLINE))
self._panel_code_phantoms.update(phantoms)

# --- Implements WindowConfigChangeListener ------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion plugin/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _annotation_region_key(self, severity: DiagnosticSeverity) -> str:
return f'lsp_da-{severity}-{self._config_name}'

def draw(self, diagnostics: list[tuple[Diagnostic, sublime.Region]]) -> None:
flags = sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.NO_UNDO
flags = sublime.RegionFlags.DRAW_NO_FILL | sublime.RegionFlags.DRAW_NO_OUTLINE | sublime.RegionFlags.NO_UNDO
max_severity_level = userprefs().show_diagnostics_annotations_severity_level
# To achieve the correct order of annotations (most severe having priority) we have to add regions from the
# most to the least severe.
Expand Down
Loading

0 comments on commit d6815f5

Please sign in to comment.