Skip to content

Commit

Permalink
update server to the latest version (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl authored Nov 15, 2023
1 parent 1ab9d9b commit 4cba034
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 77 deletions.
20 changes: 18 additions & 2 deletions language-server/out/jsonServer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 57 additions & 69 deletions language-server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"@vscode/l10n": "^0.0.16",
"jsonc-parser": "^3.2.0",
"request-light": "^0.7.0",
"vscode-json-languageservice": "^5.3.6",
"vscode-languageserver": "^8.2.0-next.3",
"vscode-uri": "^3.0.7"
"vscode-json-languageservice": "^5.3.7",
"vscode-languageserver": "^9.0.1",
"vscode-uri": "^3.0.8"
},
"devDependencies": {
"@types/mocha": "^9.1.1",
Expand Down
4 changes: 2 additions & 2 deletions language-server/update-info.log
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ref: 1.82.2
49e432df586ad803dd3e733cdb5ffbb59365b115
ref: 1.84.1
3cfd80993de3fb158ff1b3c4e03c9e9dbb80cc3d
13 changes: 12 additions & 1 deletion plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .schema_store import StoreListener, SchemaStore
from LSP.plugin import DottedDict
from LSP.plugin import Notification
from LSP.plugin.core.typing import Any, Callable, cast, Dict, List, Optional, Tuple
from LSP.plugin.core.typing import Any, Callable, cast, Dict, List, Mapping, Optional, Tuple
from lsp_utils import ApiWrapperInterface
from lsp_utils import request_handler
from lsp_utils import NpmClientHandler
Expand Down Expand Up @@ -72,6 +72,17 @@ def on_pre_send_notification_async(self, notification: Notification) -> None:
if any((pattern.search(text_document['uri']) for pattern in self._jsonc_patterns)):
text_document['languageId'] = 'jsonc'

def on_pre_server_command(self, command: Mapping[str, Any], done_callback: Callable[[], None]) -> bool:
if command['command'] == 'json.sort':
session = self.weaksession()
if session:
view = session.window.active_view()
if view:
view.run_command('lsp_json_sort_document')
done_callback()
return True
return False

# --- StoreListener ------------------------------------------------------------------------------------------------

def on_store_changed_async(self, schemas: List[Dict]) -> None:
Expand Down

0 comments on commit 4cba034

Please sign in to comment.