From 12b3e932ee892678469c4744eb0438f3942a1ef4 Mon Sep 17 00:00:00 2001 From: Ilia <43654815+istudyatuni@users.noreply.github.com> Date: Mon, 19 Feb 2024 14:38:04 +0300 Subject: [PATCH 1/3] docs: add info about typst-lsp commands (#2424) --- docs/src/language_servers.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/src/language_servers.md b/docs/src/language_servers.md index c24b1459b..f5cfbc212 100644 --- a/docs/src/language_servers.md +++ b/docs/src/language_servers.md @@ -738,6 +738,7 @@ See [Javascript/TypeScript](#javascripttypescript). } } ``` + 4. Optional: to enable auto-completions for the relevant situations in Typst files, adjust Sublime's `"auto_complete_selector"` and/or `"auto_complete_triggers"` setting (`Preferences > Settings`); for example ```jsonc @@ -751,6 +752,33 @@ See [Javascript/TypeScript](#javascripttypescript). } ``` +5. Optional: to enable some useful commands provided by language server, add the following to the `*.sublime-commands`: + + + ```jsonc title="Packages/User/Default.sublime-commands" + [ + // ... + { + "caption": "typst-lsp - Pin the main file to the currently opened document", + "command": "lsp_execute", + "args": { + "session_name": "typst-lsp", + "command_name": "typst-lsp.doPinMain", + "command_args": ["${file_uri}"] + } + }, + { + "caption": "typst-lsp - Unpin the main file", + "command": "lsp_execute", + "args": { + "session_name": "typst-lsp", + "command_name": "typst-lsp.doPinMain", + "command_args": ["detached"] + } + }, + ] + ``` + ## Vue There are multiple options: From 1ba8c054f20a8aaf941c2b5018fdd91a7296c0b5 Mon Sep 17 00:00:00 2001 From: Benjamin Schaaf Date: Wed, 28 Feb 2024 18:24:53 +1100 Subject: [PATCH 2/3] Fix usage of sublime.score_selector (#2427) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ST 4173 tweaks how selector scoring works resulting in LSP no longer functioning. As per the comment there seems to be a misunderstanding of how `sublime.score_selector` works. The entire selector must always match for a non-zero score, so if the goal is to check if it's not empty and matches then checking for `>= 8` is simply wrong. --------- Co-authored-by: Benjamin Schaaf Co-authored-by: Rafał Chłodnicki --- plugin/core/types.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugin/core/types.py b/plugin/core/types.py index 91b7d16df..8ae09bfb1 100644 --- a/plugin/core/types.py +++ b/plugin/core/types.py @@ -840,11 +840,10 @@ def match_view(self, view: sublime.View, scheme: str) -> bool: syntax = view.syntax() if not syntax: return False - # Every part of a x.y.z scope seems to contribute 8. - # An empty selector result in a score of 1. - # A non-matching non-empty selector results in a score of 0. - # We want to match at least one part of an x.y.z, and we don't want to match on empty selectors. - return scheme in self.schemes and sublime.score_selector(syntax.scope, self.selector) >= 8 + selector = self.selector.strip() + if not selector: + return False + return scheme in self.schemes and sublime.score_selector(syntax.scope, selector) > 0 def map_client_path_to_server_uri(self, path: str) -> str: if self.path_maps: From 79a2128840af25a27dec14aeb4be23790efd5459 Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Wed, 28 Feb 2024 08:27:35 +0100 Subject: [PATCH 3/3] Cut 1.29.0 --- VERSION | 2 +- messages.json | 1 + messages/1.29.0.txt | 30 ++++++++++++++++++++++++++++++ plugin/core/version.py | 2 +- plugin/goto_diagnostic.py | 2 +- popups.css | 1 + 6 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 messages/1.29.0.txt diff --git a/VERSION b/VERSION index 3c71e4721..72f3c1dac 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.28.0 \ No newline at end of file +1.29.0 \ No newline at end of file diff --git a/messages.json b/messages.json index 7d12816dc..58ed88d9f 100644 --- a/messages.json +++ b/messages.json @@ -26,6 +26,7 @@ "1.26.0": "messages/1.26.0.txt", "1.27.0": "messages/1.27.0.txt", "1.28.0": "messages/1.28.0.txt", + "1.29.0": "messages/1.29.0.txt", "1.3.0": "messages/1.3.0.txt", "1.3.1": "messages/1.3.1.txt", "1.4.0": "messages/1.4.0.txt", diff --git a/messages/1.29.0.txt b/messages/1.29.0.txt new file mode 100644 index 000000000..ad82b190a --- /dev/null +++ b/messages/1.29.0.txt @@ -0,0 +1,30 @@ +=> 1.29.0 + +⚠️⚠️⚠️ +To ensure that everything works properly after LSP package is updated, +it's strongly recommended to restart Sublime Text once it finishes updating all packages. +⚠️⚠️⚠️ + +# New features + +- add commands for opening "find references" in bottom or quick panel (#2409) (Rafał Chłodnicki) +- Add format on paste (#2397) (Предраг Николић) + +# Fixes and Improvements + +- Fix usage of sublime.score_selector (#2427) (Benjamin Schaaf) +- Fix find_open_file incompatibility with older ST versions (Janos Wortmann) + +# Refactoring + +- Remove hover provider count view setting (Janos Wortmann) +- Remove unnecessary argument from lsp_symbol_rename command (Janos Wortmann) + +# Documentation + +- docs: add info about typst-lsp commands (#2424) (Ilia) +- docs: add systemverilog/verible language server setup guide (#2416) (Johnny Martínez) +- docs: rewrite self-help instructions (#2405) (Rafał Chłodnicki) +- docs: rewritten "common problems" section (#2406) (Rafał Chłodnicki) +- A few enhancements for the docs website (#2402) (jwortmann) +- chore: deploy docs preview on docs changes (#2403) (Rafał Chłodnicki) diff --git a/plugin/core/version.py b/plugin/core/version.py index 594b8564f..b68c353d5 100644 --- a/plugin/core/version.py +++ b/plugin/core/version.py @@ -1 +1 @@ -__version__ = (1, 28, 0) +__version__ = (1, 29, 0) diff --git a/plugin/goto_diagnostic.py b/plugin/goto_diagnostic.py index f9d0abad7..aef65c8e9 100644 --- a/plugin/goto_diagnostic.py +++ b/plugin/goto_diagnostic.py @@ -35,7 +35,7 @@ PREVIEW_PANE_CSS = """ .diagnostics {padding: 0.5em} .diagnostics a {color: var(--bluish)} - .diagnostics.error {background-color: color(var(--redish) alpha(0.25))} + .diagnostics.error {background-color: color(var(--redish) alpha(0.25)); white-space: pre-wrap} .diagnostics.warning {background-color: color(var(--yellowish) alpha(0.25))} .diagnostics.info {background-color: color(var(--bluish) alpha(0.25))} .diagnostics.hint {background-color: color(var(--bluish) alpha(0.25))} diff --git a/popups.css b/popups.css index 4e43362b0..621bc11ea 100644 --- a/popups.css +++ b/popups.css @@ -41,6 +41,7 @@ background-color: color(var(--redish) alpha(0.25)); color: var(--foreground); padding: 0.5rem; + white-space: pre-wrap; } .warnings { border-width: 0;