@theia/ai-code-completion 1.67.0-next.3 → 1.67.0-next.56
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/README.md +1 -0
- package/package.json +7 -7
- package/lib/browser/ai-code-completion-frontend-module.d.ts +0 -4
- package/lib/browser/ai-code-completion-frontend-module.d.ts.map +0 -1
- package/lib/browser/ai-code-completion-frontend-module.js +0 -40
- package/lib/browser/ai-code-completion-frontend-module.js.map +0 -1
- package/lib/browser/ai-code-frontend-application-contribution.d.ts +0 -17
- package/lib/browser/ai-code-frontend-application-contribution.d.ts.map +0 -1
- package/lib/browser/ai-code-frontend-application-contribution.js +0 -135
- package/lib/browser/ai-code-frontend-application-contribution.js.map +0 -1
- package/lib/browser/ai-code-inline-completion-provider.d.ts +0 -9
- package/lib/browser/ai-code-inline-completion-provider.d.ts.map +0 -1
- package/lib/browser/ai-code-inline-completion-provider.js +0 -46
- package/lib/browser/ai-code-inline-completion-provider.js.map +0 -1
- package/lib/browser/code-completion-agent.d.ts +0 -27
- package/lib/browser/code-completion-agent.d.ts.map +0 -1
- package/lib/browser/code-completion-agent.js +0 -148
- package/lib/browser/code-completion-agent.js.map +0 -1
- package/lib/browser/code-completion-cache.d.ts +0 -49
- package/lib/browser/code-completion-cache.d.ts.map +0 -1
- package/lib/browser/code-completion-cache.js +0 -135
- package/lib/browser/code-completion-cache.js.map +0 -1
- package/lib/browser/code-completion-debouncer.d.ts +0 -5
- package/lib/browser/code-completion-debouncer.d.ts.map +0 -1
- package/lib/browser/code-completion-debouncer.js +0 -35
- package/lib/browser/code-completion-debouncer.js.map +0 -1
- package/lib/browser/code-completion-postprocessor.d.ts +0 -11
- package/lib/browser/code-completion-postprocessor.d.ts.map +0 -1
- package/lib/browser/code-completion-postprocessor.js +0 -49
- package/lib/browser/code-completion-postprocessor.js.map +0 -1
- package/lib/browser/code-completion-postprocessor.spec.d.ts +0 -2
- package/lib/browser/code-completion-postprocessor.spec.d.ts.map +0 -1
- package/lib/browser/code-completion-postprocessor.spec.js +0 -73
- package/lib/browser/code-completion-postprocessor.spec.js.map +0 -1
- package/lib/browser/code-completion-prompt-template.d.ts +0 -3
- package/lib/browser/code-completion-prompt-template.d.ts.map +0 -1
- package/lib/browser/code-completion-prompt-template.js +0 -82
- package/lib/browser/code-completion-prompt-template.js.map +0 -1
- package/lib/browser/code-completion-variable-context.d.ts +0 -11
- package/lib/browser/code-completion-variable-context.d.ts.map +0 -1
- package/lib/browser/code-completion-variable-context.js +0 -26
- package/lib/browser/code-completion-variable-context.js.map +0 -1
- package/lib/browser/code-completion-variable-contribution.d.ts +0 -15
- package/lib/browser/code-completion-variable-contribution.d.ts.map +0 -1
- package/lib/browser/code-completion-variable-contribution.js +0 -127
- package/lib/browser/code-completion-variable-contribution.js.map +0 -1
- package/lib/browser/code-completion-variable-contribution.spec.d.ts +0 -2
- package/lib/browser/code-completion-variable-contribution.spec.d.ts.map +0 -1
- package/lib/browser/code-completion-variable-contribution.spec.js +0 -143
- package/lib/browser/code-completion-variable-contribution.spec.js.map +0 -1
- package/lib/browser/code-completion-variables.d.ts +0 -6
- package/lib/browser/code-completion-variables.d.ts.map +0 -1
- package/lib/browser/code-completion-variables.js +0 -40
- package/lib/browser/code-completion-variables.js.map +0 -1
- package/lib/common/ai-code-completion-preference.d.ts +0 -9
- package/lib/common/ai-code-completion-preference.d.ts.map +0 -1
- package/lib/common/ai-code-completion-preference.js +0 -78
- package/lib/common/ai-code-completion-preference.js.map +0 -1
- package/lib/node/ai-code-completion-backend-module.d.ts +0 -4
- package/lib/node/ai-code-completion-backend-module.d.ts.map +0 -1
- package/lib/node/ai-code-completion-backend-module.js +0 -24
- package/lib/node/ai-code-completion-backend-module.js.map +0 -1
- package/lib/package.spec.d.ts +0 -1
- package/lib/package.spec.d.ts.map +0 -1
- package/lib/package.spec.js +0 -26
- package/lib/package.spec.js.map +0 -1
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var CodeCompletionCache_1;
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.CodeCompletionCache = void 0;
|
|
20
|
-
const tslib_1 = require("tslib");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const monaco = require("@theia/monaco-editor-core");
|
|
23
|
-
let CodeCompletionCache = CodeCompletionCache_1 = class CodeCompletionCache {
|
|
24
|
-
constructor() {
|
|
25
|
-
this.maxSize = 100;
|
|
26
|
-
this.cache = new Map();
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Generate a unique cache key for code completion based on the file path, cursor position, and the hashed context (prefix and suffix).
|
|
30
|
-
* The prefix and suffix are hashed to avoid storing large or sensitive content directly in the cache key.
|
|
31
|
-
*
|
|
32
|
-
* @param filePath Path of the current file
|
|
33
|
-
* @param model Monaco text model of the file
|
|
34
|
-
* @param position Current cursor position in the editor
|
|
35
|
-
* @returns Unique cache key as a string
|
|
36
|
-
*/
|
|
37
|
-
generateKey(filePath, model, position) {
|
|
38
|
-
const lineNumber = position.lineNumber;
|
|
39
|
-
const prefixRange = new monaco.Range(1, 1, position.lineNumber, position.column);
|
|
40
|
-
const prefix = model.getValueInRange(prefixRange);
|
|
41
|
-
const lastLine = model.getLineCount();
|
|
42
|
-
const lastColumn = model.getLineMaxColumn(lastLine);
|
|
43
|
-
const suffixRange = new monaco.Range(position.lineNumber, position.column, lastLine, lastColumn);
|
|
44
|
-
const suffix = model.getValueInRange(suffixRange);
|
|
45
|
-
const key = JSON.stringify({
|
|
46
|
-
filePath,
|
|
47
|
-
lineNumber,
|
|
48
|
-
prefixHash: CodeCompletionCache_1.hashString(prefix),
|
|
49
|
-
suffixHash: CodeCompletionCache_1.hashString(suffix)
|
|
50
|
-
});
|
|
51
|
-
return key;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Hash a string using a simple hash algorithm (FNV-1a 32-bit).
|
|
55
|
-
* This is not cryptographically secure but is sufficient for cache key uniqueness.
|
|
56
|
-
* @param str The string to hash
|
|
57
|
-
* @returns The hash as a hex string
|
|
58
|
-
*/
|
|
59
|
-
static hashString(str) {
|
|
60
|
-
let hash = 0x811c9dc5;
|
|
61
|
-
for (let i = 0; i < str.length; i++) {
|
|
62
|
-
hash ^= str.charCodeAt(i);
|
|
63
|
-
hash = (hash * 0x01000193) >>> 0;
|
|
64
|
-
}
|
|
65
|
-
return hash.toString(16);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Get a cached completion if available
|
|
69
|
-
* @param key Cache key
|
|
70
|
-
* @returns Cached completion or undefined
|
|
71
|
-
*/
|
|
72
|
-
get(key) {
|
|
73
|
-
const entry = this.cache.get(key);
|
|
74
|
-
if (entry) {
|
|
75
|
-
// Update the entry's last accessed time
|
|
76
|
-
entry.lastAccessed = Date.now();
|
|
77
|
-
return entry.value;
|
|
78
|
-
}
|
|
79
|
-
return undefined;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Store a completion in the cache
|
|
83
|
-
* @param key Cache key
|
|
84
|
-
* @param value Completion value to cache
|
|
85
|
-
*/
|
|
86
|
-
put(key, value) {
|
|
87
|
-
// If cache is full, remove the least recently used entry
|
|
88
|
-
if (this.cache.size >= this.maxSize) {
|
|
89
|
-
this.removeLeastRecentlyUsed();
|
|
90
|
-
}
|
|
91
|
-
this.cache.set(key, {
|
|
92
|
-
value,
|
|
93
|
-
lastAccessed: Date.now()
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Clear the entire cache
|
|
98
|
-
*/
|
|
99
|
-
clear() {
|
|
100
|
-
this.cache.clear();
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Remove the least recently used entry from the cache
|
|
104
|
-
*/
|
|
105
|
-
removeLeastRecentlyUsed() {
|
|
106
|
-
let oldestKey;
|
|
107
|
-
let oldestTime = Infinity;
|
|
108
|
-
for (const [key, entry] of this.cache.entries()) {
|
|
109
|
-
if (entry.lastAccessed < oldestTime) {
|
|
110
|
-
oldestKey = key;
|
|
111
|
-
oldestTime = entry.lastAccessed;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (oldestKey) {
|
|
115
|
-
this.cache.delete(oldestKey);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Set the maximum cache size
|
|
120
|
-
* @param size New maximum cache size
|
|
121
|
-
*/
|
|
122
|
-
setMaxSize(size) {
|
|
123
|
-
this.maxSize = size;
|
|
124
|
-
// Trim cache if it exceeds new size
|
|
125
|
-
while (this.cache.size > this.maxSize) {
|
|
126
|
-
this.removeLeastRecentlyUsed();
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
exports.CodeCompletionCache = CodeCompletionCache;
|
|
131
|
-
exports.CodeCompletionCache = CodeCompletionCache = CodeCompletionCache_1 = tslib_1.__decorate([
|
|
132
|
-
(0, inversify_1.injectable)(),
|
|
133
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
134
|
-
], CodeCompletionCache);
|
|
135
|
-
//# sourceMappingURL=code-completion-cache.js.map
|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,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACK,uBAAuB;QAC3B,IAAI,SAA6B,CAAC;QAClC,IAAI,UAAU,GAAG,QAAQ,CAAC;QAE1B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YAC9C,IAAI,KAAK,CAAC,YAAY,GAAG,UAAU,EAAE,CAAC;gBAClC,SAAS,GAAG,GAAG,CAAC;gBAChB,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC;YACpC,CAAC;QACL,CAAC;QAED,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,IAAY;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,oCAAoC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YACpC,IAAI,CAAC,uBAAuB,EAAE,CAAC;QACnC,CAAC;IACL,CAAC;CACJ,CAAA;AAtHY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;;GACA,mBAAmB,CAsH/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-debouncer.d.ts","sourceRoot":"","sources":["../../src/browser/code-completion-debouncer.ts"],"names":[],"mappings":"AAgBA,qBAAa,yBAAyB;IAElC,OAAO,CAAC,SAAS,CAAC,CAAS;IAE3B,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAc7E"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.InlineCompletionDebouncer = void 0;
|
|
19
|
-
class InlineCompletionDebouncer {
|
|
20
|
-
debounce(callback, debounceDelay) {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
if (this.timeoutId) {
|
|
23
|
-
window.clearTimeout(this.timeoutId);
|
|
24
|
-
}
|
|
25
|
-
this.timeoutId = window.setTimeout(() => {
|
|
26
|
-
callback()
|
|
27
|
-
.then(resolve)
|
|
28
|
-
.catch(reject);
|
|
29
|
-
this.timeoutId = undefined;
|
|
30
|
-
}, debounceDelay);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.InlineCompletionDebouncer = InlineCompletionDebouncer;
|
|
35
|
-
//# sourceMappingURL=code-completion-debouncer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-debouncer.js","sourceRoot":"","sources":["../../src/browser/code-completion-debouncer.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,MAAa,yBAAyB;IAIlC,QAAQ,CAAI,QAA0B,EAAE,aAAqB;QACzD,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBACjB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACxC,CAAC;YAED,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;gBACpC,QAAQ,EAAE;qBACL,IAAI,CAAC,OAAO,CAAC;qBACb,KAAK,CAAC,MAAM,CAAC,CAAC;gBACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC/B,CAAC,EAAE,aAAa,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAlBD,8DAkBC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PreferenceService } from '@theia/core/lib/common';
|
|
2
|
-
export interface CodeCompletionPostProcessor {
|
|
3
|
-
postProcess(text: string): string;
|
|
4
|
-
}
|
|
5
|
-
export declare const CodeCompletionPostProcessor: unique symbol;
|
|
6
|
-
export declare class DefaultCodeCompletionPostProcessor {
|
|
7
|
-
protected readonly preferenceService: PreferenceService;
|
|
8
|
-
postProcess(text: string): string;
|
|
9
|
-
stripBackticks(text: string): string;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=code-completion-postprocessor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-postprocessor.d.ts","sourceRoot":"","sources":["../../src/browser/code-completion-postprocessor.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,MAAM,WAAW,2BAA2B;IACxC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AACD,eAAO,MAAM,2BAA2B,eAAwC,CAAC;AAEjF,qBACa,kCAAkC;IAG3C,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAEjD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAOjC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAS9C"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.DefaultCodeCompletionPostProcessor = exports.CodeCompletionPostProcessor = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const common_1 = require("@theia/core/lib/common");
|
|
22
|
-
const ai_code_completion_preference_1 = require("../common/ai-code-completion-preference");
|
|
23
|
-
exports.CodeCompletionPostProcessor = Symbol('CodeCompletionPostProcessor');
|
|
24
|
-
let DefaultCodeCompletionPostProcessor = class DefaultCodeCompletionPostProcessor {
|
|
25
|
-
postProcess(text) {
|
|
26
|
-
if (this.preferenceService.get(ai_code_completion_preference_1.PREF_AI_INLINE_COMPLETION_STRIP_BACKTICKS, true)) {
|
|
27
|
-
return this.stripBackticks(text);
|
|
28
|
-
}
|
|
29
|
-
return text;
|
|
30
|
-
}
|
|
31
|
-
stripBackticks(text) {
|
|
32
|
-
if (text.startsWith('```')) {
|
|
33
|
-
// Remove the first backticks and any language identifier
|
|
34
|
-
const startRemoved = text.slice(3).replace(/^\w*\n/, '');
|
|
35
|
-
const lastBacktickIndex = startRemoved.lastIndexOf('```');
|
|
36
|
-
return lastBacktickIndex !== -1 ? startRemoved.slice(0, lastBacktickIndex).trim() : startRemoved.trim();
|
|
37
|
-
}
|
|
38
|
-
return text;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
exports.DefaultCodeCompletionPostProcessor = DefaultCodeCompletionPostProcessor;
|
|
42
|
-
tslib_1.__decorate([
|
|
43
|
-
(0, inversify_1.inject)(common_1.PreferenceService),
|
|
44
|
-
tslib_1.__metadata("design:type", Object)
|
|
45
|
-
], DefaultCodeCompletionPostProcessor.prototype, "preferenceService", void 0);
|
|
46
|
-
exports.DefaultCodeCompletionPostProcessor = DefaultCodeCompletionPostProcessor = tslib_1.__decorate([
|
|
47
|
-
(0, inversify_1.injectable)()
|
|
48
|
-
], DefaultCodeCompletionPostProcessor);
|
|
49
|
-
//# sourceMappingURL=code-completion-postprocessor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-postprocessor.js","sourceRoot":"","sources":["../../src/browser/code-completion-postprocessor.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAClE,mDAA2D;AAC3D,2FAAoG;AAKvF,QAAA,2BAA2B,GAAG,MAAM,CAAC,6BAA6B,CAAC,CAAC;AAG1E,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAKpC,WAAW,CAAC,IAAY;QAC3B,IAAI,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAU,yEAAyC,EAAE,IAAI,CAAC,EAAE,CAAC;YACvF,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,cAAc,CAAC,IAAY;QAC9B,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,yDAAyD;YACzD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACzD,MAAM,iBAAiB,GAAG,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAC1D,OAAO,iBAAiB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QAC5G,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AArBY,gFAAkC;AAGxB;IADlB,IAAA,kBAAM,EAAC,0BAAiB,CAAC;;6EAC8B;6CAH/C,kCAAkC;IAD9C,IAAA,sBAAU,GAAE;GACA,kCAAkC,CAqB9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-postprocessor.spec.d.ts","sourceRoot":"","sources":["../../src/browser/code-completion-postprocessor.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
|
|
19
|
-
let disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
20
|
-
const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
|
|
21
|
-
frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
|
|
22
|
-
const chai_1 = require("chai");
|
|
23
|
-
const code_completion_postprocessor_1 = require("./code-completion-postprocessor");
|
|
24
|
-
disableJSDOM();
|
|
25
|
-
describe('CodeCompletionAgentImpl', () => {
|
|
26
|
-
let codeCompletionProcessor;
|
|
27
|
-
before(() => {
|
|
28
|
-
disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
29
|
-
codeCompletionProcessor = new code_completion_postprocessor_1.DefaultCodeCompletionPostProcessor();
|
|
30
|
-
});
|
|
31
|
-
after(() => {
|
|
32
|
-
// Disable JSDOM after all tests
|
|
33
|
-
disableJSDOM();
|
|
34
|
-
});
|
|
35
|
-
describe('stripBackticks', () => {
|
|
36
|
-
it('should remove surrounding backticks and language (TypeScript)', () => {
|
|
37
|
-
const input = '```TypeScript\nconsole.log(\"Hello, World!\");```';
|
|
38
|
-
const output = codeCompletionProcessor.stripBackticks(input);
|
|
39
|
-
(0, chai_1.expect)(output).to.equal('console.log("Hello, World!");');
|
|
40
|
-
});
|
|
41
|
-
it('should remove surrounding backticks and language (md)', () => {
|
|
42
|
-
const input = '```md\nconsole.log(\"Hello, World!\");```';
|
|
43
|
-
const output = codeCompletionProcessor.stripBackticks(input);
|
|
44
|
-
(0, chai_1.expect)(output).to.equal('console.log("Hello, World!");');
|
|
45
|
-
});
|
|
46
|
-
it('should remove all text after second occurrence of backticks', () => {
|
|
47
|
-
const input = '```js\nlet x = 10;\n```\nTrailing text should be removed';
|
|
48
|
-
const output = codeCompletionProcessor.stripBackticks(input);
|
|
49
|
-
(0, chai_1.expect)(output).to.equal('let x = 10;');
|
|
50
|
-
});
|
|
51
|
-
it('should return the text unchanged if no surrounding backticks', () => {
|
|
52
|
-
const input = 'console.log(\"Hello, World!\");';
|
|
53
|
-
const output = codeCompletionProcessor.stripBackticks(input);
|
|
54
|
-
(0, chai_1.expect)(output).to.equal('console.log("Hello, World!");');
|
|
55
|
-
});
|
|
56
|
-
it('should remove surrounding backticks without language', () => {
|
|
57
|
-
const input = '```\nconsole.log(\"Hello, World!\");```';
|
|
58
|
-
const output = codeCompletionProcessor.stripBackticks(input);
|
|
59
|
-
(0, chai_1.expect)(output).to.equal('console.log("Hello, World!");');
|
|
60
|
-
});
|
|
61
|
-
it('should handle text starting with backticks but no second delimiter', () => {
|
|
62
|
-
const input = '```python\nprint(\"Hello, World!\")';
|
|
63
|
-
const output = codeCompletionProcessor.stripBackticks(input);
|
|
64
|
-
(0, chai_1.expect)(output).to.equal('print("Hello, World!")');
|
|
65
|
-
});
|
|
66
|
-
it('should handle multiple internal backticks correctly', () => {
|
|
67
|
-
const input = '```\nFoo```Bar```FooBar```';
|
|
68
|
-
const output = codeCompletionProcessor.stripBackticks(input);
|
|
69
|
-
(0, chai_1.expect)(output).to.equal('Foo```Bar```FooBar');
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=code-completion-postprocessor.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-postprocessor.spec.js","sourceRoot":"","sources":["../../src/browser/code-completion-postprocessor.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,8DAAiE;AACjE,IAAI,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC;AACjC,uHAAiH;AACjH,wEAAiC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAE1C,+BAA8B;AAC9B,mFAAqF;AAErF,YAAY,EAAE,CAAC;AAEf,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACrC,IAAI,uBAA2D,CAAC;IAChE,MAAM,CAAC,GAAG,EAAE;QACR,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC;QAC7B,uBAAuB,GAAG,IAAI,kEAAkC,EAAE,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,GAAG,EAAE;QACP,gCAAgC;QAChC,YAAY,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAE5B,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;YACrE,MAAM,KAAK,GAAG,mDAAmD,CAAC;YAClE,MAAM,MAAM,GAAG,uBAAuB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YAC7D,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;YAC7D,MAAM,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AAC,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;YAC3D,MAAM,KAAK,GAAG,4BAA4B,CAAC;YAC3C,MAAM,MAAM,GAAG,uBAAuB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YAC7D,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IAEP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-prompt-template.d.ts","sourceRoot":"","sources":["../../src/browser/code-completion-prompt-template.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,EAkEnD,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/tslint/config */
|
|
3
|
-
// *****************************************************************************
|
|
4
|
-
// Copyright (C) 2025 EclipseSource GmbH and others.
|
|
5
|
-
//
|
|
6
|
-
// This file is licensed under the MIT License.
|
|
7
|
-
// See LICENSE-MIT.txt in the project root for license information.
|
|
8
|
-
// https://opensource.org/license/mit.
|
|
9
|
-
//
|
|
10
|
-
// SPDX-License-Identifier: MIT
|
|
11
|
-
// *****************************************************************************
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.codeCompletionPrompts = void 0;
|
|
14
|
-
const code_completion_variables_1 = require("./code-completion-variables");
|
|
15
|
-
exports.codeCompletionPrompts = [{
|
|
16
|
-
id: 'code-completion-system',
|
|
17
|
-
variants: [{
|
|
18
|
-
id: 'code-completion-system-previous',
|
|
19
|
-
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
20
|
-
Made improvements or adaptations to this prompt template? We’d love for you to share it with the community! Contribute back here:
|
|
21
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
22
|
-
You are a code completion agent. The current file you have to complete is named {{${code_completion_variables_1.FILE.id}}}.
|
|
23
|
-
The language of the file is {{${code_completion_variables_1.LANGUAGE.id}}}. Return your result as plain text without markdown formatting.
|
|
24
|
-
Finish the following code snippet.
|
|
25
|
-
|
|
26
|
-
{{${code_completion_variables_1.PREFIX.id}}}[[MARKER]]{{${code_completion_variables_1.SUFFIX.id}}}
|
|
27
|
-
|
|
28
|
-
Only return the exact replacement for [[MARKER]] to complete the snippet.`
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: 'code-completion-system-next',
|
|
32
|
-
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
33
|
-
Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
|
|
34
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
35
|
-
# System Role
|
|
36
|
-
You are an expert AI code completion assistant focused on generating precise, contextually appropriate code snippets.
|
|
37
|
-
|
|
38
|
-
## Code Context
|
|
39
|
-
\`\`\`
|
|
40
|
-
{{${code_completion_variables_1.PREFIX.id}}}[[MARKER]]{{${code_completion_variables_1.SUFFIX.id}}}
|
|
41
|
-
\`\`\`
|
|
42
|
-
|
|
43
|
-
## Metadata
|
|
44
|
-
- File: {{${code_completion_variables_1.FILE.id}}}
|
|
45
|
-
- Programming Language: {{${code_completion_variables_1.LANGUAGE.id}}}
|
|
46
|
-
- Project Context: {{prompt:project-info}}
|
|
47
|
-
|
|
48
|
-
# Completion Guidelines
|
|
49
|
-
1. Analyze the surrounding code context carefully.
|
|
50
|
-
2. Generate ONLY the code that should replace [[MARKER]].
|
|
51
|
-
3. Ensure the completion:
|
|
52
|
-
- Maintains the exact syntax of the surrounding code
|
|
53
|
-
- Follows best practices for the specific programming language
|
|
54
|
-
- Completes the code snippet logically and efficiently
|
|
55
|
-
4. Do NOT include any explanatory text, comments, or additional instructions.
|
|
56
|
-
5. Return ONLY the raw code replacement.
|
|
57
|
-
|
|
58
|
-
# Constraints
|
|
59
|
-
- Return strictly the code for [[MARKER]]
|
|
60
|
-
- Match indentation and style of surrounding code
|
|
61
|
-
- Prioritize readability and maintainability
|
|
62
|
-
- Consider language-specific idioms and patterns`
|
|
63
|
-
}],
|
|
64
|
-
defaultVariant: {
|
|
65
|
-
id: 'code-completion-system-default',
|
|
66
|
-
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
67
|
-
Made improvements or adaptations to this prompt template? We’d love for you to share it with the community! Contribute back here:
|
|
68
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
69
|
-
## Code snippet
|
|
70
|
-
\`\`\`
|
|
71
|
-
{{${code_completion_variables_1.PREFIX.id}}}[[MARKER]]{{${code_completion_variables_1.SUFFIX.id}}}
|
|
72
|
-
\`\`\`
|
|
73
|
-
|
|
74
|
-
## Meta Data
|
|
75
|
-
- File: {{${code_completion_variables_1.FILE.id}}}
|
|
76
|
-
- Language: {{${code_completion_variables_1.LANGUAGE.id}}}
|
|
77
|
-
|
|
78
|
-
Replace [[MARKER]] with the exact code to complete the code snippet. Return only the replacement of [[MARKER]] as plain text.`,
|
|
79
|
-
},
|
|
80
|
-
}
|
|
81
|
-
];
|
|
82
|
-
//# sourceMappingURL=code-completion-prompt-template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-prompt-template.js","sourceRoot":"","sources":["../../src/browser/code-completion-prompt-template.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,+CAA+C;AAC/C,mEAAmE;AACnE,sCAAsC;AACtC,EAAE;AACF,+BAA+B;AAC/B,gFAAgF;;;AAGhF,2EAA6E;AAEhE,QAAA,qBAAqB,GAAuB,CAAC;QACtD,EAAE,EAAE,wBAAwB;QAC5B,QAAQ,EAAE,CAAC;gBACP,EAAE,EAAE,iCAAiC;gBACrC,QAAQ,EAAE;;;oFAGkE,gCAAI,CAAC,EAAE;gCAC3D,oCAAQ,CAAC,EAAE;;;IAGvC,kCAAM,CAAC,EAAE,iBAAiB,kCAAM,CAAC,EAAE;;0EAEmC;aACrE;YACD;gBACI,EAAE,EAAE,6BAA6B;gBACjC,QAAQ,EAAE;;;;;;;;IAQd,kCAAM,CAAC,EAAE,iBAAiB,kCAAM,CAAC,EAAE;;;;YAI3B,gCAAI,CAAC,EAAE;4BACS,oCAAQ,CAAC,EAAE;;;;;;;;;;;;;;;;;iDAiBU;aAC5C,CAAC;QACF,cAAc,EAAE;YACZ,EAAE,EAAE,gCAAgC;YACpC,QAAQ,EAAE;;;;;IAKd,kCAAM,CAAC,EAAE,iBAAiB,kCAAM,CAAC,EAAE;;;;YAI3B,gCAAI,CAAC,EAAE;gBACH,oCAAQ,CAAC,EAAE;;8HAEmG;SACzH;KACJ;CACA,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AIVariableContext } from '@theia/ai-core';
|
|
2
|
-
import * as monaco from '@theia/monaco-editor-core';
|
|
3
|
-
export interface CodeCompletionVariableContext {
|
|
4
|
-
model: monaco.editor.ITextModel;
|
|
5
|
-
position: monaco.Position;
|
|
6
|
-
context: monaco.languages.InlineCompletionContext;
|
|
7
|
-
}
|
|
8
|
-
export declare namespace CodeCompletionVariableContext {
|
|
9
|
-
function is(context: AIVariableContext): context is CodeCompletionVariableContext;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=code-completion-variable-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-variable-context.d.ts","sourceRoot":"","sources":["../../src/browser/code-completion-variable-context.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAEpD,MAAM,WAAW,6BAA6B;IAC1C,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,uBAAuB,CAAA;CACpD;AAED,yBAAiB,6BAA6B,CAAC;IAC3C,SAAgB,EAAE,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,IAAI,6BAA6B,CAEvF;CACJ"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 Lonti.com Pty Ltd.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.CodeCompletionVariableContext = void 0;
|
|
19
|
-
var CodeCompletionVariableContext;
|
|
20
|
-
(function (CodeCompletionVariableContext) {
|
|
21
|
-
function is(context) {
|
|
22
|
-
return !!context && 'model' in context && 'position' in context && 'context' in context;
|
|
23
|
-
}
|
|
24
|
-
CodeCompletionVariableContext.is = is;
|
|
25
|
-
})(CodeCompletionVariableContext || (exports.CodeCompletionVariableContext = CodeCompletionVariableContext = {}));
|
|
26
|
-
//# sourceMappingURL=code-completion-variable-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-variable-context.js","sourceRoot":"","sources":["../../src/browser/code-completion-variable-context.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,wCAAwC;AACxC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAWhF,IAAiB,6BAA6B,CAI7C;AAJD,WAAiB,6BAA6B;IAC1C,SAAgB,EAAE,CAAC,OAA0B;QACzC,OAAO,CAAC,CAAC,OAAO,IAAI,OAAO,IAAI,OAAO,IAAI,UAAU,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC;IAC5F,CAAC;IAFe,gCAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,6BAA6B,6CAA7B,6BAA6B,QAI7C"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AIVariableContext, AIVariableResolutionRequest, AIVariableResolver, ResolvedAIVariable } from '@theia/ai-core';
|
|
2
|
-
import { FrontendVariableContribution, FrontendVariableService } from '@theia/ai-core/lib/browser';
|
|
3
|
-
import { MaybePromise, PreferenceService } from '@theia/core';
|
|
4
|
-
import { CodeCompletionVariableContext } from './code-completion-variable-context';
|
|
5
|
-
export declare class CodeCompletionVariableContribution implements FrontendVariableContribution, AIVariableResolver {
|
|
6
|
-
protected preferences: PreferenceService;
|
|
7
|
-
registerVariables(service: FrontendVariableService): void;
|
|
8
|
-
canResolve(_request: AIVariableResolutionRequest, context: AIVariableContext): MaybePromise<number>;
|
|
9
|
-
resolve(request: AIVariableResolutionRequest, context: AIVariableContext): Promise<ResolvedAIVariable | undefined>;
|
|
10
|
-
protected resolvePrefix(context: CodeCompletionVariableContext): ResolvedAIVariable | undefined;
|
|
11
|
-
protected resolveSuffix(context: CodeCompletionVariableContext): ResolvedAIVariable | undefined;
|
|
12
|
-
protected resolveLanguage(context: CodeCompletionVariableContext): ResolvedAIVariable | undefined;
|
|
13
|
-
protected resolveFile(context: CodeCompletionVariableContext): ResolvedAIVariable | undefined;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=code-completion-variable-contribution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-completion-variable-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/code-completion-variable-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACxH,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAGnF,qBACa,kCAAmC,YAAW,4BAA4B,EAAE,kBAAkB;IAEvG,SAAS,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAEzC,iBAAiB,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI;IAWzD,UAAU,CAAC,QAAQ,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,GAAG,YAAY,CAAC,MAAM,CAAC;IAI7F,OAAO,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;IAmBxH,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,6BAA6B,GAAG,kBAAkB,GAAG,SAAS;IAkC/F,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,6BAA6B,GAAG,kBAAkB,GAAG,SAAS;IAgC/F,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,6BAA6B,GAAG,kBAAkB,GAAG,SAAS;IAOjG,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,6BAA6B,GAAG,kBAAkB,GAAG,SAAS;CAOhG"}
|