Skip to content

Commit

Permalink
Merge branch 'main' into feat/py38
Browse files Browse the repository at this point in the history
* main:
  Cut 1.29.0
  Fix usage of sublime.score_selector (#2427)
  docs: add info about typst-lsp commands (#2424)
  • Loading branch information
rchl committed Feb 28, 2024
2 parents 2e252d3 + 79a2128 commit 1bb3bc6
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.28.0
1.29.0
28 changes: 28 additions & 0 deletions docs/src/language_servers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`:
<!-- how to call: see https://github.com/nvarner/typst-lsp/blob/master/editors/vscode/src/extension.ts -->
```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:
Expand Down
1 change: 1 addition & 0 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
30 changes: 30 additions & 0 deletions messages/1.29.0.txt
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 4 additions & 5 deletions plugin/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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__ = (1, 28, 0)
__version__ = (1, 29, 0)
2 changes: 1 addition & 1 deletion plugin/goto_diagnostic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))}
Expand Down
1 change: 1 addition & 0 deletions popups.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1bb3bc6

Please sign in to comment.