vscode-languageclient
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -116,2 +116,3 @@ /* -------------------------------------------------------------------------------------------- | ||
set(item.code, function () { return result.code = item.code; }); | ||
set(item.source, function () { return result.source = item.source; }); | ||
return result; | ||
@@ -118,0 +119,0 @@ } |
@@ -132,2 +132,7 @@ import { RequestType, NotificationType } from 'vscode-jsonrpc'; | ||
/** | ||
* A human-readable string describing the source of this | ||
* diagnostic, e.g. 'typescript' or 'super lint'. | ||
*/ | ||
source?: string; | ||
/** | ||
* The diagnostic's message. | ||
@@ -145,3 +150,3 @@ */ | ||
*/ | ||
function create(range: Range, message: string, severity?: number, code?: number | string): Diagnostic; | ||
function create(range: Range, message: string, severity?: number, code?: number | string, source?: string): Diagnostic; | ||
/** | ||
@@ -148,0 +153,0 @@ * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. |
@@ -113,3 +113,3 @@ /* -------------------------------------------------------------------------------------------- | ||
*/ | ||
function create(range, message, severity, code) { | ||
function create(range, message, severity, code, source) { | ||
var result = { range: range, message: message }; | ||
@@ -122,2 +122,5 @@ if (Is.defined(severity)) { | ||
} | ||
if (Is.defined(source)) { | ||
result.source = source; | ||
} | ||
return result; | ||
@@ -135,3 +138,4 @@ } | ||
&& (Is.number(candidate.severity) || Is.undefined(candidate.severity)) | ||
&& (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)); | ||
&& (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) | ||
&& (Is.string(candidate.source) || Is.undefined(candidate.source)); | ||
} | ||
@@ -138,0 +142,0 @@ Diagnostic.is = is; |
@@ -20,2 +20,5 @@ /* -------------------------------------------------------------------------------------------- | ||
} | ||
if (is.defined(diagnostic.source)) { | ||
result.source = diagnostic.source; | ||
} | ||
return result; | ||
@@ -45,2 +48,5 @@ } | ||
function asDiagnosticSeverity(value) { | ||
if (is.undefined(value) || is.nil(value)) { | ||
return code.DiagnosticSeverity.Error; | ||
} | ||
switch (value) { | ||
@@ -56,2 +62,3 @@ case proto.DiagnosticSeverity.Error: | ||
} | ||
return code.DiagnosticSeverity.Error; | ||
} | ||
@@ -58,0 +65,0 @@ exports.asDiagnosticSeverity = asDiagnosticSeverity; |
{ | ||
"name": "vscode-languageclient", | ||
"description": "VSCode Language client implementation", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"author": "Microsoft Corporation", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
160228
4041