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


C# IPsiSourceFile.GetPsiFile方法代码示例

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


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

示例1: Build

 public static IList<DisposeMethodStatus> Build(IPsiSourceFile sourceFile)
 {
     var file = sourceFile.GetPsiFile<CSharpLanguage>(new DocumentRange(sourceFile.Document, 0)) as ICSharpFile;
     if (file == null)
         return null;
     return Build(file);
 }
开发者ID:vorkulsky,项目名称:DisposePlugin,代码行数:7,代码来源:DisposeCacheBuilder.cs

示例2: 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

示例3: Process

        /// <summary>
        /// Process clean-up on file.
        /// </summary>
        /// <param name="projectFile">
        /// The project file to process.
        /// </param>
        /// <param name="rangeMarker">
        /// The range marker to process.
        /// </param>
        /// <param name="profile">
        /// The code cleanup settings to use.
        /// </param>
        /// <param name="progressIndicator">
        /// The progress indicator.
        /// </param>
        public void Process(
            IPsiSourceFile projectFile, IRangeMarker rangeMarker, CodeCleanupProfile profile, JB::JetBrains.Application.Progress.IProgressIndicator progressIndicator)
        {
            if (projectFile == null)
            {
                return;
            }

            if (!this.IsAvailable(projectFile))
            {
                return;
            }

            ISolution solution = projectFile.GetSolution();

            ICSharpFile file = projectFile.GetPsiFile<CSharpLanguage>() as ICSharpFile;

            if (file == null)
            {
                return;
            }

            PsiManager.GetInstance(solution).DoTransaction(() => this.InternalProcess(profile, file), "Code cleanup");

            StyleCopTrace.Out();
        }
开发者ID:transformersprimeabcxyz,项目名称:_TO-FIRST-stylecop,代码行数:41,代码来源:StyleCopCodeCleanupModule.cs

示例4: IsAvailable

 /// <summary>
 /// Check if this module can handle given project file.
 /// </summary>
 /// <param name="projectFile">
 /// The project file to check.
 /// </param>
 /// <returns>
 /// <c>True.</c>if the project file is available; otherwise 
 /// <c>False.</c>.
 /// </returns>
 public bool IsAvailable(IPsiSourceFile projectFile)
 {
     return projectFile.GetPsiFile<CSharpLanguage>() != null;
 }
开发者ID:transformersprimeabcxyz,项目名称:_TO-FIRST-stylecop,代码行数:14,代码来源:StyleCopCodeCleanupModule.cs

示例5: GetPsiFile

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

示例6: GetDeclarationsIn

        public static IList<IDeclaration> GetDeclarationsIn(
            IPsiSourceFile sourceFile, IUriIdentifierDeclaredElement declaredElement)
        {
            var psiFile = sourceFile.GetPsiFile<NTriplesLanguage>(new DocumentRange(sourceFile.Document, 0)) as NTriplesFile;
            if (psiFile == null)
            {
                return EmptyList<IDeclaration>.InstanceList;
            }

            var uri = declaredElement.GetUri();
            if (string.IsNullOrEmpty(uri))
            {
                return EmptyList<IDeclaration>.InstanceList;
            }

            var uriIdentifiers = psiFile.GetUriIdentifiers(uri);
            return uriIdentifiers;
        }
开发者ID:xsburg,项目名称:ReSharper.NTriples,代码行数:18,代码来源:UriIdentifierDeclaredElement.cs

示例7: Build

 public static ICollection<IPsiSymbol> Build(IPsiSourceFile sourceFile)
 {
   var file = sourceFile.GetPsiFile<PsiLanguage>(new DocumentRange(sourceFile.Document, 0)) as IPsiFile;
   if (file == null)
   {
     return null;
   }
   return Build(file);
 }
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:9,代码来源:PsiCacheBuilder.cs


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