} // GetExpressionType /// <summary> /// Get overloads for a method /// </summary> internal List <Afrodite.Symbol> GetOverloads(string name, string filename, int line, int column) { List <Afrodite.Symbol> overloads = new List <Afrodite.Symbol> (); if (!DepsInstalled) { return(overloads); } using (Afrodite.Ast parseTree = engine.TryAcquireAst()) { if (null != parseTree) { Afrodite.Symbol symbol = parseTree.GetSymbolForNameAndPath(name, filename, line, column); overloads = new List <Afrodite.Symbol> () { symbol }; } else { LoggingService.LogDebug("GetOverloads: Unable to acquire ast"); } } return(overloads); } // GetOverloads
} // AddPackage /// <summary> /// Gets the completion list for a given symbol at a given location /// </summary> internal List <Afrodite.Symbol> Complete(string symbol, string filename, int line, int column, ValaCompletionDataList results) { List <Afrodite.Symbol> nodes = new List <Afrodite.Symbol> (); if (!DepsInstalled) { return(nodes); } using (Afrodite.Ast parseTree = engine.TryAcquireAst()) { if (null != parseTree) { LoggingService.LogDebug("Complete: Looking up symbol at {0}:{1}:{2}", filename, line, column); Afrodite.Symbol sym = parseTree.GetSymbolForNameAndPath(symbol, filename, line, column); LoggingService.LogDebug("Complete: Got {0}", (null == sym)? "null": sym.Name); if (null != sym) { nodes = sym.Children; AddResults(nodes, results); } } else { LoggingService.LogDebug("Complete: Unable to acquire ast"); } } return(nodes); } // Complete
/// <summary> /// Gets the completion list for a given type name in a given file /// </summary> internal List <Afrodite.Symbol> CompleteType(string typename, string filename, int linenum, int column, ValaCompletionDataList results) { List <Afrodite.Symbol> nodes = new List <Afrodite.Symbol> (); if (!DepsInstalled) { return(nodes); } using (Afrodite.Ast parseTree = engine.TryAcquireAst()) { if (null != parseTree) { Afrodite.Symbol symbol = parseTree.GetSymbolForNameAndPath(typename, filename, linenum, column); if (null == symbol) { LoggingService.LogDebug("CompleteType: Unable to lookup {0} in {1} at {2}:{3}", typename, filename, linenum, column); } else { nodes = symbol.Children; } } else { LoggingService.LogDebug("CompleteType: Unable to acquire ast"); } } return(nodes); }
} // Complete internal Afrodite.Symbol GetFunction(string name, string filename, int line, int column) { if (!DepsInstalled) { return(null); } using (Afrodite.Ast parseTree = engine.TryAcquireAst()) { if (null != parseTree) { LoggingService.LogDebug("GetFunction: Looking up symbol at {0}:{1}:{2}", filename, line, column); Afrodite.Symbol symbol = parseTree.GetSymbolForNameAndPath(name, filename, line, column); LoggingService.LogDebug("GetFunction: Got {0}", (null == symbol)? "null": symbol.Name); return(symbol); } else { LoggingService.LogDebug("GetFunction: Unable to acquire ast"); } } return(null); }