Reputation: 274
I call the command vscode.executeDocumentSymbolProvider to get the symbols in a file, but anonymous functions which are assigned to a variable are not reported as functions.
For example, in the following Typescript code, the variable functionVariable is reported by the Typescript language server as a variable, and there is no indication that it is a function.
const functionVariable = async (req: Request, res: Response) => {}
So how can I properly identify these variables as functions?
My current solution, which seems questionable, is to say that a variable is actually a function if it has child symbols which are not properties (as they would be if the symbol was an object or struct). Is there a better way?
Upvotes: 1
Views: 29