Exemplo n.º 1
0
		void parsingFinished(ParsingFinishedEventArgs ea)
		{
			HadInitialParse = true;

			if (FinishedParsing != null)
				FinishedParsing (ea);
		}
Exemplo n.º 2
0
        static void noticeFinish(ParseIntermediate p)
        {
            var im = p.im;

            im.sw.Stop();
            im.completed.Set();

            if (!string.IsNullOrEmpty(p.im.basePath) && p.root != null)
            {
                ParsedDirectories [im.basePath] = p.root;
                p.root.TryPreResolveCommonTypes();
            }

            var pf = new ParsingFinishedEventArgs(im.basePath, p.root, im.actualTimeNeeded, im.ActualParseTimeNeeded, im.totalFiles);

            if (ParseTaskFinished != null)
            {
                ParseTaskFinished(pf);
            }

            criticalPreparationSection.WaitOne();
            var subTasks = im.parseSubTasksUntilFinished.ToArray();

            if (p.im.basePath != null)
            {
                ParseStatistics.Remove(p.im.basePath);
            }

            criticalPreparationSection.Set();

            foreach (var subtask in subTasks)
            {
                if (Interlocked.Decrement(ref subtask.i) < 1 && subtask.finishedHandler != null)
                {
                    subtask.finishedHandler(pf);                      // Generic issue: The wrong statistics will be passed, if we fire the event for a task which was added some time afterwards
                }
            }

            if (Interlocked.Decrement(ref parsingThreads) <= 0)
            {
                parseCompletedEvent.Set();
            }
        }
Exemplo n.º 3
0
 protected void LocalIncludeCache_FinishedParsing(ParsingFinishedEventArgs PerformanceData)
 {
     if (References != null)
         References.FireUpdate();
 }
Exemplo n.º 4
0
        static void noticeFinish(ParseIntermediate p)
        {
            var im = p.im;

            im.sw.Stop ();
            im.completed.Set ();

            if (!string.IsNullOrEmpty (p.im.basePath) && p.root != null) {
                ParsedDirectories [im.basePath] = p.root;
                p.root.TryPreResolveCommonTypes ();
            }

            var pf = new ParsingFinishedEventArgs (im.basePath, p.root, im.actualTimeNeeded, im.ActualParseTimeNeeded, im.totalFiles);

            if (ParseTaskFinished != null)
                ParseTaskFinished (pf);

            criticalPreparationSection.WaitOne ();
            var subTasks = im.parseSubTasksUntilFinished.ToArray ();

            if(p.im.basePath != null)
                ParseStatistics.Remove (p.im.basePath);

            criticalPreparationSection.Set ();

            foreach(var subtask in subTasks) {
                if (Interlocked.Decrement (ref subtask.i) < 1 && subtask.finishedHandler != null)
                    subtask.finishedHandler (pf); // Generic issue: The wrong statistics will be passed, if we fire the event for a task which was added some time afterwards
            }

            if (Interlocked.Decrement (ref parsingThreads) <= 0)
                parseCompletedEvent.Set ();
        }
Exemplo n.º 5
0
		static void pc_FinishedParsing(ParsingFinishedEventArgs ppd)
		{
			Trace.WriteLine(string.Format("Parsed {0} files in {1}; {2}ms/file", ppd.FileAmount, ppd.Directory, ppd.FileDuration), "ParserTests");
		}
Exemplo n.º 6
0
		void parsedSources(ParsingFinishedEventArgs pfd)
		{
			InitialParsingDone = true;
			if(ParsingFinished != null)
				ParsingFinished();

			var pcw = new ParseCacheView(tempImports);
			
			// Output parse time stats
			if (pfd != null)
				ErrorLogger.Log("Parsed " + pfd.FileAmount + " files in [" +
						string.Join(",",tempImports) + "] in " +
						Math.Round(pfd.ParseDuration/1000.0, 2).ToString() + "s (~" +
						Math.Round(pfd.FileParseDuration, 3).ToString() + "ms per file)",
						ErrorType.Information, ErrorOrigin.Parser);

			// For debugging purposes dump all parse results (errors etc.) to a log file.
			/*try
			{
				ParseLog.Write(ASTCache, IDEInterface.ConfigDirectory + "\\" + Version.ToString() + ".GlobalParseLog.log");
			}
			catch (Exception ex)
			{
				ErrorLogger.Log(ex, ErrorType.Warning, ErrorOrigin.System);
			}*/
		}
Exemplo n.º 7
0
        void GlobalParseCacheFilled(ParsingFinishedEventArgs ea)
        {
            var GuiDoc = GuiDocument;
            if (GuiDoc != null && Document != null && ea.Package != null)
            {
                var root = ea.Package.Root;
                if (root == null)
                    return;

                var pcl = MonoDevelop.D.Resolver.DResolverWrapper.CreateCacheList(GuiDoc);
                if (pcl.Contains(root))
                    HandleDocumentParsed(this, EventArgs.Empty);
            }
        }
Exemplo n.º 8
0
		void GlobalParseCacheFilled(ParsingFinishedEventArgs ea)
		{
			var GuiDoc = GuiDocument;
			if (GuiDoc != null && Document != null && ea.Package != null && GuiDoc.ParsedDocument is ParsedDModule)
			{
				var root = ea.Package.Root;
				if (root == null)
					return;

				var mod = (GuiDoc.ParsedDocument as ParsedDModule).DDom;
				if (mod == null)
					return;

				var pcl = MonoDevelop.D.Resolver.DResolverWrapper.CreateParseCacheView(GuiDoc);
				if (pcl.EnumRootPackagesSurroundingModule(mod).Contains(root))
					HandleDocumentParsed(this, EventArgs.Empty);
			}
		}