@gratux/sdk 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/host.d.ts ADDED
@@ -0,0 +1,108 @@
1
+ import type { DocumentSelector, GratuxApi, WebviewViewProvider } from "./api-types";
2
+ /** Transport the host shim gives to the SDK. One instance per extension. */
3
+ export interface NativeTransport {
4
+ readonly extensionId: string;
5
+ /** Synchronous bridge call; throws an Error with `code` on failure. */
6
+ callSync(method: string, params?: Record<string, unknown>): unknown;
7
+ /** Asynchronous bridge call resolved by the Kotlin runtime. */
8
+ post(method: string, params?: Record<string, unknown>): Promise<unknown>;
9
+ log(level: "info" | "warn" | "error" | "debug" | "trace", message: string): void;
10
+ }
11
+ export interface ProviderRegistration {
12
+ id: number;
13
+ selector?: DocumentSelector;
14
+ provider: unknown;
15
+ triggerCharacters?: string[];
16
+ }
17
+ export interface WebviewViewRegistration {
18
+ provider: WebviewViewProvider;
19
+ }
20
+ /**
21
+ * Per-extension mutable state. It lives in the host shim, not in the SDK, so a
22
+ * re-loaded extension module starts clean and so the native dispatcher can see
23
+ * the registered command handlers.
24
+ */
25
+ export interface ExtensionState {
26
+ commands: Record<string, (...args: unknown[]) => unknown>;
27
+ providers: Record<string, ProviderRegistration[]>;
28
+ listeners: Record<string, Array<(payload: unknown) => void>>;
29
+ webviewViews: Record<string, WebviewViewRegistration>;
30
+ /** Latest document snapshot pushed by the native editor. */
31
+ document: DocumentSnapshot | undefined;
32
+ documentVersion: number;
33
+ diagnostics: Record<string, unknown[]>;
34
+ statusItems: Record<string, Record<string, unknown>>;
35
+ outputChannels: Record<string, string[]>;
36
+ storage: Record<string, unknown>;
37
+ }
38
+ export interface DocumentSnapshot {
39
+ uri: string;
40
+ path: string;
41
+ languageId: string;
42
+ text: string;
43
+ version: number;
44
+ dirty: boolean;
45
+ selections: Array<{
46
+ anchor: number;
47
+ head: number;
48
+ anchorLine: number;
49
+ anchorColumn: number;
50
+ headLine: number;
51
+ headColumn: number;
52
+ }>;
53
+ }
54
+ export interface HostBinding {
55
+ readonly extensionId: string;
56
+ readonly token: string;
57
+ readonly manifest: Record<string, unknown>;
58
+ readonly transport: NativeTransport;
59
+ readonly state: ExtensionState;
60
+ log(level: "info" | "warn" | "error" | "debug" | "trace", message: string): void;
61
+ }
62
+ export declare function createState(): ExtensionState;
63
+ export interface ProviderPayload {
64
+ uri: string;
65
+ path: string;
66
+ languageId: string;
67
+ text: string;
68
+ version: number;
69
+ line: number;
70
+ character: number;
71
+ offset: number;
72
+ selection?: {
73
+ start: number;
74
+ end: number;
75
+ };
76
+ range?: {
77
+ start: {
78
+ line: number;
79
+ character: number;
80
+ };
81
+ end: {
82
+ line: number;
83
+ character: number;
84
+ };
85
+ };
86
+ diagnostics?: unknown[];
87
+ triggerKind?: number;
88
+ triggerCharacter?: string;
89
+ tabSize?: number;
90
+ insertSpaces?: boolean;
91
+ query?: string;
92
+ }
93
+ /**
94
+ * Invoked by the host when the native side asks for language features.
95
+ * Providers return plain objects so the result survives the JSON bridge.
96
+ */
97
+ export declare function invokeProvider(registration: ProviderRegistration, type: string, payload: ProviderPayload): unknown;
98
+ export declare function normaliseProviderResults(type: string, results: unknown[]): unknown;
99
+ /**
100
+ * Minimal TextDocument implementation handed to providers. It is a snapshot:
101
+ * calling `save()` uses the real editor API through the binding transport.
102
+ */
103
+ export declare function buildDocument(payload: ProviderPayload): Record<string, unknown>;
104
+ /** Used by the host shim after deactivation to release provider/command closures. */
105
+ export declare function disposeAll(disposables: ReadonlyArray<{
106
+ dispose?: () => void;
107
+ }>): void;
108
+ export type { GratuxApi };
package/dist/host.js ADDED
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createState = createState;
4
+ exports.invokeProvider = invokeProvider;
5
+ exports.normaliseProviderResults = normaliseProviderResults;
6
+ exports.buildDocument = buildDocument;
7
+ exports.disposeAll = disposeAll;
8
+ function createState() {
9
+ return {
10
+ commands: Object.create(null),
11
+ providers: Object.create(null),
12
+ listeners: Object.create(null),
13
+ webviewViews: Object.create(null),
14
+ document: undefined,
15
+ documentVersion: 0,
16
+ diagnostics: Object.create(null),
17
+ statusItems: Object.create(null),
18
+ outputChannels: Object.create(null),
19
+ storage: Object.create(null),
20
+ };
21
+ }
22
+ /**
23
+ * Invoked by the host when the native side asks for language features.
24
+ * Providers return plain objects so the result survives the JSON bridge.
25
+ */
26
+ function invokeProvider(registration, type, payload) {
27
+ const provider = registration.provider;
28
+ const document = buildDocument(payload);
29
+ const position = { line: payload.line, character: payload.character };
30
+ const token = { isCancellationRequested: false, onCancellationRequested: () => ({ dispose() { } }) };
31
+ switch (type) {
32
+ case "completion": {
33
+ const fn = provider.provideCompletionItems;
34
+ if (typeof fn !== "function")
35
+ return undefined;
36
+ return fn.call(provider, document, position, token, {
37
+ triggerKind: payload.triggerKind ?? 0,
38
+ triggerCharacter: payload.triggerCharacter,
39
+ });
40
+ }
41
+ case "hover": {
42
+ const fn = provider.provideHover;
43
+ return typeof fn === "function" ? fn.call(provider, document, position, token) : undefined;
44
+ }
45
+ case "definition": {
46
+ const fn = provider.provideDefinition;
47
+ return typeof fn === "function" ? fn.call(provider, document, position, token) : undefined;
48
+ }
49
+ case "references": {
50
+ const fn = provider.provideReferences;
51
+ return typeof fn === "function" ? fn.call(provider, document, position, token) : undefined;
52
+ }
53
+ case "formatting": {
54
+ const fn = provider.provideDocumentFormattingEdits;
55
+ return typeof fn === "function"
56
+ ? fn.call(provider, document, { tabSize: payload.tabSize ?? 2, insertSpaces: payload.insertSpaces ?? true }, token)
57
+ : undefined;
58
+ }
59
+ case "codeActions": {
60
+ const fn = provider.provideCodeActions;
61
+ return typeof fn === "function"
62
+ ? fn.call(provider, document, payload.range ?? { start: position, end: position }, { diagnostics: payload.diagnostics ?? [] }, token)
63
+ : undefined;
64
+ }
65
+ case "symbols": {
66
+ const fn = provider.provideDocumentSymbols;
67
+ return typeof fn === "function" ? fn.call(provider, document, token) : undefined;
68
+ }
69
+ default:
70
+ return undefined;
71
+ }
72
+ }
73
+ function normaliseProviderResults(type, results) {
74
+ const flat = [];
75
+ for (const result of results) {
76
+ if (result == null)
77
+ continue;
78
+ if (Array.isArray(result))
79
+ flat.push(...result);
80
+ else if (type === "completion" && typeof result === "object" && Array.isArray(result.items)) {
81
+ flat.push(...(result.items ?? []));
82
+ }
83
+ else
84
+ flat.push(result);
85
+ }
86
+ return flat;
87
+ }
88
+ /**
89
+ * Minimal TextDocument implementation handed to providers. It is a snapshot:
90
+ * calling `save()` uses the real editor API through the binding transport.
91
+ */
92
+ function buildDocument(payload) {
93
+ const text = payload.text ?? "";
94
+ const lines = text.split("\n");
95
+ const uri = {
96
+ scheme: payload.uri.startsWith("file:") ? "file" : "gratux",
97
+ path: payload.path || payload.uri,
98
+ fsPath: payload.path || payload.uri,
99
+ toString: () => payload.uri,
100
+ };
101
+ const lineCount = lines.length;
102
+ const offsetAt = (position) => {
103
+ let line = 0;
104
+ let offset = 0;
105
+ while (line < position.line) {
106
+ const next = text.indexOf("\n", offset);
107
+ if (next < 0)
108
+ return text.length;
109
+ offset = next + 1;
110
+ line++;
111
+ }
112
+ const end = text.indexOf("\n", offset);
113
+ return Math.min(offset + Math.max(0, position.character), end < 0 ? text.length : end);
114
+ };
115
+ const positionAt = (offset) => {
116
+ let line = 0;
117
+ let last = 0;
118
+ for (let i = 0; i < Math.min(offset, text.length); i++) {
119
+ if (text.charCodeAt(i) === 10) {
120
+ line++;
121
+ last = i + 1;
122
+ }
123
+ }
124
+ return { line, character: Math.min(offset, text.length) - last };
125
+ };
126
+ const lineAt = (lineOrPosition) => {
127
+ const number = typeof lineOrPosition === "number" ? lineOrPosition : lineOrPosition.line;
128
+ const safe = Math.max(0, Math.min(number, lineCount - 1));
129
+ const value = lines[safe] ?? "";
130
+ return {
131
+ lineNumber: safe,
132
+ text: value,
133
+ range: {
134
+ start: { line: safe, character: 0 },
135
+ end: { line: safe, character: value.length },
136
+ },
137
+ firstNonWhitespaceCharacterIndex: value.length - value.trimStart().length,
138
+ isEmptyOrWhitespace: value.trim().length === 0,
139
+ };
140
+ };
141
+ return {
142
+ uri,
143
+ fileName: payload.path || payload.uri,
144
+ languageId: payload.languageId,
145
+ version: payload.version ?? 0,
146
+ isDirty: false,
147
+ isClosed: false,
148
+ lineCount,
149
+ eol: "\n",
150
+ getText: (range) => {
151
+ if (!range)
152
+ return text;
153
+ return text.slice(offsetAt(range.start), offsetAt(range.end));
154
+ },
155
+ lineAt,
156
+ offsetAt,
157
+ positionAt,
158
+ save: async () => true,
159
+ };
160
+ }
161
+ /** Used by the host shim after deactivation to release provider/command closures. */
162
+ function disposeAll(disposables) {
163
+ const copy = disposables.slice();
164
+ for (let i = copy.length - 1; i >= 0; i--) {
165
+ try {
166
+ copy[i]?.dispose?.();
167
+ }
168
+ catch {
169
+ /* ignore */
170
+ }
171
+ }
172
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * `@gratux/sdk` — public entry point for extension authors.
3
+ *
4
+ * At runtime the extension host injects the real implementation: build your
5
+ * extension as CommonJS and keep `@gratux/sdk` external, e.g.
6
+ *
7
+ * esbuild src/extension.ts --bundle --platform=node --format=cjs \
8
+ * --external:@gratux/sdk --outfile=dist/extension.js
9
+ *
10
+ * The `require('gratux')` and `require('@gratux/sdk')` calls then resolve to the
11
+ * host-provided API object. If the SDK is accidentally bundled, the stubs below
12
+ * throw a clear error instead of silently pretending to work.
13
+ */
14
+ export * from "./api-types";
15
+ export * from "./language-types";
16
+ export * from "./manifest";
17
+ export { EventEmitter, CancellationTokenSource, Position, Range, Selection, Uri, StatusBarAlignment, offsetAt, positionAt, dispose, disposeAll, } from "./types";
18
+ export { SDK_VERSION } from "./runtime";
19
+ export { createExtensionApi } from "./runtime";
20
+ import type { AiApi, AndroidApi, CommandsApi, ConfigApi, EditorApi, EnvApi, FileSystemApi, LanguagesApi, LspApi, NetworkApi, PermissionsApi, StorageApi, TerminalApi, WindowApi, WorkspaceApi } from "./api-types";
21
+ /** @deprecated Runtime value is injected by the host; use the injected API. */
22
+ export declare const commands: CommandsApi;
23
+ export declare const window: WindowApi;
24
+ export declare const workspace: WorkspaceApi;
25
+ export declare const fs: FileSystemApi;
26
+ export declare const editor: EditorApi;
27
+ export declare const languages: LanguagesApi;
28
+ export declare const lsp: LspApi;
29
+ export declare const terminal: TerminalApi;
30
+ export declare const network: NetworkApi;
31
+ export declare const storage: StorageApi;
32
+ export declare const config: ConfigApi;
33
+ export declare const android: AndroidApi;
34
+ export declare const ai: AiApi;
35
+ export declare const env: EnvApi;
36
+ export declare const permissions: PermissionsApi;
package/dist/index.js ADDED
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.permissions = exports.env = exports.ai = exports.android = exports.config = exports.storage = exports.network = exports.terminal = exports.lsp = exports.languages = exports.editor = exports.fs = exports.workspace = exports.window = exports.commands = exports.createExtensionApi = exports.SDK_VERSION = exports.disposeAll = exports.dispose = exports.positionAt = exports.offsetAt = exports.StatusBarAlignment = exports.Uri = exports.Selection = exports.Range = exports.Position = exports.CancellationTokenSource = exports.EventEmitter = void 0;
18
+ /**
19
+ * `@gratux/sdk` — public entry point for extension authors.
20
+ *
21
+ * At runtime the extension host injects the real implementation: build your
22
+ * extension as CommonJS and keep `@gratux/sdk` external, e.g.
23
+ *
24
+ * esbuild src/extension.ts --bundle --platform=node --format=cjs \
25
+ * --external:@gratux/sdk --outfile=dist/extension.js
26
+ *
27
+ * The `require('gratux')` and `require('@gratux/sdk')` calls then resolve to the
28
+ * host-provided API object. If the SDK is accidentally bundled, the stubs below
29
+ * throw a clear error instead of silently pretending to work.
30
+ */
31
+ __exportStar(require("./api-types"), exports);
32
+ __exportStar(require("./language-types"), exports);
33
+ __exportStar(require("./manifest"), exports);
34
+ var types_1 = require("./types");
35
+ Object.defineProperty(exports, "EventEmitter", { enumerable: true, get: function () { return types_1.EventEmitter; } });
36
+ Object.defineProperty(exports, "CancellationTokenSource", { enumerable: true, get: function () { return types_1.CancellationTokenSource; } });
37
+ Object.defineProperty(exports, "Position", { enumerable: true, get: function () { return types_1.Position; } });
38
+ Object.defineProperty(exports, "Range", { enumerable: true, get: function () { return types_1.Range; } });
39
+ Object.defineProperty(exports, "Selection", { enumerable: true, get: function () { return types_1.Selection; } });
40
+ Object.defineProperty(exports, "Uri", { enumerable: true, get: function () { return types_1.Uri; } });
41
+ Object.defineProperty(exports, "StatusBarAlignment", { enumerable: true, get: function () { return types_1.StatusBarAlignment; } });
42
+ Object.defineProperty(exports, "offsetAt", { enumerable: true, get: function () { return types_1.offsetAt; } });
43
+ Object.defineProperty(exports, "positionAt", { enumerable: true, get: function () { return types_1.positionAt; } });
44
+ Object.defineProperty(exports, "dispose", { enumerable: true, get: function () { return types_1.dispose; } });
45
+ Object.defineProperty(exports, "disposeAll", { enumerable: true, get: function () { return types_1.disposeAll; } });
46
+ var runtime_1 = require("./runtime");
47
+ Object.defineProperty(exports, "SDK_VERSION", { enumerable: true, get: function () { return runtime_1.SDK_VERSION; } });
48
+ // Host-internal exports. Extensions do not need these; they are exported so the
49
+ // app can build `extension-sdk.js` from the same sources (`host-entry.ts`).
50
+ var runtime_2 = require("./runtime");
51
+ Object.defineProperty(exports, "createExtensionApi", { enumerable: true, get: function () { return runtime_2.createExtensionApi; } });
52
+ function hostProvided(name) {
53
+ const message = `[@gratux/sdk] '${name}' is provided by the Gratux extension host. ` +
54
+ `Bundle extensions with '@gratux/sdk' marked as external so require('@gratux/sdk') ` +
55
+ `resolves to the host API (see the Gratux extension guide).`;
56
+ const target = {};
57
+ return new Proxy(target, {
58
+ get() {
59
+ throw new Error(message);
60
+ },
61
+ apply() {
62
+ throw new Error(message);
63
+ },
64
+ });
65
+ }
66
+ /** @deprecated Runtime value is injected by the host; use the injected API. */
67
+ exports.commands = hostProvided("commands");
68
+ exports.window = hostProvided("window");
69
+ exports.workspace = hostProvided("workspace");
70
+ exports.fs = hostProvided("fs");
71
+ exports.editor = hostProvided("editor");
72
+ exports.languages = hostProvided("languages");
73
+ exports.lsp = hostProvided("lsp");
74
+ exports.terminal = hostProvided("terminal");
75
+ exports.network = hostProvided("network");
76
+ exports.storage = hostProvided("storage");
77
+ exports.config = hostProvided("config");
78
+ exports.android = hostProvided("android");
79
+ exports.ai = hostProvided("ai");
80
+ exports.env = hostProvided("env");
81
+ exports.permissions = hostProvided("permissions");
@@ -0,0 +1,135 @@
1
+ import type { Range, RangeLike, Selection, TextEdit, Uri } from "./types";
2
+ export interface TextLine {
3
+ readonly lineNumber: number;
4
+ readonly text: string;
5
+ readonly range: Range;
6
+ readonly firstNonWhitespaceCharacterIndex: number;
7
+ readonly isEmptyOrWhitespace: boolean;
8
+ }
9
+ export interface TextDocument {
10
+ readonly uri: Uri;
11
+ readonly fileName: string;
12
+ readonly languageId: string;
13
+ readonly version: number;
14
+ readonly isDirty: boolean;
15
+ readonly isClosed: boolean;
16
+ readonly lineCount: number;
17
+ readonly eol: "\n" | "\r\n";
18
+ getText(range?: RangeLike): string;
19
+ lineAt(lineOrPosition: number | {
20
+ line: number;
21
+ character: number;
22
+ }): TextLine;
23
+ offsetAt(position: {
24
+ line: number;
25
+ character: number;
26
+ }): number;
27
+ positionAt(offset: number): {
28
+ line: number;
29
+ character: number;
30
+ };
31
+ save(): Promise<boolean>;
32
+ }
33
+ export interface TextEditorState {
34
+ readonly document: TextDocument;
35
+ readonly selection: Selection;
36
+ readonly selections: Selection[];
37
+ readonly visibleRanges: Range[];
38
+ }
39
+ export interface TextDocumentChangeEvent {
40
+ readonly document: TextDocument;
41
+ readonly contentChanges: {
42
+ range: RangeLike;
43
+ text: string;
44
+ }[];
45
+ }
46
+ export interface CompletionContext {
47
+ readonly triggerKind: 0 | 1 | 2;
48
+ readonly triggerCharacter?: string;
49
+ }
50
+ export declare enum CompletionItemKind {
51
+ Text = 0,
52
+ Method = 1,
53
+ Function = 2,
54
+ Constructor = 3,
55
+ Field = 4,
56
+ Variable = 5,
57
+ Class = 6,
58
+ Interface = 7,
59
+ Module = 8,
60
+ Property = 9,
61
+ Unit = 10,
62
+ Value = 11,
63
+ Enum = 12,
64
+ Keyword = 13,
65
+ Snippet = 14,
66
+ Color = 15,
67
+ File = 16,
68
+ Reference = 17,
69
+ Folder = 18,
70
+ EnumMember = 19,
71
+ Constant = 20,
72
+ Struct = 21,
73
+ Event = 22,
74
+ Operator = 23,
75
+ TypeParameter = 24
76
+ }
77
+ export interface CompletionItem {
78
+ label: string;
79
+ kind?: CompletionItemKind | number;
80
+ detail?: string;
81
+ documentation?: string | {
82
+ kind: "plaintext" | "markdown";
83
+ value: string;
84
+ };
85
+ insertText?: string;
86
+ filterText?: string;
87
+ sortText?: string;
88
+ range?: RangeLike;
89
+ additionalTextEdits?: TextEdit[];
90
+ }
91
+ export interface CompletionList {
92
+ isIncomplete?: boolean;
93
+ items: CompletionItem[];
94
+ }
95
+ export interface Hover {
96
+ contents: string | {
97
+ kind: "plaintext" | "markdown";
98
+ value: string;
99
+ } | Array<string | {
100
+ kind: "plaintext" | "markdown";
101
+ value: string;
102
+ }>;
103
+ range?: RangeLike;
104
+ }
105
+ export interface Location {
106
+ uri: string;
107
+ range: RangeLike;
108
+ }
109
+ export declare enum DiagnosticSeverity {
110
+ Error = 0,
111
+ Warning = 1,
112
+ Information = 2,
113
+ Hint = 3
114
+ }
115
+ export interface Diagnostic {
116
+ range: RangeLike;
117
+ message: string;
118
+ severity?: DiagnosticSeverity | number;
119
+ source?: string;
120
+ code?: string | number;
121
+ }
122
+ export interface DocumentSymbol {
123
+ name: string;
124
+ detail?: string;
125
+ kind: number;
126
+ range: RangeLike;
127
+ selectionRange?: RangeLike;
128
+ children?: DocumentSymbol[];
129
+ }
130
+ export type ProviderResult<T> = T | undefined | null | Promise<T | undefined | null>;
131
+ export interface CodeLens {
132
+ range: RangeLike;
133
+ title: string;
134
+ command?: string;
135
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiagnosticSeverity = exports.CompletionItemKind = void 0;
4
+ var CompletionItemKind;
5
+ (function (CompletionItemKind) {
6
+ CompletionItemKind[CompletionItemKind["Text"] = 0] = "Text";
7
+ CompletionItemKind[CompletionItemKind["Method"] = 1] = "Method";
8
+ CompletionItemKind[CompletionItemKind["Function"] = 2] = "Function";
9
+ CompletionItemKind[CompletionItemKind["Constructor"] = 3] = "Constructor";
10
+ CompletionItemKind[CompletionItemKind["Field"] = 4] = "Field";
11
+ CompletionItemKind[CompletionItemKind["Variable"] = 5] = "Variable";
12
+ CompletionItemKind[CompletionItemKind["Class"] = 6] = "Class";
13
+ CompletionItemKind[CompletionItemKind["Interface"] = 7] = "Interface";
14
+ CompletionItemKind[CompletionItemKind["Module"] = 8] = "Module";
15
+ CompletionItemKind[CompletionItemKind["Property"] = 9] = "Property";
16
+ CompletionItemKind[CompletionItemKind["Unit"] = 10] = "Unit";
17
+ CompletionItemKind[CompletionItemKind["Value"] = 11] = "Value";
18
+ CompletionItemKind[CompletionItemKind["Enum"] = 12] = "Enum";
19
+ CompletionItemKind[CompletionItemKind["Keyword"] = 13] = "Keyword";
20
+ CompletionItemKind[CompletionItemKind["Snippet"] = 14] = "Snippet";
21
+ CompletionItemKind[CompletionItemKind["Color"] = 15] = "Color";
22
+ CompletionItemKind[CompletionItemKind["File"] = 16] = "File";
23
+ CompletionItemKind[CompletionItemKind["Reference"] = 17] = "Reference";
24
+ CompletionItemKind[CompletionItemKind["Folder"] = 18] = "Folder";
25
+ CompletionItemKind[CompletionItemKind["EnumMember"] = 19] = "EnumMember";
26
+ CompletionItemKind[CompletionItemKind["Constant"] = 20] = "Constant";
27
+ CompletionItemKind[CompletionItemKind["Struct"] = 21] = "Struct";
28
+ CompletionItemKind[CompletionItemKind["Event"] = 22] = "Event";
29
+ CompletionItemKind[CompletionItemKind["Operator"] = 23] = "Operator";
30
+ CompletionItemKind[CompletionItemKind["TypeParameter"] = 24] = "TypeParameter";
31
+ })(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {}));
32
+ var DiagnosticSeverity;
33
+ (function (DiagnosticSeverity) {
34
+ DiagnosticSeverity[DiagnosticSeverity["Error"] = 0] = "Error";
35
+ DiagnosticSeverity[DiagnosticSeverity["Warning"] = 1] = "Warning";
36
+ DiagnosticSeverity[DiagnosticSeverity["Information"] = 2] = "Information";
37
+ DiagnosticSeverity[DiagnosticSeverity["Hint"] = 3] = "Hint";
38
+ })(DiagnosticSeverity || (exports.DiagnosticSeverity = DiagnosticSeverity = {}));