1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | exports.Severity = void 0;
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
|
24 | var Severity;
|
25 | (function (Severity) {
|
26 | Severity[Severity["Ignore"] = 0] = "Ignore";
|
27 | Severity[Severity["Error"] = 1] = "Error";
|
28 | Severity[Severity["Warning"] = 2] = "Warning";
|
29 | Severity[Severity["Info"] = 3] = "Info";
|
30 | Severity[Severity["Log"] = 4] = "Log";
|
31 | })(Severity = exports.Severity || (exports.Severity = {}));
|
32 | (function (Severity) {
|
33 | const error = 'Errors';
|
34 | const warning = 'Warnings';
|
35 | const info = 'Info';
|
36 | const log = 'Log';
|
37 | const ignore = 'All';
|
38 | function fromValue(value) {
|
39 | value = value && value.toLowerCase();
|
40 | if (!value) {
|
41 | return Severity.Ignore;
|
42 | }
|
43 | if (['error', 'errors'].indexOf(value) !== -1) {
|
44 | return Severity.Error;
|
45 | }
|
46 | if (['warn', 'warning', 'warnings'].indexOf(value) !== -1) {
|
47 | return Severity.Warning;
|
48 | }
|
49 | if (value === 'info') {
|
50 | return Severity.Info;
|
51 | }
|
52 | if (value === 'log') {
|
53 | return Severity.Log;
|
54 | }
|
55 | return Severity.Ignore;
|
56 | }
|
57 | Severity.fromValue = fromValue;
|
58 | function toDiagnosticSeverity(value) {
|
59 | switch (value) {
|
60 | case Severity.Ignore:
|
61 | return vscode_languageserver_protocol_1.DiagnosticSeverity.Hint;
|
62 | case Severity.Info:
|
63 | return vscode_languageserver_protocol_1.DiagnosticSeverity.Information;
|
64 | case Severity.Log:
|
65 | return vscode_languageserver_protocol_1.DiagnosticSeverity.Information;
|
66 | case Severity.Warning:
|
67 | return vscode_languageserver_protocol_1.DiagnosticSeverity.Warning;
|
68 | case Severity.Error:
|
69 | return vscode_languageserver_protocol_1.DiagnosticSeverity.Error;
|
70 | default:
|
71 | return vscode_languageserver_protocol_1.DiagnosticSeverity.Error;
|
72 | }
|
73 | }
|
74 | Severity.toDiagnosticSeverity = toDiagnosticSeverity;
|
75 | function toString(severity) {
|
76 | switch (severity) {
|
77 | case Severity.Error:
|
78 | return error;
|
79 | case Severity.Warning:
|
80 | return warning;
|
81 | case Severity.Info:
|
82 | return info;
|
83 | case Severity.Log:
|
84 | return log;
|
85 | default:
|
86 | return ignore;
|
87 | }
|
88 | }
|
89 | Severity.toString = toString;
|
90 | function toArray() {
|
91 | return [ignore, error, warning, info, log];
|
92 | }
|
93 | Severity.toArray = toArray;
|
94 | })(Severity = exports.Severity || (exports.Severity = {}));
|
95 |
|
\ | No newline at end of file |