diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 061936a93..bc9e25c4d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: matrix: os: - ubuntu-latest - # - macOS-latest + - macOS-latest - windows-latest runs-on: ${{ matrix.os }} steps: diff --git a/VERSION b/VERSION index 359a5b952..50aea0e7a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 \ No newline at end of file +2.1.0 \ No newline at end of file diff --git a/docs/src/language_servers.md b/docs/src/language_servers.md index b85b1d59e..5a704b738 100644 --- a/docs/src/language_servers.md +++ b/docs/src/language_servers.md @@ -484,6 +484,24 @@ Follow installation instructions on [LSP-ruff](https://github.com/sublimelsp/LSP Follow installation instructions on [R-IDE](https://github.com/REditorSupport/sublime-ide-r#installation). +## Racket + +1. Install the [Racket](https://packagecontrol.io/packages/Racket) package from Package Control for syntax highlighting. +2. Follow the instructions for installation at [racket-langserver](https://github.com/jeapostrophe/racket-langserver). +3. Open `Preferences > Package Settings > LSP > Settings` and add the `"racket-langserver"` client configuration to the `"clients"`: + +```jsonc +{ + "clients": { + "racket-langserver": { + "enabled": true, + "command": ["racket", "-l", "racket-langserver"], + "selector": "source.racket" + } + } +} +``` + ## Ruby / Ruby on Rails There are multiple options: diff --git a/messages.json b/messages.json index a8333cbea..d772f9522 100644 --- a/messages.json +++ b/messages.json @@ -38,5 +38,6 @@ "1.8.0": "messages/1.8.0.txt", "1.9.0": "messages/1.9.0.txt", "2.0.0": "messages/2.0.0.txt", + "2.1.0": "messages/2.1.0.txt", "install": "messages/install.txt" } diff --git a/messages/2.1.0.txt b/messages/2.1.0.txt new file mode 100644 index 000000000..31b4e89ff --- /dev/null +++ b/messages/2.1.0.txt @@ -0,0 +1,11 @@ +=> 2.1.0 + +# Features + +- Add `refactoring_auto_save` setting to save modified files after applying a refactoring (#2433) (Janos Wortmann) + +# Fixes and Improvements + +- Respect semantic token capability when dynamically registered (#2453) (Rafał Chłodnicki) +- Use caret for point to look up symbol (#2440) (Troels Bjørnskov) +- Various typing improvements (#2446, #2450, #2456, #2458, #2460, #2459) (Janos Wortmann, Jack Cherng, deathaxe) \ No newline at end of file diff --git a/plugin/core/sessions.py b/plugin/core/sessions.py index 7879ddacf..8d06245f9 100644 --- a/plugin/core/sessions.py +++ b/plugin/core/sessions.py @@ -98,6 +98,7 @@ from .types import SettingsRegistration from .types import sublime_pattern_to_glob from .types import WORKSPACE_DIAGNOSTICS_TIMEOUT +from .typing import StrEnum from .url import filename_to_uri from .url import parse_uri from .url import unparse_uri @@ -248,29 +249,29 @@ def on_post_exit_async(self, session: Session, exit_code: int, exception: Except raise NotImplementedError() -def _enum_to_list(e: type[IntEnum]) -> list[int]: +def _int_enum_to_list(e: type[IntEnum]) -> list[int]: return [v.value for v in e] -def _enum_like_class_to_list(c: type[object]) -> list[int | str]: - return [v for k, v in c.__dict__.items() if not k.startswith('_')] +def _str_enum_to_list(e: type[StrEnum]) -> list[str]: + return [v.value for v in e] def get_initialize_params(variables: dict[str, str], workspace_folders: list[WorkspaceFolder], config: ClientConfig) -> InitializeParams: - completion_kinds = cast(List[CompletionItemKind], _enum_to_list(CompletionItemKind)) - symbol_kinds = cast(List[SymbolKind], _enum_to_list(SymbolKind)) - diagnostic_tag_value_set = cast(List[DiagnosticTag], _enum_to_list(DiagnosticTag)) - completion_tag_value_set = cast(List[CompletionItemTag], _enum_to_list(CompletionItemTag)) - symbol_tag_value_set = cast(List[SymbolTag], _enum_to_list(SymbolTag)) - semantic_token_types = cast(List[str], _enum_like_class_to_list(SemanticTokenTypes)) + completion_kinds = cast(List[CompletionItemKind], _int_enum_to_list(CompletionItemKind)) + symbol_kinds = cast(List[SymbolKind], _int_enum_to_list(SymbolKind)) + diagnostic_tag_value_set = cast(List[DiagnosticTag], _int_enum_to_list(DiagnosticTag)) + completion_tag_value_set = cast(List[CompletionItemTag], _int_enum_to_list(CompletionItemTag)) + symbol_tag_value_set = cast(List[SymbolTag], _int_enum_to_list(SymbolTag)) + semantic_token_types = cast(List[str], _str_enum_to_list(SemanticTokenTypes)) if config.semantic_tokens is not None: for token_type in config.semantic_tokens.keys(): if token_type not in semantic_token_types: semantic_token_types.append(token_type) - semantic_token_modifiers = cast(List[str], _enum_like_class_to_list(SemanticTokenModifiers)) - supported_markup_kinds = [MarkupKind.Markdown, MarkupKind.PlainText] - folding_range_kind_value_set = cast(List[FoldingRangeKind], _enum_like_class_to_list(FoldingRangeKind)) + semantic_token_modifiers = cast(List[str], _str_enum_to_list(SemanticTokenModifiers)) + supported_markup_kinds = cast(List[MarkupKind], [MarkupKind.Markdown.value, MarkupKind.PlainText.value]) + folding_range_kind_value_set = cast(List[FoldingRangeKind], _str_enum_to_list(FoldingRangeKind)) first_folder = workspace_folders[0] if workspace_folders else None general_capabilities: GeneralClientCapabilities = { # https://microsoft.github.io/language-server-protocol/specification#regExp @@ -382,15 +383,15 @@ def get_initialize_params(variables: dict[str, str], workspace_folders: list[Wor "dynamicRegistration": True, "codeActionLiteralSupport": { "codeActionKind": { - "valueSet": [ - CodeActionKind.QuickFix, - CodeActionKind.Refactor, - CodeActionKind.RefactorExtract, - CodeActionKind.RefactorInline, - CodeActionKind.RefactorRewrite, - CodeActionKind.SourceFixAll, - CodeActionKind.SourceOrganizeImports, - ] + "valueSet": cast(List[CodeActionKind], [ + CodeActionKind.QuickFix.value, + CodeActionKind.Refactor.value, + CodeActionKind.RefactorExtract.value, + CodeActionKind.RefactorInline.value, + CodeActionKind.RefactorRewrite.value, + CodeActionKind.SourceFixAll.value, + CodeActionKind.SourceOrganizeImports.value, + ]) } }, "dataSupport": True, @@ -451,9 +452,9 @@ def get_initialize_params(variables: dict[str, str], workspace_folders: list[Wor }, "tokenTypes": semantic_token_types, "tokenModifiers": semantic_token_modifiers, - "formats": [ - TokenFormat.Relative - ], + "formats": cast(List[TokenFormat], [ + TokenFormat.Relative.value + ]), "overlappingTokenSupport": False, "multilineTokenSupport": True, "augmentsSyntaxTokens": True @@ -473,7 +474,7 @@ def get_initialize_params(variables: dict[str, str], workspace_folders: list[Wor "executeCommand": {}, "workspaceEdit": { "documentChanges": True, - "failureHandling": FailureHandlingKind.Abort, + "failureHandling": cast(FailureHandlingKind, FailureHandlingKind.Abort.value), }, "workspaceFolders": True, "symbol": { diff --git a/plugin/core/version.py b/plugin/core/version.py index 14246847e..fc2d6561c 100644 --- a/plugin/core/version.py +++ b/plugin/core/version.py @@ -1 +1 @@ -__version__ = (2, 0, 0) +__version__ = (2, 1, 0) diff --git a/plugin/core/views.py b/plugin/core/views.py index 3a6e8e8d1..b5374eeff 100644 --- a/plugin/core/views.py +++ b/plugin/core/views.py @@ -403,9 +403,10 @@ def text_document_code_action_params( only_kinds: list[CodeActionKind] | None = None, manual: bool = False ) -> CodeActionParams: + trigger_kind = CodeActionTriggerKind.Invoked.value if manual else CodeActionTriggerKind.Automatic.value context: CodeActionContext = { "diagnostics": diagnostics, - "triggerKind": CodeActionTriggerKind.Invoked if manual else CodeActionTriggerKind.Automatic, + "triggerKind": cast(CodeActionTriggerKind, trigger_kind), } if only_kinds: context["only"] = only_kinds diff --git a/third_party/websocket_server/websocket_server.py b/third_party/websocket_server/websocket_server.py index 00ba508fe..1597a79b2 100644 --- a/third_party/websocket_server/websocket_server.py +++ b/third_party/websocket_server/websocket_server.py @@ -15,7 +15,9 @@ from socketserver import ThreadingMixIn, TCPServer, StreamRequestHandler logger = logging.getLogger(__name__) -logging.basicConfig() +# This line installed a root logger, which results in duplicate log entries. +# For more details, see: https://github.com/sublimelsp/LSP/issues/2477 +# logging.basicConfig() ''' +-+-+-+-+-------+-+-------------+-------------------------------+