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


C# IPsiSourceFile.GetTheOnlyPsiFile方法代码示例

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


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

示例1: Analyze

        public IEnumerable<RegistrationInfo> Analyze(IPsiSourceFile sourceFile)
        {
            ICSharpFile cSharpFile;
            #if SDK70
            cSharpFile = sourceFile.GetTheOnlyPsiFile(CSharpLanguage.Instance) as ICSharpFile;
            #else
            cSharpFile = sourceFile.GetPsiFile(CSharpLanguage.Instance) as ICSharpFile;
            #endif
            if (cSharpFile == null)
            {
                return EmptyList<RegistrationInfo>.InstanceList;
            }

            var usingStatements = cSharpFile.Imports
                                            .Where(directive => !directive.ImportedSymbolName.QualifiedName.StartsWith("System"))
                                            .Select(directive => directive.ImportedSymbolName.QualifiedName).ToList();

            IContainerInfo matchingContainer = GetMatchingContainer(usingStatements);
            if (matchingContainer == null)
            {
                return EmptyList<RegistrationInfo>.InstanceList;
            }

            ISearchDomain searchDomain = searchDomainFactory.CreateSearchDomain(sourceFile);

            return ScanRegistrations(matchingContainer, searchDomain);
        }
开发者ID:dpvreony-forks,项目名称:AgentMulder,代码行数:27,代码来源:SolutionAnalyzer.cs

示例2: Build

		public CodeStructureRootElement Build(IPsiSourceFile sourceFile, CodeStructureOptions options) {
			var t4File = sourceFile.GetTheOnlyPsiFile(T4Language.Instance) as IT4File;
			if (t4File == null)
				return null;

			// TODO: handle VB
			var cSharpFile = sourceFile.GetTheOnlyPsiFile(CSharpLanguage.Instance) as ICSharpFile;
			var cSharpFileImpl = cSharpFile as IFileImpl;
			if (cSharpFileImpl == null || cSharpFileImpl.SecondaryRangeTranslator == null)
				return null;

			var state = new CSharpCodeStructureProcessingState(CodeStructureOptions.Default);

			var rootElement = new T4CodeStructureRootElement(t4File);
			foreach (ITreeNode treeNode in t4File.Children())
				ProcessT4Node(treeNode, rootElement, cSharpFile, cSharpFileImpl.SecondaryRangeTranslator, state);
			return rootElement;
		}
开发者ID:mnaoumov,项目名称:ForTea,代码行数:18,代码来源:T4CSharpCodeStructureProvider.cs

示例3:

		object ICache.Build(IPsiSourceFile sourceFile, bool isStartup)
		{
			if (!CanHandle(sourceFile))
			{
				return null;
			}
			var dominantPsiFile = sourceFile.GetTheOnlyPsiFile(JavaScriptLanguage.Instance);
			if (dominantPsiFile == null)
			{
				return null;
			}
			var explored = new List<IUnitTestElement>();
			var transitiveDependencies = _javaScriptDependencyManager.GetTransitiveDependencies(sourceFile);
			ExploreJasmine(transitiveDependencies, dominantPsiFile, explored);
			return explored;
		}
开发者ID:sergeyt,项目名称:karma-resharper,代码行数:16,代码来源:TestCache.cs

示例4: GetPsiFile

 private IFile GetPsiFile(IPsiSourceFile psiSourceFile)
 {
     return psiSourceFile.GetTheOnlyPsiFile(psiSourceFile.PrimaryPsiLanguage);
 }
开发者ID:dpvreony-forks,项目名称:AgentMulder,代码行数:4,代码来源:ContainerRegistrationAnalysisStageProcess.7.1.cs


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