@opensumi/ide-core-common 2.27.3-rc-1710495297.0 → 2.27.3-rc-1711024024.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/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/types/ai-native/index.d.ts +57 -101
- package/lib/types/ai-native/index.d.ts.map +1 -1
- package/lib/types/ai-native/index.js +40 -18
- package/lib/types/ai-native/index.js.map +1 -1
- package/lib/types/ai-native/reporter.d.ts +15 -48
- package/lib/types/ai-native/reporter.d.ts.map +1 -1
- package/lib/types/ai-native/reporter.js +7 -10
- package/lib/types/ai-native/reporter.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +0 -1
- package/src/types/ai-native/index.ts +63 -104
- package/src/types/ai-native/reporter.ts +17 -44
- package/lib/range.d.ts +0 -7
- package/lib/range.d.ts.map +0 -1
- package/lib/range.js +0 -28
- package/lib/range.js.map +0 -1
- package/src/range.ts +0 -24
package/lib/index.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export * from './json-schema';
|
|
|
17
17
|
export * from './reporter';
|
|
18
18
|
export * from './connection';
|
|
19
19
|
export * from './comparers';
|
|
20
|
-
export * from './range';
|
|
21
20
|
export * from './problem-pattern';
|
|
22
21
|
export * from './problem-matcher';
|
|
23
22
|
export * from './task-definition';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,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ED
|
@@ -20,7 +20,6 @@ tslib_1.__exportStar(require("./json-schema"), exports);
|
|
|
20
20
|
tslib_1.__exportStar(require("./reporter"), exports);
|
|
21
21
|
tslib_1.__exportStar(require("./connection"), exports);
|
|
22
22
|
tslib_1.__exportStar(require("./comparers"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./range"), exports);
|
|
24
23
|
tslib_1.__exportStar(require("./problem-pattern"), exports);
|
|
25
24
|
tslib_1.__exportStar(require("./problem-matcher"), exports);
|
|
26
25
|
tslib_1.__exportStar(require("./task-definition"), exports);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,sDAA4B;AAC5B,kEAAwC;AACxC,oDAA0B;AAC1B,mDAAyB;AACzB,sDAA4B;AAC5B,mDAAyB;AACzB,oDAA0B;AAC1B,iDAAuB;AACvB,qDAA2B;AAC3B,kDAAwB;AACxB,wDAA8B;AAC9B,oDAA0B;AAC1B,oDAA0B;AAC1B,gDAAsB;AACtB,wDAA8B;AAC9B,qDAA2B;AAC3B,uDAA6B;AAC7B,sDAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,sDAA4B;AAC5B,kEAAwC;AACxC,oDAA0B;AAC1B,mDAAyB;AACzB,sDAA4B;AAC5B,mDAAyB;AACzB,oDAA0B;AAC1B,iDAAuB;AACvB,qDAA2B;AAC3B,kDAAwB;AACxB,wDAA8B;AAC9B,oDAA0B;AAC1B,oDAA0B;AAC1B,gDAAsB;AACtB,wDAA8B;AAC9B,qDAA2B;AAC3B,uDAA6B;AAC7B,sDAA4B;AAC5B,4DAAkC;AAClC,4DAAkC;AAClC,4DAAkC;AAClC,sDAA4B;AAC5B,qDAA2B;AAC3B,kDAAwB;AACxB,gDAAsB;AACtB,uDAA6B;AAC7B,mDAAyB;AACzB,qDAA2B;AAC3B,qDAA2B;AAC3B,kDAAwB;AACxB,sDAA4B;AAC5B,iDAAuB;AACvB,kEAAwC;AACxC,6DAAmC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { CancellationToken } from '../../utils';
|
|
2
|
+
import { CancellationToken, MaybePromise } from '../../utils';
|
|
3
|
+
import { IAIReportCompletionOption } from './reporter';
|
|
4
|
+
export * from './reporter';
|
|
3
5
|
export interface IAINativeCapabilities {
|
|
4
6
|
/**
|
|
5
7
|
* Use opensumi design UI style
|
|
@@ -25,9 +27,18 @@ export interface IAINativeCapabilities {
|
|
|
25
27
|
* Use ai to intelligently resolve conflicts
|
|
26
28
|
*/
|
|
27
29
|
supportsConflictResolve?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Use ai to provide rename suggestions
|
|
32
|
+
*/
|
|
33
|
+
supportsRenameSuggestions?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface IAINativeLayout {
|
|
36
|
+
useMergeRightWithLeftPanel?: boolean;
|
|
37
|
+
useMenubarView?: boolean;
|
|
28
38
|
}
|
|
29
39
|
export interface IAINativeConfig {
|
|
30
40
|
capabilities?: IAINativeCapabilities;
|
|
41
|
+
layout?: IAINativeLayout;
|
|
31
42
|
}
|
|
32
43
|
export interface IAICompletionResultModel {
|
|
33
44
|
sessionId: string;
|
|
@@ -57,13 +68,9 @@ export interface IAICompletionOption {
|
|
|
57
68
|
fileUrl?: string;
|
|
58
69
|
sessionId?: string;
|
|
59
70
|
}
|
|
60
|
-
export interface
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
accept: boolean;
|
|
64
|
-
repo?: string;
|
|
65
|
-
completionUseTime?: number;
|
|
66
|
-
renderingTime?: number;
|
|
71
|
+
export interface IAIRenameSuggestionOption {
|
|
72
|
+
prompt: string;
|
|
73
|
+
language?: string;
|
|
67
74
|
}
|
|
68
75
|
export interface IAIBackService<BaseResponse extends IAIBackServiceResponse = IAIBackServiceResponse, StreamResponse extends NodeJS.ReadableStream = NodeJS.ReadableStream, CompletionResponse = IAICompletionResultModel> {
|
|
69
76
|
request<O extends IAIBackServiceOption>(input: string, options: O, cancelToken?: CancellationToken): Promise<BaseResponse>;
|
|
@@ -72,98 +79,47 @@ export interface IAIBackService<BaseResponse extends IAIBackServiceResponse = IA
|
|
|
72
79
|
reportCompletion<I extends IAIReportCompletionOption>(input: I): Promise<void>;
|
|
73
80
|
destroyStreamRequest?: (sessionId: string) => Promise<void>;
|
|
74
81
|
}
|
|
75
|
-
export declare
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
useCommandSuccess: boolean;
|
|
118
|
-
}
|
|
119
|
-
export interface RunRT extends Partial<CommonLogInfo> {
|
|
120
|
-
runSuccess: boolean;
|
|
121
|
-
}
|
|
122
|
-
export interface CompletionRT extends Partial<CommonLogInfo> {
|
|
123
|
-
isReceive?: boolean;
|
|
124
|
-
isStop?: boolean;
|
|
125
|
-
completionNum?: number;
|
|
126
|
-
renderingTime?: number;
|
|
127
|
-
}
|
|
128
|
-
export interface MergeConflictRT extends Partial<CommonLogInfo> {
|
|
129
|
-
editorMode: '3way' | 'traditional';
|
|
130
|
-
conflictPointNum: number;
|
|
131
|
-
useAiConflictPointNum: number;
|
|
132
|
-
receiveNum: number;
|
|
133
|
-
clickNum: number;
|
|
134
|
-
clickAllNum: number;
|
|
135
|
-
aiOutputNum: number;
|
|
136
|
-
cancelNum: number;
|
|
137
|
-
}
|
|
138
|
-
export type ReportInfo = Partial<CommonLogInfo> | ({
|
|
139
|
-
type: AISerivceType.GPT;
|
|
140
|
-
} & QuestionRT) | ({
|
|
141
|
-
type: AISerivceType.Explain;
|
|
142
|
-
} & QuestionRT) | ({
|
|
143
|
-
type: AISerivceType.SearchCode;
|
|
144
|
-
} & QuestionRT) | ({
|
|
145
|
-
type: AISerivceType.SearchDoc;
|
|
146
|
-
} & QuestionRT) | ({
|
|
147
|
-
type: AISerivceType.Test;
|
|
148
|
-
} & QuestionRT) | ({
|
|
149
|
-
type: AISerivceType.Optimize;
|
|
150
|
-
} & CodeRT) | ({
|
|
151
|
-
type: AISerivceType.Generate;
|
|
152
|
-
} & GenerateRT) | ({
|
|
153
|
-
type: AISerivceType.Sumi;
|
|
154
|
-
} & CommandRT) | ({
|
|
155
|
-
type: AISerivceType.Run;
|
|
156
|
-
} & RunRT) | ({
|
|
157
|
-
type: AISerivceType.Completion;
|
|
158
|
-
} & CompletionRT) | ({
|
|
159
|
-
type: AISerivceType.MergeConflict;
|
|
160
|
-
} & MergeConflictRT);
|
|
161
|
-
export declare const IAIReporter: unique symbol;
|
|
162
|
-
export interface IAIReporter {
|
|
163
|
-
getCommonReportInfo(): Record<string, unknown>;
|
|
164
|
-
getCacheReportInfo<T = ReportInfo>(relationId: string): T | undefined;
|
|
165
|
-
record(data: ReportInfo, relationId?: string): ReportInfo;
|
|
166
|
-
start(msg: string, data: ReportInfo): string;
|
|
167
|
-
end(relationId: string, data: ReportInfo): void;
|
|
82
|
+
export declare class ReplyResponse {
|
|
83
|
+
readonly message: string;
|
|
84
|
+
constructor(message: string);
|
|
85
|
+
static is(response: any): boolean;
|
|
86
|
+
}
|
|
87
|
+
export declare class ErrorResponse {
|
|
88
|
+
readonly error: any;
|
|
89
|
+
readonly message?: string | undefined;
|
|
90
|
+
constructor(error: any, message?: string | undefined);
|
|
91
|
+
static is(response: any): boolean;
|
|
92
|
+
}
|
|
93
|
+
export declare class CancelResponse {
|
|
94
|
+
readonly message?: string | undefined;
|
|
95
|
+
readonly cancellation: boolean;
|
|
96
|
+
constructor(message?: string | undefined);
|
|
97
|
+
static is(response: any): boolean;
|
|
98
|
+
}
|
|
99
|
+
export type ChatResponse = ReplyResponse | ErrorResponse | CancelResponse;
|
|
100
|
+
/**
|
|
101
|
+
* DI Token
|
|
102
|
+
*/
|
|
103
|
+
export declare const InlineChatFeatureRegistryToken: unique symbol;
|
|
104
|
+
export declare const ChatFeatureRegistryToken: unique symbol;
|
|
105
|
+
export declare const ResolveConflictRegistryToken: unique symbol;
|
|
106
|
+
export declare const RenameCandidatesProviderRegistryToken: unique symbol;
|
|
107
|
+
export declare const ChatAgentViewServiceToken: unique symbol;
|
|
108
|
+
/**
|
|
109
|
+
* Contribute Registry
|
|
110
|
+
*/
|
|
111
|
+
export interface IConflictContentMetadata {
|
|
112
|
+
current: string;
|
|
113
|
+
base: string;
|
|
114
|
+
incoming: string;
|
|
115
|
+
}
|
|
116
|
+
export interface IResolveConflictHandler {
|
|
117
|
+
providerRequest: (contentMetadata: IConflictContentMetadata, options: {
|
|
118
|
+
isRegenerate: boolean;
|
|
119
|
+
}, token: CancellationToken) => MaybePromise<ReplyResponse | ErrorResponse | CancelResponse>;
|
|
120
|
+
}
|
|
121
|
+
export interface IInternalResolveConflictRegistry {
|
|
122
|
+
getThreeWayHandler(): IResolveConflictHandler | undefined;
|
|
123
|
+
getTraditionalHandler(): IResolveConflictHandler | undefined;
|
|
168
124
|
}
|
|
169
125
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/ai-native/index.ts"],"names":[],"mappings":";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E,EAClC,KAAK,EAAE,iBAAiB,KACrB,YAAY,CAAC,aAAa,GAAG,aAAa,GAAG,cAAc,CAAC,CAAC;CACnE;AACD,MAAM,WAAW,gCAAgC;IAC/C,kBAAkB,IAAI,uBAAuB,GAAG,SAAS,CAAC;IAC1D,qBAAqB,IAAI,uBAAuB,GAAG,SAAS,CAAC;CAC9D"}
|
|
@@ -1,23 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ChatAgentViewServiceToken = exports.RenameCandidatesProviderRegistryToken = exports.ResolveConflictRegistryToken = exports.ChatFeatureRegistryToken = exports.InlineChatFeatureRegistryToken = exports.CancelResponse = exports.ErrorResponse = exports.ReplyResponse = exports.AIBackSerivcePath = exports.AIBackSerivceToken = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./reporter"), exports);
|
|
4
6
|
exports.AIBackSerivceToken = Symbol('AIBackSerivceToken');
|
|
5
7
|
exports.AIBackSerivcePath = 'AIBackSerivcePath';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
class ReplyResponse {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
this.message = message;
|
|
11
|
+
}
|
|
12
|
+
static is(response) {
|
|
13
|
+
return response instanceof ReplyResponse || (typeof response === 'object' && response.message !== undefined);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ReplyResponse = ReplyResponse;
|
|
17
|
+
class ErrorResponse {
|
|
18
|
+
constructor(error, message) {
|
|
19
|
+
this.error = error;
|
|
20
|
+
this.message = message;
|
|
21
|
+
}
|
|
22
|
+
static is(response) {
|
|
23
|
+
return response instanceof ErrorResponse || (typeof response === 'object' && response.error !== undefined);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.ErrorResponse = ErrorResponse;
|
|
27
|
+
class CancelResponse {
|
|
28
|
+
constructor(message) {
|
|
29
|
+
this.message = message;
|
|
30
|
+
this.cancellation = true;
|
|
31
|
+
}
|
|
32
|
+
static is(response) {
|
|
33
|
+
return response instanceof CancelResponse || (typeof response === 'object' && response.cancellation !== undefined);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.CancelResponse = CancelResponse;
|
|
37
|
+
/**
|
|
38
|
+
* DI Token
|
|
39
|
+
*/
|
|
40
|
+
exports.InlineChatFeatureRegistryToken = Symbol('InlineChatFeatureRegistryToken');
|
|
41
|
+
exports.ChatFeatureRegistryToken = Symbol('ChatFeatureRegistryToken');
|
|
42
|
+
exports.ResolveConflictRegistryToken = Symbol('ResolveConflictRegistryToken');
|
|
43
|
+
exports.RenameCandidatesProviderRegistryToken = Symbol('RenameCandidatesProviderRegistryToken');
|
|
44
|
+
exports.ChatAgentViewServiceToken = Symbol('ChatAgentViewServiceToken');
|
|
23
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/ai-native/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/ai-native/index.ts"],"names":[],"mappings":";;;;AAGA,qDAA2B;AAmDd,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAClD,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAoDrD,MAAa,aAAa;IACxB,YAAqB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAAG,CAAC;IAExC,MAAM,CAAC,EAAE,CAAC,QAAa;QACrB,OAAO,QAAQ,YAAY,aAAa,IAAI,CAAC,OAAO,QAAQ,K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
|
|
9
|
-
Test = "test",
|
|
10
|
-
Optimize = "optimize",
|
|
11
|
-
Generate = "generate",
|
|
3
|
+
Chat = "chat",
|
|
12
4
|
Completion = "completion",
|
|
13
5
|
Agent = "agent",
|
|
14
6
|
MergeConflict = "mergeConflict"
|
|
15
7
|
}
|
|
16
8
|
export interface CommonLogInfo {
|
|
17
|
-
msgType: AISerivceType;
|
|
9
|
+
msgType: AISerivceType | string;
|
|
18
10
|
relationId: string;
|
|
19
11
|
replytime: number;
|
|
20
12
|
success: boolean;
|
|
@@ -26,33 +18,26 @@ export interface CommonLogInfo {
|
|
|
26
18
|
copy: boolean;
|
|
27
19
|
insert: boolean;
|
|
28
20
|
}
|
|
29
|
-
export interface QuestionRT extends Partial<CommonLogInfo> {
|
|
30
|
-
isRetry: boolean;
|
|
31
|
-
isStop: boolean;
|
|
32
|
-
}
|
|
33
|
-
export interface CodeRT extends Partial<CommonLogInfo> {
|
|
34
|
-
isReceive: boolean;
|
|
35
|
-
isDrop: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface GenerateRT extends Partial<CommonLogInfo> {
|
|
38
|
-
fileCount: number;
|
|
39
|
-
requirment: string;
|
|
40
|
-
}
|
|
41
|
-
export interface CommandRT extends Partial<CommonLogInfo> {
|
|
42
|
-
useCommand: boolean;
|
|
43
|
-
useCommandSuccess: boolean;
|
|
44
|
-
}
|
|
45
|
-
export interface RunRT extends Partial<CommonLogInfo> {
|
|
46
|
-
runSuccess: boolean;
|
|
47
|
-
}
|
|
48
21
|
export interface CompletionRT extends Partial<CommonLogInfo> {
|
|
49
22
|
isReceive?: boolean;
|
|
50
23
|
isStop?: boolean;
|
|
51
24
|
completionNum?: number;
|
|
52
25
|
renderingTime?: number;
|
|
53
26
|
}
|
|
27
|
+
export interface IAIReportCompletionOption {
|
|
28
|
+
relationId: string;
|
|
29
|
+
sessionId: string;
|
|
30
|
+
accept: boolean;
|
|
31
|
+
repo?: string;
|
|
32
|
+
completionUseTime?: number;
|
|
33
|
+
renderingTime?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare enum MergeConflictEditorMode {
|
|
36
|
+
'3way' = "3way",
|
|
37
|
+
'traditional' = "traditional"
|
|
38
|
+
}
|
|
54
39
|
export interface MergeConflictRT extends Partial<CommonLogInfo> {
|
|
55
|
-
editorMode:
|
|
40
|
+
editorMode: MergeConflictEditorMode;
|
|
56
41
|
conflictPointNum: number;
|
|
57
42
|
useAiConflictPointNum: number;
|
|
58
43
|
receiveNum: number;
|
|
@@ -62,24 +47,6 @@ export interface MergeConflictRT extends Partial<CommonLogInfo> {
|
|
|
62
47
|
cancelNum: number;
|
|
63
48
|
}
|
|
64
49
|
export type ReportInfo = Partial<CommonLogInfo> | ({
|
|
65
|
-
type: AISerivceType.GPT;
|
|
66
|
-
} & QuestionRT) | ({
|
|
67
|
-
type: AISerivceType.Explain;
|
|
68
|
-
} & QuestionRT) | ({
|
|
69
|
-
type: AISerivceType.SearchCode;
|
|
70
|
-
} & QuestionRT) | ({
|
|
71
|
-
type: AISerivceType.SearchDoc;
|
|
72
|
-
} & QuestionRT) | ({
|
|
73
|
-
type: AISerivceType.Test;
|
|
74
|
-
} & QuestionRT) | ({
|
|
75
|
-
type: AISerivceType.Optimize;
|
|
76
|
-
} & CodeRT) | ({
|
|
77
|
-
type: AISerivceType.Generate;
|
|
78
|
-
} & GenerateRT) | ({
|
|
79
|
-
type: AISerivceType.Sumi;
|
|
80
|
-
} & CommandRT) | ({
|
|
81
|
-
type: AISerivceType.Run;
|
|
82
|
-
} & RunRT) | ({
|
|
83
50
|
type: AISerivceType.Completion;
|
|
84
51
|
} & CompletionRT) | ({
|
|
85
52
|
type: AISerivceType.MergeConflict;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../../src/types/ai-native/reporter.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,oBAAY,aAAa;IACvB,
|
|
1
|
+
{"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MAAM,CAAC;IAE9B,UAAU,EAAE,MAAM,CAAC;IAEnB,QAAQ,EAAE,MAAM,CAAC;IAEjB,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,UAAU,GAClB,OAAO,CAAC,aAAa,CAAC,GACtB,CAAC;IAAE,IAAI,EAAE,aAAa,CAAC,UAAU,CAAA;CAAE,GAAG,YAAY,CAAC,GACnD,CAAC;IAAE,IAAI,EAAE,aAAa,CAAC,aAAa,CAAA;CAAE,GAAG,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,WAAW,eAAwB,CAAC;AAEjD,MAAM,WAAW,WAAW;IAC1B,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,kBAAkB,CAAC,CAAC,GAAG,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IACtE,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAE1D,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC;IAC7C,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CACjD"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IAIReporter = exports.AISerivceType = exports.AI_REPORTER_NAME = void 0;
|
|
3
|
+
exports.IAIReporter = exports.MergeConflictEditorMode = exports.AISerivceType = exports.AI_REPORTER_NAME = void 0;
|
|
4
4
|
exports.AI_REPORTER_NAME = 'AI';
|
|
5
5
|
var AISerivceType;
|
|
6
6
|
(function (AISerivceType) {
|
|
7
|
-
AISerivceType["
|
|
8
|
-
AISerivceType["SearchCode"] = "searchCode";
|
|
9
|
-
AISerivceType["Sumi"] = "sumi";
|
|
10
|
-
AISerivceType["GPT"] = "chat";
|
|
11
|
-
AISerivceType["Explain"] = "explain";
|
|
12
|
-
AISerivceType["Run"] = "run";
|
|
13
|
-
AISerivceType["Test"] = "test";
|
|
14
|
-
AISerivceType["Optimize"] = "optimize";
|
|
15
|
-
AISerivceType["Generate"] = "generate";
|
|
7
|
+
AISerivceType["Chat"] = "chat";
|
|
16
8
|
AISerivceType["Completion"] = "completion";
|
|
17
9
|
AISerivceType["Agent"] = "agent";
|
|
18
10
|
AISerivceType["MergeConflict"] = "mergeConflict";
|
|
19
11
|
})(AISerivceType = exports.AISerivceType || (exports.AISerivceType = {}));
|
|
12
|
+
var MergeConflictEditorMode;
|
|
13
|
+
(function (MergeConflictEditorMode) {
|
|
14
|
+
MergeConflictEditorMode["3way"] = "3way";
|
|
15
|
+
MergeConflictEditorMode["traditional"] = "traditional";
|
|
16
|
+
})(MergeConflictEditorMode = exports.MergeConflictEditorMode || (exports.MergeConflictEditorMode = {}));
|
|
20
17
|
exports.IAIReporter = Symbol('IAIReporter');
|
|
21
18
|
//# sourceMappingURL=reporter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../../src/types/ai-native/reporter.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,IAAI,CAAC;AAErC,IAAY,
|
|
1
|
+
{"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../../src/types/ai-native/reporter.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,IAAI,CAAC;AAErC,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,0CAAyB,CAAA;IACzB,gCAAe,CAAA;IACf,gDAA+B,CAAA;AACjC,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB;AAoCD,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,wCAAe,CAAA;IACf,sDAA6B,CAAA;AAC/B,CAAC,EAHW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAGlC;AA0BY,QAAA,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-core-common",
|
|
3
|
-
"version": "2.27.3-rc-
|
|
3
|
+
"version": "2.27.3-rc-1711024024.0",
|
|
4
4
|
"description": "@opensumi/ide-core-common",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@opensumi/di": "^1.4.0",
|
|
22
|
-
"@opensumi/ide-utils": "2.27.3-rc-
|
|
22
|
+
"@opensumi/ide-utils": "2.27.3-rc-1711024024.0",
|
|
23
23
|
"jschardet": "3.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@opensumi/ide-dev-tool": "1.3.1"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "2b5368401ed5223fc1581bf807fdb0bbf720b04c"
|
|
29
29
|
}
|
package/src/index.ts
CHANGED
|
@@ -17,7 +17,6 @@ export * from './json-schema';
|
|
|
17
17
|
export * from './reporter';
|
|
18
18
|
export * from './connection';
|
|
19
19
|
export * from './comparers';
|
|
20
|
-
export * from './range';
|
|
21
20
|
export * from './problem-pattern';
|
|
22
21
|
export * from './problem-matcher';
|
|
23
22
|
export * from './task-definition';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { CancellationToken } from '../../utils';
|
|
1
|
+
import { CancellationToken, MaybePromise } from '../../utils';
|
|
2
|
+
|
|
3
|
+
import { IAIReportCompletionOption } from './reporter';
|
|
4
|
+
export * from './reporter';
|
|
2
5
|
|
|
3
6
|
export interface IAINativeCapabilities {
|
|
4
7
|
/**
|
|
@@ -25,10 +28,22 @@ export interface IAINativeCapabilities {
|
|
|
25
28
|
* Use ai to intelligently resolve conflicts
|
|
26
29
|
*/
|
|
27
30
|
supportsConflictResolve?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Use ai to provide rename suggestions
|
|
33
|
+
*/
|
|
34
|
+
supportsRenameSuggestions?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface IAINativeLayout {
|
|
38
|
+
// Use Merge right panel with left panel
|
|
39
|
+
useMergeRightWithLeftPanel?: boolean;
|
|
40
|
+
// Use ai manubar view
|
|
41
|
+
useMenubarView?: boolean;
|
|
28
42
|
}
|
|
29
43
|
|
|
30
44
|
export interface IAINativeConfig {
|
|
31
45
|
capabilities?: IAINativeCapabilities;
|
|
46
|
+
layout?: IAINativeLayout;
|
|
32
47
|
}
|
|
33
48
|
|
|
34
49
|
export interface IAICompletionResultModel {
|
|
@@ -62,13 +77,9 @@ export interface IAICompletionOption {
|
|
|
62
77
|
sessionId?: string;
|
|
63
78
|
}
|
|
64
79
|
|
|
65
|
-
export interface
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
accept: boolean;
|
|
69
|
-
repo?: string;
|
|
70
|
-
completionUseTime?: number;
|
|
71
|
-
renderingTime?: number;
|
|
80
|
+
export interface IAIRenameSuggestionOption {
|
|
81
|
+
prompt: string;
|
|
82
|
+
language?: string;
|
|
72
83
|
}
|
|
73
84
|
|
|
74
85
|
export interface IAIBackService<
|
|
@@ -94,112 +105,60 @@ export interface IAIBackService<
|
|
|
94
105
|
destroyStreamRequest?: (sessionId: string) => Promise<void>;
|
|
95
106
|
}
|
|
96
107
|
|
|
97
|
-
export
|
|
98
|
-
|
|
99
|
-
export enum AISerivceType {
|
|
100
|
-
SearchDoc = 'searchDoc',
|
|
101
|
-
SearchCode = 'searchCode',
|
|
102
|
-
Sumi = 'sumi',
|
|
103
|
-
GPT = 'chat',
|
|
104
|
-
Explain = 'explain',
|
|
105
|
-
Run = 'run',
|
|
106
|
-
Test = 'test',
|
|
107
|
-
Optimize = 'optimize',
|
|
108
|
-
Generate = 'generate',
|
|
109
|
-
Completion = 'completion',
|
|
110
|
-
Agent = 'agent',
|
|
111
|
-
MergeConflict = 'mergeConflict',
|
|
112
|
-
}
|
|
108
|
+
export class ReplyResponse {
|
|
109
|
+
constructor(readonly message: string) {}
|
|
113
110
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
replytime: number;
|
|
118
|
-
success: boolean;
|
|
119
|
-
message: string;
|
|
120
|
-
isStart: boolean;
|
|
121
|
-
isLike: boolean;
|
|
122
|
-
// 是否有效
|
|
123
|
-
isValid: boolean;
|
|
124
|
-
model: string;
|
|
125
|
-
copy: boolean;
|
|
126
|
-
insert: boolean;
|
|
111
|
+
static is(response: any): boolean {
|
|
112
|
+
return response instanceof ReplyResponse || (typeof response === 'object' && response.message !== undefined);
|
|
113
|
+
}
|
|
127
114
|
}
|
|
128
115
|
|
|
129
|
-
export
|
|
130
|
-
|
|
131
|
-
isStop: boolean;
|
|
132
|
-
}
|
|
116
|
+
export class ErrorResponse {
|
|
117
|
+
constructor(readonly error: any, readonly message?: string) {}
|
|
133
118
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
119
|
+
static is(response: any): boolean {
|
|
120
|
+
return response instanceof ErrorResponse || (typeof response === 'object' && response.error !== undefined);
|
|
121
|
+
}
|
|
137
122
|
}
|
|
138
123
|
|
|
139
|
-
export
|
|
140
|
-
|
|
141
|
-
requirment: string;
|
|
142
|
-
}
|
|
124
|
+
export class CancelResponse {
|
|
125
|
+
readonly cancellation: boolean = true;
|
|
143
126
|
|
|
144
|
-
|
|
145
|
-
useCommand: boolean;
|
|
146
|
-
useCommandSuccess: boolean;
|
|
147
|
-
}
|
|
127
|
+
constructor(readonly message?: string) {}
|
|
148
128
|
|
|
149
|
-
|
|
150
|
-
|
|
129
|
+
static is(response: any): boolean {
|
|
130
|
+
return response instanceof CancelResponse || (typeof response === 'object' && response.cancellation !== undefined);
|
|
131
|
+
}
|
|
151
132
|
}
|
|
152
133
|
|
|
153
|
-
export
|
|
154
|
-
isReceive?: boolean;
|
|
155
|
-
// 是否取消
|
|
156
|
-
isStop?: boolean;
|
|
157
|
-
// 补全条数
|
|
158
|
-
completionNum?: number;
|
|
159
|
-
// 渲染时长
|
|
160
|
-
renderingTime?: number;
|
|
161
|
-
}
|
|
134
|
+
export type ChatResponse = ReplyResponse | ErrorResponse | CancelResponse;
|
|
162
135
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
// 点击了 ai 解决冲突的数量
|
|
173
|
-
clickNum: number;
|
|
174
|
-
// 点击了一键解决的次数
|
|
175
|
-
clickAllNum: number;
|
|
176
|
-
// ai 成功输出了的数量
|
|
177
|
-
aiOutputNum: number;
|
|
178
|
-
// 取消次数
|
|
179
|
-
cancelNum: number;
|
|
180
|
-
}
|
|
136
|
+
/**
|
|
137
|
+
* DI Token
|
|
138
|
+
*/
|
|
139
|
+
export const InlineChatFeatureRegistryToken = Symbol('InlineChatFeatureRegistryToken');
|
|
140
|
+
export const ChatFeatureRegistryToken = Symbol('ChatFeatureRegistryToken');
|
|
141
|
+
export const ResolveConflictRegistryToken = Symbol('ResolveConflictRegistryToken');
|
|
142
|
+
export const RenameCandidatesProviderRegistryToken = Symbol('RenameCandidatesProviderRegistryToken');
|
|
143
|
+
|
|
144
|
+
export const ChatAgentViewServiceToken = Symbol('ChatAgentViewServiceToken');
|
|
181
145
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
getCacheReportInfo<T = ReportInfo>(relationId: string): T | undefined;
|
|
201
|
-
record(data: ReportInfo, relationId?: string): ReportInfo;
|
|
202
|
-
// 返回关联 ID
|
|
203
|
-
start(msg: string, data: ReportInfo): string;
|
|
204
|
-
end(relationId: string, data: ReportInfo): void;
|
|
146
|
+
/**
|
|
147
|
+
* Contribute Registry
|
|
148
|
+
*/
|
|
149
|
+
export interface IConflictContentMetadata {
|
|
150
|
+
current: string;
|
|
151
|
+
base: string;
|
|
152
|
+
incoming: string;
|
|
153
|
+
}
|
|
154
|
+
export interface IResolveConflictHandler {
|
|
155
|
+
providerRequest: (
|
|
156
|
+
contentMetadata: IConflictContentMetadata,
|
|
157
|
+
options: { isRegenerate: boolean },
|
|
158
|
+
token: CancellationToken,
|
|
159
|
+
) => MaybePromise<ReplyResponse | ErrorResponse | CancelResponse>;
|
|
160
|
+
}
|
|
161
|
+
export interface IInternalResolveConflictRegistry {
|
|
162
|
+
getThreeWayHandler(): IResolveConflictHandler | undefined;
|
|
163
|
+
getTraditionalHandler(): IResolveConflictHandler | undefined;
|
|
205
164
|
}
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
export const AI_REPORTER_NAME = 'AI';
|
|
2
2
|
|
|
3
3
|
export enum AISerivceType {
|
|
4
|
-
|
|
5
|
-
SearchCode = 'searchCode',
|
|
6
|
-
Sumi = 'sumi',
|
|
7
|
-
GPT = 'chat',
|
|
8
|
-
Explain = 'explain',
|
|
9
|
-
Run = 'run',
|
|
10
|
-
Test = 'test',
|
|
11
|
-
Optimize = 'optimize',
|
|
12
|
-
Generate = 'generate',
|
|
4
|
+
Chat = 'chat',
|
|
13
5
|
Completion = 'completion',
|
|
14
6
|
Agent = 'agent',
|
|
15
7
|
MergeConflict = 'mergeConflict',
|
|
16
8
|
}
|
|
17
9
|
|
|
18
10
|
export interface CommonLogInfo {
|
|
19
|
-
msgType: AISerivceType;
|
|
11
|
+
msgType: AISerivceType | string;
|
|
20
12
|
relationId: string;
|
|
21
13
|
replytime: number;
|
|
22
14
|
success: boolean;
|
|
@@ -30,30 +22,6 @@ export interface CommonLogInfo {
|
|
|
30
22
|
insert: boolean;
|
|
31
23
|
}
|
|
32
24
|
|
|
33
|
-
export interface QuestionRT extends Partial<CommonLogInfo> {
|
|
34
|
-
isRetry: boolean;
|
|
35
|
-
isStop: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface CodeRT extends Partial<CommonLogInfo> {
|
|
39
|
-
isReceive: boolean;
|
|
40
|
-
isDrop: boolean;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface GenerateRT extends Partial<CommonLogInfo> {
|
|
44
|
-
fileCount: number;
|
|
45
|
-
requirment: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface CommandRT extends Partial<CommonLogInfo> {
|
|
49
|
-
useCommand: boolean;
|
|
50
|
-
useCommandSuccess: boolean;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface RunRT extends Partial<CommonLogInfo> {
|
|
54
|
-
runSuccess: boolean;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
25
|
export interface CompletionRT extends Partial<CommonLogInfo> {
|
|
58
26
|
isReceive?: boolean;
|
|
59
27
|
// 是否取消
|
|
@@ -64,9 +32,23 @@ export interface CompletionRT extends Partial<CommonLogInfo> {
|
|
|
64
32
|
renderingTime?: number;
|
|
65
33
|
}
|
|
66
34
|
|
|
35
|
+
export interface IAIReportCompletionOption {
|
|
36
|
+
relationId: string;
|
|
37
|
+
sessionId: string;
|
|
38
|
+
accept: boolean;
|
|
39
|
+
repo?: string;
|
|
40
|
+
completionUseTime?: number;
|
|
41
|
+
renderingTime?: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export enum MergeConflictEditorMode {
|
|
45
|
+
'3way' = '3way',
|
|
46
|
+
'traditional' = 'traditional',
|
|
47
|
+
}
|
|
48
|
+
|
|
67
49
|
export interface MergeConflictRT extends Partial<CommonLogInfo> {
|
|
68
50
|
// 解决冲突模式 (3-way 或 传统模式)
|
|
69
|
-
editorMode:
|
|
51
|
+
editorMode: MergeConflictEditorMode;
|
|
70
52
|
// 冲突点数量(仅包含 AI 冲突点)
|
|
71
53
|
conflictPointNum: number;
|
|
72
54
|
// 使用了 ai 处理的冲突点数量
|
|
@@ -85,15 +67,6 @@ export interface MergeConflictRT extends Partial<CommonLogInfo> {
|
|
|
85
67
|
|
|
86
68
|
export type ReportInfo =
|
|
87
69
|
| Partial<CommonLogInfo>
|
|
88
|
-
| ({ type: AISerivceType.GPT } & QuestionRT)
|
|
89
|
-
| ({ type: AISerivceType.Explain } & QuestionRT)
|
|
90
|
-
| ({ type: AISerivceType.SearchCode } & QuestionRT)
|
|
91
|
-
| ({ type: AISerivceType.SearchDoc } & QuestionRT)
|
|
92
|
-
| ({ type: AISerivceType.Test } & QuestionRT)
|
|
93
|
-
| ({ type: AISerivceType.Optimize } & CodeRT)
|
|
94
|
-
| ({ type: AISerivceType.Generate } & GenerateRT)
|
|
95
|
-
| ({ type: AISerivceType.Sumi } & CommandRT)
|
|
96
|
-
| ({ type: AISerivceType.Run } & RunRT)
|
|
97
70
|
| ({ type: AISerivceType.Completion } & CompletionRT)
|
|
98
71
|
| ({ type: AISerivceType.MergeConflict } & MergeConflictRT);
|
|
99
72
|
|
package/lib/range.d.ts
DELETED
package/lib/range.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../src/range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,uDAAuD,CAAC;AAE/F;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAiBpE"}
|
package/lib/range.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.positionToRange = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* position 转换 range
|
|
6
|
-
* @param position
|
|
7
|
-
*/
|
|
8
|
-
function positionToRange(position) {
|
|
9
|
-
if (typeof position === 'number') {
|
|
10
|
-
return {
|
|
11
|
-
startLineNumber: position,
|
|
12
|
-
endLineNumber: position,
|
|
13
|
-
startColumn: 1,
|
|
14
|
-
endColumn: 1,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
const { lineNumber } = position;
|
|
19
|
-
return {
|
|
20
|
-
startLineNumber: lineNumber,
|
|
21
|
-
endLineNumber: lineNumber,
|
|
22
|
-
startColumn: 1,
|
|
23
|
-
endColumn: 1,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.positionToRange = positionToRange;
|
|
28
|
-
//# sourceMappingURL=range.js.map
|
package/lib/range.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"range.js","sourceRoot":"","sources":["../src/range.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,SAAgB,eAAe,CAAC,QAA4B;IAC1D,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,OAAO;YACL,eAAe,EAAE,QAAQ;YACzB,aAAa,EAAE,QAAQ;YACvB,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,CAAC;SACb,CAAC;KACH;SAAM;QACL,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;QAChC,OAAO;YACL,eAAe,EAAE,UAAU;YAC3B,aAAa,EAAE,UAAU;YACzB,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,CAAC;SACb,CAAC;KACH;AACH,CAAC;AAjBD,0CAiBC"}
|
package/src/range.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { IPosition, IRange } from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* position 转换 range
|
|
5
|
-
* @param position
|
|
6
|
-
*/
|
|
7
|
-
export function positionToRange(position: IPosition | number): IRange {
|
|
8
|
-
if (typeof position === 'number') {
|
|
9
|
-
return {
|
|
10
|
-
startLineNumber: position,
|
|
11
|
-
endLineNumber: position,
|
|
12
|
-
startColumn: 1,
|
|
13
|
-
endColumn: 1,
|
|
14
|
-
};
|
|
15
|
-
} else {
|
|
16
|
-
const { lineNumber } = position;
|
|
17
|
-
return {
|
|
18
|
-
startLineNumber: lineNumber,
|
|
19
|
-
endLineNumber: lineNumber,
|
|
20
|
-
startColumn: 1,
|
|
21
|
-
endColumn: 1,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
}
|