MCPcopy Create free account
hub / github.com/microsoft/vscode-extension-samples / sort

Method sort

tree-view-sample/src/ftpExplorer.ts:67–79  ·  view source on GitHub ↗
(nodes: FtpNode[])

Source from the content-addressed store, hash-verified

65 }
66
67 private sort(nodes: FtpNode[]): FtpNode[] {
68 return nodes.sort((n1, n2) => {
69 if (n1.isDirectory && !n2.isDirectory) {
70 return -1;
71 }
72
73 if (!n1.isDirectory && n2.isDirectory) {
74 return 1;
75 }
76
77 return basename(n1.resource.fsPath).localeCompare(basename(n2.resource.fsPath));
78 });
79 }
80
81 public getContent(resource: vscode.Uri): Thenable<string> {
82 return this.connect().then(client => {

Callers 5

rootsMethod · 0.95
getChildrenMethod · 0.95
getChildrenMethod · 0.80
sortedWorkspaceFoldersFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected