本文整理汇总了C#中IPsiSourceFile类的典型用法代码示例。如果您正苦于以下问题:C# IPsiSourceFile类的具体用法?C# IPsiSourceFile怎么用?C# IPsiSourceFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPsiSourceFile类属于命名空间,在下文中一共展示了IPsiSourceFile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Read
public static CachePair Read(BinaryReader reader, IPsiSourceFile sourceFile)
{
IList<PsiRuleSymbol> ruleData = ReadRules(reader, sourceFile);
IList<PsiOptionSymbol> optionData = ReadOptions(reader, sourceFile);
return new CachePair(ruleData, optionData);
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:7,代码来源:PsiCacheBuilder.cs
示例2: XXLanguageXXFile
public XXLanguageXXFile(FileStatistics statistics, IPsiSourceFile psiSourceFile, XXLanguageXXProject project)
: base(null)// TODO: add statistics
{
_psiSourceFile = psiSourceFile;
_fullName = psiSourceFile.GetLocation().FullPath;
_project = project;
}
开发者ID:derigel23,项目名称:Nitra,代码行数:7,代码来源:File.cs
示例3: GetMixedLexerFactory
public ILexerFactory GetMixedLexerFactory(IBuffer buffer, IPsiSourceFile sourceFile, PsiManager manager)
{
var LanguageService = RaconteurLanguage.Instance.LanguageService();
return LanguageService == null ? null
: LanguageService.GetPrimaryLexerFactory();
}
开发者ID:rossbeehler,项目名称:raconteur,代码行数:7,代码来源:RaconteurProjectFileLanguageService.cs
示例4: lock
void ICache.MarkAsDirty(IPsiSourceFile sourceFile)
{
lock (lockObject)
{
dirtyFiles.Add(sourceFile);
}
}
开发者ID:dpvreony-forks,项目名称:AgentMulder,代码行数:7,代码来源:PatternManagerCache.cs
示例5: Add
public ITreeNode Add(IPsiSourceFile sourceFile, string text, int start, int len)
{
var name = text.Substring(start, len);
NitraDeclaredElement declaredElement;
if (!_declaredElements.TryGetValue(name.ToLower(), out declaredElement))
declaredElement = new NitraDeclaredElement(sourceFile.GetSolution(), name);
if (name.Length > 0 && char.IsUpper(name[0]))
{
var node = new NitraDeclaration(declaredElement, sourceFile, name, start, len);
declaredElement.AddDeclaration(node);
_declaredElements.Add(name, declaredElement);
return node;
}
else
{
List<NitraNameReference> refs;
if (!_references.TryGetValue(declaredElement, out refs))
{
refs = new List<NitraNameReference>();
_references.Add(declaredElement, refs);
}
var node = new NitraNameReference(sourceFile, name, start, len);
refs.Add(node);
return node;
}
}
开发者ID:lhsail,项目名称:Nitra,代码行数:28,代码来源:NitraProject.cs
示例6: 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
示例7: T4Parser
internal T4Parser([NotNull] T4Environment t4Environment, [NotNull] DirectiveInfoManager directiveInfoManager, [NotNull] ILexer lexer,
[CanBeNull] IPsiSourceFile sourceFile) {
_t4Environment = t4Environment;
_directiveInfoManager = directiveInfoManager;
_lexer = lexer;
_sourceFile = sourceFile;
}
开发者ID:mnaoumov,项目名称:ForTea,代码行数:7,代码来源:T4Parser.cs
示例8: 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
示例9: IsSupported
protected override bool IsSupported(IPsiSourceFile sourceFile)
{
if (sourceFile == null || !sourceFile.IsValid())
return false;
return sourceFile.IsLanguageSupported<CSharpLanguage>();
}
开发者ID:JetBrains,项目名称:resharper-unity,代码行数:7,代码来源:UnityColorHighlighterProcess.cs
示例10: GetSelectedRange
public ISelectedRange GetSelectedRange(IPsiSourceFile sourceFile, DocumentRange documentRange) {
Pair<IT4File, IFile> pair = GetFiles(sourceFile, documentRange);
IT4File t4File = pair.First;
IFile codeBehindFile = pair.Second;
if (t4File == null)
return null;
ITreeNode t4Node = t4File.FindNodeAt(documentRange);
if (t4Node == null)
return null;
// if the current selection is inside C# code, use the C# extend selection directly
if (codeBehindFile != null) {
ISelectEmbracingConstructProvider codeBehindProvider = PsiShared.GetComponent<PsiProjectFileTypeCoordinator>()
.GetByPrimaryPsiLanguageType(codeBehindFile.Language)
.SelectNotNull(fileType => Shell.Instance.GetComponent<IProjectFileTypeServices>().TryGetService<ISelectEmbracingConstructProvider>(fileType))
.FirstOrDefault();
if (codeBehindProvider != null) {
ISelectedRange codeBehindRange = codeBehindProvider.GetSelectedRange(sourceFile, documentRange);
if (codeBehindRange != null)
return new T4CodeBehindWrappedSelection(t4File, codeBehindRange);
}
}
return new T4NodeSelection(t4File, t4Node);
}
开发者ID:mnaoumov,项目名称:ForTea,代码行数:28,代码来源:T4SelectEmbracingConstructProvider.cs
示例11: SaveInvocationData
private static void SaveInvocationData(ControlFlowElementData data, IVariableDeclaration variable,
byte position, string name, int offset, IPsiSourceFile sourceFile)
{
data[variable] = VariableDisposeStatus.DependsOnInvocation;
var invokedExpression = new InvokedExpressionData(name, offset, position, sourceFile);
data.InvokedExpressions.Add(variable, invokedExpression);
}
开发者ID:vorkulsky,项目名称:DisposePlugin,代码行数:7,代码来源:TreeNodeHandler.cs
示例12: IsSupported
protected static bool IsSupported(IPsiSourceFile sourceFile)
{
if (sourceFile == null || !sourceFile.IsValid())
return false;
return sourceFile.IsLanguageSupported<AngularJsLanguage>();
}
开发者ID:redoz,项目名称:resharper-angularjs,代码行数:7,代码来源:AngularJsDaemonStageBase.cs
示例13: PsiOptionSymbol
public PsiOptionSymbol(string name, int offset, string value, IPsiSourceFile psiSourceFile)
{
myName = name;
myOffset = offset;
myValue = value;
myPsiSourceFile = psiSourceFile;
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:7,代码来源:PsiOptionSymbol.cs
示例14: Process
public void Process(IPsiSourceFile sourceFile, IRangeMarker rangeMarker, CodeCleanupProfile profile, IProgressIndicator progressIndicator)
{
var file = sourceFile.GetNonInjectedPsiFile<CSharpLanguage>();
if (file == null)
return;
if (!profile.GetSetting(DescriptorInstance))
return;
CSharpElementFactory elementFactory = CSharpElementFactory.GetInstance(sourceFile.PsiModule);
file.GetPsiServices().PsiManager.DoTransaction(
() =>
{
using (_shellLocks.UsingWriteLock())
file.ProcessChildren<IExpression>(
expression =>
{
ConstantValue value = expression.ConstantValue;
if (value.IsInteger() && Convert.ToInt32(value.Value) == int.MaxValue)
ModificationUtil.ReplaceChild(expression, elementFactory.CreateExpression("int.MaxValue"));
}
);
},
"Code cleanup");
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:26,代码来源:UseIntConstantsInsteadOfLiterals.cs
示例15: Read
public static DisposeCacheData Read(BinaryReader reader, IPsiSourceFile sourceFile)
{
var count = reader.ReadInt32();
var statuses = new List<DisposeMethodStatus>(count);
for (var i = 0; i < count; i++)
statuses.Add(DisposeMethodStatus.Read(reader, sourceFile));
return new DisposeCacheData(statuses);
}
开发者ID:vorkulsky,项目名称:DisposePlugin,代码行数:8,代码来源:DisposeCacheSerializer.cs
示例16: NitraDeclaration
public NitraDeclaration(NitraDeclaredElement nitraDeclaredElement, IPsiSourceFile sourceFile, string name, int start, int len)
{
_sourceFile = sourceFile;
DeclaredName = name;
NameIdentifier = new NitraNameDeclaration(sourceFile, name, start, len);
NitraDeclaredElement = nitraDeclaredElement;
this.AddChild(NameIdentifier);
}
开发者ID:lhsail,项目名称:Nitra,代码行数:8,代码来源:NitraDeclaration.cs
示例17: T4SecondaryDocumentGenerationResult
// ReSharper disable once UnusedParameter.Local
public T4SecondaryDocumentGenerationResult([NotNull] IPsiSourceFile sourceFile, [NotNull] string text, [NotNull] PsiLanguageType language,
[NotNull] ISecondaryRangeTranslator secondaryRangeTranslator, [NotNull] ILexerFactory lexerFactory,
[NotNull] T4FileDependencyManager t4FileDependencyManager, [NotNull] IEnumerable<FileSystemPath> includedFiles)
: base(text, language, secondaryRangeTranslator, lexerFactory) {
_sourceFile = sourceFile;
_t4FileDependencyManager = t4FileDependencyManager;
_includedFiles = new HashSet<FileSystemPath>(includedFiles);
}
开发者ID:mnaoumov,项目名称:ForTea,代码行数:9,代码来源:T4SecondaryDocumentGenerationResult.cs
示例18: Run
public IFileStructure Run(IDaemonProcess process, IPsiSourceFile psiSourceFile, IContextBoundSettingsStore settingsStore, IFile file)
{
var psiFile = file as IPsiFile;
if (psiFile == null)
return null;
return new PsiFileStructure(psiFile, settingsStore);
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:8,代码来源:PsiFileStructureExplorer.cs
示例19: CreateFactory
public IReferenceFactory CreateFactory(IPsiSourceFile sourceFile, IFile file)
{
if (sourceFile.PrimaryPsiLanguage.Is<CSharpLanguage>())
return new CSharpPropertyDataReferenceFactory();
if (sourceFile.PrimaryPsiLanguage.Is<VBLanguage>())
return new VBPropertyDataReferenceProviderFactory();
return null;
}
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:8,代码来源:PropertyDataReferenceProviderFactory.cs
示例20: GetPsiProperties
public override IPsiSourceFileProperties GetPsiProperties(IProjectFile projectFile, IPsiSourceFile sourceFile)
{
if (!projectFile.IsProjectReferencingNancyRazorViewEngine())
{
return base.GetPsiProperties(projectFile, sourceFile);
}
return new RazorMvcPsiProjectFileProperties(projectFile, sourceFile);
}
开发者ID:jimmason,项目名称:Nancy.ReSharper,代码行数:9,代码来源:RazorCSharpNancyProjectFileLanguageService.cs
注:本文中的IPsiSourceFile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论