private VarSym GetNameInfo(int position, CodeDocument doc) { var word = sci.GetWordAt(position) ?? GetOperator(position, 0); var frame = doc != null ? doc.Unit : null; if (word != null && frame != null) { var dr = new DebugReader(((CompiledUnit)frame).CodeFrame.Symbols); var lineNum = sci.GetLineFromPosition(position); var colNum = sci.GetColumnFromPosition(position); var ln = dr.FindClosestLineSym(lineNum + 1, colNum + 1); var scope = default(ScopeSym); if (ln != null && (scope = (dr.FindScopeSym(lineNum + 1, colNum + 1) ?? dr.GetScopeSymByIndex(0))) != null) { return(LookVar(dr, ln.Offset, scope.Index, word)); } } return(null); }
public void FindSymbol() { var w = sci.GetWordAt(sci.CurrentPosition); app.GetService <ISymbolSearchService>().SearchSymbol(w, new SymbolFinder(app)); }