Skip to content

Commit

Permalink
Merge branch 'main' into mark-deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
predragnikolic committed May 29, 2024
2 parents b841251 + 8d8f5c7 commit e6caf61
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
os:
- ubuntu-latest
# - macOS-latest
- macOS-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.1.0
18 changes: 18 additions & 0 deletions docs/src/language_servers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
11 changes: 11 additions & 0 deletions messages/2.1.0.txt
Original file line number Diff line number Diff line change
@@ -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)
51 changes: 26 additions & 25 deletions plugin/core/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion plugin/core/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = (2, 0, 0)
__version__ = (2, 1, 0)
3 changes: 2 additions & 1 deletion plugin/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion third_party/websocket_server/websocket_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

'''
+-+-+-+-+-------+-+-------------+-------------------------------+
Expand Down

0 comments on commit e6caf61

Please sign in to comment.