@theia/file-search 1.17.0-next.ff9e0507 → 1.18.0-next.04e2816d
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/browser/file-search-frontend-module.js +11 -13
- package/lib/browser/file-search-frontend-module.js.map +1 -1
- package/lib/browser/quick-file-open-contribution.js +23 -48
- package/lib/browser/quick-file-open-contribution.js.map +1 -1
- package/lib/browser/quick-file-open.d.ts.map +1 -1
- package/lib/browser/quick-file-open.js +220 -323
- package/lib/browser/quick-file-open.js.map +1 -1
- package/lib/node/file-search-backend-module.js +6 -10
- package/lib/node/file-search-backend-module.js.map +1 -1
- package/lib/node/file-search-service-impl.js +121 -254
- package/lib/node/file-search-service-impl.js.map +1 -1
- package/lib/node/file-search-service-impl.spec.js +154 -373
- package/lib/node/file-search-service-impl.spec.js.map +1 -1
- package/package.json +8 -8
- package/src/browser/quick-file-open.ts +13 -6
|
@@ -15,22 +15,20 @@
|
|
|
15
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
********************************************************************************/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
exports.default = new inversify_1.ContainerModule(
|
|
26
|
-
bind(file_search_service_1.FileSearchService).toDynamicValue(
|
|
27
|
-
|
|
18
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
+
const common_1 = require("@theia/core/lib/common");
|
|
20
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
21
|
+
const quick_file_open_contribution_1 = require("./quick-file-open-contribution");
|
|
22
|
+
const quick_file_open_1 = require("./quick-file-open");
|
|
23
|
+
const file_search_service_1 = require("../common/file-search-service");
|
|
24
|
+
const quick_access_1 = require("@theia/core/lib/browser/quick-input/quick-access");
|
|
25
|
+
exports.default = new inversify_1.ContainerModule((bind) => {
|
|
26
|
+
bind(file_search_service_1.FileSearchService).toDynamicValue(ctx => {
|
|
27
|
+
const provider = ctx.container.get(browser_1.WebSocketConnectionProvider);
|
|
28
28
|
return provider.createProxy(file_search_service_1.fileSearchServicePath);
|
|
29
29
|
}).inSingletonScope();
|
|
30
30
|
bind(quick_file_open_contribution_1.QuickFileOpenFrontendContribution).toSelf().inSingletonScope();
|
|
31
|
-
[common_1.CommandContribution, browser_1.KeybindingContribution, quick_access_1.QuickAccessContribution].forEach(
|
|
32
|
-
return bind(serviceIdentifier).toService(quick_file_open_contribution_1.QuickFileOpenFrontendContribution);
|
|
33
|
-
});
|
|
31
|
+
[common_1.CommandContribution, browser_1.KeybindingContribution, quick_access_1.QuickAccessContribution].forEach(serviceIdentifier => bind(serviceIdentifier).toService(quick_file_open_contribution_1.QuickFileOpenFrontendContribution));
|
|
34
32
|
bind(quick_file_open_1.QuickFileOpenService).toSelf().inSingletonScope();
|
|
35
33
|
});
|
|
36
34
|
//# sourceMappingURL=file-search-frontend-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-search-frontend-module.js","sourceRoot":"","sources":["../../src/browser/file-search-frontend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,
|
|
1
|
+
{"version":3,"file":"file-search-frontend-module.js","sourceRoot":"","sources":["../../src/browser/file-search-frontend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,4DAA2E;AAC3E,mDAA6D;AAC7D,qDAA8F;AAC9F,iFAAmF;AACnF,uDAAyD;AACzD,uEAAyF;AACzF,mFAA2F;AAE3F,kBAAe,IAAI,2BAAe,CAAC,CAAC,IAAqB,EAAE,EAAE;IACzD,IAAI,CAAC,uCAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACzC,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,qCAA2B,CAAC,CAAC;QAChE,OAAO,QAAQ,CAAC,WAAW,CAAoB,2CAAqB,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAEtB,IAAI,CAAC,gEAAiC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACpE,CAAC,4BAAmB,EAAE,gCAAsB,EAAE,sCAAuB,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAC/F,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,gEAAiC,CAAC,CACvE,CAAC;IAEF,IAAI,CAAC,sCAAoB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;AAC3D,CAAC,CAAC,CAAC"}
|
|
@@ -23,70 +23,45 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
23
23
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
24
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
25
|
};
|
|
26
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
27
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
28
|
-
if (!m) return o;
|
|
29
|
-
var i = m.call(o), r, ar = [], e;
|
|
30
|
-
try {
|
|
31
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
32
|
-
}
|
|
33
|
-
catch (error) { e = { error: error }; }
|
|
34
|
-
finally {
|
|
35
|
-
try {
|
|
36
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
37
|
-
}
|
|
38
|
-
finally { if (e) throw e.error; }
|
|
39
|
-
}
|
|
40
|
-
return ar;
|
|
41
|
-
};
|
|
42
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
27
|
exports.QuickFileOpenFrontendContribution = void 0;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
QuickFileOpenFrontendContribution.prototype.registerCommands = function (commands) {
|
|
51
|
-
var _this = this;
|
|
28
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
30
|
+
const quick_file_open_1 = require("./quick-file-open");
|
|
31
|
+
let QuickFileOpenFrontendContribution = class QuickFileOpenFrontendContribution {
|
|
32
|
+
registerCommands(commands) {
|
|
52
33
|
commands.registerCommand(quick_file_open_1.quickFileOpen, {
|
|
53
34
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
-
execute:
|
|
55
|
-
|
|
56
|
-
var args = [];
|
|
57
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
58
|
-
args[_i] = arguments[_i];
|
|
59
|
-
}
|
|
60
|
-
var fileURI;
|
|
35
|
+
execute: (...args) => {
|
|
36
|
+
let fileURI;
|
|
61
37
|
if (args) {
|
|
62
|
-
|
|
38
|
+
[fileURI] = args;
|
|
63
39
|
}
|
|
64
40
|
if (fileURI) {
|
|
65
|
-
|
|
41
|
+
this.quickFileOpenService.openFile(new uri_1.default(fileURI));
|
|
66
42
|
}
|
|
67
43
|
else {
|
|
68
|
-
|
|
44
|
+
this.quickFileOpenService.open();
|
|
69
45
|
}
|
|
70
46
|
}
|
|
71
47
|
});
|
|
72
|
-
}
|
|
73
|
-
|
|
48
|
+
}
|
|
49
|
+
registerKeybindings(keybindings) {
|
|
74
50
|
keybindings.registerKeybinding({
|
|
75
51
|
command: quick_file_open_1.quickFileOpen.id,
|
|
76
52
|
keybinding: 'ctrlcmd+p'
|
|
77
53
|
});
|
|
78
|
-
}
|
|
79
|
-
|
|
54
|
+
}
|
|
55
|
+
registerQuickAccessProvider() {
|
|
80
56
|
this.quickFileOpenService.registerQuickAccessProvider();
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}());
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
__decorate([
|
|
60
|
+
inversify_1.inject(quick_file_open_1.QuickFileOpenService),
|
|
61
|
+
__metadata("design:type", quick_file_open_1.QuickFileOpenService)
|
|
62
|
+
], QuickFileOpenFrontendContribution.prototype, "quickFileOpenService", void 0);
|
|
63
|
+
QuickFileOpenFrontendContribution = __decorate([
|
|
64
|
+
inversify_1.injectable()
|
|
65
|
+
], QuickFileOpenFrontendContribution);
|
|
91
66
|
exports.QuickFileOpenFrontendContribution = QuickFileOpenFrontendContribution;
|
|
92
67
|
//# sourceMappingURL=quick-file-open-contribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quick-file-open-contribution.js","sourceRoot":"","sources":["../../src/browser/quick-file-open-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF
|
|
1
|
+
{"version":3,"file":"quick-file-open-contribution.js","sourceRoot":"","sources":["../../src/browser/quick-file-open-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,4DAAkE;AAClE,oDAA6C;AAC7C,uDAAwE;AAKxE,IAAa,iCAAiC,GAA9C,MAAa,iCAAiC;IAK1C,gBAAgB,CAAC,QAAyB;QACtC,QAAQ,CAAC,eAAe,CAAC,+BAAa,EAAE;YACpC,8DAA8D;YAC9D,OAAO,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE;gBACxB,IAAI,OAA2B,CAAC;gBAChC,IAAI,IAAI,EAAE;oBACN,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;iBACpB;gBACD,IAAI,OAAO,EAAE;oBACT,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,aAAG,CAAC,OAAO,CAAC,CAAC,CAAC;iBACxD;qBAAM;oBACH,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC;iBACpC;YACL,CAAC;SACJ,CAAC,CA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CAA8B;IAEtE;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAI5B;IAGF,SAAS,CAAC,IAAI,IAAI,IAAI;IAUtB,SAAS,IAAI,OAAO;IAIpB,IAAI,IAAI,IAAI;IAeZ,SAAS,CAAC,aAAa,IAAI,IAAI;IAK/B;;;OAGG;IACH,SAAS,CAAC,aAAa,IAAI,MAAM,GAAG,SAAS;IAWvC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC;IAkE7E,SAAS,CAAC,YAAY,CAClB,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,iBAAiB,GAAG,MAAM;IAyDrC,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI;IAcxB,SAAS,CAAC,kBAAkB,IAAI,mBAAmB;IAInD,OAAO,CAAC,MAAM;IAmBd,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,cAAc;IAStB;;;;;OAKG;IACH,SAAS,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc;CAsBpE"}
|
|
@@ -23,96 +23,30 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
23
23
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
24
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
25
|
};
|
|
26
|
-
var
|
|
27
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
30
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
31
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
32
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
36
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
37
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
38
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
39
|
-
function step(op) {
|
|
40
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
41
|
-
while (_) try {
|
|
42
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
43
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
44
|
-
switch (op[0]) {
|
|
45
|
-
case 0: case 1: t = op; break;
|
|
46
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
47
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
48
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
49
|
-
default:
|
|
50
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
51
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
52
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
53
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
54
|
-
if (t[2]) _.ops.pop();
|
|
55
|
-
_.trys.pop(); continue;
|
|
56
|
-
}
|
|
57
|
-
op = body.call(thisArg, _);
|
|
58
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
59
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
63
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
64
|
-
if (!m) return o;
|
|
65
|
-
var i = m.call(o), r, ar = [], e;
|
|
66
|
-
try {
|
|
67
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
68
|
-
}
|
|
69
|
-
catch (error) { e = { error: error }; }
|
|
70
|
-
finally {
|
|
71
|
-
try {
|
|
72
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
73
|
-
}
|
|
74
|
-
finally { if (e) throw e.error; }
|
|
75
|
-
}
|
|
76
|
-
return ar;
|
|
77
|
-
};
|
|
78
|
-
var __spread = (this && this.__spread) || function () {
|
|
79
|
-
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
80
|
-
return ar;
|
|
81
|
-
};
|
|
82
|
-
var __values = (this && this.__values) || function(o) {
|
|
83
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
84
|
-
if (m) return m.call(o);
|
|
85
|
-
if (o && typeof o.length === "number") return {
|
|
86
|
-
next: function () {
|
|
87
|
-
if (o && i >= o.length) o = void 0;
|
|
88
|
-
return { value: o && o[i++], done: !o };
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
92
|
-
};
|
|
26
|
+
var QuickFileOpenService_1;
|
|
93
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
94
28
|
exports.QuickFileOpenService = exports.quickFileOpen = void 0;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
31
|
+
const workspace_service_1 = require("@theia/workspace/lib/browser/workspace-service");
|
|
32
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
33
|
+
const file_search_service_1 = require("../common/file-search-service");
|
|
34
|
+
const label_provider_1 = require("@theia/core/lib/browser/label-provider");
|
|
35
|
+
const navigation_location_service_1 = require("@theia/editor/lib/browser/navigation/navigation-location-service");
|
|
36
|
+
const fuzzy = require("@theia/core/shared/fuzzy");
|
|
37
|
+
const message_service_1 = require("@theia/core/lib/common/message-service");
|
|
38
|
+
const browser_2 = require("@theia/filesystem/lib/browser");
|
|
39
|
+
const browser_3 = require("@theia/editor/lib/browser");
|
|
40
|
+
const quick_input_service_1 = require("@theia/core/lib/browser/quick-input/quick-input-service");
|
|
107
41
|
exports.quickFileOpen = {
|
|
108
42
|
id: 'file-search.openFile',
|
|
109
43
|
category: 'File',
|
|
110
44
|
label: 'Open File...'
|
|
111
45
|
};
|
|
112
46
|
// Supports patterns of <path><#|:><line><#|:|,><col?>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
47
|
+
const LINE_COLON_PATTERN = /\s?[#:\(](?:line )?(\d*)(?:[#:,](\d*))?\)?\s*$/;
|
|
48
|
+
let QuickFileOpenService = QuickFileOpenService_1 = class QuickFileOpenService {
|
|
49
|
+
constructor() {
|
|
116
50
|
/**
|
|
117
51
|
* Whether to hide .gitignored (and other ignored) files.
|
|
118
52
|
*/
|
|
@@ -128,32 +62,29 @@ var QuickFileOpenService = /** @class */ (function () {
|
|
|
128
62
|
*/
|
|
129
63
|
this.filterAndRange = this.filterAndRangeDefault;
|
|
130
64
|
}
|
|
131
|
-
|
|
132
|
-
QuickFileOpenService.prototype.registerQuickAccessProvider = function () {
|
|
133
|
-
var _this = this;
|
|
65
|
+
registerQuickAccessProvider() {
|
|
134
66
|
this.quickAccessRegistry.registerQuickAccessProvider({
|
|
135
|
-
getInstance:
|
|
67
|
+
getInstance: () => this,
|
|
136
68
|
prefix: QuickFileOpenService_1.PREFIX,
|
|
137
69
|
placeholder: this.getPlaceHolder(),
|
|
138
70
|
helpEntries: [{ description: 'Open File', needsEditor: false }]
|
|
139
71
|
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
var _this = this;
|
|
72
|
+
}
|
|
73
|
+
init() {
|
|
143
74
|
var _a;
|
|
144
|
-
(_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.onHide(
|
|
145
|
-
if (
|
|
146
|
-
|
|
75
|
+
(_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.onHide(() => {
|
|
76
|
+
if (this.updateIsOpen) {
|
|
77
|
+
this.isOpen = false;
|
|
147
78
|
}
|
|
148
79
|
else {
|
|
149
|
-
|
|
80
|
+
this.updateIsOpen = true;
|
|
150
81
|
}
|
|
151
82
|
});
|
|
152
|
-
}
|
|
153
|
-
|
|
83
|
+
}
|
|
84
|
+
isEnabled() {
|
|
154
85
|
return this.workspaceService.opened;
|
|
155
|
-
}
|
|
156
|
-
|
|
86
|
+
}
|
|
87
|
+
open() {
|
|
157
88
|
var _a;
|
|
158
89
|
// Triggering the keyboard shortcut while the dialog is open toggles
|
|
159
90
|
// showing the ignored files.
|
|
@@ -167,114 +98,82 @@ var QuickFileOpenService = /** @class */ (function () {
|
|
|
167
98
|
this.isOpen = true;
|
|
168
99
|
}
|
|
169
100
|
(_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.open(this.filterAndRange.filter);
|
|
170
|
-
}
|
|
171
|
-
|
|
101
|
+
}
|
|
102
|
+
hideQuickPick() {
|
|
172
103
|
var _a;
|
|
173
104
|
this.updateIsOpen = false;
|
|
174
105
|
(_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.hide();
|
|
175
|
-
}
|
|
106
|
+
}
|
|
176
107
|
/**
|
|
177
108
|
* Get a string (suitable to show to the user) representing the keyboard
|
|
178
109
|
* shortcut used to open the quick file open menu.
|
|
179
110
|
*/
|
|
180
|
-
|
|
181
|
-
|
|
111
|
+
getKeyCommand() {
|
|
112
|
+
const keyCommand = this.keybindingRegistry.getKeybindingsForCommand(exports.quickFileOpen.id);
|
|
182
113
|
if (keyCommand) {
|
|
183
114
|
// We only consider the first keybinding.
|
|
184
|
-
|
|
115
|
+
const accel = this.keybindingRegistry.acceleratorFor(keyCommand[0], '+');
|
|
185
116
|
return accel.join(' ');
|
|
186
117
|
}
|
|
187
118
|
return undefined;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
recentlyUsedItems
|
|
200
|
-
|
|
201
|
-
try {
|
|
202
|
-
for (locations_1 = __values(locations), locations_1_1 = locations_1.next(); !locations_1_1.done; locations_1_1 = locations_1.next()) {
|
|
203
|
-
location_1 = locations_1_1.value;
|
|
204
|
-
uriString = location_1.uri.toString();
|
|
205
|
-
if (location_1.uri.scheme === 'file' && !alreadyCollected.has(uriString) && fuzzy.test(fileFilter, uriString)) {
|
|
206
|
-
if (recentlyUsedItems.length === 0) {
|
|
207
|
-
recentlyUsedItems.push({ type: 'separator', label: 'recently opened' });
|
|
208
|
-
}
|
|
209
|
-
item = this.toItem(fileFilter, location_1.uri);
|
|
210
|
-
recentlyUsedItems.push(item);
|
|
211
|
-
alreadyCollected.add(uriString);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
119
|
+
}
|
|
120
|
+
async getPicks(filter, token) {
|
|
121
|
+
const roots = this.workspaceService.tryGetRoots();
|
|
122
|
+
this.filterAndRange = this.splitFilterAndRange(filter);
|
|
123
|
+
const fileFilter = this.filterAndRange.filter;
|
|
124
|
+
const alreadyCollected = new Set();
|
|
125
|
+
const recentlyUsedItems = [];
|
|
126
|
+
const locations = [...this.navigationLocationService.locations()].reverse();
|
|
127
|
+
for (const location of locations) {
|
|
128
|
+
const uriString = location.uri.toString();
|
|
129
|
+
if (location.uri.scheme === 'file' && !alreadyCollected.has(uriString) && fuzzy.test(fileFilter, uriString)) {
|
|
130
|
+
if (recentlyUsedItems.length === 0) {
|
|
131
|
+
recentlyUsedItems.push({ type: 'separator', label: 'recently opened' });
|
|
214
132
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
133
|
+
const item = this.toItem(fileFilter, location.uri);
|
|
134
|
+
recentlyUsedItems.push(item);
|
|
135
|
+
alreadyCollected.add(uriString);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (fileFilter.length > 0) {
|
|
139
|
+
const handler = async (results) => {
|
|
140
|
+
if (token.isCancellationRequested || results.length <= 0) {
|
|
141
|
+
return [];
|
|
221
142
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
result = __spread(recentlyUsedItems);
|
|
232
|
-
fileSearchResultItems = [];
|
|
233
|
-
try {
|
|
234
|
-
for (results_1 = __values(results), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {
|
|
235
|
-
fileUri = results_1_1.value;
|
|
236
|
-
if (!alreadyCollected.has(fileUri)) {
|
|
237
|
-
item = this.toItem(fileFilter, fileUri);
|
|
238
|
-
fileSearchResultItems.push(item);
|
|
239
|
-
alreadyCollected.add(fileUri);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
244
|
-
finally {
|
|
245
|
-
try {
|
|
246
|
-
if (results_1_1 && !results_1_1.done && (_a = results_1.return)) _a.call(results_1);
|
|
247
|
-
}
|
|
248
|
-
finally { if (e_2) throw e_2.error; }
|
|
249
|
-
}
|
|
250
|
-
sortedResults = fileSearchResultItems.slice();
|
|
251
|
-
sortedResults.sort(function (a, b) { return _this.compareItems(a, b); });
|
|
252
|
-
if (sortedResults.length > 0) {
|
|
253
|
-
result.unshift({ type: 'separator', label: 'file results' });
|
|
254
|
-
result.push.apply(result, __spread(sortedResults));
|
|
255
|
-
}
|
|
256
|
-
// Return the recently used items, followed by the search results.
|
|
257
|
-
return [2 /*return*/, result];
|
|
258
|
-
});
|
|
259
|
-
}); };
|
|
260
|
-
return [2 /*return*/, this.fileSearchService.find(fileFilter, {
|
|
261
|
-
rootUris: roots.map(function (r) { return r.resource.toString(); }),
|
|
262
|
-
fuzzyMatch: true,
|
|
263
|
-
limit: 200,
|
|
264
|
-
useGitIgnore: this.hideIgnoredFiles,
|
|
265
|
-
excludePatterns: this.hideIgnoredFiles
|
|
266
|
-
? Object.keys(this.fsPreferences['files.exclude'])
|
|
267
|
-
: undefined,
|
|
268
|
-
}, token).then(handler)];
|
|
143
|
+
const result = [...recentlyUsedItems];
|
|
144
|
+
const fileSearchResultItems = [];
|
|
145
|
+
for (const fileUri of results) {
|
|
146
|
+
if (!alreadyCollected.has(fileUri)) {
|
|
147
|
+
const item = this.toItem(fileFilter, fileUri);
|
|
148
|
+
fileSearchResultItems.push(item);
|
|
149
|
+
alreadyCollected.add(fileUri);
|
|
150
|
+
}
|
|
269
151
|
}
|
|
270
|
-
|
|
271
|
-
|
|
152
|
+
// Create a copy of the file search results and sort.
|
|
153
|
+
const sortedResults = fileSearchResultItems.slice();
|
|
154
|
+
sortedResults.sort((a, b) => this.compareItems(a, b));
|
|
155
|
+
if (sortedResults.length > 0) {
|
|
156
|
+
result.unshift({ type: 'separator', label: 'file results' });
|
|
157
|
+
result.push(...sortedResults);
|
|
272
158
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
159
|
+
// Return the recently used items, followed by the search results.
|
|
160
|
+
return result;
|
|
161
|
+
};
|
|
162
|
+
return this.fileSearchService.find(fileFilter, {
|
|
163
|
+
rootUris: roots.map(r => r.resource.toString()),
|
|
164
|
+
fuzzyMatch: true,
|
|
165
|
+
limit: 200,
|
|
166
|
+
useGitIgnore: this.hideIgnoredFiles,
|
|
167
|
+
excludePatterns: this.hideIgnoredFiles
|
|
168
|
+
? Object.keys(this.fsPreferences['files.exclude'])
|
|
169
|
+
: undefined,
|
|
170
|
+
}, token).then(handler);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
return roots.length !== 0 ? recentlyUsedItems : [];
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
compareItems(left, right) {
|
|
278
177
|
/**
|
|
279
178
|
* Score a given string.
|
|
280
179
|
*
|
|
@@ -286,19 +185,19 @@ var QuickFileOpenService = /** @class */ (function () {
|
|
|
286
185
|
return 0;
|
|
287
186
|
}
|
|
288
187
|
// Adjust for whitespaces in the query.
|
|
289
|
-
|
|
290
|
-
|
|
188
|
+
const querySplit = query.split(file_search_service_1.WHITESPACE_QUERY_SEPARATOR);
|
|
189
|
+
const queryJoin = querySplit.join('');
|
|
291
190
|
// Check exact and partial exact matches.
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
querySplit.forEach(
|
|
295
|
-
|
|
191
|
+
let exactMatch = true;
|
|
192
|
+
let partialMatch = false;
|
|
193
|
+
querySplit.forEach(part => {
|
|
194
|
+
const partMatches = str.includes(part);
|
|
296
195
|
exactMatch = exactMatch && partMatches;
|
|
297
196
|
partialMatch = partialMatch || partMatches;
|
|
298
197
|
});
|
|
299
198
|
// Check fuzzy matches.
|
|
300
|
-
|
|
301
|
-
|
|
199
|
+
const fuzzyMatch = fuzzy.match(queryJoin, str);
|
|
200
|
+
let matchScore = 0;
|
|
302
201
|
// eslint-disable-next-line no-null/no-null
|
|
303
202
|
if (!!fuzzyMatch && matchScore !== null) {
|
|
304
203
|
matchScore = (fuzzyMatch.score === Infinity) ? QuickFileOpenService_1.Scores.max : fuzzyMatch.score;
|
|
@@ -315,159 +214,161 @@ var QuickFileOpenService = /** @class */ (function () {
|
|
|
315
214
|
return (fuzzyMatch === null) ? 0 : matchScore;
|
|
316
215
|
}
|
|
317
216
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
217
|
+
const query = normalize(this.filterAndRange.filter);
|
|
218
|
+
const compareByLabelScore = (l, r) => score(r.label) - score(l.label);
|
|
219
|
+
const compareByLabelIndex = (l, r) => r.label.indexOf(query) - l.label.indexOf(query);
|
|
220
|
+
const compareByLabel = (l, r) => r.label.localeCompare(l.label);
|
|
221
|
+
const compareByPathScore = (l, r) => score(r.uri.path.toString()) - score(l.uri.path.toString());
|
|
222
|
+
const compareByPathIndex = (l, r) => r.uri.path.toString().indexOf(query) - l.uri.path.toString().indexOf(query);
|
|
223
|
+
const compareByPathLabel = (l, r) => r.uri.path.toString().localeCompare(l.uri.path.toString());
|
|
325
224
|
return compareWithDiscriminators(left, right, compareByLabelScore, compareByLabelIndex, compareByLabel, compareByPathScore, compareByPathIndex, compareByPathLabel);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
var closedEditor = this.navigationLocationService.closedEditorsStack.find(function (editor) { return editor.uri.path.toString() === uri.path.toString(); });
|
|
225
|
+
}
|
|
226
|
+
openFile(uri) {
|
|
227
|
+
const options = this.buildOpenerOptions();
|
|
228
|
+
const closedEditor = this.navigationLocationService.closedEditorsStack.find(editor => editor.uri.path.toString() === uri.path.toString());
|
|
331
229
|
this.openerService.getOpener(uri, options)
|
|
332
|
-
.then(
|
|
333
|
-
.then(
|
|
230
|
+
.then(opener => opener.open(uri, options))
|
|
231
|
+
.then(widget => {
|
|
334
232
|
// Attempt to restore the editor state if it exists, and no selection is explicitly requested.
|
|
335
233
|
if (widget instanceof browser_3.EditorWidget && closedEditor && !options.selection) {
|
|
336
234
|
widget.editor.restoreViewState(closedEditor.viewState);
|
|
337
235
|
}
|
|
338
236
|
})
|
|
339
|
-
.catch(
|
|
340
|
-
}
|
|
341
|
-
|
|
237
|
+
.catch(error => this.messageService.error(error));
|
|
238
|
+
}
|
|
239
|
+
buildOpenerOptions() {
|
|
342
240
|
return { selection: this.filterAndRange.range };
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
var iconClasses = this.getItemIconClasses(uri);
|
|
241
|
+
}
|
|
242
|
+
toItem(lookFor, uriOrString) {
|
|
243
|
+
const uri = uriOrString instanceof uri_1.default ? uriOrString : new uri_1.default(uriOrString);
|
|
244
|
+
const label = this.labelProvider.getName(uri);
|
|
245
|
+
const description = this.getItemDescription(uri);
|
|
246
|
+
const iconClasses = this.getItemIconClasses(uri);
|
|
350
247
|
return {
|
|
351
|
-
label
|
|
352
|
-
description
|
|
248
|
+
label,
|
|
249
|
+
description,
|
|
353
250
|
highlights: {
|
|
354
251
|
label: quick_input_service_1.findMatches(label, lookFor),
|
|
355
252
|
description: quick_input_service_1.findMatches(description, lookFor)
|
|
356
253
|
},
|
|
357
|
-
iconClasses
|
|
358
|
-
uri
|
|
359
|
-
execute:
|
|
254
|
+
iconClasses,
|
|
255
|
+
uri,
|
|
256
|
+
execute: () => this.openFile(uri)
|
|
360
257
|
};
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
|
|
258
|
+
}
|
|
259
|
+
getItemIconClasses(uri) {
|
|
260
|
+
const icon = this.labelProvider.getIcon(uri);
|
|
364
261
|
return icon !== '' ? [icon + ' file-icon'] : [];
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
262
|
+
}
|
|
263
|
+
getItemDescription(uri) {
|
|
264
|
+
const resourcePathLabel = this.labelProvider.getLongName(uri.parent);
|
|
265
|
+
const rootUri = this.workspaceService.getWorkspaceRootUri(uri);
|
|
266
|
+
// Display the path normally if outside any workspace root.
|
|
267
|
+
if (!rootUri) {
|
|
268
|
+
return resourcePathLabel;
|
|
269
|
+
}
|
|
270
|
+
// Compute the multi-root label for the resource.
|
|
368
271
|
if (this.workspaceService.isMultiRootWorkspaceOpened) {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
description = this.labelProvider.getLongName(rootUri) + " \u2022 " + description;
|
|
372
|
-
}
|
|
272
|
+
const rootLabel = this.labelProvider.getName(rootUri);
|
|
273
|
+
return rootUri.path.toString() === uri.parent.path.toString() ? `${rootLabel}` : `${rootLabel} • ${resourcePathLabel}`;
|
|
373
274
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
275
|
+
else {
|
|
276
|
+
return rootUri.toString() === uri.parent.toString() ? '' : resourcePathLabel;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
getPlaceHolder() {
|
|
280
|
+
let placeholder = 'File name to search (append : to go to line).';
|
|
281
|
+
const keybinding = this.getKeyCommand();
|
|
379
282
|
if (keybinding) {
|
|
380
|
-
placeholder +=
|
|
283
|
+
placeholder += ` (Press ${keybinding} to show/hide ignored files)`;
|
|
381
284
|
}
|
|
382
285
|
return placeholder;
|
|
383
|
-
}
|
|
286
|
+
}
|
|
384
287
|
/**
|
|
385
288
|
* Splits the given expression into a structure of search-file-filter and
|
|
386
289
|
* location-range.
|
|
387
290
|
*
|
|
388
291
|
* @param expression patterns of <path><#|:><line><#|:|,><col?>
|
|
389
292
|
*/
|
|
390
|
-
|
|
293
|
+
splitFilterAndRange(expression) {
|
|
391
294
|
var _a, _b;
|
|
392
|
-
|
|
393
|
-
|
|
295
|
+
let filter = expression;
|
|
296
|
+
let range = undefined;
|
|
394
297
|
// Find line and column number from the expression using RegExp.
|
|
395
|
-
|
|
298
|
+
const patternMatch = LINE_COLON_PATTERN.exec(expression);
|
|
396
299
|
if (patternMatch) {
|
|
397
|
-
|
|
300
|
+
const line = parseInt((_a = patternMatch[1]) !== null && _a !== void 0 ? _a : '', 10);
|
|
398
301
|
if (Number.isFinite(line)) {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
302
|
+
const lineNumber = line > 0 ? line - 1 : 0;
|
|
303
|
+
const column = parseInt((_b = patternMatch[2]) !== null && _b !== void 0 ? _b : '', 10);
|
|
304
|
+
const startColumn = Number.isFinite(column) && column > 0 ? column - 1 : 0;
|
|
305
|
+
const position = browser_3.Position.create(lineNumber, startColumn);
|
|
403
306
|
filter = expression.substr(0, patternMatch.index);
|
|
404
307
|
range = browser_3.Range.create(position, position);
|
|
405
308
|
}
|
|
406
309
|
}
|
|
407
|
-
return { filter
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
return QuickFileOpenService;
|
|
470
|
-
}());
|
|
310
|
+
return { filter, range };
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
QuickFileOpenService.PREFIX = '';
|
|
314
|
+
/**
|
|
315
|
+
* The score constants when comparing file search results.
|
|
316
|
+
*/
|
|
317
|
+
QuickFileOpenService.Scores = {
|
|
318
|
+
max: 1000,
|
|
319
|
+
exact: 500,
|
|
320
|
+
partial: 250 // represents the score assigned to partial matching.
|
|
321
|
+
};
|
|
322
|
+
__decorate([
|
|
323
|
+
inversify_1.inject(browser_1.KeybindingRegistry),
|
|
324
|
+
__metadata("design:type", browser_1.KeybindingRegistry)
|
|
325
|
+
], QuickFileOpenService.prototype, "keybindingRegistry", void 0);
|
|
326
|
+
__decorate([
|
|
327
|
+
inversify_1.inject(workspace_service_1.WorkspaceService),
|
|
328
|
+
__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
329
|
+
], QuickFileOpenService.prototype, "workspaceService", void 0);
|
|
330
|
+
__decorate([
|
|
331
|
+
inversify_1.inject(browser_1.OpenerService),
|
|
332
|
+
__metadata("design:type", Object)
|
|
333
|
+
], QuickFileOpenService.prototype, "openerService", void 0);
|
|
334
|
+
__decorate([
|
|
335
|
+
inversify_1.inject(quick_input_service_1.QuickInputService),
|
|
336
|
+
inversify_1.optional(),
|
|
337
|
+
__metadata("design:type", Object)
|
|
338
|
+
], QuickFileOpenService.prototype, "quickInputService", void 0);
|
|
339
|
+
__decorate([
|
|
340
|
+
inversify_1.inject(browser_1.QuickAccessRegistry),
|
|
341
|
+
__metadata("design:type", Object)
|
|
342
|
+
], QuickFileOpenService.prototype, "quickAccessRegistry", void 0);
|
|
343
|
+
__decorate([
|
|
344
|
+
inversify_1.inject(file_search_service_1.FileSearchService),
|
|
345
|
+
__metadata("design:type", Object)
|
|
346
|
+
], QuickFileOpenService.prototype, "fileSearchService", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
inversify_1.inject(label_provider_1.LabelProvider),
|
|
349
|
+
__metadata("design:type", label_provider_1.LabelProvider)
|
|
350
|
+
], QuickFileOpenService.prototype, "labelProvider", void 0);
|
|
351
|
+
__decorate([
|
|
352
|
+
inversify_1.inject(navigation_location_service_1.NavigationLocationService),
|
|
353
|
+
__metadata("design:type", navigation_location_service_1.NavigationLocationService)
|
|
354
|
+
], QuickFileOpenService.prototype, "navigationLocationService", void 0);
|
|
355
|
+
__decorate([
|
|
356
|
+
inversify_1.inject(message_service_1.MessageService),
|
|
357
|
+
__metadata("design:type", message_service_1.MessageService)
|
|
358
|
+
], QuickFileOpenService.prototype, "messageService", void 0);
|
|
359
|
+
__decorate([
|
|
360
|
+
inversify_1.inject(browser_2.FileSystemPreferences),
|
|
361
|
+
__metadata("design:type", Object)
|
|
362
|
+
], QuickFileOpenService.prototype, "fsPreferences", void 0);
|
|
363
|
+
__decorate([
|
|
364
|
+
inversify_1.postConstruct(),
|
|
365
|
+
__metadata("design:type", Function),
|
|
366
|
+
__metadata("design:paramtypes", []),
|
|
367
|
+
__metadata("design:returntype", void 0)
|
|
368
|
+
], QuickFileOpenService.prototype, "init", null);
|
|
369
|
+
QuickFileOpenService = QuickFileOpenService_1 = __decorate([
|
|
370
|
+
inversify_1.injectable()
|
|
371
|
+
], QuickFileOpenService);
|
|
471
372
|
exports.QuickFileOpenService = QuickFileOpenService;
|
|
472
373
|
/**
|
|
473
374
|
* Normalize a given string.
|
|
@@ -478,13 +379,9 @@ exports.QuickFileOpenService = QuickFileOpenService;
|
|
|
478
379
|
function normalize(str) {
|
|
479
380
|
return str.trim().toLowerCase();
|
|
480
381
|
}
|
|
481
|
-
function compareWithDiscriminators(left, right) {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
discriminators[_i - 2] = arguments[_i];
|
|
485
|
-
}
|
|
486
|
-
var comparisonValue = 0;
|
|
487
|
-
var i = 0;
|
|
382
|
+
function compareWithDiscriminators(left, right, ...discriminators) {
|
|
383
|
+
let comparisonValue = 0;
|
|
384
|
+
let i = 0;
|
|
488
385
|
while (comparisonValue === 0 && i < discriminators.length) {
|
|
489
386
|
comparisonValue = discriminators[i](left, right);
|
|
490
387
|
i++;
|