Skip to content

Commit

Permalink
Merge branch 'main' into typing
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann committed Apr 19, 2024
2 parents 2c3dbf3 + 1c6d8bc commit ae49f92
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.29.0
2.0.0
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ nav:
extra:
social:
- icon: fontawesome/brands/discord
link: https://discordapp.com/channels/280102180189634562/645268178397560865
link: https://discord.gg/TZ5WN8t
20 changes: 19 additions & 1 deletion docs/src/language_servers.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Follow installation instructions on [LSP-gopls](https://github.com/sublimelsp/LS
"godot-lsp": {
"enabled": true,
"command": ["/PATH/TO/godot-editor.exe"], // Update the PATH
"tcp_port": 6008,
"tcp_port": 6005, // Older versions of Godot(3.x) use port 6008
"selector": "source.gdscript",
}
}
Expand Down Expand Up @@ -673,6 +673,24 @@ Follow installation instructions on [LSP-metals](https://github.com/scalameta/me
}
```

## Solidity

1. Install the [Ethereum](https://packagecontrol.io/packages/Ethereum) package from Package Control for syntax highlighting.
2. Install the [github:NomicFoundation/hardhat-vscode](https://github.com/NomicFoundation/hardhat-vscode/tree/development/server) language server.
3. Open `Preferences > Package Settings > LSP > Settings` and add the `"solidity"` client configuration to the `"clients"`:

```jsonc
{
"clients": {
"solidity": {
"enabled": true,
"command": ["nomicfoundation-solidity-language-server", "--stdio"],
"selector": "source.solidity"
}
}
}
```

## Stylelint

Follow installation instructions on [LSP-stylelint](https://github.com/sublimelsp/LSP-stylelint).
Expand Down
2 changes: 2 additions & 0 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
"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.30.0": "messages/1.30.0.txt",
"1.4.0": "messages/1.4.0.txt",
"1.5.0": "messages/1.5.0.txt",
"1.6.0": "messages/1.6.0.txt",
"1.6.1": "messages/1.6.1.txt",
"1.7.0": "messages/1.7.0.txt",
"1.8.0": "messages/1.8.0.txt",
"1.9.0": "messages/1.9.0.txt",
"2.0.0": "messages/2.0.0.txt",
"install": "messages/install.txt"
}
21 changes: 21 additions & 0 deletions messages/1.30.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
=> 1.30.0

# Breaking changes

- [godot-editor](https://lsp.sublimetext.io/language_servers/#gdscript-godot-engine) client configuration default `tcp_port` value is now `6005` instead of `6008`. Older versions of Godot(3.x) use port `6008`. (#2447) (Предраг Николић)

# Fixes and Improvements

- Keep tab selection and focus when applying WorkspaceEdit (#2431) (Janos Wortmann)
- Enhancements for the rename panel (#2428) (Janos Wortmann)
- Fix URI format for res scheme (#2432) (Janos Wortmann)
- If `"log_debug"` is enabled, `window/logMessage` will be printed to the Sublime Text Console instead of LSP log panel (#2444) (Janos Wortmann)

# Documentation

- docs: Add Toit (#2425) (Serjan Nasredin)
- docs: Add Solidity (#2383) (Nikita Kozlov)

# Plugin API changes

- Allow plugins to ignore certain views (#2410) (Janos Wortmann)
31 changes: 28 additions & 3 deletions messages/2.0.0.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
=> 2.0.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. ⚠️
⚠️ Sublime Text will need to be restarted **more than once** for things to work properly. ⚠️

# Breaking changes
- We are transitioning LSP and LSP-* packages from Python 3.3 to Python 3.8.

- LSP and LSP-* packages are transitioning from Python 3.3 to Python 3.8.

# FAQ

### What are the most significant improvements that stem from the 3.3 to 3.8 change?

There are no new features.
This is an internal LSP codebase change that affects all LSP-* packages.

### LSP is broken after the update even if Sublime Text is restarted many times

If that is the case, follow these steps:

- ##### Check if `"index_files"` is set to `false` in `Preferences.sublime-settings`

From the command palette open `Preferences: Settings` and see if `"index_files": false` exists.
If yes, remove that setting.

- ##### Check if `"LSP"` is put in `"ignored_packages"` in `Preferences.sublime-settings`

Ensure that LSP hasn't been added to the "ignored_packages" list during the update. If it has, remove it.

- ##### Reach for help

Feel free to [open an issue](https://github.com/sublimelsp/LSP/issues/new?assignees=&labels=&projects=&template=bug_report.md&title=) or reach out to us on [Discord](https://discord.gg/TZ5WN8t) if you encounter any problems during the update.
Please provide logs from the Sublime Text console.
2 changes: 2 additions & 0 deletions plugin/core/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ class MessageType(IntEnum):
""" An information message. """
Log = 4
""" A log message. """
Debug = 5
""" A debug message. """


class TextDocumentSyncKind(IntEnum):
Expand Down
3 changes: 2 additions & 1 deletion plugin/core/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from .protocol import InsertTextMode
from .protocol import Location
from .protocol import LocationLink
from .protocol import LogMessageParams
from .protocol import LSPAny
from .protocol import LSPErrorCodes
from .protocol import LSPObject
Expand Down Expand Up @@ -1924,7 +1925,7 @@ def m_window_showMessage(self, params: Any) -> None:
"""handles the window/showMessage notification"""
self.call_manager('handle_show_message', self, params)

def m_window_logMessage(self, params: Any) -> None:
def m_window_logMessage(self, params: LogMessageParams) -> None:
"""handles the window/logMessage notification"""
self.call_manager('handle_log_message', self, params)

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, 29, 0)
__version__ = (2, 0, 0)
19 changes: 17 additions & 2 deletions plugin/core/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from .panels import PanelName
from .protocol import DocumentUri
from .protocol import Error
from .protocol import LogMessageParams
from .protocol import MessageType
from .sessions import AbstractViewListener
from .sessions import get_plugin
from .sessions import Logger
Expand Down Expand Up @@ -413,8 +415,21 @@ def destroy(self) -> None:
self.panel_manager.destroy_output_panels()
self.panel_manager = None

def handle_log_message(self, session: Session, params: Any) -> None:
self.handle_server_message_async(session.config.name, extract_message(params))
def handle_log_message(self, session: Session, params: LogMessageParams) -> None:
if not userprefs().log_debug:
return
message_type = params['type']
level = {
MessageType.Error: "ERROR",
MessageType.Warning: "WARNING",
MessageType.Info: "INFO",
MessageType.Log: "LOG",
MessageType.Debug: "DEBUG"
}.get(message_type, "?")
message = params['message']
print("{}: {}: {}".format(session.config.name, level, message))
if message_type == MessageType.Error:
self.window.status_message("{}: {}".format(session.config.name, message))

def handle_stderr_log(self, session: Session, message: str) -> None:
self.handle_server_message_async(session.config.name, message)
Expand Down

0 comments on commit ae49f92

Please sign in to comment.