Skip to content

Commit

Permalink
Merge branch 'main' into fix/sorted-diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl committed Oct 23, 2023
2 parents ba7f68a + 661ff53 commit da3ffdc
Show file tree
Hide file tree
Showing 62 changed files with 1,895 additions and 710 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- if: ${{ matrix.os == 'macOS-latest' }}
run: brew unlink openssl
- uses: SublimeText/UnitTesting/actions/setup@v1
- uses: SublimeText/UnitTesting/actions/run-tests@v1
with:
Expand All @@ -32,7 +34,7 @@ jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.8'
Expand Down
32 changes: 21 additions & 11 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
"caption": "LSP: Format File",
"command": "lsp_format_document",
},
{
"caption": "LSP: Format File With",
"command": "lsp_format_document",
"args": {"select": true}
},
{
"caption": "LSP: Format Selection",
"command": "lsp_format_document_range",
Expand All @@ -70,38 +75,38 @@
"command": "lsp_restart_server",
},
{
"caption": "LSP: Goto Symbol",
"caption": "LSP: Goto Symbol",
"command": "lsp_document_symbols",
},
{
"caption": "LSP: Goto Symbol In Project",
"caption": "LSP: Goto Symbol in Project",
"command": "lsp_workspace_symbols"
},
{
"caption": "LSP: Goto Definition",
"caption": "LSP: Goto Definition",
"command": "lsp_symbol_definition"
},
{
"caption": "LSP: Goto Type Definition",
"caption": "LSP: Goto Type Definition",
"command": "lsp_symbol_type_definition"
},
{
"caption": "LSP: Goto Declaration",
"caption": "LSP: Goto Declaration",
"command": "lsp_symbol_declaration",
},
{
"caption": "LSP: Goto Implementation",
"caption": "LSP: Goto Implementation",
"command": "lsp_symbol_implementation",
},
{
"caption": "LSP: Goto Diagnostic",
"caption": "LSP: Goto Diagnostic",
"command": "lsp_goto_diagnostic",
"args": {
"uri": "$view_uri"
}
},
{
"caption": "LSP: Goto Diagnostic in Project",
"caption": "LSP: Goto Diagnostic in Project",
"command": "lsp_goto_diagnostic"
},
{
Expand All @@ -125,11 +130,11 @@
"command": "lsp_symbol_rename"
},
{
"caption": "LSP: Code Action",
"caption": "LSP: Code Action",
"command": "lsp_code_actions"
},
{
"caption": "LSP: Refactor",
"caption": "LSP: Refactor",
"command": "lsp_code_actions",
"args": {
"only_kinds": [
Expand All @@ -138,7 +143,7 @@
},
},
{
"caption": "LSP: Source Action",
"caption": "LSP: Source Action",
"command": "lsp_code_actions",
"args": {
"only_kinds": [
Expand All @@ -162,4 +167,9 @@
"caption": "LSP: Toggle Inlay Hints",
"command": "lsp_toggle_inlay_hints",
},
// {
// "caption": "LSP: Fold All Comment Blocks",
// "command": "lsp_fold_all",
// "args": {"kind": "comment"}
// },
]
12 changes: 11 additions & 1 deletion Default.sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
{
"keys": ["shift+f12"],
"command": "lsp_symbol_references",
"args": {"side_by_side": false, "force_group": true, "fallback": false, "group": -1},
"args": {"side_by_side": false, "force_group": true, "fallback": false, "group": -1, "include_declaration": false},
"context": [{"key": "lsp.session_with_capability", "operand": "referencesProvider"}]
},
// Find References (side-by-side)
Expand Down Expand Up @@ -211,8 +211,18 @@
// {
// "keys": ["primary+shift+a"],
// "command": "lsp_expand_selection",
// "args": {"fallback": false},
// "context": [{"key": "lsp.session_with_capability", "operand": "selectionRangeProvider"}]
// },
// Fold around caret position - an optional "strict" argument can be used to configure whether
// to fold only when the caret is contained within the folded region (true), or even when it is
// anywhere on the starting line (false).
// {
// "keys": ["UNBOUND"],
// "command": "lsp_fold",
// "args": {"strict": true},
// "context": [{"key": "lsp.session_with_capability", "operand": "foldingRangeProvider"}]
// },
//==== Internal key-bindings ====
{
"keys": ["<character>"],
Expand Down
18 changes: 18 additions & 0 deletions LSP.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@
// hint: 4
"show_diagnostics_severity_level": 4,

// Show diagnostics as annotations with level equal to or less than:
// none: 0 (never show)
// error: 1
// warning: 2
// info: 3
// hint: 4
// When enabled, it's recommended not to use the "annotation" value for the
// `show_code_actions` option as it's impossible to enforce which one gets shown first.
"show_diagnostics_annotations_severity_level": 0,

// Open the diagnostics panel automatically on save when diagnostics level is
// equal to or less than:
// none: 0 (never open the panel automatically)
Expand Down Expand Up @@ -202,6 +212,14 @@
// about how to configure your color scheme for semantic highlighting.
"semantic_highlighting": false,

// Determines ranges which initially should be folded when a document is opened,
// provided that the language server has support for this.
"initially_folded": [
// "comment",
// "imports",
// "region",
],

// --- Debugging ----------------------------------------------------------------------

// Show verbose debug messages in the sublime console.
Expand Down
17 changes: 17 additions & 0 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,27 @@
{
"id": "edit",
"children": [
{
"id": "fold",
"children": [
{
"id": "lsp",
"caption": "-"
},
{
"command": "lsp_fold",
"args": {"prefetch": true}
}
]
},
{
"id": "lsp",
"caption": "-"
},
{
"command": "lsp_fold",
"args": {"prefetch": true, "hidden": true}
},
{
"command": "lsp_source_action",
"args": {"id": -1}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.24.0
1.26.0
16 changes: 16 additions & 0 deletions annotations.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.lsp_annotation {
margin: 0;
border-width: 0;
}
.lsp_annotation .errors {
color: color(var(--redish) alpha(0.85));
}
.lsp_annotation .warnings {
color: color(var(--yellowish) alpha(0.85));
}
.lsp_annotation .info {
color: color(var(--bluish) alpha(0.85));
}
.lsp_annotation .hints {
color: color(var(--bluish) alpha(0.85));
}
3 changes: 2 additions & 1 deletion boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from .plugin.core.registry import LspNextDiagnosticCommand
from .plugin.core.registry import LspOpenLocationCommand
from .plugin.core.registry import LspPrevDiagnosticCommand
from .plugin.core.registry import LspRecheckSessionsCommand
from .plugin.core.registry import LspRestartServerCommand
from .plugin.core.registry import windows
from .plugin.core.sessions import AbstractPlugin
Expand All @@ -43,6 +42,8 @@
from .plugin.documents import TextChangeListener
from .plugin.edit import LspApplyDocumentEditCommand
from .plugin.execute_command import LspExecuteCommand
from .plugin.folding_range import LspFoldAllCommand
from .plugin.folding_range import LspFoldCommand
from .plugin.formatting import LspFormatCommand
from .plugin.formatting import LspFormatDocumentCommand
from .plugin.formatting import LspFormatDocumentRangeCommand
Expand Down
2 changes: 0 additions & 2 deletions dependencies.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"*": {
">=4096": [
"backrefs",
"bracex",
"mdpopups",
"pathlib",
"pyyaml",
"wcmatch"
]
}
Expand Down
10 changes: 8 additions & 2 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ theme:
extra_css:
- stylesheets/extra.css

extra_javascript:
- js/redirect.js

markdown_extensions:
# tabs for ST4 and ST3 content
- pymdownx.tabbed

# higlight code block
- pymdownx.highlight
# highlight code blocks
- pymdownx.highlight:
extend_pygments_lang:
- name: jsonc
lang: json
- pymdownx.superfences

# add tip, warning info boxes
Expand Down
8 changes: 5 additions & 3 deletions docs/src/client_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If your language server is missing or not configured correctly, you need to add/

Below is an example of the `LSP.sublime-settings` file with configurations for the [Phpactor](https://phpactor.readthedocs.io/en/master/usage/language-server.html#language-server) server.

```js
```jsonc
{
// General settings
"show_diagnostics_panel_on_save": 0,
Expand Down Expand Up @@ -65,6 +65,8 @@ The vast majority of language servers can communicate over stdio. To use stdio,

Some language servers can also act as a TCP server accepting incoming TCP connections. So: the language server subprocess is started by this package, and the subprocess will then open a TCP listener port. The editor can then connect as a client and initiate the communication. To use this mode, set `tcp_port` to a positive number designating the port to connect to on `localhost`.

Optionally in this case, you can omit the `command` setting if you don't want Sublime LSP to manage the language server process and you'll take care of it yourself.

### TCP - localhost - editor acts as a TCP server

Some _LSP servers_ instead expect the _LSP client_ to act as a _TCP server_. The _LSP server_ will then connect as a _TCP client_, after which the _LSP client_ is expected to initiate the communication. To use this mode, set `tcp_port` to a negative number designating the port to bind to for accepting new TCP connections.
Expand All @@ -79,7 +81,7 @@ The port number can be inserted into the server's startup `command` in your clie

Global LSP settings (which currently are `lsp_format_on_save` and `lsp_code_actions_on_save`) can be overridden per-project in `.sublime-project` file:

```json
```jsonc
{
"folders":
[
Expand All @@ -97,7 +99,7 @@ Also global language server settings can be added or overridden per-project by a

> **Note**: The `settings` and `initializationOptions` objects for server configurations will be merged with globally defined server configurations so it's possible to override only certain properties from those objects.
```json
```jsonc
{
"folders":
[
Expand Down
2 changes: 1 addition & 1 deletion docs/src/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For LSP servers that can handle [workspace/executeCommand](https://microsoft.git

Example:

```js
```jsonc
[
// ...
{
Expand Down
Loading

0 comments on commit da3ffdc

Please sign in to comment.