Skip to content

Commit

Permalink
[json] update service (folding api for #47808)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Apr 16, 2018
1 parent d516e62 commit 6c22305
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 269 deletions.
3 changes: 1 addition & 2 deletions extensions/json-language-features/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"jsonc-parser": "^2.0.0-next.1",
"request-light": "^0.2.2",
"vscode-json-languageservice": "^3.0.13",
"vscode-json-languageservice": "^3.1.2-next.1",
"vscode-languageserver": "^4.0.0",
"vscode-languageserver-protocol-foldingprovider": "^1.0.1",
"vscode-nls": "^3.2.2",
Expand All @@ -33,7 +33,6 @@
"install-service-local": "yarn link vscode-json-languageservice",
"install-server-next": "yarn add vscode-languageserver@next",
"install-server-local": "yarn link vscode-languageserver-server",
"test": "npm run compile && ../../../node_modules/.bin/mocha",
"version": "git commit -m \"JSON Language Server $npm_package_version\" package.json"
}
}
117 changes: 0 additions & 117 deletions extensions/json-language-features/server/src/jsonFolding.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { startsWith } from './utils/strings';
import { formatError, runSafe, runSafeAsync } from './utils/runner';
import { JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration } from 'vscode-json-languageservice';
import { getLanguageModelCache } from './languageModelCache';
import { getFoldingRegions } from './jsonFolding';

import { FoldingRangesRequest, FoldingProviderServerCapabilities } from 'vscode-languageserver-protocol-foldingprovider';

Expand Down Expand Up @@ -369,7 +368,7 @@ connection.onRequest(FoldingRangesRequest.type, (params, token) => {
return runSafe(() => {
let document = documents.get(params.textDocument.uri);
if (document) {
return getFoldingRegions(document, params.maxRanges, token);
return languageService.getFoldingRanges(document, { maxRanges: params.maxRanges });
}
return null;
}, null, `Error while computing folding ranges for ${params.textDocument.uri}`, token);
Expand Down
144 changes: 0 additions & 144 deletions extensions/json-language-features/server/src/test/folding.test.ts

This file was deleted.

12 changes: 8 additions & 4 deletions extensions/json-language-features/server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ https-proxy-agent@2.1.1:
agent-base "^4.1.0"
debug "^3.1.0"

jsonc-parser@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.0.tgz#62ff087a7e753875febf3c55f1fc0cd737c36b5a"

jsonc-parser@^2.0.0-next.1:
version "2.0.0-next.1"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.0-next.1.tgz#445a824f765a96abfbb286d759a9b1d226b18088"
Expand All @@ -68,11 +72,11 @@ request-light@^0.2.2:
https-proxy-agent "2.1.1"
vscode-nls "^2.0.2"

vscode-json-languageservice@^3.0.13:
version "3.0.13"
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.0.13.tgz#dd1b7ddfd4f5ca16e2a7adcc7d7f9009ac02319a"
vscode-json-languageservice@^3.1.2-next.1:
version "3.1.2-next.1"
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.1.2-next.1.tgz#8acee581c664e2af72ade2f08252aeae9b5918ca"
dependencies:
jsonc-parser "^2.0.0-next.1"
jsonc-parser "^2.0.0"
vscode-languageserver-types "^3.6.1"
vscode-nls "^3.2.1"
vscode-uri "^1.0.3"
Expand Down

0 comments on commit 6c22305

Please sign in to comment.