public virtual bool CanHandle(FilePath fileName, string mimeType, Project ownerProject) { if (excludeThis) { return(false); } var dprj = ownerProject as AbstractDProject; if (dprj == null) { return(false); } var mod = GlobalParseCache.GetModule(fileName.ToString()); if (GetGtkDMainClass(mod) == null) { return(false); } excludeThis = true; var db = DisplayBindingService.GetDefaultViewBinding(fileName, mimeType, ownerProject); excludeThis = false; return(db != null); }
public static DModule GetFileSyntaxTree(string file, out AbstractDProject OwnerProject) { var doc = IdeApp.Workbench.ActiveDocument; OwnerProject = doc.Project as AbstractDProject; var dparsedDoc = doc.ParsedDocument as MonoDevelop.D.Parser.ParsedDModule; return(dparsedDoc != null ? dparsedDoc.DDom : GlobalParseCache.GetModule(file)); }
public DModule GetModule(string fileName) { DModule mod; if (!_modules.TryGetValue(fileName, out mod)) { GlobalParseCache.GetModule(fileName); } return(mod); }
public DModule GetModule(string fileName) { DModule mod; mod = GlobalParseCache.GetModule(fileName); if (mod == null) { _modules.TryGetValue(fileName, out mod); } return(mod); }
public DModule GetModule(string fileName) { if (!_sources.ContainsKey(fileName)) { return(null); } DModule mod = GlobalParseCache.GetModule(fileName); if (mod == null) { _modules.TryGetValue(fileName, out mod); } return(mod); }
/// <summary> /// Searches in current solution and in the global cache for the given file and returns it. /// If not found, file will be parsed. /// </summary> /// <param name="file"></param> /// <returns></returns> public static DModule GetFileSyntaxTree(string file, out DProject OwnerProject) { OwnerProject = null; var mod = GlobalParseCache.GetModule(file); if (CoreManager.CurrentSolution != null) { foreach (var prj in CoreManager.CurrentSolution) { var dprj = prj as DProject; if (dprj != null && dprj.ContainsFile(file)) { OwnerProject = dprj; } } } return(mod ?? DParser.ParseFile(file)); }
public static DModule GetAstModule(Uri uri) { return(GlobalParseCache.GetModule(uri.AbsolutePath) ?? OpenFiles[uri].Module); }
public void TryUpdateStackFrameInfo() { if (needsStackFrameInfoUpdate || ctxt == null) { string file; ulong eip; CodeLocation loc; BacktraceHelper.GetCurrentStackFrameInfo(out file, out eip, out loc); currentStackFrameSource = file; currentInstruction = eip; currentSourceLocation = loc; if (needsStackFrameInfoUpdate = string.IsNullOrWhiteSpace(file)) { return; } needsStackFrameInfoUpdate |= loc.IsEmpty; var mod = GlobalParseCache.GetModule(file); if (ctxt == null) { var doc = Ide.IdeApp.Workbench.GetDocument(file); if (doc != null) { ctxt = ResolutionContext.Create(MonoDevelop.D.Resolver.DResolverWrapper.CreateEditorData(doc), false); } SymbolProvider = new DebugSymbolValueProvider(this, ctxt); if (doc == null) { return; } } if (SymbolProvider.ResolutionContext == null) { SymbolProvider = new DebugSymbolValueProvider(this, ctxt); } SymbolProvider.ResetCache(); if (mod == null) { if (ctxt.CurrentContext != null) { ctxt.CurrentContext.Set(loc); } } else { var bn = D_Parser.Resolver.TypeResolution.DResolver.SearchBlockAt(mod, loc); if (ctxt.CurrentContext == null) { ctxt.Push(bn, loc); } else { ctxt.CurrentContext.Set(bn, loc); } } } }