From 6e5f3d71650f72515fd57490ce56e044bc1de1bc Mon Sep 17 00:00:00 2001 From: MischaPanch Date: Sat, 26 Jul 2025 14:29:33 +0200 Subject: [PATCH] CLI: allow -n for --name. Formatting. [ci skip] --- src/serena/cli.py | 4 ++++ src/solidlsp/ls.py | 9 +++------ src/solidlsp/ls_types.py | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/serena/cli.py b/src/serena/cli.py index 65ffeae3..9b10be5f 100644 --- a/src/serena/cli.py +++ b/src/serena/cli.py @@ -245,6 +245,8 @@ class ModeCommands(AutoRegisteringGroup): @click.command("create", help="Create a new mode or copy an internal one.") @click.option( "--name", + "-n", + multiple=True, type=str, default=None, help="Name for the new mode. If --from-internal is passed may be left empty to create a mode of the same name, which will then override the internal mode.", @@ -321,6 +323,8 @@ class ContextCommands(AutoRegisteringGroup): @click.command("create", help="Create a new context or copy an internal one.") @click.option( "--name", + "-n", + multiple=True, type=str, default=None, help="Name for the new context. If --from-internal is passed may be left empty to create a context of the same name, which will then override the internal context", diff --git a/src/solidlsp/ls.py b/src/solidlsp/ls.py index 3c1de8a5..7cb82d72 100644 --- a/src/solidlsp/ls.py +++ b/src/solidlsp/ls.py @@ -709,10 +709,8 @@ class SolidLanguageServer(ABC): ret.append(ls_types.Location(**new_item)) return ret - - def request_text_document_diagnostics( - self, relative_file_path: str - ) -> list[ls_types.Diagnostic]: + + def request_text_document_diagnostics(self, relative_file_path: str) -> list[ls_types.Diagnostic]: """ Raise a [textDocument/diagnostic](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_diagnostic) request to the Language Server to find diagnostics for the given file. Wait for the response and return the result. @@ -748,7 +746,7 @@ class SolidLanguageServer(ABC): "severity": item["severity"], "message": item["message"], "range": item["range"], - "code": item["code"] + "code": item["code"], } ret.append(ls_types.Diagnostic(new_item)) @@ -1577,7 +1575,6 @@ class SolidLanguageServer(ABC): defining_symbol = self.request_containing_symbol(def_path, def_line, def_col, strict=False, include_body=include_body) return defining_symbol - @property def cache_path(self) -> Path: diff --git a/src/solidlsp/ls_types.py b/src/solidlsp/ls_types.py index 6c9a2385..d8ff8903 100644 --- a/src/solidlsp/ls_types.py +++ b/src/solidlsp/ls_types.py @@ -318,6 +318,7 @@ class Hover(TypedDict): """ An optional range inside the text document that is used to visualize the hover, e.g. by changing the background color. """ + class DiagnosticsSeverity(IntEnum): ERROR = 1 WARNING = 2