当前位置: 首页>>代码示例>>C#>>正文


C# ICompilation.GetProject方法代码示例

本文整理汇总了C#中ICompilation.GetProject方法的典型用法代码示例。如果您正苦于以下问题:C# ICompilation.GetProject方法的具体用法?C# ICompilation.GetProject怎么用?C# ICompilation.GetProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICompilation的用法示例。


在下文中一共展示了ICompilation.GetProject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindLocalReferencesAsync

		public async Task FindLocalReferencesAsync(FileName fileName, IVariable variable, Action<SearchResultMatch> callback, ITextSource fileContent, ICompilation compilation, CancellationToken cancellationToken)
		{
			var entry = GetFileEntry(fileName, true);
			if (entry.parser == null)
				return;
			if (fileContent == null)
				fileContent = entry.parser.GetFileContent(fileName);
			if (compilation == null)
				compilation = GetCompilationForFile(fileName);
			var parseInfo = await entry.ParseAsync(fileContent, compilation.GetProject(), cancellationToken).ConfigureAwait(false);
			await Task.Run(
				() => entry.parser.FindLocalReferences(parseInfo, fileContent, variable, compilation, callback, cancellationToken)
			);
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:14,代码来源:ParserService.cs

示例2: ResolveSnippet

		public ResolveResult ResolveSnippet(FileName fileName, TextLocation fileLocation, string codeSnippet, ITextSource fileContent, ICompilation compilation, CancellationToken cancellationToken)
		{
			var entry = GetFileEntry(fileName, true);
			if (entry.parser == null)
				return ErrorResolveResult.UnknownError;
			IProject project = compilation != null ? compilation.GetProject() : null;
			var parseInfo = entry.Parse(fileContent, project, cancellationToken);
			if (parseInfo == null)
				return ErrorResolveResult.UnknownError;
			if (compilation == null)
				compilation = GetCompilationForFile(fileName);
			ResolveResult rr = entry.parser.ResolveSnippet(parseInfo, fileLocation, codeSnippet, compilation, cancellationToken);
			LoggingService.Debug("Resolved " + fileLocation + " to " + rr);
			return rr ?? ErrorResolveResult.UnknownError;
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:15,代码来源:ParserService.cs

示例3: ResolveAsync

		public Task<ResolveResult> ResolveAsync(FileName fileName, TextLocation location, ITextSource fileContent, ICompilation compilation, CancellationToken cancellationToken)
		{
			var entry = GetFileEntry(fileName, true);
			if (entry.parser == null)
				return Task.FromResult<ResolveResult>(ErrorResolveResult.UnknownError);
			IProject project = compilation != null ? compilation.GetProject() : null;
			return entry.ParseAsync(fileContent, project, cancellationToken).ContinueWith(
				delegate (Task<ParseInformation> parseInfoTask) {
					var parseInfo = parseInfoTask.Result;
					if (parseInfo == null)
						return ErrorResolveResult.UnknownError;
					if (compilation == null)
						compilation = GetCompilationForFile(fileName);
					ResolveResult rr = entry.parser.Resolve(parseInfo, location, compilation, cancellationToken);
					LoggingService.Debug("Resolved " + location + " to " + rr);
					return rr ?? ErrorResolveResult.UnknownError;
				}, cancellationToken);
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:18,代码来源:ParserService.cs

示例4: ResolveContext

		public ICodeContext ResolveContext(FileName fileName, TextLocation location, ITextSource fileContent = null, ICompilation compilation = null, CancellationToken cancellationToken = default(CancellationToken))
		{
			if (compilation == null)
				compilation = GetCompilationForFile(fileName);
			var entry = GetFileEntry(fileName, true);
			if (entry.parser == null)
				return new UnknownCodeContext(compilation);
			IProject project = compilation != null ? compilation.GetProject() : null;
			var parseInfo = entry.Parse(fileContent, project, cancellationToken);
			if (parseInfo == null)
				return new UnknownCodeContext(compilation);
			var context = entry.parser.ResolveContext(parseInfo, location, compilation, cancellationToken);
			if (context == null)
				return new UnknownCodeContext(compilation, parseInfo.UnresolvedFile, location);
			return context;
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:16,代码来源:ParserService.cs


注:本文中的ICompilation.GetProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。