@vscode/chat-lib 0.1.3-7 → 0.1.3-8
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/src/_internal/extension/byok/node/openAIEndpoint.js +2 -2
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/auth/copilotTokenManager.d.ts +2 -2
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/auth/copilotTokenNotifier.d.ts +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/auth/orgs.d.ts +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/config.js +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/experiments/defaultExpFilters.d.ts +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/configBlockMode.d.ts +2 -2
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/contextualFilterConstants.js +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/contextualFilterConstants.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.d.ts +11 -2
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.js +73 -54
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/snippy/errorCreator.js +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/telemetry/userConfig.d.ts +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/prompt/src/components/reconciler.js +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/prompt/src/languageMarker.js +7 -7
- package/dist/src/_internal/extension/completions-core/vscode-node/prompt/src/parseBlock.js +4 -4
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js +2 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js.map +1 -1
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js +1 -1
- package/dist/src/_internal/extension/xtab/common/tags.js +7 -7
- package/dist/src/_internal/platform/authentication/common/authentication.d.ts +47 -27
- package/dist/src/_internal/platform/authentication/common/authentication.d.ts.map +1 -1
- package/dist/src/_internal/platform/authentication/common/authentication.js +2 -2
- package/dist/src/_internal/platform/authentication/common/authentication.js.map +1 -1
- package/dist/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.d.ts +8 -3
- package/dist/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.js +11 -9
- package/dist/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.js.map +1 -1
- package/dist/src/_internal/platform/chat/common/commonTypes.js +7 -7
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +36 -9
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +44 -41
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/jsonSchema.d.ts +1 -1
- package/dist/src/_internal/platform/configuration/common/jsonSchema.js +22 -22
- package/dist/src/_internal/platform/configuration/common/validator.js +14 -14
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts +1 -0
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js +15 -6
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js.map +1 -1
- package/dist/src/_internal/platform/github/common/githubService.d.ts +4 -2
- package/dist/src/_internal/platform/github/common/githubService.d.ts.map +1 -1
- package/dist/src/_internal/platform/github/common/githubService.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditLogContext.d.ts +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditLogContext.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditLogContext.js +46 -41
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditLogContext.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.d.ts +2 -0
- package/dist/src/_internal/platform/networking/common/networking.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.js.map +1 -1
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.d.ts +3 -0
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.d.ts.map +1 -1
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.js +4 -1
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.js.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/telemetry.d.ts +1 -1
- package/dist/src/_internal/platform/workspaceRecorder/common/workspaceLog.d.ts +6 -6
- package/dist/src/_internal/util/common/crypto.js +2 -2
- package/dist/src/_internal/util/common/imageUtils.js +9 -9
- package/dist/src/_internal/util/common/languages.js +4 -4
- package/dist/src/_internal/util/vs/base/common/types.d.ts +27 -0
- package/dist/src/_internal/util/vs/base/common/types.d.ts.map +1 -1
- package/dist/src/_internal/util/vs/base/common/types.js +28 -0
- package/dist/src/_internal/util/vs/base/common/types.js.map +1 -1
- package/dist/src/_internal/util/vs/editor/common/core/text/positionToOffsetImpl.d.ts +2 -5
- package/dist/src/_internal/util/vs/editor/common/core/text/positionToOffsetImpl.d.ts.map +1 -1
- package/dist/src/_internal/util/vs/editor/common/core/text/positionToOffsetImpl.js +10 -24
- package/dist/src/_internal/util/vs/editor/common/core/text/positionToOffsetImpl.js.map +1 -1
- package/dist/src/main.js +2 -1
- package/dist/src/main.js.map +1 -1
- package/dist/src/package.json +88 -141
- package/package.json +1 -1
|
@@ -238,7 +238,7 @@ let OpenAIEndpoint = class OpenAIEndpoint extends chatEndpoint_1.ChatEndpoint {
|
|
|
238
238
|
if (body?.tools) {
|
|
239
239
|
body.tools = body.tools.map(tool => {
|
|
240
240
|
if ((0, fetch_1.isOpenAiFunctionTool)(tool) && tool.function.parameters === undefined) {
|
|
241
|
-
tool.function.parameters = { type:
|
|
241
|
+
tool.function.parameters = { type: 'object', properties: {} };
|
|
242
242
|
}
|
|
243
243
|
return tool;
|
|
244
244
|
});
|
|
@@ -261,7 +261,7 @@ let OpenAIEndpoint = class OpenAIEndpoint extends chatEndpoint_1.ChatEndpoint {
|
|
|
261
261
|
}
|
|
262
262
|
getExtraHeaders() {
|
|
263
263
|
const headers = {
|
|
264
|
-
|
|
264
|
+
'Content-Type': 'application/json'
|
|
265
265
|
};
|
|
266
266
|
if (this._modelUrl.includes('openai.azure')) {
|
|
267
267
|
headers['api-key'] = this._apiKey;
|
|
@@ -9,7 +9,7 @@ export interface ICompletionsCopilotTokenManager {
|
|
|
9
9
|
primeToken(): Promise<boolean>;
|
|
10
10
|
getToken(): Promise<CopilotToken>;
|
|
11
11
|
resetToken(httpError?: number): void;
|
|
12
|
-
getLastToken(): Omit<CopilotToken,
|
|
12
|
+
getLastToken(): Omit<CopilotToken, 'token'> | undefined;
|
|
13
13
|
}
|
|
14
14
|
export declare class CopilotTokenManagerImpl extends Disposable implements ICompletionsCopilotTokenManager {
|
|
15
15
|
protected primed: boolean;
|
|
@@ -26,6 +26,6 @@ export declare class CopilotTokenManagerImpl extends Disposable implements IComp
|
|
|
26
26
|
getToken(): Promise<CopilotToken>;
|
|
27
27
|
private updateCachedToken;
|
|
28
28
|
resetToken(httpError?: number): void;
|
|
29
|
-
getLastToken(): Omit<CopilotToken,
|
|
29
|
+
getLastToken(): Omit<CopilotToken, 'token'> | undefined;
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=copilotTokenManager.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IAuthenticationService } from '../../../../../../platform/authentication/common/authentication';
|
|
2
2
|
import { CopilotToken } from '../../../../../../platform/authentication/common/copilotToken';
|
|
3
|
-
export declare function onCopilotToken(authService: IAuthenticationService, listener: (token: Omit<CopilotToken,
|
|
3
|
+
export declare function onCopilotToken(authService: IAuthenticationService, listener: (token: Omit<CopilotToken, 'token'>) => unknown): import("../../../../../../util/vs/base/common/lifecycle").IDisposable;
|
|
4
4
|
//# sourceMappingURL=copilotTokenNotifier.d.ts.map
|
|
@@ -264,7 +264,7 @@ const configDefaults = new Map([
|
|
|
264
264
|
[exports.ConfigKey.FilterCompletions, undefined],
|
|
265
265
|
[exports.ConfigKey.UseSplitContextPrompt, true],
|
|
266
266
|
// These are defaults from package.json
|
|
267
|
-
[exports.ConfigKey.Enable, {
|
|
267
|
+
[exports.ConfigKey.Enable, { '*': true, 'plaintext': false, 'markdown': false, 'scminput': false }],
|
|
268
268
|
[exports.ConfigKey.UserSelectedCompletionModel, ''],
|
|
269
269
|
// These are advanced defaults from package.json
|
|
270
270
|
[exports.ConfigKey.DebugOverrideEngineLegacy, ''],
|
|
@@ -3,5 +3,5 @@ import { ServicesAccessor } from '../../../../../../util/vs/platform/instantiati
|
|
|
3
3
|
import { CopilotToken } from '../auth/copilotTokenManager';
|
|
4
4
|
import { Filter } from './filters';
|
|
5
5
|
export declare function setupCompletionsExperimentationService(accessor: ServicesAccessor): IDisposable;
|
|
6
|
-
export declare function createCompletionsFilters(accessor: ServicesAccessor, token: Omit<CopilotToken,
|
|
6
|
+
export declare function createCompletionsFilters(accessor: ServicesAccessor, token: Omit<CopilotToken, 'token'> | undefined): Map<Filter, string>;
|
|
7
7
|
//# sourceMappingURL=defaultExpFilters.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IInstantiationService } from '../../../../../../util/vs/platform/instantiation/common/instantiation';
|
|
2
|
-
import { BlockMode } from
|
|
2
|
+
import { BlockMode } from '../../../../../completions/common/config';
|
|
3
3
|
import { ICompletionsFeaturesService } from '../experiments/featuresService';
|
|
4
|
-
import { TelemetryWithExp } from
|
|
4
|
+
import { TelemetryWithExp } from '../telemetry';
|
|
5
5
|
export declare const ICompletionsBlockModeConfig: import("../../../../../../util/common/services").ServiceIdentifier<ICompletionsBlockModeConfig>;
|
|
6
6
|
export interface ICompletionsBlockModeConfig {
|
|
7
7
|
readonly _serviceBrand: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextualFilterConstants.js","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/contextualFilterConstants.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AACnF,QAAA,4BAA4B,GAA8B;IACtE,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,CAAC,EAAE,CAAC;IACJ,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,
|
|
1
|
+
{"version":3,"file":"contextualFilterConstants.js","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/contextualFilterConstants.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AACnF,QAAA,4BAA4B,GAA8B;IACtE,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,CAAC,EAAE,CAAC;IACJ,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,CAAC;IACP,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IAC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IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;CACP,CAAC"}
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { CancellationToken, Position } from 'vscode-languageserver-protocol';
|
|
2
|
-
import {
|
|
2
|
+
import { IInstantiationService } from '../../../../../util/vs/platform/instantiation/common/instantiation';
|
|
3
3
|
import { CopilotCompletion } from './ghostText/copilotCompletion';
|
|
4
4
|
import { GetGhostTextOptions } from './ghostText/ghostText';
|
|
5
5
|
import { ITextEditorOptions } from './ghostText/normalizeIndent';
|
|
6
|
+
import { ICompletionsSpeculativeRequestCache } from './ghostText/speculativeRequestCache';
|
|
7
|
+
import { ICompletionsLogTargetService } from './logger';
|
|
6
8
|
import { ITextDocument } from './textDocument';
|
|
7
9
|
type GetInlineCompletionsOptions = Partial<GetGhostTextOptions> & {
|
|
8
10
|
formattingOptions?: ITextEditorOptions;
|
|
9
11
|
};
|
|
10
|
-
export declare
|
|
12
|
+
export declare class GhostText {
|
|
13
|
+
private readonly instantiationService;
|
|
14
|
+
private readonly logTargetService;
|
|
15
|
+
private readonly speculativeRequestCache;
|
|
16
|
+
constructor(instantiationService: IInstantiationService, logTargetService: ICompletionsLogTargetService, speculativeRequestCache: ICompletionsSpeculativeRequestCache);
|
|
17
|
+
getInlineCompletions(textDocument: ITextDocument, position: Position, token?: CancellationToken, options?: Exclude<Partial<GetInlineCompletionsOptions>, 'promptOnly'>): Promise<CopilotCompletion[] | undefined>;
|
|
18
|
+
private getInlineCompletionsResult;
|
|
19
|
+
}
|
|
11
20
|
export {};
|
|
12
21
|
//# sourceMappingURL=inlineCompletion.d.ts.map
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inlineCompletion.d.ts","sourceRoot":"","sources":["../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAS,MAAM,gCAAgC,CAAC;AACpF,OAAO,
|
|
1
|
+
{"version":3,"file":"inlineCompletion.d.ts","sourceRoot":"","sources":["../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAS,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oEAAoE,CAAC;AAE3G,OAAO,EAAmC,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAgB,mBAAmB,EAAc,MAAM,uBAAuB,CAAC;AAEtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,mCAAmC,EAAE,MAAM,qCAAqC,CAAC;AAE1F,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,aAAa,EAAwB,MAAM,gBAAgB,CAAC;AAErE,KAAK,2BAA2B,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG;IACjE,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;CACvC,CAAC;AAEF,qBAAa,SAAS;IAGG,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAC9B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAC1B,OAAO,CAAC,QAAQ,CAAC,uBAAuB;gBAFrC,oBAAoB,EAAE,qBAAqB,EACpC,gBAAgB,EAAE,4BAA4B,EACvC,uBAAuB,EAAE,mCAAmC;IAGtG,oBAAoB,CAChC,YAAY,EAAE,aAAa,EAC3B,QAAQ,EAAE,QAAQ,EAClB,KAAK,CAAC,EAAE,iBAAiB,EACzB,OAAO,GAAE,OAAO,CAAC,OAAO,CAAC,2BAA2B,CAAC,EAAE,YAAY,CAAM,GACvE,OAAO,CAAC,iBAAiB,EAAE,GAAG,SAAS,CAAC;YAO7B,0BAA0B;CAgExC"}
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
9
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
12
|
+
exports.GhostText = void 0;
|
|
4
13
|
/*---------------------------------------------------------------------------------------------
|
|
5
14
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6
15
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
@@ -14,62 +23,72 @@ const last_1 = require("./ghostText/last");
|
|
|
14
23
|
const speculativeRequestCache_1 = require("./ghostText/speculativeRequestCache");
|
|
15
24
|
const telemetry_1 = require("./ghostText/telemetry");
|
|
16
25
|
const logger_1 = require("./logger");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// to look like empty function calls (e.g., `foo()`) in selectedCompletionInfo.text. Injecting that directly into
|
|
23
|
-
// the prompt produces low quality completions, so don't.
|
|
24
|
-
if (options.selectedCompletionInfo?.text && !options.selectedCompletionInfo.text.includes(')')) {
|
|
25
|
-
completionState = completionState.addSelectedCompletionInfo(options.selectedCompletionInfo);
|
|
26
|
-
lineLengthIncrease = completionState.position.character - options.selectedCompletionInfo.range.end.character;
|
|
26
|
+
let GhostText = class GhostText {
|
|
27
|
+
constructor(instantiationService, logTargetService, speculativeRequestCache) {
|
|
28
|
+
this.instantiationService = instantiationService;
|
|
29
|
+
this.logTargetService = logTargetService;
|
|
30
|
+
this.speculativeRequestCache = speculativeRequestCache;
|
|
27
31
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
async getInlineCompletions(textDocument, position, token, options = {}) {
|
|
33
|
+
logCompletionLocation(this.logTargetService, textDocument, position);
|
|
34
|
+
const result = await this.getInlineCompletionsResult((0, completionState_1.createCompletionState)(textDocument, position), token, options);
|
|
35
|
+
return this.instantiationService.invokeFunction(telemetry_1.handleGhostTextResultTelemetry, result);
|
|
31
36
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
async getInlineCompletionsResult(completionState, token, options = {}) {
|
|
38
|
+
let lineLengthIncrease = 0;
|
|
39
|
+
// The golang.go extension (and quite possibly others) uses snippets for function completions, which collapse down
|
|
40
|
+
// to look like empty function calls (e.g., `foo()`) in selectedCompletionInfo.text. Injecting that directly into
|
|
41
|
+
// the prompt produces low quality completions, so don't.
|
|
42
|
+
if (options.selectedCompletionInfo?.text && !options.selectedCompletionInfo.text.includes(')')) {
|
|
43
|
+
completionState = completionState.addSelectedCompletionInfo(options.selectedCompletionInfo);
|
|
44
|
+
lineLengthIncrease = completionState.position.character - options.selectedCompletionInfo.range.end.character;
|
|
45
|
+
}
|
|
46
|
+
const result = await this.instantiationService.invokeFunction(ghostText_1.getGhostText, completionState, token, options);
|
|
47
|
+
if (result.type !== 'success') {
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
const [resultArray, resultType] = result.value;
|
|
51
|
+
if (token?.isCancellationRequested) {
|
|
52
|
+
return {
|
|
53
|
+
type: 'canceled',
|
|
54
|
+
reason: 'after getGhostText',
|
|
55
|
+
telemetryData: { telemetryBlob: result.telemetryBlob },
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const index = this.instantiationService.invokeFunction(last_1.setLastShown, completionState.textDocument, completionState.position, resultType);
|
|
59
|
+
const completions = (0, copilotCompletion_1.completionsFromGhostTextResults)(resultArray, resultType, completionState.textDocument, completionState.position, options.formattingOptions, index);
|
|
60
|
+
if (completions.length === 0) {
|
|
61
|
+
// This is a backstop, most/all cases of an empty completions list should be caught earlier
|
|
62
|
+
// TODO: figure out how this accounts for 7% of ghostText.empty when it looks unreachable
|
|
63
|
+
return { type: 'empty', reason: 'no completions in final result', telemetryData: result.telemetryData };
|
|
64
|
+
}
|
|
65
|
+
// Speculatively request a new completion including the newly returned completion in the document
|
|
66
|
+
if (resultType !== ghostText_1.ResultType.TypingAsSuggested) {
|
|
67
|
+
completionState = completionState.applyEdits([
|
|
68
|
+
{
|
|
69
|
+
newText: completions[0].insertText,
|
|
70
|
+
range: completions[0].range,
|
|
71
|
+
},
|
|
72
|
+
]);
|
|
73
|
+
// Cache speculative request to be triggered when telemetryShown is called
|
|
74
|
+
const specOpts = { isSpeculative: true, opportunityId: options.opportunityId };
|
|
75
|
+
const fn = () => this.instantiationService.invokeFunction(ghostText_1.getGhostText, completionState, undefined, specOpts);
|
|
76
|
+
this.speculativeRequestCache.set(completions[0].clientCompletionId, fn);
|
|
77
|
+
}
|
|
78
|
+
const value = completions.map(completion => {
|
|
79
|
+
const { start, end } = completion.range;
|
|
80
|
+
const range = vscode_languageserver_protocol_1.Range.create(start, vscode_languageserver_protocol_1.Position.create(end.line, end.character - lineLengthIncrease));
|
|
81
|
+
return { ...completion, range };
|
|
82
|
+
});
|
|
83
|
+
return { ...result, value };
|
|
39
84
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// Speculatively request a new completion including the newly returned completion in the document
|
|
48
|
-
if (resultType !== ghostText_1.ResultType.TypingAsSuggested) {
|
|
49
|
-
completionState = completionState.applyEdits([
|
|
50
|
-
{
|
|
51
|
-
newText: completions[0].insertText,
|
|
52
|
-
range: completions[0].range,
|
|
53
|
-
},
|
|
54
|
-
]);
|
|
55
|
-
// Cache speculative request to be triggered when telemetryShown is called
|
|
56
|
-
const specOpts = { isSpeculative: true, opportunityId: options.opportunityId };
|
|
57
|
-
const fn = () => instantiationService.invokeFunction(ghostText_1.getGhostText, completionState, undefined, specOpts);
|
|
58
|
-
speculativeRequestCache.set(completions[0].clientCompletionId, fn);
|
|
59
|
-
}
|
|
60
|
-
const value = completions.map(completion => {
|
|
61
|
-
const { start, end } = completion.range;
|
|
62
|
-
const range = vscode_languageserver_protocol_1.Range.create(start, vscode_languageserver_protocol_1.Position.create(end.line, end.character - lineLengthIncrease));
|
|
63
|
-
return { ...completion, range };
|
|
64
|
-
});
|
|
65
|
-
return { ...result, value };
|
|
66
|
-
}
|
|
67
|
-
async function getInlineCompletions(accessor, textDocument, position, token, options = {}) {
|
|
68
|
-
const instantiationService = accessor.get(instantiation_1.IInstantiationService);
|
|
69
|
-
logCompletionLocation(accessor.get(logger_1.ICompletionsLogTargetService), textDocument, position);
|
|
70
|
-
const result = await getInlineCompletionsResult(accessor, (0, completionState_1.createCompletionState)(textDocument, position), token, options);
|
|
71
|
-
return instantiationService.invokeFunction(telemetry_1.handleGhostTextResultTelemetry, result);
|
|
72
|
-
}
|
|
85
|
+
};
|
|
86
|
+
exports.GhostText = GhostText;
|
|
87
|
+
exports.GhostText = GhostText = __decorate([
|
|
88
|
+
__param(0, instantiation_1.IInstantiationService),
|
|
89
|
+
__param(1, logger_1.ICompletionsLogTargetService),
|
|
90
|
+
__param(2, speculativeRequestCache_1.ICompletionsSpeculativeRequestCache)
|
|
91
|
+
], GhostText);
|
|
73
92
|
function logCompletionLocation(logTarget, textDocument, position) {
|
|
74
93
|
const prefix = textDocument.getText({
|
|
75
94
|
start: { line: Math.max(position.line - 1, 0), character: 0 },
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inlineCompletion.js","sourceRoot":"","sources":["../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inlineCompletion.js","sourceRoot":"","sources":["../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,mFAAoF;AACpF,sGAA2G;AAC3G,uDAA2E;AAC3E,qEAAmG;AACnG,qDAAsF;AACtF,2CAAgD;AAEhD,iFAA0F;AAC1F,qDAA6G;AAC7G,qCAAwD;AAOjD,IAAM,SAAS,GAAf,MAAM,SAAS;IAErB,YACyC,oBAA2C,EACpC,gBAA8C,EACvC,uBAA4D;QAF1E,yBAAoB,GAApB,oBAAoB,CAAuB;QACpC,qBAAgB,GAAhB,gBAAgB,CAA8B;QACvC,4BAAuB,GAAvB,uBAAuB,CAAqC;IAC/G,CAAC;IAEE,KAAK,CAAC,oBAAoB,CAChC,YAA2B,EAC3B,QAAkB,EAClB,KAAyB,EACzB,UAAuE,EAAE;QAEzE,qBAAqB,CAA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BAAkB,YAAY,CAAC,GAAG,OAAO,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,SAAS,EAAE,EAC9E,WAAW,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAClE,CAAC;AACH,CAAC"}
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/snippy/errorCreator.js
CHANGED
|
@@ -15,7 +15,7 @@ exports.ErrorReasons = {
|
|
|
15
15
|
exports.ErrorMessages = {
|
|
16
16
|
[exports.ErrorReasons.Unauthorized]: 'Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again',
|
|
17
17
|
[exports.ErrorReasons.InternalError]: 'Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.',
|
|
18
|
-
[exports.ErrorReasons.RateLimit]:
|
|
18
|
+
[exports.ErrorReasons.RateLimit]: `You've reached your quota and limit, code matching will be unavailable until the limit resets`,
|
|
19
19
|
};
|
|
20
20
|
function getErrorType(code) {
|
|
21
21
|
if (code === 401) {
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/telemetry/userConfig.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare class TelemetryUserConfig extends Disposable implements ICompleti
|
|
|
23
23
|
constructor(authenticationService: IAuthenticationService);
|
|
24
24
|
getProperties(): Partial<UserConfigProperties>;
|
|
25
25
|
get trackingId(): string | undefined;
|
|
26
|
-
updateFromToken(copilotToken: Omit<CopilotToken,
|
|
26
|
+
updateFromToken(copilotToken: Omit<CopilotToken, 'token'>): void;
|
|
27
27
|
}
|
|
28
28
|
export {};
|
|
29
29
|
//# sourceMappingURL=userConfig.d.ts.map
|
|
@@ -159,7 +159,7 @@ class VirtualPromptReconciler {
|
|
|
159
159
|
}
|
|
160
160
|
async recursivelyPumpData(data, node) {
|
|
161
161
|
if (!node) {
|
|
162
|
-
throw new Error(
|
|
162
|
+
throw new Error(`Can't pump data into undefined node.`);
|
|
163
163
|
}
|
|
164
164
|
await node.lifecycle?.dataHook.updateData(data);
|
|
165
165
|
for (const child of node.children || []) {
|
package/dist/src/_internal/extension/completions-core/vscode-node/prompt/src/languageMarker.js
CHANGED
|
@@ -278,7 +278,7 @@ exports.languageMarkers = {
|
|
|
278
278
|
markdownLanguageIds: ['tsx'],
|
|
279
279
|
},
|
|
280
280
|
vb: {
|
|
281
|
-
lineComment: { start:
|
|
281
|
+
lineComment: { start: `'`, end: '' },
|
|
282
282
|
markdownLanguageIds: ['vb', 'vbscript'],
|
|
283
283
|
},
|
|
284
284
|
verilog: {
|
|
@@ -322,11 +322,11 @@ const dontAddLanguageMarker = [
|
|
|
322
322
|
];
|
|
323
323
|
// prettier-ignore
|
|
324
324
|
const shebangLines = {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
325
|
+
'html': '<!DOCTYPE html>',
|
|
326
|
+
'python': '#!/usr/bin/env python3',
|
|
327
|
+
'ruby': '#!/usr/bin/env ruby',
|
|
328
|
+
'shellscript': '#!/bin/sh',
|
|
329
|
+
'yaml': '# YAML data'
|
|
330
330
|
};
|
|
331
331
|
/**
|
|
332
332
|
* Determine if a line is a shebang line for a known language
|
|
@@ -344,7 +344,7 @@ function isShebangLine(line) {
|
|
|
344
344
|
*/
|
|
345
345
|
// prettier-ignore
|
|
346
346
|
function hasLanguageMarker({ source }) {
|
|
347
|
-
return source.startsWith(
|
|
347
|
+
return source.startsWith('#!') || source.startsWith('<!DOCTYPE');
|
|
348
348
|
}
|
|
349
349
|
/**
|
|
350
350
|
* Comment a single line of text in a given language.
|
|
@@ -342,7 +342,7 @@ class TreeSitterBasedBlockParser extends BaseBlockParser {
|
|
|
342
342
|
const prevSibling = blockNode.previousSibling;
|
|
343
343
|
if (prevSibling !== null &&
|
|
344
344
|
prevSibling.hasError &&
|
|
345
|
-
(prevSibling.text.startsWith('"""') || prevSibling.text.startsWith(
|
|
345
|
+
(prevSibling.text.startsWith('"""') || prevSibling.text.startsWith(`'''`))) {
|
|
346
346
|
return true;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
@@ -364,7 +364,7 @@ class TreeSitterBasedBlockParser extends BaseBlockParser {
|
|
|
364
364
|
if (this.languageId === 'python' && version >= 14) {
|
|
365
365
|
// In version 14 and later, we need to account for the possibility of
|
|
366
366
|
// an unfinished docstring being represented as an ERROR node.
|
|
367
|
-
if (errorNode.hasError && (errorNode.text.startsWith('"') || errorNode.text.startsWith(
|
|
367
|
+
if (errorNode.hasError && (errorNode.text.startsWith('"') || errorNode.text.startsWith(`'`))) {
|
|
368
368
|
const parentType = errorNode.parent?.type;
|
|
369
369
|
if (parentType === 'function_definition' ||
|
|
370
370
|
parentType === 'class_definition' ||
|
|
@@ -420,10 +420,10 @@ class TreeSitterBasedBlockParser extends BaseBlockParser {
|
|
|
420
420
|
// horrible hack to handle unfinished docstrings :(
|
|
421
421
|
if (keyword.type === 'def') {
|
|
422
422
|
const sibling = colonNode.nextSibling;
|
|
423
|
-
if (sibling.type === '"' || sibling.type ===
|
|
423
|
+
if (sibling.type === '"' || sibling.type === `'`) {
|
|
424
424
|
return true;
|
|
425
425
|
}
|
|
426
|
-
if (sibling.type === 'ERROR' && (sibling.text === '"""' || sibling.text ===
|
|
426
|
+
if (sibling.type === 'ERROR' && (sibling.text === '"""' || sibling.text === `'''`)) {
|
|
427
427
|
return true;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatMLFetcher.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/extension/prompt/node/chatMLFetcher.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAEhG,OAAO,EAAuB,cAAc,EAAE,eAAe,EAAE,MA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AmB,EAC1C,iBAAiB,EAAE,iBAAiB,EACnC,kBAAkB,EAAE,kBAAkB,EACrD,OAAO,EAAE,oBAAoB,EACX,qBAAqB,EAAE,qBAAqB,EAC1C,uBAAuB,EAAE,uBAAuB;IAK3F;;OAEG;IACU,SAAS,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;YAiRjF,yBAAyB;YAiCzB,eAAe;YAmBf,mBAAmB;YAqInB,yBAAyB;YAgHzB,YAAY;YA0OZ,yBAAyB;IAyFvC,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,YAAY;IAiCpB,OAAO,CAAC,uBAAuB;IAS/B,OAAO,CAAC,qBAAqB;IAyC7B,OAAO,CAAC,YAAY;IA8DpB,OAAO,CAAC,gBAAgB;CAOxB;AAkCD,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAOnH;AAED;;;;GAIG;AAEH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAmB/D"}
|
|
@@ -162,7 +162,8 @@ let ChatMLFetcherImpl = class ChatMLFetcherImpl extends AbstractChatMLFetcher {
|
|
|
162
162
|
ourRequestId,
|
|
163
163
|
location: opts.location,
|
|
164
164
|
body: requestBody,
|
|
165
|
-
ignoreStatefulMarker: opts.ignoreStatefulMarker
|
|
165
|
+
ignoreStatefulMarker: opts.ignoreStatefulMarker,
|
|
166
|
+
isConversationRequest: opts.isConversationRequest
|
|
166
167
|
});
|
|
167
168
|
let tokenCount = -1;
|
|
168
169
|
const streamRecorder = new chatMLFetcher_1.FetchStreamRecorder(finishedCb);
|