mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Use ErrorCode in JSON Language Service schema resolution error handling
This adds a dependency on vscode-json-languageservice to the client, which might not be desired, but allows for cleaner code and the correct reference should the error codes change.
This commit is contained in:
parent
157ee8c394
commit
0137ebd471
|
@ -10,6 +10,7 @@ const localize = nls.loadMessageBundle();
|
|||
|
||||
import { workspace, window, languages, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic } from 'vscode';
|
||||
import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification, HandleDiagnosticsSignature } from 'vscode-languageclient';
|
||||
import { ErrorCode } from 'vscode-json-languageservice';
|
||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||
|
||||
import { hash } from './utils/hash';
|
||||
|
@ -92,7 +93,7 @@ export function activate(context: ExtensionContext) {
|
|||
},
|
||||
handleDiagnostics: (uri: Uri, diagnostics: Diagnostic[], next: HandleDiagnosticsSignature) => {
|
||||
let schemaResolveDiagnostic = diagnostics
|
||||
.find(candidate => candidate.code === /* SchemaResolveError */ 0x300);
|
||||
.find(candidate => candidate.code === ErrorCode.SchemaResolveError);
|
||||
if (schemaResolveDiagnostic) {
|
||||
// Show schema resolution errors in status bar only; ref: #51032
|
||||
window.showWarningMessage(schemaResolveDiagnostic.message);
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"vscode-extension-telemetry": "0.0.22",
|
||||
"vscode-json-languageservice": "^3.2.0",
|
||||
"vscode-languageclient": "^5.1.0",
|
||||
"vscode-nls": "^4.0.0"
|
||||
},
|
||||
|
|
|
@ -28,6 +28,11 @@ diagnostic-channel@0.2.0:
|
|||
dependencies:
|
||||
semver "^5.3.0"
|
||||
|
||||
jsonc-parser@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.2.tgz#42fcf56d70852a043fadafde51ddb4a85649978d"
|
||||
integrity sha512-TSU435K5tEKh3g7bam1AFf+uZrISheoDsLlpmAo6wWZYqjsnd09lHYK1Qo+moK4Ikifev1Gdpa69g4NELKnCrQ==
|
||||
|
||||
semver@^5.3.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
|
@ -45,6 +50,16 @@ vscode-extension-telemetry@0.0.22:
|
|||
dependencies:
|
||||
applicationinsights "1.0.5"
|
||||
|
||||
vscode-json-languageservice@^3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.2.0.tgz#fe796c2ddbda966d87905442f9636f139e00f341"
|
||||
integrity sha512-tLAv9/D01fLAvnYnZ1OLy03HSHhVFjaSkUidEjfrwytHrxVDgqXLkHAJg+F6Q3mPYfpnPQvN2jTjiJ1yInuNVg==
|
||||
dependencies:
|
||||
jsonc-parser "^2.0.2"
|
||||
vscode-languageserver-types "^3.13.0"
|
||||
vscode-nls "^4.0.0"
|
||||
vscode-uri "^1.0.6"
|
||||
|
||||
vscode-jsonrpc@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9"
|
||||
|
@ -66,7 +81,7 @@ vscode-languageserver-protocol@3.13.0:
|
|||
vscode-jsonrpc "^4.0.0"
|
||||
vscode-languageserver-types "3.13.0"
|
||||
|
||||
vscode-languageserver-types@3.13.0:
|
||||
vscode-languageserver-types@3.13.0, vscode-languageserver-types@^3.13.0:
|
||||
version "3.13.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.13.0.tgz#b704b024cef059f7b326611c99b9c8753c0a18b4"
|
||||
integrity sha512-BnJIxS+5+8UWiNKCP7W3g9FlE7fErFw0ofP5BXJe7c2tl0VeWh+nNHFbwAS2vmVC4a5kYxHBjRy0UeOtziemVA==
|
||||
|
@ -76,6 +91,11 @@ vscode-nls@^4.0.0:
|
|||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.0.0.tgz#4001c8a6caba5cedb23a9c5ce1090395c0e44002"
|
||||
integrity sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw==
|
||||
|
||||
vscode-uri@^1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.6.tgz#6b8f141b0bbc44ad7b07e94f82f168ac7608ad4d"
|
||||
integrity sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww==
|
||||
|
||||
zone.js@0.7.6:
|
||||
version "0.7.6"
|
||||
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009"
|
||||
|
|
Loading…
Reference in a new issue