aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces-provider.js
blob: 969c5622d2d5b393abfcec72ca7df1cf9b281b0a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const vscode = require('vscode');

function provideInterfaces(keyword, callback) {
    vscode.commands.executeCommand("vscode.executeWorkspaceSymbolProvider", keyword)
        .then(
            /** 
             * @param {array} objects
             */
            (objects) => {
                const interfaces = objects.
                    filter(x => x.kind == vscode.SymbolKind.Interface).
                    map(x => ({ label: x.name, detail: x.containerName }))
                callback(interfaces);
            });
}

module.exports = { provideInterfaces };