static private void IndexTranslationUnit(IProjectIndex index, TranslationUnit tu) { foreach (Cursor c in tu.Cursor.Children) { IndexCursor(index, c); } }
public FindAllReferencesSearch(IProjectIndex index, ICodeLocation location) { JadeUtils.ArgChecking.ThrowIfNull(index, "index"); JadeUtils.ArgChecking.ThrowIfNull(location, "location"); _projectIndex = index; _location = location; }
public ParseResult(IProjectIndex index, FilePath path, IEnumerable<ParseFile> files, LibClang.TranslationUnit tu) { _index = index; _path = path; _translationUnit = tu; _files = new Dictionary<FilePath, ParseFile>(); foreach(ParseFile pf in files) { _files.Add(pf.Path, pf); } }
public static ParseResult Parse(IProjectIndex index, FilePath path, string[] compilerArgs, IUnsavedFileProvider unsavedFiles) { TranslationUnit tu = new TranslationUnit(index.LibClangIndex, path.Str); //Take a snapshot of the source IEnumerable<ParseFile> files = unsavedFiles.UnsavedFiles; List<Tuple<string, string>> unsavedList = new List<Tuple<string, string>>(); foreach (var i in files) { unsavedList.Add(new Tuple<string, string>(i.Path.Str, i.Content)); } if (tu.Parse(compilerArgs, unsavedList) == false) { tu.Dispose(); return null; } return new ParseResult(index, path, files, tu); ; }
static private void IndexCursor(IProjectIndex index, Cursor c) { if (FilterCursor(c) == false) return; if (c.Kind == CursorKind.InclusionDirective) { int i = 0; } if (CursorKinds.IsDefinition(c.Kind) || c.Kind == CursorKind.InclusionDirective) { index.Symbols.UpdateDefinition(c); } else if (c.CursorReferenced != null)// && c.Kind != CursorKind.CallExpr) { if (FilterCursor(c.CursorReferenced)) index.Symbols.UpdateReference(c); } foreach (Cursor child in c.Children) { IndexCursor(index, child); } }
public JumpToBrowser(IProjectIndex index) { _index = index; }