@opensumi/ide-preferences 2.12.1-next-079c1930
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +190 -0
- package/lib/browser/abstract-resource-preference-provider.d.ts +51 -0
- package/lib/browser/abstract-resource-preference-provider.d.ts.map +1 -0
- package/lib/browser/abstract-resource-preference-provider.js +281 -0
- package/lib/browser/abstract-resource-preference-provider.js.map +1 -0
- package/lib/browser/folder-preference-provider.d.ts +26 -0
- package/lib/browser/folder-preference-provider.d.ts.map +1 -0
- package/lib/browser/folder-preference-provider.js +49 -0
- package/lib/browser/folder-preference-provider.js.map +1 -0
- package/lib/browser/folders-preferences-provider.d.ts +41 -0
- package/lib/browser/folders-preferences-provider.d.ts.map +1 -0
- package/lib/browser/folders-preferences-provider.js +240 -0
- package/lib/browser/folders-preferences-provider.js.map +1 -0
- package/lib/browser/index.d.ts +12 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +120 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/index.less +35 -0
- package/lib/browser/preference-contribution.d.ts +51 -0
- package/lib/browser/preference-contribution.d.ts.map +1 -0
- package/lib/browser/preference-contribution.js +315 -0
- package/lib/browser/preference-contribution.js.map +1 -0
- package/lib/browser/preference-settings.service.d.ts +120 -0
- package/lib/browser/preference-settings.service.d.ts.map +1 -0
- package/lib/browser/preference-settings.service.js +492 -0
- package/lib/browser/preference-settings.service.js.map +1 -0
- package/lib/browser/preferenceItem.view.d.ts +20 -0
- package/lib/browser/preferenceItem.view.d.ts.map +1 -0
- package/lib/browser/preferenceItem.view.js +357 -0
- package/lib/browser/preferenceItem.view.js.map +1 -0
- package/lib/browser/preferences.module.less +272 -0
- package/lib/browser/preferences.view.d.ts +29 -0
- package/lib/browser/preferences.view.d.ts.map +1 -0
- package/lib/browser/preferences.view.js +159 -0
- package/lib/browser/preferences.view.js.map +1 -0
- package/lib/browser/user-preference-provider.d.ts +9 -0
- package/lib/browser/user-preference-provider.d.ts.map +1 -0
- package/lib/browser/user-preference-provider.js +23 -0
- package/lib/browser/user-preference-provider.js.map +1 -0
- package/lib/browser/userstorage/index.d.ts +3 -0
- package/lib/browser/userstorage/index.d.ts.map +1 -0
- package/lib/browser/userstorage/index.js +6 -0
- package/lib/browser/userstorage/index.js.map +1 -0
- package/lib/browser/userstorage/user-storage.contribution.d.ts +8 -0
- package/lib/browser/userstorage/user-storage.contribution.d.ts.map +1 -0
- package/lib/browser/userstorage/user-storage.contribution.js +27 -0
- package/lib/browser/userstorage/user-storage.contribution.js.map +1 -0
- package/lib/browser/userstorage/user-storage.service.d.ts +62 -0
- package/lib/browser/userstorage/user-storage.service.d.ts.map +1 -0
- package/lib/browser/userstorage/user-storage.service.js +163 -0
- package/lib/browser/userstorage/user-storage.service.js.map +1 -0
- package/lib/browser/workspace-file-preference-provider.d.ts +19 -0
- package/lib/browser/workspace-file-preference-provider.d.ts.map +1 -0
- package/lib/browser/workspace-file-preference-provider.js +49 -0
- package/lib/browser/workspace-file-preference-provider.js.map +1 -0
- package/lib/browser/workspace-preference-provider.d.ts +34 -0
- package/lib/browser/workspace-preference-provider.d.ts.map +1 -0
- package/lib/browser/workspace-preference-provider.js +109 -0
- package/lib/browser/workspace-preference-provider.js.map +1 -0
- package/lib/common/index.d.ts +5 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +8 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/preference-id.d.ts +8 -0
- package/lib/common/preference-id.d.ts.map +1 -0
- package/lib/common/preference-id.js +12 -0
- package/lib/common/preference-id.js.map +1 -0
- package/lib/common/preference.d.ts +4 -0
- package/lib/common/preference.d.ts.map +1 -0
- package/lib/common/preference.js +21 -0
- package/lib/common/preference.js.map +1 -0
- package/lib/common/types.d.ts +38 -0
- package/lib/common/types.d.ts.map +1 -0
- package/lib/common/types.js +5 -0
- package/lib/common/types.js.map +1 -0
- package/lib/common/user-storage.d.ts +6 -0
- package/lib/common/user-storage.d.ts.map +1 -0
- package/lib/common/user-storage.js +6 -0
- package/lib/common/user-storage.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ReactEditorComponent } from '@opensumi/ide-editor/lib/browser';
|
|
3
|
+
import { PreferenceScope, ISettingGroup, ISettingSection } from '@opensumi/ide-core-browser';
|
|
4
|
+
import { ISectionItemData } from '../common';
|
|
5
|
+
import './index.less';
|
|
6
|
+
export declare const PreferenceView: ReactEditorComponent<null>;
|
|
7
|
+
export declare const PreferenceSections: ({ preferenceSections, navigateTo }: {
|
|
8
|
+
preferenceSections: ISettingSection[];
|
|
9
|
+
navigateTo: (section: ISettingSection) => void;
|
|
10
|
+
}) => JSX.Element;
|
|
11
|
+
export declare const PreferencesIndexes: ({ groups, scope, search, navigateTo }: {
|
|
12
|
+
groups: ISettingGroup[];
|
|
13
|
+
scope: PreferenceScope;
|
|
14
|
+
search: string;
|
|
15
|
+
navigateTo: (setction: ISettingSection) => void;
|
|
16
|
+
}) => JSX.Element;
|
|
17
|
+
export declare const PreferenceItem: ({ data, index }: {
|
|
18
|
+
data: ISectionItemData;
|
|
19
|
+
index: number;
|
|
20
|
+
}) => JSX.Element | undefined;
|
|
21
|
+
export declare const PreferenceBody: ({ items, onReady }: {
|
|
22
|
+
items: ISectionItemData[];
|
|
23
|
+
onReady: (handler: any) => void;
|
|
24
|
+
}) => JSX.Element;
|
|
25
|
+
export declare const PreferenceSection: ({ section, scope }: {
|
|
26
|
+
section: ISettingSection;
|
|
27
|
+
scope: PreferenceScope;
|
|
28
|
+
}) => JSX.Element;
|
|
29
|
+
//# sourceMappingURL=preferences.view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preferences.view.d.ts","sourceRoot":"","sources":["../../src/browser/preferences.view.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAuD,eAAe,EAAqC,aAAa,EAA8B,eAAe,EAA8B,MAAM,4BAA4B,CAAC;AAM7O,OAAO,EAAE,gBAAgB,EAAgB,MAAM,WAAW,CAAC;AAE3D,OAAO,cAAc,CAAC;AAatB,eAAO,MAAM,cAAc,EAAE,oBAAoB,CAAC,IAAI,CAiHpD,CAAC;AAEH,eAAO,MAAM,kBAAkB;wBAA+D,eAAe,EAAE;0BAAwB,eAAe,KAAK,IAAI;iBAS7J,CAAC;AAEH,eAAO,MAAM,kBAAkB;YACrB,aAAa,EAAE;WAChB,eAAe;YACd,MAAM;2BACS,eAAe,KAAK,IAAI;iBA+BhD,CAAC;AAEF,eAAO,MAAM,cAAc;UACnB,gBAAgB;WACf,MAAM;6BAWd,CAAC;AAEF,eAAO,MAAM,cAAc;WAClB,gBAAgB,EAAE;uBACN,GAAG,KAAK,IAAI;iBAUhC,CAAC;AAEF,eAAO,MAAM,iBAAiB;aAAmC,eAAe;WAAS,eAAe;iBAcvG,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreferenceSection = exports.PreferenceBody = exports.PreferenceItem = exports.PreferencesIndexes = exports.PreferenceSections = exports.PreferenceView = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
6
|
+
const mobx_react_lite_1 = require("mobx-react-lite");
|
|
7
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
8
|
+
const preferences_module_less_1 = (0, tslib_1.__importDefault)(require("./preferences.module.less"));
|
|
9
|
+
const classnames_1 = (0, tslib_1.__importDefault)(require("classnames"));
|
|
10
|
+
const scroll_1 = require("@opensumi/ide-editor/lib/browser/component/scroll/scroll");
|
|
11
|
+
const ide_components_1 = require("@opensumi/ide-components");
|
|
12
|
+
const common_1 = require("../common");
|
|
13
|
+
const preferenceItem_view_1 = require("./preferenceItem.view");
|
|
14
|
+
require("./index.less");
|
|
15
|
+
const debounce = require("lodash.debounce");
|
|
16
|
+
const WorkspaceScope = {
|
|
17
|
+
id: ide_core_browser_1.PreferenceScope.Workspace,
|
|
18
|
+
label: 'preference.tab.workspace',
|
|
19
|
+
};
|
|
20
|
+
const UserScope = {
|
|
21
|
+
id: ide_core_browser_1.PreferenceScope.User,
|
|
22
|
+
label: 'preference.tab.user',
|
|
23
|
+
};
|
|
24
|
+
exports.PreferenceView = (0, mobx_react_lite_1.observer)(() => {
|
|
25
|
+
const preferenceService = (0, ide_core_browser_1.useInjectable)(ide_core_browser_1.IPreferenceSettingsService);
|
|
26
|
+
const preferences = (0, ide_core_browser_1.useInjectable)(ide_core_browser_1.PreferenceService);
|
|
27
|
+
const labelService = (0, ide_core_browser_1.useInjectable)(ide_core_browser_1.LabelService);
|
|
28
|
+
const getResourceIcon = react_1.default.useCallback((uri, options) => {
|
|
29
|
+
return labelService.getIcon(ide_core_browser_1.URI.parse(uri), options);
|
|
30
|
+
}, []);
|
|
31
|
+
const userBeforeWorkspace = preferences.get('settings.userBeforeWorkspace');
|
|
32
|
+
const tabList = userBeforeWorkspace
|
|
33
|
+
? [UserScope, WorkspaceScope]
|
|
34
|
+
: [WorkspaceScope, UserScope];
|
|
35
|
+
const [tabIndex, setTabIndex] = react_1.default.useState(0);
|
|
36
|
+
const currentScope = react_1.default.useMemo(() => {
|
|
37
|
+
return (tabList[tabIndex] || tabList[0]).id;
|
|
38
|
+
}, [tabList, tabIndex]);
|
|
39
|
+
const { currentSearch: doSearchValue, currentGroup } = preferenceService;
|
|
40
|
+
const [currentSearch, setCurrentSearch] = react_1.default.useState('');
|
|
41
|
+
const groups = preferenceService.getSettingGroups(currentScope, currentSearch);
|
|
42
|
+
const inputRef = react_1.default.useRef(null);
|
|
43
|
+
if (groups.length > 0 && groups.findIndex((g) => g.id === preferenceService.currentGroup) === -1) {
|
|
44
|
+
preferenceService.setCurrentGroup(groups[0].id);
|
|
45
|
+
}
|
|
46
|
+
const debouncedSearch = debounce((value) => {
|
|
47
|
+
setCurrentSearch(value);
|
|
48
|
+
}, 100, { maxWait: 1000 });
|
|
49
|
+
const search = (value) => {
|
|
50
|
+
debouncedSearch(value);
|
|
51
|
+
};
|
|
52
|
+
react_1.default.useEffect(() => {
|
|
53
|
+
setCurrentSearch(doSearchValue);
|
|
54
|
+
}, [doSearchValue]);
|
|
55
|
+
react_1.default.useEffect(() => {
|
|
56
|
+
const focusDispose = preferenceService.onFocus(() => {
|
|
57
|
+
if (inputRef && inputRef.current) {
|
|
58
|
+
inputRef.current.focus();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return () => {
|
|
62
|
+
focusDispose.dispose();
|
|
63
|
+
};
|
|
64
|
+
}, []);
|
|
65
|
+
const headers = (react_1.default.createElement(ide_components_1.Tabs, { className: preferences_module_less_1.default.tabs, value: tabIndex, onChange: (index) => setTabIndex(index), tabs: tabList.map((n) => (0, ide_core_browser_1.localize)(n.label)) }));
|
|
66
|
+
const items = react_1.default.useMemo(() => {
|
|
67
|
+
const sections = preferenceService.getSections(preferenceService.currentGroup, currentScope, currentSearch);
|
|
68
|
+
let items = [];
|
|
69
|
+
for (const section of sections) {
|
|
70
|
+
if (section.title) {
|
|
71
|
+
items.push({ title: section.title, scope: currentScope });
|
|
72
|
+
}
|
|
73
|
+
if (section.component) {
|
|
74
|
+
items.push({ component: section.title, scope: currentScope });
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
items = items.concat(section.preferences.map((pre) => ({ preference: pre, scope: currentScope })));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return items;
|
|
81
|
+
}, [currentGroup, currentScope, currentSearch]);
|
|
82
|
+
const navigateTo = react_1.default.useCallback((section) => {
|
|
83
|
+
var _a;
|
|
84
|
+
const index = items.findIndex((item) => item.title === section.title);
|
|
85
|
+
if (index >= 0) {
|
|
86
|
+
(_a = preferenceService.listHandler) === null || _a === void 0 ? void 0 : _a.scrollToIndex(index);
|
|
87
|
+
}
|
|
88
|
+
}, [items]);
|
|
89
|
+
return (react_1.default.createElement(ide_components_1.ComponentContextProvider, { value: { getIcon: ide_core_browser_1.getIcon, localize: ide_core_browser_1.localize, getResourceIcon } },
|
|
90
|
+
react_1.default.createElement("div", { className: preferences_module_less_1.default.preferences },
|
|
91
|
+
react_1.default.createElement("div", { className: preferences_module_less_1.default.preferences_header },
|
|
92
|
+
headers,
|
|
93
|
+
react_1.default.createElement("div", { className: preferences_module_less_1.default.search_pref },
|
|
94
|
+
react_1.default.createElement(ide_components_1.Input, { autoFocus: true, value: currentSearch, placeholder: (0, ide_core_browser_1.localize)('preference.searchPlaceholder'), onValueChange: search, ref: inputRef }))),
|
|
95
|
+
groups.length > 0 ?
|
|
96
|
+
react_1.default.createElement("div", { className: preferences_module_less_1.default.preferences_body },
|
|
97
|
+
react_1.default.createElement(exports.PreferencesIndexes, { groups: groups, scope: currentScope, search: currentSearch, navigateTo: navigateTo }),
|
|
98
|
+
react_1.default.createElement("div", { className: preferences_module_less_1.default.preferences_items },
|
|
99
|
+
react_1.default.createElement(exports.PreferenceBody, { items: items, onReady: preferenceService.handleListHandler }))) :
|
|
100
|
+
react_1.default.createElement("div", { className: preferences_module_less_1.default.preference_noResults }, (0, ide_core_browser_1.formatLocalize)('preference.noResults', currentSearch)))));
|
|
101
|
+
});
|
|
102
|
+
exports.PreferenceSections = (({ preferenceSections, navigateTo }) => {
|
|
103
|
+
return react_1.default.createElement("div", { className: preferences_module_less_1.default.preference_section_link }, preferenceSections.filter((s) => s.title).map((section, idx) => {
|
|
104
|
+
return react_1.default.createElement("div", { key: `${section.title}-${idx}`, onClick: () => navigateTo(section) }, section.title);
|
|
105
|
+
}));
|
|
106
|
+
});
|
|
107
|
+
const PreferencesIndexes = ({ groups, scope, search, navigateTo }) => {
|
|
108
|
+
const preferenceService = (0, ide_core_browser_1.useInjectable)(ide_core_browser_1.IPreferenceSettingsService);
|
|
109
|
+
return react_1.default.createElement("div", { className: preferences_module_less_1.default.preferences_indexes },
|
|
110
|
+
react_1.default.createElement(scroll_1.Scroll, null, groups && groups.map(({ id, title, iconClass }) => {
|
|
111
|
+
const sections = preferenceService.getSections(id, scope, search);
|
|
112
|
+
return (react_1.default.createElement("div", { key: `${id} - ${title}`, className: preferences_module_less_1.default.index_item_wrapper },
|
|
113
|
+
react_1.default.createElement("div", { key: `${id} - ${title}`, className: (0, classnames_1.default)({
|
|
114
|
+
[preferences_module_less_1.default.index_item]: true,
|
|
115
|
+
[preferences_module_less_1.default.activated]: preferenceService.currentGroup === id,
|
|
116
|
+
}), onClick: () => { preferenceService.setCurrentGroup(id); } },
|
|
117
|
+
react_1.default.createElement("span", { className: iconClass }),
|
|
118
|
+
(0, common_1.toNormalCase)((0, ide_core_browser_1.replaceLocalizePlaceholder)(title) || '')),
|
|
119
|
+
preferenceService.currentGroup === id ?
|
|
120
|
+
react_1.default.createElement("div", null,
|
|
121
|
+
react_1.default.createElement(exports.PreferenceSections, { preferenceSections: sections, navigateTo: navigateTo }))
|
|
122
|
+
: react_1.default.createElement("div", null)));
|
|
123
|
+
})));
|
|
124
|
+
};
|
|
125
|
+
exports.PreferencesIndexes = PreferencesIndexes;
|
|
126
|
+
const PreferenceItem = ({ data, index }) => {
|
|
127
|
+
if (data.title) {
|
|
128
|
+
return react_1.default.createElement("div", { className: preferences_module_less_1.default.section_title, id: `preferenceSection-${data.title}` }, data.title);
|
|
129
|
+
}
|
|
130
|
+
else if (data.component) {
|
|
131
|
+
return react_1.default.createElement(data.component, { scope: data.scope });
|
|
132
|
+
}
|
|
133
|
+
else if (typeof data.preference === 'string') {
|
|
134
|
+
return react_1.default.createElement(preferenceItem_view_1.NextPreferenceItem, { key: `${index} - ${data.preference} - ${data.scope}`, preferenceName: data.preference, scope: data.scope });
|
|
135
|
+
}
|
|
136
|
+
else if (data.preference) {
|
|
137
|
+
return react_1.default.createElement(preferenceItem_view_1.NextPreferenceItem, { key: `${index} - ${data.preference.id} - ${data.scope}`, preferenceName: data.preference.id, localizedName: (0, ide_core_browser_1.localize)(data.preference.localized), scope: data.scope });
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
exports.PreferenceItem = PreferenceItem;
|
|
141
|
+
const PreferenceBody = ({ items, onReady }) => {
|
|
142
|
+
return react_1.default.createElement(ide_components_1.RecycleList, { onReady: onReady, data: items, template: exports.PreferenceItem, className: preferences_module_less_1.default.preference_section,
|
|
143
|
+
// 防止底部选择框无法查看的临时处理方式
|
|
144
|
+
paddingBottomSize: 100 });
|
|
145
|
+
};
|
|
146
|
+
exports.PreferenceBody = PreferenceBody;
|
|
147
|
+
const PreferenceSection = ({ section, scope }) => {
|
|
148
|
+
return react_1.default.createElement("div", { className: preferences_module_less_1.default.preference_section, id: 'preferenceSection-' + section.title },
|
|
149
|
+
section.title ? react_1.default.createElement("div", { className: preferences_module_less_1.default.section_title }, section.title) : null,
|
|
150
|
+
section.component ? react_1.default.createElement(section.component, { scope: scope }) :
|
|
151
|
+
section.preferences.map((preference, idx) => {
|
|
152
|
+
if (typeof preference === 'string') {
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
}
|
|
156
|
+
}) || react_1.default.createElement("div", null));
|
|
157
|
+
};
|
|
158
|
+
exports.PreferenceSection = PreferenceSection;
|
|
159
|
+
//# sourceMappingURL=preferences.view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preferences.view.js","sourceRoot":"","sources":["../../src/browser/preferences.view.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,qDAA2C;AAE3C,iEAA6O;AAE7O,qGAA+C;AAC/C,yEAAoC;AACpC,qFAAkF;AAClF,6DAAoH;AACpH,sCAA2D;AAC3D,+DAA2D;AAC3D,wBAAsB;AACtB,4CAA6C;AAE7C,MAA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AAG,CAAC,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE;gBAC1C,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;iBACnC;qBAAM;iBACN;YACH,CAAC,CAAC,IAAI,0CAAW,CAEjB,CAAC;AACT,CAAC,CAAC;AAdW,QAAA,iBAAiB,qBAc5B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { URI } from '@opensumi/ide-core-browser';
|
|
2
|
+
import { PreferenceScope } from '@opensumi/ide-core-browser/lib/preferences';
|
|
3
|
+
import { AbstractResourcePreferenceProvider } from './abstract-resource-preference-provider';
|
|
4
|
+
export declare const USER_PREFERENCE_URI: URI;
|
|
5
|
+
export declare class UserPreferenceProvider extends AbstractResourcePreferenceProvider {
|
|
6
|
+
protected getUri(): URI;
|
|
7
|
+
protected getScope(): PreferenceScope;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=user-preference-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-preference-provider.d.ts","sourceRoot":"","sources":["../../src/browser/user-preference-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAG7F,eAAO,MAAM,mBAAmB,KAAsE,CAAC;AAEvG,qBACa,sBAAuB,SAAQ,kCAAkC;IAE5E,SAAS,CAAC,MAAM,IAAI,GAAG;IAIvB,SAAS,CAAC,QAAQ;CAGnB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserPreferenceProvider = exports.USER_PREFERENCE_URI = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const di_1 = require("@opensumi/di");
|
|
6
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
7
|
+
const preferences_1 = require("@opensumi/ide-core-browser/lib/preferences");
|
|
8
|
+
const abstract_resource_preference_provider_1 = require("./abstract-resource-preference-provider");
|
|
9
|
+
const common_1 = require("../common");
|
|
10
|
+
exports.USER_PREFERENCE_URI = new ide_core_browser_1.URI().withScheme(common_1.USER_STORAGE_SCHEME).withPath('settings.json');
|
|
11
|
+
let UserPreferenceProvider = class UserPreferenceProvider extends abstract_resource_preference_provider_1.AbstractResourcePreferenceProvider {
|
|
12
|
+
getUri() {
|
|
13
|
+
return exports.USER_PREFERENCE_URI;
|
|
14
|
+
}
|
|
15
|
+
getScope() {
|
|
16
|
+
return preferences_1.PreferenceScope.User;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
UserPreferenceProvider = (0, tslib_1.__decorate)([
|
|
20
|
+
(0, di_1.Injectable)()
|
|
21
|
+
], UserPreferenceProvider);
|
|
22
|
+
exports.UserPreferenceProvider = UserPreferenceProvider;
|
|
23
|
+
//# sourceMappingURL=user-preference-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-preference-provider.js","sourceRoot":"","sources":["../../src/browser/user-preference-provider.ts"],"names":[],"mappings":";;;;AAAA,qCAA0C;AAC1C,iEAAiD;AACjD,4EAA6E;AAC7E,mGAA6F;AAC7F,sCAAgD;AAEnC,QAAA,mBAAmB,GAAG,IAAI,sBAAG,EAAE,CAAC,UAAU,CAAC,4BAAmB,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AAGvG,IAAa,sBAAsB,GAAnC,MAAa,sBAAuB,SAAQ,0EAAkC;IAElE,MAAM;QACd,OAAO,2BAAmB,CAAC;IAC7B,CAAC;IAES,QAAQ;QAChB,OAAO,6BAAe,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF,CAAA;AATY,sBAAsB;IADlC,IAAA,eAAU,GAAE;GACA,sBAAsB,CASlC;AATY,wDAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/userstorage/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./user-storage.service"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./user-storage.contribution"), exports);
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/browser/userstorage/index.ts"],"names":[],"mappings":";;;AAAA,sEAAuC;AACvC,2EAA4C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ClientAppContribution } from '@opensumi/ide-core-browser';
|
|
2
|
+
import { FileServiceClient } from '@opensumi/ide-file-service/lib/browser/file-service-client';
|
|
3
|
+
export declare class UserStorageContribution implements ClientAppContribution {
|
|
4
|
+
private readonly userStorageService;
|
|
5
|
+
protected readonly fileSystem: FileServiceClient;
|
|
6
|
+
initialize(): void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=user-storage.contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-storage.contribution.d.ts","sourceRoot":"","sources":["../../../src/browser/userstorage/user-storage.contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4DAA4D,CAAC;AAG/F,qBACa,uBAAwB,YAAW,qBAAqB;IAEnE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAsB;IAGzD,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;IAEjD,UAAU;CAGX"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserStorageContribution = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const di_1 = require("@opensumi/di");
|
|
6
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
7
|
+
const ide_file_service_1 = require("@opensumi/ide-file-service");
|
|
8
|
+
const file_service_client_1 = require("@opensumi/ide-file-service/lib/browser/file-service-client");
|
|
9
|
+
const common_1 = require("../../common");
|
|
10
|
+
let UserStorageContribution = class UserStorageContribution {
|
|
11
|
+
initialize() {
|
|
12
|
+
this.fileSystem.registerProvider(common_1.USER_STORAGE_SCHEME, this.userStorageService);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
(0, tslib_1.__decorate)([
|
|
16
|
+
(0, di_1.Autowired)(common_1.IUserStorageService),
|
|
17
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
18
|
+
], UserStorageContribution.prototype, "userStorageService", void 0);
|
|
19
|
+
(0, tslib_1.__decorate)([
|
|
20
|
+
(0, di_1.Autowired)(ide_file_service_1.IFileServiceClient),
|
|
21
|
+
(0, tslib_1.__metadata)("design:type", file_service_client_1.FileServiceClient)
|
|
22
|
+
], UserStorageContribution.prototype, "fileSystem", void 0);
|
|
23
|
+
UserStorageContribution = (0, tslib_1.__decorate)([
|
|
24
|
+
(0, ide_core_browser_1.Domain)(ide_core_browser_1.ClientAppContribution)
|
|
25
|
+
], UserStorageContribution);
|
|
26
|
+
exports.UserStorageContribution = UserStorageContribution;
|
|
27
|
+
//# sourceMappingURL=user-storage.contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-storage.contribution.js","sourceRoot":"","sources":["../../../src/browser/userstorage/user-storage.contribution.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AACzC,iEAGoC;AACpC,iEAAgE;AAChE,oGAA+F;AAC/F,yCAAwE;AAGxE,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAOlC,UAAU;QACR,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,4BAAmB,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACjF,CAAC;CACF,CAAA;AARC;IADC,IAAA,cAAS,EAAC,4BAAmB,CAAC;;mEAC0B;AAGzD;IADC,IAAA,cAAS,EAAC,qCAAkB,CAAC;2CACC,uCAAiB;2DAAC;AALtC,uBAAuB;IADnC,IAAA,yBAAM,EAAC,wCAAqB,CAAC;GACjB,uBAAuB,CAUnC;AAVY,0DAAuB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Event, FileSystemProviderCapabilities } from '@opensumi/ide-core-common';
|
|
2
|
+
import { DisposableCollection, ILogger, Emitter, URI, AppConfig, Uri, FileType, FileChangeEvent } from '@opensumi/ide-core-browser';
|
|
3
|
+
import { IUserStorageService } from '../../common';
|
|
4
|
+
import { FileSetContentOptions } from '@opensumi/ide-file-service/lib/common';
|
|
5
|
+
import { IFileServiceClient } from '@opensumi/ide-file-service/lib/common';
|
|
6
|
+
export declare const DEFAULT_USER_STORAGE_FOLDER = ".sumi";
|
|
7
|
+
export declare class UserStorageServiceImpl implements IUserStorageService {
|
|
8
|
+
capabilities: FileSystemProviderCapabilities;
|
|
9
|
+
onDidChangeCapabilities: Event<any>;
|
|
10
|
+
/**
|
|
11
|
+
* 基于用户存储路径创建文件路径
|
|
12
|
+
* @param userStorageFolderUri 存储目录路径,如 file://{home}/
|
|
13
|
+
* @param fsPath 文件系统路径
|
|
14
|
+
*/
|
|
15
|
+
static toUserStorageUri(userStorageFolderUri: URI, rawUri: URI): URI;
|
|
16
|
+
/**
|
|
17
|
+
* 返回相对存储路径
|
|
18
|
+
* 如传入 'file://{path_to_userhome}/.sumi', 'file://{path_to_userhome}/.sumi/settings.json',
|
|
19
|
+
* 则返回 'settings.json'
|
|
20
|
+
* @param userStorageFolderUri 存储目录路径,如 file://{path_to_userhome}/
|
|
21
|
+
* @param fileUri 文件路径
|
|
22
|
+
*/
|
|
23
|
+
private static getRelativeUserStoragePath;
|
|
24
|
+
/**
|
|
25
|
+
* 返回用户路径下的文件绝对路径
|
|
26
|
+
* @param userStorageFolderUri 存储目录路径,如 file://{home}/.sumi
|
|
27
|
+
* @param userStorageUri 存储文件路径,如 file://{home}/.sumi/settings.json
|
|
28
|
+
*/
|
|
29
|
+
static toFilesystemURI(userStorageFolderUri: URI, userStorageUri: URI): URI;
|
|
30
|
+
protected readonly toDispose: DisposableCollection;
|
|
31
|
+
protected readonly onDidChangeFileEmitter: Emitter<FileChangeEvent>;
|
|
32
|
+
private _whenReady;
|
|
33
|
+
private userStorageFolder;
|
|
34
|
+
protected readonly fileServiceClient: IFileServiceClient;
|
|
35
|
+
protected readonly logger: ILogger;
|
|
36
|
+
protected readonly appConfig: AppConfig;
|
|
37
|
+
constructor();
|
|
38
|
+
get whenReady(): Promise<void>;
|
|
39
|
+
get onDidChangeFile(): Event<FileChangeEvent>;
|
|
40
|
+
init(): Promise<void>;
|
|
41
|
+
readDirectory(uri: Uri): [string, FileType][] | Promise<[string, FileType][]>;
|
|
42
|
+
createDirectory(uri: Uri): void;
|
|
43
|
+
watch(uri: Uri, options?: {
|
|
44
|
+
recursive: boolean;
|
|
45
|
+
excludes: string[];
|
|
46
|
+
}): Promise<number>;
|
|
47
|
+
readFile(uri: Uri): Promise<Uint8Array>;
|
|
48
|
+
writeFile(uri: Uri, content: Uint8Array, options?: FileSetContentOptions): Promise<void>;
|
|
49
|
+
delete(uri: Uri, options: {
|
|
50
|
+
recursive: boolean;
|
|
51
|
+
moveToTrash?: boolean;
|
|
52
|
+
}): void;
|
|
53
|
+
rename(oldUri: Uri, newUri: Uri, options: {
|
|
54
|
+
overwrite: boolean;
|
|
55
|
+
}): void;
|
|
56
|
+
copy(source: Uri, destination: Uri, options: {
|
|
57
|
+
overwrite: boolean;
|
|
58
|
+
}): void;
|
|
59
|
+
stat(uri: Uri): Promise<import("@opensumi/ide-core-common").FileStat | undefined>;
|
|
60
|
+
access(uri: Uri, mode: number): Promise<boolean>;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=user-storage.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-storage.service.d.ts","sourceRoot":"","sources":["../../../src/browser/userstorage/user-storage.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAElF,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEpI,OAAO,EAAuB,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,eAAO,MAAM,2BAA2B,UAAU,CAAC;AAEnD,qBACa,sBAAuB,YAAW,mBAAmB;IAChE,YAAY,EAAE,8BAA8B,CAAgD;IAC5F,uBAAuB,aAAc;IACrC;;;;OAIG;WACW,gBAAgB,CAAC,oBAAoB,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,GAAG;IAK3E;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAKzC;;;;OAIG;WACW,eAAe,CAAC,oBAAoB,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,GAAG,GAAG;IAIlF,SAAS,CAAC,QAAQ,CAAC,SAAS,uBAA8B;IAC1D,SAAS,CAAC,QAAQ,CAAC,sBAAsB,2BAAkC;IAC3E,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,iBAAiB,CAAM;IAG/B,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,kBAAkB,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iceImpl = exports.DEFAULT_USER_STORAGE_FOLDER = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
7
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
8
|
+
const di_1 = require("@opensumi/di");
|
|
9
|
+
const common_1 = require("../../common");
|
|
10
|
+
const common_2 = require("@opensumi/ide-file-service/lib/common");
|
|
11
|
+
exports.DEFAULT_USER_STORAGE_FOLDER = '.sumi';
|
|
12
|
+
let UserStorageServiceImpl = UserStorageServiceImpl_1 = class UserStorageServiceImpl {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.capabilities = 2 /* FileReadWrite */;
|
|
15
|
+
this.onDidChangeCapabilities = ide_core_common_1.Event.None;
|
|
16
|
+
this.toDispose = new ide_core_browser_1.DisposableCollection();
|
|
17
|
+
this.onDidChangeFileEmitter = new ide_core_browser_1.Emitter();
|
|
18
|
+
this._whenReady = this.init();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 基于用户存储路径创建文件路径
|
|
22
|
+
* @param userStorageFolderUri 存储目录路径,如 file://{home}/
|
|
23
|
+
* @param fsPath 文件系统路径
|
|
24
|
+
*/
|
|
25
|
+
static toUserStorageUri(userStorageFolderUri, rawUri) {
|
|
26
|
+
const userStorageRelativePath = this.getRelativeUserStoragePath(userStorageFolderUri, rawUri);
|
|
27
|
+
return new ide_core_browser_1.URI('').withScheme(common_1.USER_STORAGE_SCHEME).withPath(userStorageRelativePath).withFragment(rawUri.fragment).withQuery(rawUri.query);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 返回相对存储路径
|
|
31
|
+
* 如传入 'file://{path_to_userhome}/.sumi', 'file://{path_to_userhome}/.sumi/settings.json',
|
|
32
|
+
* 则返回 'settings.json'
|
|
33
|
+
* @param userStorageFolderUri 存储目录路径,如 file://{path_to_userhome}/
|
|
34
|
+
* @param fileUri 文件路径
|
|
35
|
+
*/
|
|
36
|
+
static getRelativeUserStoragePath(userStorageFolderUri, fileUri) {
|
|
37
|
+
// 返回虚拟用户协议下的路径,去掉头部的/,如返回settings.json而不是/settings.json
|
|
38
|
+
return fileUri.toString().slice(userStorageFolderUri.toString().length + 1);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 返回用户路径下的文件绝对路径
|
|
42
|
+
* @param userStorageFolderUri 存储目录路径,如 file://{home}/.sumi
|
|
43
|
+
* @param userStorageUri 存储文件路径,如 file://{home}/.sumi/settings.json
|
|
44
|
+
*/
|
|
45
|
+
static toFilesystemURI(userStorageFolderUri, userStorageUri) {
|
|
46
|
+
return userStorageFolderUri.withPath(userStorageFolderUri.path.join(userStorageUri.path.toString()));
|
|
47
|
+
}
|
|
48
|
+
get whenReady() {
|
|
49
|
+
return this._whenReady;
|
|
50
|
+
}
|
|
51
|
+
get onDidChangeFile() {
|
|
52
|
+
return this.onDidChangeFileEmitter.event;
|
|
53
|
+
}
|
|
54
|
+
async init() {
|
|
55
|
+
// 请求用户路径并存储
|
|
56
|
+
const home = await this.fileServiceClient.getCurrentUserHome();
|
|
57
|
+
if (home) {
|
|
58
|
+
const userStorageFolderUri = new ide_core_browser_1.URI(home.uri).resolve(this.appConfig.userPreferenceDirName || this.appConfig.preferenceDirName || exports.DEFAULT_USER_STORAGE_FOLDER);
|
|
59
|
+
if (!await this.fileServiceClient.access(userStorageFolderUri.toString())) {
|
|
60
|
+
await this.fileServiceClient.createFolder(userStorageFolderUri.toString());
|
|
61
|
+
}
|
|
62
|
+
this.userStorageFolder = userStorageFolderUri;
|
|
63
|
+
}
|
|
64
|
+
this.toDispose.push(this.onDidChangeFileEmitter);
|
|
65
|
+
}
|
|
66
|
+
readDirectory(uri) {
|
|
67
|
+
throw new Error('Method not implemented.');
|
|
68
|
+
}
|
|
69
|
+
createDirectory(uri) {
|
|
70
|
+
throw new Error('Method not implemented.');
|
|
71
|
+
}
|
|
72
|
+
async watch(uri, options = { recursive: false, excludes: ['**/logs/**'] }) {
|
|
73
|
+
await this.whenReady;
|
|
74
|
+
const target = UserStorageServiceImpl_1.toFilesystemURI(this.userStorageFolder, ide_core_browser_1.URI.from(uri));
|
|
75
|
+
const watcher = await this.fileServiceClient.watchFileChanges(target.parent, options.excludes);
|
|
76
|
+
this.toDispose.push(watcher);
|
|
77
|
+
this.toDispose.push(watcher.onFilesChanged((changes) => {
|
|
78
|
+
const effectedChanges = [];
|
|
79
|
+
for (const change of changes) {
|
|
80
|
+
// 在UserStorage的监听模式下,只会存在一个独立的 Change 事件
|
|
81
|
+
// 故在获取到变更事件时直接推出遍历
|
|
82
|
+
if (change.uri === target.toString()) {
|
|
83
|
+
effectedChanges.push(change);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (effectedChanges.length > 0) {
|
|
87
|
+
this.onDidChangeFileEmitter.fire(effectedChanges.map((change) => ({
|
|
88
|
+
uri: UserStorageServiceImpl_1.toUserStorageUri(this.userStorageFolder, new ide_core_browser_1.URI(change.uri)).toString(),
|
|
89
|
+
type: change.type,
|
|
90
|
+
})));
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
return watcher.watchId;
|
|
94
|
+
}
|
|
95
|
+
async readFile(uri) {
|
|
96
|
+
await this.whenReady;
|
|
97
|
+
const target = UserStorageServiceImpl_1.toFilesystemURI(this.userStorageFolder, ide_core_browser_1.URI.from(uri));
|
|
98
|
+
try {
|
|
99
|
+
const { content } = await this.fileServiceClient.readFile(target.toString());
|
|
100
|
+
return content.buffer;
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
throw new Error(e);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async writeFile(uri, content, options) {
|
|
107
|
+
await this.whenReady;
|
|
108
|
+
const target = UserStorageServiceImpl_1.toFilesystemURI(this.userStorageFolder, ide_core_browser_1.URI.from(uri));
|
|
109
|
+
try {
|
|
110
|
+
let fileStat = await this.fileServiceClient.getFileStat(target.toString());
|
|
111
|
+
if (fileStat) {
|
|
112
|
+
await this.fileServiceClient.setContent(fileStat, content, options);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
fileStat = await this.fileServiceClient.createFile(target.toString());
|
|
116
|
+
await this.fileServiceClient.setContent(fileStat, content, options);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (e) {
|
|
120
|
+
throw new Error(e);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
delete(uri, options) {
|
|
124
|
+
throw new Error('Method not implemented.');
|
|
125
|
+
}
|
|
126
|
+
rename(oldUri, newUri, options) {
|
|
127
|
+
throw new Error('Method not implemented.');
|
|
128
|
+
}
|
|
129
|
+
copy(source, destination, options) {
|
|
130
|
+
throw new Error('Method not implemented.');
|
|
131
|
+
}
|
|
132
|
+
async stat(uri) {
|
|
133
|
+
await this.whenReady;
|
|
134
|
+
const target = UserStorageServiceImpl_1.toFilesystemURI(this.userStorageFolder, ide_core_browser_1.URI.from(uri));
|
|
135
|
+
const stat = await this.fileServiceClient.getFileStat(target.toString());
|
|
136
|
+
if (stat) {
|
|
137
|
+
return stat;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async access(uri, mode) {
|
|
141
|
+
await this.whenReady;
|
|
142
|
+
const target = UserStorageServiceImpl_1.toFilesystemURI(this.userStorageFolder, ide_core_browser_1.URI.from(uri));
|
|
143
|
+
return this.fileServiceClient.access(target.toString(), mode);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
(0, tslib_1.__decorate)([
|
|
147
|
+
(0, di_1.Autowired)(common_2.IFileServiceClient),
|
|
148
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
149
|
+
], UserStorageServiceImpl.prototype, "fileServiceClient", void 0);
|
|
150
|
+
(0, tslib_1.__decorate)([
|
|
151
|
+
(0, di_1.Autowired)(ide_core_browser_1.ILogger),
|
|
152
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
153
|
+
], UserStorageServiceImpl.prototype, "logger", void 0);
|
|
154
|
+
(0, tslib_1.__decorate)([
|
|
155
|
+
(0, di_1.Autowired)(ide_core_browser_1.AppConfig),
|
|
156
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
157
|
+
], UserStorageServiceImpl.prototype, "appConfig", void 0);
|
|
158
|
+
UserStorageServiceImpl = UserStorageServiceImpl_1 = (0, tslib_1.__decorate)([
|
|
159
|
+
(0, di_1.Injectable)(),
|
|
160
|
+
(0, tslib_1.__metadata)("design:paramtypes", [])
|
|
161
|
+
], UserStorageServiceImpl);
|
|
162
|
+
exports.UserStorageServiceImpl = UserStorageServiceImpl;
|
|
163
|
+
//# sourceMappingURL=user-storage.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-storage.service.js","sourceRoot":"","sources":["../../../src/browser/userstorage/user-storage.service.ts"],"names":[],"mappings":";;;;;AAAA,+DAAkF;AAElF,iEAAoI;AACpI,qCAAqD;AACrD,yCAAwE;AAExE,kEAA2E;AAE9D,QAAA,2BAA2B,GAAG,OAAO,CAAC;AAGnD,IAAa,sBAAsB,8BAAnC,MAAa,sBAAsB;IA8CjC;QA7CA,iBAAY,yBAAgF;QAC5F,4BAAuB,GAAG,uBAAK,CAAC,IAAI,CAAC;QAgClB,cAAS,GAAG,IAAI,uCAAoB,EAAE,CAAC;QACvC,2BAAsB,GAAG,IAAI,0BAAO,EAAmB,CAAC;QAYzE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IA7CD;;;;OAIG;IACI,MAAM,CAAC,gBAAgB,CAAC,oBAAyB,EAAE,MAAW;QACnE,MAAM,uBAAuB,GAAG,IAAI,CAAC,0BAA0B,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;QAC9F,OAAO,IAAI,sBAAG,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,4BAAmB,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,YAAY,CAA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AAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;IAChE,CAAC;CACF,CAAA;AApHC;IADC,IAAA,cAAS,EAAC,2BAAkB,CAAC;;iEAC2B;AAEzD;IADC,IAAA,cAAS,EAAC,0BAAO,CAAC;;sDACgB;AAEnC;IADC,IAAA,cAAS,EAAC,4BAAS,CAAC;;yDACmB;AA5C7B,sBAAsB;IADlC,IAAA,eAAU,GAAE;;GACA,sBAAsB,CA4JlC;AA5JY,wDAAsB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { URI } from '@opensumi/ide-core-browser';
|
|
2
|
+
import { PreferenceScope } from '@opensumi/ide-core-browser/lib/preferences';
|
|
3
|
+
import { IWorkspaceService } from '@opensumi/ide-workspace';
|
|
4
|
+
import { AbstractResourcePreferenceProvider } from './abstract-resource-preference-provider';
|
|
5
|
+
export declare class WorkspaceFilePreferenceProviderOptions {
|
|
6
|
+
workspaceUri: URI;
|
|
7
|
+
}
|
|
8
|
+
export declare const WorkspaceFilePreferenceProviderFactory: unique symbol;
|
|
9
|
+
export declare type WorkspaceFilePreferenceProviderFactory = (options: WorkspaceFilePreferenceProviderOptions) => WorkspaceFilePreferenceProvider;
|
|
10
|
+
export declare class WorkspaceFilePreferenceProvider extends AbstractResourcePreferenceProvider {
|
|
11
|
+
protected readonly workspaceService: IWorkspaceService;
|
|
12
|
+
protected readonly options: WorkspaceFilePreferenceProviderOptions;
|
|
13
|
+
protected getUri(): URI;
|
|
14
|
+
protected parse(content: string): any;
|
|
15
|
+
protected getPath(preferenceName: string): string[];
|
|
16
|
+
protected getScope(): PreferenceScope;
|
|
17
|
+
getDomain(): string[];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=workspace-file-preference-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-file-preference-provider.d.ts","sourceRoot":"","sources":["../../src/browser/workspace-file-preference-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAiB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAE7F,qBACa,sCAAsC;IACjD,YAAY,EAAE,GAAG,CAAC;CACnB;AAED,eAAO,MAAM,sCAAsC,eAAmD,CAAC;AACvG,oBAAY,sCAAsC,GAAG,CAAC,OAAO,EAAE,sCAAsC,KAAK,+BAA+B,CAAC;AAE1I,qBACa,+BAAgC,SAAQ,kCAAkC;IAGrF,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAGvD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,sCAAsC,CAAC;IAEnE,SAAS,CAAC,MAAM,IAAI,GAAG;IAIvB,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG;IAQrC,SAAS,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE;IAInD,SAAS,CAAC,QAAQ,IAAI,eAAe;IAIrC,SAAS,IAAI,MAAM,EAAE;CAGtB"}
|