Skip to content

Commit cdcd716

Browse files
committed
fix(extensions): not check file when main field not exists
Closes #1641
1 parent f8b83aa commit cdcd716

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

build/index.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35280,7 +35280,7 @@ class Plugin extends events_1.EventEmitter {
3528035280
return false;
3528135281
}
3528235282
get version() {
35283-
return workspace_1.default.version + ( true ? '-' + "2e9f0a2814" : undefined);
35283+
return workspace_1.default.version + ( true ? '-' + "9e9b0ad3a2" : undefined);
3528435284
}
3528535285
async showInfo() {
3528635286
if (!this.infoChannel) {
@@ -39066,6 +39066,10 @@ class Extensions {
3906639066
let filename = path_1.default.join(root, packageJSON.main || 'index.js');
3906739067
let ext;
3906839068
let subscriptions = [];
39069+
if (packageJSON.main && !fs_1.default.existsSync(filename)) {
39070+
workspace_1.default.showMessage(`extension "${id}" doesn't contain main file ${filename}.`, 'error');
39071+
return;
39072+
}
3906939073
let extension = {
3907039074
activate: async () => {
3907139075
if (isActive)
@@ -39164,7 +39168,6 @@ class Extensions {
3916439168
if (this.activated) {
3916539169
this.setupActiveEvents(id, packageJSON);
3916639170
}
39167-
return id;
3916839171
}
3916939172
async initializeRoot() {
3917039173
let root = this.root = await workspace_1.default.nvim.call('coc#util#extension_root');
@@ -57214,7 +57217,7 @@ class BaseLanguageClient {
5721457217
}
5721557218
}
5721657219
notifyFileEvent(event) {
57217-
var _a;
57220+
var _a, _b;
5721857221
const client = this;
5721957222
function didChangeWatchedFile(event) {
5722057223
client._fileEvents.push(event);
@@ -57233,7 +57236,7 @@ class BaseLanguageClient {
5723357236
});
5723457237
}
5723557238
const workSpaceMiddleware = (_a = this.clientOptions.middleware) === null || _a === void 0 ? void 0 : _a.workspace;
57236-
(workSpaceMiddleware === null || workSpaceMiddleware === void 0 ? void 0 : workSpaceMiddleware.didChangeWatchedFile) ? workSpaceMiddleware.didChangeWatchedFile(event, didChangeWatchedFile) : didChangeWatchedFile(event);
57239+
((_b = workSpaceMiddleware) === null || _b === void 0 ? void 0 : _b.didChangeWatchedFile) ? workSpaceMiddleware.didChangeWatchedFile(event, didChangeWatchedFile) : didChangeWatchedFile(event);
5723757240
}
5723857241
forceDocumentSync() {
5723957242
let doc = workspace_1.default.getDocument(workspace_1.default.bufnr);
@@ -59066,7 +59069,7 @@ class ListManager {
5906659069
nvim.command('setl nomod', true);
5906759070
nvim.command('setl nomodifiable', true);
5906859071
nvim.command('normal! gg', true);
59069-
nvim.command('nnoremap q :bd!<CR>', true);
59072+
nvim.command('nnoremap <buffer> q :bd!<CR>', true);
5907059073
await nvim.resumeNotification();
5907159074
}
5907259075
get context() {
@@ -63584,7 +63587,7 @@ class Complete {
6358463587
}
6358563588
if ((!item.dup || source == 'tabnine') && words.has(word))
6358663589
continue;
63587-
if (removeDuplicateItems && !item.isSnippet && words.has(word))
63590+
if (removeDuplicateItems && !item.isSnippet && words.has(word) && item.line == undefined)
6358863591
continue;
6358963592
let filterText = item.filterText || item.word;
6359063593
item.filterText = filterText;

0 commit comments

Comments
 (0)