aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces-provider.js
blob: d42995e2951fe3334ea657868c1e36be886a8bca (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 => x.name)
                callback(interfaces);
            });
}

module.exports = provideInterfaces