From 0098e0b03a736a99fbb29e963150bd387617c355 Mon Sep 17 00:00:00 2001 From: Samuel Brucksch Date: Tue, 27 Nov 2018 22:51:15 +0100 Subject: [PATCH 1/2] Removed sorting of items when querying completion items vscode deals with sorting the items in the auto completion list so no need to do it here. might improve speed a bit. Signed-off-by: Samuel Brucksch Signed-off-by: Samuel Brucksch (github: SamuelBrucksch) --- src/ItemsExplorer/ItemsModel.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/ItemsExplorer/ItemsModel.ts b/src/ItemsExplorer/ItemsModel.ts index a303315..f0d733b 100644 --- a/src/ItemsExplorer/ItemsModel.ts +++ b/src/ItemsExplorer/ItemsModel.ts @@ -12,7 +12,7 @@ import * as request from 'request-promise-native' /** * Collects Items in JSON format from REST API - * and transforms it into sorted tree + * and transforms it into tree * * Kuba Wolanin - Initial contribution */ @@ -62,25 +62,11 @@ export class ItemsModel { return new Promise((resolve, reject) => { request(options) .then(function (response: Item[] | Item) { - resolve(this.sort(transform(response))) + resolve(transform(response)) }.bind(this)) .catch(err => { handleRequestError(err).then(err => resolve([])) }) }) } - - protected sort(nodes: Item[]): Item[] { - return nodes.sort((n1, n2) => { - if (n1.isGroup && !n2.isGroup) { - return -1 - } - - if (!n1.isGroup && n2.isGroup) { - return 1 - } - - return n1.name.localeCompare(n2.name) - }); - } } From 52dbdfdb5fd284e8fc9007bd5714148472cfae10 Mon Sep 17 00:00:00 2001 From: Samuel Brucksch Date: Thu, 6 Dec 2018 09:22:17 +0100 Subject: [PATCH 2/2] Fixed Docs (pseudo commit for sign off) Signed-off-by: Samuel Brucksch (github: SamuelBrucksch) --- src/ItemsExplorer/ItemsModel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ItemsExplorer/ItemsModel.ts b/src/ItemsExplorer/ItemsModel.ts index f0d733b..42d25b6 100644 --- a/src/ItemsExplorer/ItemsModel.ts +++ b/src/ItemsExplorer/ItemsModel.ts @@ -12,7 +12,7 @@ import * as request from 'request-promise-native' /** * Collects Items in JSON format from REST API - * and transforms it into tree + * and transforms it into a tree * * Kuba Wolanin - Initial contribution */