Skip to content

Commit

Permalink
Merge branch 'main' into maintenance/remove-legacy-code
Browse files Browse the repository at this point in the history
  • Loading branch information
rwols committed Feb 15, 2022
2 parents ff2074a + 9f9ad2b commit 5aaf356
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/src/keyboard_shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Refer to the [Customization section](customization.md#keyboard-shortcuts-key-bin
| Run Code Action | unbound | `lsp_code_actions`
| Run Source Action | unbound | `lsp_code_actions` (with args: `{"only_kinds": ["source"]}`)
| Run Code Lens | unbound | `lsp_code_lens`
| Signature Help | <kbd>ctrl</kbd> <kbd>alt</kbd> <kbd>space</kbd> | -
| Signature Help | <kbd>ctrl</kbd> <kbd>alt</kbd> <kbd>space</kbd> | `lsp_signature_help_show`
| Hover Popup | unbound | `lsp_hover`
| Toggle Diagnostics Panel | <kbd>ctrl</kbd> <kbd>alt</kbd> <kbd>m</kbd> | `lsp_show_diagnostics_panel`
| Toggle Log Panel | unbound | `lsp_toggle_server_panel`
9 changes: 9 additions & 0 deletions plugin/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .types import Settings
from .types import SettingsRegistration
from .typing import Any, Optional, Dict, Callable
import os
import sublime


Expand Down Expand Up @@ -83,6 +84,14 @@ def update_configs(self) -> None:
self._notify_listener()

def _set_enabled(self, config_name: str, is_enabled: bool) -> None:
from .sessions import get_plugin
plugin = get_plugin(config_name)
if plugin:
plugin_settings, plugin_settings_name = plugin.configuration()
settings_basename = os.path.basename(plugin_settings_name)
plugin_settings.set("enabled", is_enabled)
sublime.save_settings(settings_basename)
return
settings = sublime.load_settings("LSP.sublime-settings")
clients = settings.get("clients")
if isinstance(clients, dict):
Expand Down
2 changes: 1 addition & 1 deletion plugin/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ def format_completion(
kind = sublime.KIND_AMBIGUOUS

if _is_completion_item_deprecated(item):
kind = (kind[0], '', "⚠ {} - Deprecated".format(kind[2]))
kind = (kind[0], '!', "⚠ {} - Deprecated".format(kind[2]))

lsp_label = item["label"]
lsp_label_details = item.get("labelDetails")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def test_show_deprecated_flag(self) -> None:
"deprecated": True
} # type: CompletionItem
formatted_completion_item = format_completion(item_with_deprecated_flag, 0, False, "")
self.assertEqual('', formatted_completion_item.kind[1])
self.assertEqual('!', formatted_completion_item.kind[1])
self.assertEqual('⚠ Method - Deprecated', formatted_completion_item.kind[2])

def test_show_deprecated_tag(self) -> None:
Expand All @@ -622,7 +622,7 @@ def test_show_deprecated_tag(self) -> None:
"tags": [CompletionItemTag.Deprecated]
} # type: CompletionItem
formatted_completion_item = format_completion(item_with_deprecated_tags, 0, False, "")
self.assertEqual('', formatted_completion_item.kind[1])
self.assertEqual('!', formatted_completion_item.kind[1])
self.assertEqual('⚠ Method - Deprecated', formatted_completion_item.kind[2])

def test_strips_carriage_return_in_insert_text(self) -> 'Generator':
Expand Down

0 comments on commit 5aaf356

Please sign in to comment.