@opensumi/ide-core-common 2.27.3-rc-1708399099.0 → 2.27.3-rc-1710386185.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/codicons.d.ts +687 -0
- package/lib/codicons.d.ts.map +1 -0
- package/lib/codicons.js +735 -0
- package/lib/codicons.js.map +1 -0
- package/lib/command.d.ts.map +1 -1
- package/lib/const/application.d.ts +4 -4
- package/lib/const/application.d.ts.map +1 -1
- package/lib/const/application.js +7 -7
- package/lib/const/application.js.map +1 -1
- package/lib/contribution-provider.d.ts +1 -1
- package/lib/contribution-provider.d.ts.map +1 -1
- package/lib/di-helper/domain-helper.d.ts +0 -6
- package/lib/di-helper/domain-helper.d.ts.map +1 -1
- package/lib/di-helper/domain-helper.js +1 -33
- package/lib/di-helper/domain-helper.js.map +1 -1
- package/lib/electron.d.ts +1 -1
- package/lib/electron.d.ts.map +1 -1
- package/lib/event-bus/event-bus.d.ts +1 -1
- package/lib/event-bus/event-bus.d.ts.map +1 -1
- package/lib/hash-calculate/WASMInterface.d.ts.map +1 -1
- package/lib/hash-calculate/lockedCreate.d.ts.map +1 -1
- 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/json-schema.d.ts +25 -1
- package/lib/json-schema.d.ts.map +1 -1
- package/lib/line-text.d.ts.map +1 -1
- package/lib/localize.d.ts.map +1 -1
- package/lib/module.d.ts +7 -1
- package/lib/module.d.ts.map +1 -1
- package/lib/module.js.map +1 -1
- package/lib/network.d.ts +1 -0
- package/lib/network.d.ts.map +1 -1
- package/lib/network.js +1 -0
- package/lib/network.js.map +1 -1
- package/lib/problem-matcher.d.ts +2 -2
- package/lib/problem-matcher.d.ts.map +1 -1
- package/lib/problem-pattern.d.ts.map +1 -1
- package/lib/problem-pattern.js.map +1 -1
- package/lib/reference.d.ts +1 -1
- package/lib/reference.d.ts.map +1 -1
- package/lib/reporter.d.ts +1 -1
- package/lib/reporter.d.ts.map +1 -1
- package/lib/settings/ai-native.d.ts +5 -0
- package/lib/settings/ai-native.d.ts.map +1 -0
- package/lib/settings/ai-native.js +9 -0
- package/lib/settings/ai-native.js.map +1 -0
- package/lib/settings/general.d.ts +2 -1
- package/lib/settings/general.d.ts.map +1 -1
- package/lib/settings/index.d.ts +1 -0
- package/lib/settings/index.d.ts.map +1 -1
- package/lib/settings/index.js +1 -0
- package/lib/settings/index.js.map +1 -1
- package/lib/storage.d.ts +1 -1
- package/lib/storage.d.ts.map +1 -1
- package/lib/task-definition.d.ts +1 -1
- package/lib/task-definition.d.ts.map +1 -1
- package/lib/theme.d.ts +23 -0
- package/lib/theme.d.ts.map +1 -1
- package/lib/theme.js +82 -1
- package/lib/theme.js.map +1 -1
- package/lib/types/ai-native.d.ts +74 -0
- package/lib/types/ai-native.d.ts.map +1 -0
- package/lib/types/ai-native.js +6 -0
- package/lib/types/ai-native.js.map +1 -0
- package/lib/types/application.d.ts +1 -2
- package/lib/types/application.d.ts.map +1 -1
- package/lib/types/authentication.d.ts +1 -5
- package/lib/types/authentication.d.ts.map +1 -1
- package/lib/types/authentication.js.map +1 -1
- package/lib/types/file.d.ts +6 -0
- package/lib/types/file.d.ts.map +1 -1
- package/lib/types/file.js.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/markdown.d.ts +1 -11
- package/lib/types/markdown.d.ts.map +1 -1
- package/lib/types/markers/markers-manager.d.ts.map +1 -1
- package/lib/types/markers/markers-manager.js +3 -4
- package/lib/types/markers/markers-manager.js.map +1 -1
- package/lib/types/markers/markers.d.ts.map +1 -1
- package/lib/types/rpc.d.ts +1 -5
- package/lib/types/rpc.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/codicons.ts +751 -0
- package/src/command.ts +1 -1
- package/src/comparers.ts +1 -1
- package/src/const/application.ts +4 -4
- package/src/contribution-provider.ts +1 -1
- package/src/di-helper/domain-helper.ts +1 -34
- package/src/electron.ts +2 -2
- package/src/event-bus/event-bus.ts +2 -2
- package/src/hash-calculate/WASMInterface.ts +1 -1
- package/src/hash-calculate/lockedCreate.ts +1 -1
- package/src/index.ts +0 -1
- package/src/json-schema.ts +34 -10
- package/src/line-text.ts +1 -1
- package/src/localize.ts +1 -1
- package/src/module.ts +8 -1
- package/src/network.ts +2 -0
- package/src/problem-matcher.ts +5 -5
- package/src/problem-pattern.ts +2 -1
- package/src/reference.ts +1 -1
- package/src/reporter.ts +4 -4
- package/src/settings/ai-native.ts +4 -0
- package/src/settings/general.ts +1 -0
- package/src/settings/index.ts +1 -0
- package/src/storage.ts +2 -2
- package/src/task-definition.ts +2 -2
- package/src/theme.ts +92 -0
- package/src/types/ai-native.ts +94 -0
- package/src/types/application.ts +1 -2
- package/src/types/authentication.ts +1 -6
- package/src/types/file.ts +8 -0
- package/src/types/index.ts +1 -0
- package/src/types/markdown.ts +1 -10
- package/src/types/markers/markers-manager.ts +1 -2
- package/src/types/markers/markers.ts +1 -1
- package/src/types/rpc.ts +1 -5
- package/src/utils/ipc.ts +2 -2
package/src/command.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Autowired, Injectable } from '@opensumi/di';
|
|
|
2
2
|
import { Disposable, Emitter, Event, IDisposable, MaybePromise } from '@opensumi/ide-utils';
|
|
3
3
|
|
|
4
4
|
import { ContributionProvider } from './contribution-provider';
|
|
5
|
-
import {
|
|
5
|
+
import { ILocalizedStr, createLocalizedStr, replaceLocalizePlaceholder } from './localize';
|
|
6
6
|
import { getDebugLogger } from './log';
|
|
7
7
|
import { IExtensionInfo } from './types';
|
|
8
8
|
|
package/src/comparers.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
// Some code copied and modified from https://github.com/microsoft/vscode/blob/1.44.0/src/vs/base/common/comparers.ts
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { IdleValue, path } from '@opensumi/ide-utils';
|
|
8
8
|
|
|
9
9
|
import { IRange } from './types';
|
|
10
10
|
const { sep } = path;
|
package/src/const/application.ts
CHANGED
|
@@ -4,10 +4,10 @@ export const DEFAULT_APPLICATION_WEB_HOST = 'web';
|
|
|
4
4
|
export const DEFAULT_URI_SCHEME = 'sumi';
|
|
5
5
|
export const DEFAULT_OPENVSX_REGISTRY = 'https://open-vsx.org'; // Official Registry
|
|
6
6
|
|
|
7
|
-
export namespace
|
|
8
|
-
export const ENDPOINT = 'https://
|
|
9
|
-
export const ACCOUNT_ID = '
|
|
10
|
-
export const MASTER_KEY = '
|
|
7
|
+
export namespace DEFAULT_ALIPAY_CLOUD_REGISTRY {
|
|
8
|
+
export const ENDPOINT = 'https://twebgwnet.alipay.com/atsmarketplace';
|
|
9
|
+
export const ACCOUNT_ID = 'WWPLOa7vWXCUTSHCfV5FK7Su';
|
|
10
|
+
export const MASTER_KEY = 'i6rkupqyvC6Bc6CiO0yVLNqq';
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const DEFAULT_VSCODE_ENGINE_VERSION = '1.68.0';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Domain, getInjectableOpts, markInjectable } from '@opensumi/di';
|
|
2
2
|
|
|
3
3
|
import { ConstructorOf } from '../declare';
|
|
4
4
|
|
|
@@ -13,36 +13,3 @@ export function Domain(...domains: Domain[]) {
|
|
|
13
13
|
markInjectable(target, opts);
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
const domainMap = new Map<Domain, ConstructorOf<any>>();
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 带全局记录的 Domain 装饰器
|
|
21
|
-
* @param domain
|
|
22
|
-
*/
|
|
23
|
-
export function EffectDomain(domain: Domain) {
|
|
24
|
-
return (target: ConstructorOf<any>) => {
|
|
25
|
-
const opts = getInjectableOpts(target) || {};
|
|
26
|
-
opts.domain = domain;
|
|
27
|
-
markInjectable(target, opts);
|
|
28
|
-
|
|
29
|
-
const tmp = domainMap.get(domain);
|
|
30
|
-
if (!tmp) {
|
|
31
|
-
domainMap.set(domain, target);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function getDomainConstructors(...domains: Domain[]) {
|
|
37
|
-
const constructorSet = new Set<ConstructorOf<any>>();
|
|
38
|
-
for (const domain of domains) {
|
|
39
|
-
const constructor = domainMap.get(domain);
|
|
40
|
-
if (constructor) {
|
|
41
|
-
constructorSet.add(constructor);
|
|
42
|
-
} else {
|
|
43
|
-
// eslint-disable-next-line no-console
|
|
44
|
-
console.error(`Unable to retrieve the Constructor for ${String(domain)}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return Array.from(constructorSet);
|
|
48
|
-
}
|
package/src/electron.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type Electron from 'electron';
|
|
2
|
-
|
|
3
1
|
import { IDisposable } from '@opensumi/ide-utils';
|
|
4
2
|
|
|
5
3
|
import { ExtensionCandidate } from './types';
|
|
6
4
|
|
|
5
|
+
import type Electron from 'electron';
|
|
6
|
+
|
|
7
7
|
export interface IElectronMainApi<Events> {
|
|
8
8
|
on(event: Events, listener: (...args) => void): IDisposable;
|
|
9
9
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Injectable } from '@opensumi/di';
|
|
2
|
-
import { Emitter,
|
|
2
|
+
import { Emitter, Event, IAsyncResult } from '@opensumi/ide-utils';
|
|
3
3
|
|
|
4
4
|
import { ConstructorOf } from '../declare';
|
|
5
5
|
|
|
6
6
|
import { BasicEvent } from './basic-event';
|
|
7
|
-
import {
|
|
7
|
+
import { IAsyncEventFireOpts, IEventBus, IEventFireOpts, IEventListener } from './event-bus-types';
|
|
8
8
|
|
|
9
9
|
@Injectable()
|
|
10
10
|
export class EventBusImpl implements IEventBus {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// copy and modified from https://github.com/Daninet/hash-wasm/blob/bd3a205ca5603fc80adf71d0966fc72e8d4fa0ef/lib/WASMInterface.ts
|
|
8
8
|
|
|
9
9
|
import { Mutex } from './mutex';
|
|
10
|
-
import { decodeBase64, getDigestHex, getUInt8Buffer,
|
|
10
|
+
import { IDataType, decodeBase64, getDigestHex, getUInt8Buffer, hexStringEqualsUInt8, writeHexToUInt8 } from './util';
|
|
11
11
|
|
|
12
12
|
export const MAX_HEAP = 16 * 1024;
|
|
13
13
|
const WASM_FUNC_HASH_LENGTH = 4;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// copy and modified from https://github.com/Daninet/hash-wasm/blob/bd3a205ca5603fc80adf71d0966fc72e8d4fa0ef/lib/lockedCreate.ts
|
|
8
8
|
|
|
9
9
|
import { Mutex } from './mutex';
|
|
10
|
-
import {
|
|
10
|
+
import { IWASMInterface, WASMInterface } from './WASMInterface';
|
|
11
11
|
|
|
12
12
|
export async function lockedCreate(mutex: Mutex, binary: any, hashLength: number): Promise<IWASMInterface> {
|
|
13
13
|
const unlock = await mutex.lock();
|
package/src/index.ts
CHANGED
package/src/json-schema.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
export type JSONSchemaType = string | 'number' | 'integer' | 'boolean' | 'null' | 'array' | 'object';
|
|
2
|
+
|
|
1
3
|
export interface IJSONSchema {
|
|
2
4
|
id?: string;
|
|
3
5
|
$id?: string;
|
|
4
6
|
$schema?: string;
|
|
5
|
-
type?:
|
|
7
|
+
type?: JSONSchemaType | JSONSchemaType[];
|
|
6
8
|
title?: string;
|
|
7
9
|
default?: any;
|
|
8
10
|
definitions?: IJSONSchemaMap;
|
|
@@ -39,6 +41,7 @@ export interface IJSONSchema {
|
|
|
39
41
|
const?: any;
|
|
40
42
|
contains?: IJSONSchema;
|
|
41
43
|
propertyNames?: IJSONSchema;
|
|
44
|
+
examples?: any[];
|
|
42
45
|
|
|
43
46
|
// schema draft 07
|
|
44
47
|
$comment?: string;
|
|
@@ -46,16 +49,37 @@ export interface IJSONSchema {
|
|
|
46
49
|
then?: IJSONSchema;
|
|
47
50
|
else?: IJSONSchema;
|
|
48
51
|
|
|
52
|
+
unevaluatedProperties?: boolean | IJSONSchema;
|
|
53
|
+
unevaluatedItems?: boolean | IJSONSchema;
|
|
54
|
+
minContains?: number;
|
|
55
|
+
maxContains?: number;
|
|
56
|
+
deprecated?: boolean;
|
|
57
|
+
dependentRequired?: { [prop: string]: string[] };
|
|
58
|
+
dependentSchemas?: IJSONSchemaMap;
|
|
59
|
+
$defs?: { [name: string]: IJSONSchema };
|
|
60
|
+
$anchor?: string;
|
|
61
|
+
$recursiveRef?: string;
|
|
62
|
+
$recursiveAnchor?: string;
|
|
63
|
+
$vocabulary?: any;
|
|
64
|
+
|
|
65
|
+
prefixItems?: IJSONSchema[];
|
|
66
|
+
$dynamicRef?: string;
|
|
67
|
+
$dynamicAnchor?: string;
|
|
68
|
+
|
|
49
69
|
// VSCode extensions
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
70
|
+
|
|
71
|
+
defaultSnippets?: IJSONSchemaSnippet[];
|
|
72
|
+
errorMessage?: string;
|
|
73
|
+
patternErrorMessage?: string;
|
|
74
|
+
deprecationMessage?: string;
|
|
75
|
+
markdownDeprecationMessage?: string;
|
|
76
|
+
enumDescriptions?: string[];
|
|
77
|
+
markdownEnumDescriptions?: string[];
|
|
78
|
+
markdownDescription?: string;
|
|
79
|
+
doNotSuggest?: boolean;
|
|
80
|
+
suggestSortText?: string;
|
|
81
|
+
allowComments?: boolean;
|
|
82
|
+
allowTrailingCommas?: boolean;
|
|
59
83
|
}
|
|
60
84
|
|
|
61
85
|
export interface IJSONSchemaMap {
|
package/src/line-text.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 用于实现效率更高的编辑操作
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { IEditOperation, IPosition, IRange } from './types/editor';
|
|
6
6
|
|
|
7
7
|
export class BasicTextLines {
|
|
8
8
|
constructor(protected readonly _lines: string[], protected _eol: '\n' | '\r\n') {}
|
package/src/localize.ts
CHANGED
package/src/module.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 项目中会使用到的模块接口定义
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { Autowired, INJECTOR_TOKEN, Injector, Provider,
|
|
5
|
+
import { Autowired, ConstructorOf, Domain, INJECTOR_TOKEN, Injector, Provider, Token } from '@opensumi/di';
|
|
6
6
|
|
|
7
7
|
import { RPCProtocol } from './types/rpc';
|
|
8
8
|
|
|
@@ -22,8 +22,15 @@ export interface BackService {
|
|
|
22
22
|
export class BasicModule {
|
|
23
23
|
@Autowired(INJECTOR_TOKEN)
|
|
24
24
|
protected injector: Injector;
|
|
25
|
+
|
|
25
26
|
providers?: Provider[];
|
|
27
|
+
/**
|
|
28
|
+
* providers only avaiable in electron
|
|
29
|
+
*/
|
|
26
30
|
electronProviders?: Provider[];
|
|
31
|
+
/**
|
|
32
|
+
* providers only avaiable in web
|
|
33
|
+
*/
|
|
27
34
|
webProviders?: Provider[];
|
|
28
35
|
backServices?: BackService[];
|
|
29
36
|
frontServices?: FrontService[];
|
package/src/network.ts
CHANGED
package/src/problem-matcher.ts
CHANGED
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
// Some code copied and modified from https://github.com/eclipse-theia/theia/tree/v1.14.0/packages/task/src/browser/task-problem-matcher-registry.ts
|
|
17
17
|
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { Autowired, Injectable } from '@opensumi/di';
|
|
19
|
+
import { Disposable, DisposableCollection, Emitter, IDisposable, URI } from '@opensumi/ide-utils';
|
|
20
20
|
|
|
21
21
|
import {
|
|
22
|
-
IProblemPatternRegistry,
|
|
23
22
|
ApplyToKind,
|
|
24
23
|
FileLocationKind,
|
|
25
|
-
|
|
26
|
-
ProblemPatternContribution,
|
|
24
|
+
IProblemPatternRegistry,
|
|
27
25
|
ProblemPattern,
|
|
26
|
+
ProblemPatternContribution,
|
|
27
|
+
Severity,
|
|
28
28
|
WatchingPattern,
|
|
29
29
|
} from './problem-pattern';
|
|
30
30
|
|
package/src/problem-pattern.ts
CHANGED
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
// Some code copied and modified from https://github.com/eclipse-theia/theia/tree/v1.14.0/packages/core/src/common/severity.ts
|
|
17
17
|
|
|
18
|
+
// eslint-disable-next-line import/no-unresolved
|
|
18
19
|
import { Diagnostic } from 'vscode';
|
|
19
20
|
|
|
20
21
|
import { Injectable } from '@opensumi/di';
|
|
21
|
-
import {
|
|
22
|
+
import { Disposable, DisposableCollection, IDisposable, URI, isArray, isString } from '@opensumi/ide-utils';
|
|
22
23
|
|
|
23
24
|
import { ProblemMatcher } from './problem-matcher';
|
|
24
25
|
|
package/src/reference.ts
CHANGED
package/src/reporter.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Inject, Injectable } from '@opensumi/di';
|
|
2
2
|
import { IDisposable } from '@opensumi/ide-utils';
|
|
3
3
|
|
|
4
4
|
import { getDebugLogger } from './log';
|
|
5
5
|
import {
|
|
6
|
-
IReporterService,
|
|
7
|
-
ReporterMetadata,
|
|
8
6
|
IReporter,
|
|
7
|
+
IReporterService,
|
|
8
|
+
IReporterTimer,
|
|
9
9
|
PerformanceData,
|
|
10
10
|
PointData,
|
|
11
|
-
IReporterTimer,
|
|
12
11
|
REPORT_NAME,
|
|
12
|
+
ReporterMetadata,
|
|
13
13
|
} from './types/reporter';
|
|
14
14
|
|
|
15
15
|
class ReporterTimer implements IReporterTimer {
|
package/src/settings/general.ts
CHANGED
package/src/settings/index.ts
CHANGED
package/src/storage.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IDisposable, MaybePromise,
|
|
1
|
+
import { Autowired, Injectable } from '@opensumi/di';
|
|
2
|
+
import { Event, IDisposable, MaybePromise, URI } from '@opensumi/ide-utils';
|
|
3
3
|
|
|
4
4
|
import { ContributionProvider } from './contribution-provider';
|
|
5
5
|
|
package/src/task-definition.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injectable } from '@opensumi/di';
|
|
2
|
-
import {
|
|
2
|
+
import { Disposable, IDisposable, objects } from '@opensumi/ide-utils';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { IJSONSchema, IJSONSchemaMap } from './json-schema';
|
|
5
5
|
import { formatLocalize } from './localize';
|
|
6
6
|
import { IStringDictionary } from './types/string';
|
|
7
7
|
|
package/src/theme.ts
CHANGED
|
@@ -1,7 +1,99 @@
|
|
|
1
|
+
import { isObject, isString, isUndefined } from '@opensumi/ide-utils';
|
|
2
|
+
|
|
3
|
+
import { Codicon } from './codicons';
|
|
4
|
+
|
|
1
5
|
export interface IThemeColor {
|
|
2
6
|
id: string;
|
|
3
7
|
}
|
|
4
8
|
|
|
9
|
+
export interface ThemeIcon {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly color?: IThemeColor;
|
|
12
|
+
// for sumiicon proxy
|
|
13
|
+
readonly alias?: string[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export namespace IThemeColor {
|
|
17
|
+
export function isThemeColor(obj: any): obj is IThemeColor {
|
|
18
|
+
return obj && typeof obj === 'object' && typeof obj.id === 'string';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
5
22
|
export function isThemeColor(obj: any): obj is IThemeColor {
|
|
6
23
|
return obj && typeof obj === 'object' && typeof (obj as IThemeColor).id === 'string';
|
|
7
24
|
}
|
|
25
|
+
|
|
26
|
+
export namespace ThemeIcon {
|
|
27
|
+
export const iconNameSegment = '[A-Za-z0-9]+';
|
|
28
|
+
export const iconNameExpression = '[A-Za-z0-9-]+';
|
|
29
|
+
export const iconModifierExpression = '~[A-Za-z]+';
|
|
30
|
+
export const iconNameCharacter = '[A-Za-z0-9~-]';
|
|
31
|
+
|
|
32
|
+
const ThemeIconIdRegex = new RegExp(`^(${iconNameExpression})(${iconModifierExpression})?$`);
|
|
33
|
+
|
|
34
|
+
export function asClassNameArray(icon: ThemeIcon): string[] {
|
|
35
|
+
const match = ThemeIconIdRegex.exec(icon.id);
|
|
36
|
+
if (!match) {
|
|
37
|
+
return asClassNameArray(Codicon.error);
|
|
38
|
+
}
|
|
39
|
+
const [, id, modifier] = match;
|
|
40
|
+
const classNames = ['codicon', 'codicon-' + id];
|
|
41
|
+
if (modifier) {
|
|
42
|
+
classNames.push('codicon-modifier-' + modifier.substring(1));
|
|
43
|
+
}
|
|
44
|
+
return classNames;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function asClassName(icon: ThemeIcon): string {
|
|
48
|
+
return asClassNameArray(icon).join(' ');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function asCSSSelector(icon: ThemeIcon): string {
|
|
52
|
+
return '.' + asClassNameArray(icon).join('.');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function isThemeIcon(obj: any): obj is ThemeIcon {
|
|
56
|
+
return isObject(obj) && isString(obj.id) && (isUndefined(obj.color) || IThemeColor.isThemeColor(obj.color));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const _regexFromString = new RegExp(
|
|
60
|
+
`^\\$\\((${ThemeIcon.iconNameExpression}(?:${ThemeIcon.iconModifierExpression})?)\\)$`,
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export function fromString(str: string): ThemeIcon | undefined {
|
|
64
|
+
const match = _regexFromString.exec(str);
|
|
65
|
+
if (!match) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
const [, name] = match;
|
|
69
|
+
return { id: name };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function fromId(id: string): ThemeIcon {
|
|
73
|
+
return { id };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function modify(icon: ThemeIcon, modifier: 'disabled' | 'spin' | undefined): ThemeIcon {
|
|
77
|
+
let id = icon.id;
|
|
78
|
+
const tildeIndex = id.lastIndexOf('~');
|
|
79
|
+
if (tildeIndex !== -1) {
|
|
80
|
+
id = id.substring(0, tildeIndex);
|
|
81
|
+
}
|
|
82
|
+
if (modifier) {
|
|
83
|
+
id = `${id}~${modifier}`;
|
|
84
|
+
}
|
|
85
|
+
return { id };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function getModifier(icon: ThemeIcon): string | undefined {
|
|
89
|
+
const tildeIndex = icon.id.lastIndexOf('~');
|
|
90
|
+
if (tildeIndex !== -1) {
|
|
91
|
+
return icon.id.substring(tildeIndex + 1);
|
|
92
|
+
}
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function isEqual(ti1: ThemeIcon, ti2: ThemeIcon): boolean {
|
|
97
|
+
return ti1.id === ti2.id && ti1.color?.id === ti2.color?.id;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { CancellationToken } from '../utils';
|
|
2
|
+
|
|
3
|
+
export interface IAINativeCapabilities {
|
|
4
|
+
/**
|
|
5
|
+
* Use opensumi design UI style
|
|
6
|
+
*/
|
|
7
|
+
supportsOpenSumiDesign?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Problem panel uses ai capabilities
|
|
10
|
+
*/
|
|
11
|
+
supportsMarkers?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Use ai chat capabilities
|
|
14
|
+
*/
|
|
15
|
+
supportsChatAssistant?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Use inline chat capabilities
|
|
18
|
+
*/
|
|
19
|
+
supportsInlineChat?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Use code intelligent completion capabilities
|
|
22
|
+
*/
|
|
23
|
+
supportsInlineCompletion?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Use ai to intelligently resolve conflicts
|
|
26
|
+
*/
|
|
27
|
+
supportsConflictResolve?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface IAINativeConfig {
|
|
31
|
+
capabilities?: IAINativeCapabilities;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IAICompletionResultModel {
|
|
35
|
+
sessionId: string;
|
|
36
|
+
codeModelList: Array<{ content: string }>;
|
|
37
|
+
isCancel?: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const AIBackSerivceToken = Symbol('AIBackSerivceToken');
|
|
41
|
+
export const AIBackSerivcePath = 'AIBackSerivcePath';
|
|
42
|
+
|
|
43
|
+
export interface IAIBackServiceResponse<T = string> {
|
|
44
|
+
errorCode?: number;
|
|
45
|
+
errorMsg?: string;
|
|
46
|
+
isCancel?: boolean;
|
|
47
|
+
data?: T;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface IAIBackServiceOption {
|
|
51
|
+
type?: string;
|
|
52
|
+
model?: string;
|
|
53
|
+
enableGptCache?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface IAICompletionOption {
|
|
57
|
+
prompt: string;
|
|
58
|
+
suffix?: string;
|
|
59
|
+
language?: string;
|
|
60
|
+
fileUrl?: string;
|
|
61
|
+
sessionId?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface IAIReportCompletionOption {
|
|
65
|
+
relationId: string;
|
|
66
|
+
sessionId: string;
|
|
67
|
+
accept: boolean;
|
|
68
|
+
repo?: string;
|
|
69
|
+
completionUseTime?: number;
|
|
70
|
+
renderingTime?: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface IAIBackService<
|
|
74
|
+
BaseResponse extends IAIBackServiceResponse = IAIBackServiceResponse,
|
|
75
|
+
StreamResponse extends NodeJS.ReadableStream = NodeJS.ReadableStream,
|
|
76
|
+
CompletionResponse = IAICompletionResultModel,
|
|
77
|
+
> {
|
|
78
|
+
request<O extends IAIBackServiceOption>(
|
|
79
|
+
input: string,
|
|
80
|
+
options: O,
|
|
81
|
+
cancelToken?: CancellationToken,
|
|
82
|
+
): Promise<BaseResponse>;
|
|
83
|
+
requestStream<O extends IAIBackServiceOption>(
|
|
84
|
+
input: string,
|
|
85
|
+
options: O,
|
|
86
|
+
cancelToken?: CancellationToken,
|
|
87
|
+
): Promise<StreamResponse>;
|
|
88
|
+
requestCompletion<I extends IAICompletionOption>(
|
|
89
|
+
input: I,
|
|
90
|
+
cancelToken?: CancellationToken,
|
|
91
|
+
): Promise<CompletionResponse>;
|
|
92
|
+
reportCompletion<I extends IAIReportCompletionOption>(input: I): Promise<void>;
|
|
93
|
+
destroyStreamRequest?: (sessionId: string) => Promise<void>;
|
|
94
|
+
}
|
package/src/types/application.ts
CHANGED
|
@@ -4,8 +4,7 @@ export const IApplicationService = Symbol('IApplicationService');
|
|
|
4
4
|
|
|
5
5
|
export interface IApplicationService {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* Otherwise, use WebSocket connection: `WSChannelHandler.clientId`
|
|
7
|
+
* equals to `WSChannelHandler.clientId`, which will be inited when create connection to backend
|
|
9
8
|
*/
|
|
10
9
|
clientId: string;
|
|
11
10
|
/**
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Event, IDisposable } from '@opensumi/ide-utils';
|
|
2
2
|
|
|
3
3
|
export const noAccountsId = 'authentication.noAccounts';
|
|
4
4
|
|
|
5
5
|
export const ACCOUNTS_MENU = ['accounts_menu'];
|
|
6
6
|
export const ACCOUNTS_SUBMENU = [...ACCOUNTS_MENU, '1_accounts_submenu'];
|
|
7
7
|
|
|
8
|
-
export interface AllowedExtension {
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
8
|
export interface AuthenticationSessionsChangeEvent {
|
|
14
9
|
added: ReadonlyArray<AuthenticationSession>;
|
|
15
10
|
removed: ReadonlyArray<AuthenticationSession>;
|
package/src/types/file.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Event, Uri } from '@opensumi/ide-utils';
|
|
2
|
+
import { IReadableStream } from '@opensumi/ide-utils/lib/stream';
|
|
2
3
|
|
|
3
4
|
import { FileChangeEvent } from './file-watch';
|
|
4
5
|
|
|
@@ -123,6 +124,11 @@ export enum FileType {
|
|
|
123
124
|
SymbolicLink = 64,
|
|
124
125
|
}
|
|
125
126
|
|
|
127
|
+
export interface IReadFileStreamOptions {
|
|
128
|
+
position?: number;
|
|
129
|
+
length?: number;
|
|
130
|
+
}
|
|
131
|
+
|
|
126
132
|
/**
|
|
127
133
|
* Compatible with vscode.FileSystemProvider
|
|
128
134
|
*/
|
|
@@ -197,6 +203,8 @@ export interface FileSystemProvider {
|
|
|
197
203
|
*/
|
|
198
204
|
readFile(uri: Uri, encoding?: string): Uint8Array | void | Promise<Uint8Array | void>;
|
|
199
205
|
|
|
206
|
+
readFileStream?(uri: Uri, opts?: IReadFileStreamOptions): Promise<IReadableStream<Uint8Array>>;
|
|
207
|
+
|
|
200
208
|
/**
|
|
201
209
|
* Write data to a file, replacing its entire contents.
|
|
202
210
|
*
|
package/src/types/index.ts
CHANGED
package/src/types/markdown.ts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface IMarkdownString {
|
|
4
|
-
value: string;
|
|
5
|
-
isTrusted?: boolean;
|
|
6
|
-
supportThemeIcons?: boolean;
|
|
7
|
-
supportHtml?: boolean;
|
|
8
|
-
baseUri?: UriComponents;
|
|
9
|
-
uris?: { [href: string]: UriComponents };
|
|
10
|
-
}
|
|
1
|
+
export type { IMarkdownString } from '@opensumi/monaco-editor-core/esm/vs/base/common/htmlContent';
|
|
@@ -3,8 +3,7 @@ import { Emitter, Event, IDisposable, arrays } from '@opensumi/ide-utils';
|
|
|
3
3
|
|
|
4
4
|
import { WithEventBus } from '../../event-bus';
|
|
5
5
|
|
|
6
|
-
import { MapMap } from './markers';
|
|
7
|
-
import { IMarker, IMarkerData, MarkerStatistics, MarkerSeverity } from './markers';
|
|
6
|
+
import { IMarker, IMarkerData, MapMap, MarkerSeverity, MarkerStatistics } from './markers';
|
|
8
7
|
|
|
9
8
|
const { isFalsyOrEmpty } = arrays;
|
|
10
9
|
|