Exemplo n.º 1
0
        public static ResolutionContext Create(IEditorData editor, ConditionalCompilationFlags globalConditions = null)
        {
            IStatement stmt;

            return(new ResolutionContext(editor.ParseCache, globalConditions ?? new ConditionalCompilationFlags(editor),
                                         DResolver.SearchBlockAt(editor.SyntaxTree, editor.CaretLocation, out stmt) ?? editor.SyntaxTree,
                                         stmt));
        }
Exemplo n.º 2
0
        public ResolutionContext(ParseCacheView parseCache, ConditionalCompilationFlags gFlags, IBlockNode bn, IStatement stmt = null)
        {
            this.CompilationEnvironment = gFlags;
            this.ParseCache             = parseCache;

            var initCtxt = new ContextFrame(this, bn, stmt);

            stack.Push(initCtxt);
        }
		public static void EnumAllAvailableMembers(ICompletionDataGenerator cdgen, IBlockNode ScopedBlock
			, IStatement ScopedStatement,
			CodeLocation Caret,
		    ParseCacheView CodeCache,
			MemberFilter VisibleMembers,
			ConditionalCompilationFlags compilationEnvironment = null)
		{
			var ctxt = ResolutionContext.Create(CodeCache, compilationEnvironment, ScopedBlock, ScopedStatement);
			
			var en = new MemberCompletionEnumeration(ctxt, cdgen) {isVarInst = true};

			en.IterateThroughScopeLayers(Caret, VisibleMembers);
		}
		public static TypeReferencesResult Scan(DModule ast, ParseCacheView pcl, ConditionalCompilationFlags compilationEnvironment = null)
		{
			if (ast == null)
				return new TypeReferencesResult();

			var typeRefFinder = new OldTypeReferenceFinder(pcl, compilationEnvironment);

			typeRefFinder.ast = ast;
			// Enum all identifiers
			typeRefFinder.S(ast);

			// Crawl through all remaining expressions by evaluating their types and check if they're actual type references.
			typeRefFinder.queueCount = typeRefFinder.q.Count;
			typeRefFinder.ResolveAllIdentifiers();

			return typeRefFinder.result;
		}
Exemplo n.º 5
0
		/// <summary>
		/// Returns false if cache is already updating.
		/// </summary>
		public bool BeginUpdate(ParseCacheView pcList, ConditionalCompilationFlags compilationEnvironment = null)
		{
			if (!processingEvent.WaitOne (0)) {
				if (Debugger.IsAttached)
					Console.WriteLine ("ufcs analysis already in progress");
				return false;
			}

			gFlags_shared = compilationEnvironment;

			methodCount = 0;
			queue.Clear();

			// Prepare queue
			foreach (var module in Root)
				PrepareQueue(module);

			sw.Restart ();
			if (queue.Count != 0) {
				//completedEvent.Reset();

				if (SingleThreaded)
					parseThread (pcList);
				else {
					var threads = new Thread[GlobalParseCache.NumThreads];
					for (int i = 0; i < GlobalParseCache.NumThreads; i++) {
						var th = threads [i] = new Thread (parseThread) {
							IsBackground = true,
							Priority = ThreadPriority.Lowest,
							Name = "UFCS Analysis thread #" + i
						};
						th.Start (pcList);
					}
				}
			} else
				noticeFinish ();

			return true;
		}
Exemplo n.º 6
0
 public ConditionSet(ConditionalCompilationFlags gFLags, ConditionalCompilationFlags lFlags = null)
 {
     // Make a default global environment for test resolutions etc.
     GlobalFlags = gFLags ?? new ConditionalCompilationFlags(null, 0, false);
     LocalFlags  = lFlags;
 }
		private OldTypeReferenceFinder(ParseCacheView sharedCache, ConditionalCompilationFlags compilationEnvironment = null)
		{
			this.sharedParseCache = sharedCache;
			sharedCtxt = ResolutionContext.Create(sharedCache, gFlags_shared = compilationEnvironment, null);
		}
Exemplo n.º 8
0
 public static ResolutionContext Create(ParseCacheView pcl, ConditionalCompilationFlags globalConditions, IBlockNode scopedBlock, IStatement scopedStatement = null)
 {
     return(new ResolutionContext(pcl, globalConditions, scopedBlock, scopedStatement));
 }
			public ConditionSet(ConditionalCompilationFlags gFLags, ConditionalCompilationFlags lFlags = null)
			{
				// Make a default global environment for test resolutions etc.
				GlobalFlags = gFLags ?? new ConditionalCompilationFlags(null,0,false);
				LocalFlags = lFlags;
			}