本文整理汇总了C#中Microsoft.CodeAnalysis.SolutionServices类的典型用法代码示例。如果您正苦于以下问题:C# SolutionServices类的具体用法?C# SolutionServices怎么用?C# SolutionServices使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SolutionServices类属于Microsoft.CodeAnalysis命名空间,在下文中一共展示了SolutionServices类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateRecoverableText
protected static ValueSource<TextAndVersion> CreateRecoverableText(TextLoader loader, DocumentId documentId, SolutionServices services)
{
return new RecoverableTextAndVersion(
new AsyncLazy<TextAndVersion>(c => LoadTextAsync(loader, documentId, services, c), cacheResult: false),
services.TemporaryStorage,
services.TextCache);
}
开发者ID:jerriclynsjohn,项目名称:roslyn,代码行数:7,代码来源:TextDocumentState.cs
示例2: SolutionState
private SolutionState(
BranchId branchId,
int workspaceVersion,
SolutionServices solutionServices,
SolutionId id,
string filePath,
IEnumerable<ProjectId> projectIds,
ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap,
ImmutableDictionary<ProjectId, CompilationTracker> projectIdToTrackerMap,
ImmutableDictionary<string, ImmutableArray<DocumentId>> linkedFilesMap,
ProjectDependencyGraph dependencyGraph,
VersionStamp version,
Lazy<VersionStamp> lazyLatestProjectVersion)
{
_branchId = branchId;
_workspaceVersion = workspaceVersion;
_id = id;
_filePath = filePath;
_solutionServices = solutionServices;
_projectIds = projectIds.ToImmutableReadOnlyListOrEmpty();
_projectIdToProjectStateMap = idToProjectStateMap;
_projectIdToTrackerMap = projectIdToTrackerMap;
_linkedFilesMap = linkedFilesMap;
_dependencyGraph = dependencyGraph;
_version = version;
_lazyLatestProjectVersion = lazyLatestProjectVersion;
CheckInvariants();
}
开发者ID:tvsonar,项目名称:roslyn,代码行数:29,代码来源:SolutionState.cs
示例3: SolutionState
private SolutionState(
BranchId branchId,
int workspaceVersion,
SolutionServices solutionServices,
SolutionInfo solutionInfo,
IEnumerable<ProjectId> projectIds,
ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap,
ImmutableDictionary<ProjectId, CompilationTracker> projectIdToTrackerMap,
ImmutableDictionary<string, ImmutableArray<DocumentId>> linkedFilesMap,
ProjectDependencyGraph dependencyGraph,
Lazy<VersionStamp> lazyLatestProjectVersion)
{
_branchId = branchId;
_workspaceVersion = workspaceVersion;
_solutionServices = solutionServices;
_solutionInfo = solutionInfo;
_projectIds = projectIds.ToImmutableReadOnlyListOrEmpty();
_projectIdToProjectStateMap = idToProjectStateMap;
_projectIdToTrackerMap = projectIdToTrackerMap;
_linkedFilesMap = linkedFilesMap;
_dependencyGraph = dependencyGraph;
_lazyLatestProjectVersion = lazyLatestProjectVersion;
// when solution state is changed, we re-calcuate its checksum
_lazyChecksums = new AsyncLazy<SolutionStateChecksums>(ComputeChecksumsAsync, cacheResult: true);
CheckInvariants();
}
开发者ID:TyOverby,项目名称:roslyn,代码行数:28,代码来源:SolutionState.cs
示例4: Solution
private Solution(
BranchId branchId,
int workspaceVersion,
SolutionServices solutionServices,
SolutionId id,
string filePath,
ImmutableList<ProjectId> projectIds,
ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap,
ImmutableDictionary<ProjectId, CompilationTracker> projectIdToTrackerMap,
ProjectDependencyGraph dependencyGraph,
VersionStamp version,
Lazy<VersionStamp> lazyLatestProjectVersion)
{
this.branchId = branchId;
this.workspaceVersion = workspaceVersion;
this.id = id;
this.filePath = filePath;
this.solutionServices = solutionServices;
this.projectIds = projectIds;
this.projectIdToProjectStateMap = idToProjectStateMap;
this.projectIdToTrackerMap = projectIdToTrackerMap;
this.dependencyGraph = dependencyGraph;
this.projectIdToProjectMap = ImmutableHashMap<ProjectId, Project>.Empty;
this.version = version;
this.lazyLatestProjectVersion = lazyLatestProjectVersion;
CheckInvariants();
}
开发者ID:riversky,项目名称:roslyn,代码行数:28,代码来源:Solution.cs
示例5: ProjectState
public ProjectState(ProjectInfo projectInfo, HostLanguageServices languageServices, SolutionServices solutionServices)
{
Contract.ThrowIfNull(projectInfo);
Contract.ThrowIfNull(languageServices);
Contract.ThrowIfNull(solutionServices);
_languageServices = languageServices;
_solutionServices = solutionServices;
_projectInfo = FixProjectInfo(projectInfo);
_documentIds = _projectInfo.Documents.Select(d => d.Id).ToImmutableArray();
_additionalDocumentIds = _projectInfo.AdditionalDocuments.Select(d => d.Id).ToImmutableArray();
var docStates = ImmutableDictionary.CreateRange<DocumentId, DocumentState>(
_projectInfo.Documents.Select(d =>
new KeyValuePair<DocumentId, DocumentState>(d.Id,
CreateDocument(_projectInfo, d, languageServices, solutionServices))));
_documentStates = docStates;
var additionalDocStates = ImmutableDictionary.CreateRange<DocumentId, TextDocumentState>(
_projectInfo.AdditionalDocuments.Select(d =>
new KeyValuePair<DocumentId, TextDocumentState>(d.Id, TextDocumentState.Create(d, solutionServices))));
_additionalDocumentStates = additionalDocStates;
_lazyLatestDocumentVersion = new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentVersionAsync(docStates, additionalDocStates, c), cacheResult: true);
_lazyLatestDocumentTopLevelChangeVersion = new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentTopLevelChangeVersionAsync(docStates, additionalDocStates, c), cacheResult: true);
// for now, let it re-calculate if anything changed.
// TODO: optimize this so that we only re-calcuate checksums that are actually changed
_lazyChecksums = new AsyncLazy<ProjectStateChecksums>(ComputeChecksumsAsync, cacheResult: true);
}
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:34,代码来源:ProjectState.cs
示例6: Create
public static DocumentState Create(
DocumentInfo info,
ParseOptions options,
HostLanguageServices language,
SolutionServices services)
{
var textSource = info.TextLoader != null
? CreateRecoverableText(info.TextLoader, info.Id, services)
: CreateStrongText(TextAndVersion.Create(SourceText.From(string.Empty, Encoding.UTF8), VersionStamp.Default, info.FilePath));
var treeSource = CreateLazyFullyParsedTree(
textSource,
GetSyntaxTreeFilePath(info),
options,
languageServices: language);
// remove any initial loader so we don't keep source alive
info = info.WithTextLoader(null);
return new DocumentState(
languageServices: language,
solutionServices: services,
info: info,
options: options,
textSource: textSource,
treeSource: treeSource);
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:27,代码来源:DocumentState.cs
示例7: ProjectState
internal ProjectState(ProjectInfo projectInfo, HostLanguageServices languageServices, SolutionServices solutionServices)
{
Contract.ThrowIfNull(projectInfo);
Contract.ThrowIfNull(languageServices);
Contract.ThrowIfNull(solutionServices);
_languageServices = languageServices;
_solutionServices = solutionServices;
_projectInfo = FixProjectInfo(projectInfo);
_documentIds = _projectInfo.Documents.Select(d => d.Id).ToImmutableArray();
_additionalDocumentIds = this.ProjectInfo.AdditionalDocuments.Select(d => d.Id).ToImmutableArray();
var docStates = ImmutableDictionary.CreateRange<DocumentId, DocumentState>(
_projectInfo.Documents.Select(d =>
new KeyValuePair<DocumentId, DocumentState>(d.Id,
CreateDocument(this.ProjectInfo, d, languageServices, solutionServices))));
_documentStates = docStates;
var additionalDocStates = ImmutableDictionary.CreateRange<DocumentId, TextDocumentState>(
_projectInfo.AdditionalDocuments.Select(d =>
new KeyValuePair<DocumentId, TextDocumentState>(d.Id, TextDocumentState.Create(d, solutionServices))));
_additionalDocumentStates = additionalDocStates;
_lazyLatestDocumentVersion = new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentVersionAsync(docStates, additionalDocStates, c), cacheResult: true);
_lazyLatestDocumentTopLevelChangeVersion = new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentTopLevelChangeVersionAsync(docStates, additionalDocStates, c), cacheResult: true);
}
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:30,代码来源:ProjectState.cs
示例8: CreateValueSource
public static ValueSource<Compilation> CreateValueSource(
Compilation compilation,
SolutionServices services)
{
return services.SupportsCachingRecoverableObjects
? new WeakConstantValueSource<Compilation>(compilation)
: (ValueSource<Compilation>)new ConstantValueSource<Compilation>(compilation);
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:Solution.CompilationTracker.State.cs
示例9: TextDocumentState
protected TextDocumentState(
SolutionServices solutionServices,
DocumentInfo info,
ValueSource<TextAndVersion> textSource)
{
this.solutionServices = solutionServices;
this.info = info;
this.textSource = textSource;
}
开发者ID:daking2014,项目名称:roslyn,代码行数:9,代码来源:TextDocumentState.cs
示例10: DocumentState
private DocumentState(
HostLanguageServices languageServices,
SolutionServices solutionServices,
DocumentInfo info,
ParseOptions options,
ValueSource<TextAndVersion> textSource,
ValueSource<TreeAndVersion> treeSource)
: base(solutionServices, info, textSource)
{
_languageServices = languageServices;
_options = options;
_treeSource = treeSource;
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:13,代码来源:DocumentState.cs
示例11: CreateLazyFullyParsedTree
private static ValueSource<TreeAndVersion> CreateLazyFullyParsedTree(
ValueSource<TextAndVersion> newTextSource,
ProjectId cacheKey,
string filePath,
ParseOptions options,
HostLanguageServices languageServices,
SolutionServices solutionServices,
PreservationMode mode = PreservationMode.PreserveValue)
{
return new AsyncLazy<TreeAndVersion>(
c => FullyParseTreeAsync(newTextSource, cacheKey, filePath, options, languageServices, solutionServices, mode, c),
cacheResult: true);
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:13,代码来源:DocumentState.cs
示例12: Create
public static TextDocumentState Create(DocumentInfo info, SolutionServices services)
{
var textSource = info.TextLoader != null
? CreateRecoverableText(info.TextLoader, info.Id, services, reportInvalidDataException: false)
: CreateStrongText(TextAndVersion.Create(SourceText.From(string.Empty, Encoding.UTF8), VersionStamp.Default, info.FilePath));
// remove any initial loader so we don't keep source alive
info = info.WithTextLoader(null);
return new TextDocumentState(
solutionServices: services,
info: info,
textSource: textSource);
}
开发者ID:daking2014,项目名称:roslyn,代码行数:14,代码来源:TextDocumentState.cs
示例13: DocumentState
private DocumentState(
HostLanguageServices languageServices,
SolutionServices solutionServices,
DocumentInfo info,
ParseOptions options,
ValueSource<TextAndVersion> textSource,
ValueSource<TreeAndVersion> treeSource)
{
this.languageServices = languageServices;
this.solutionServices = solutionServices;
this.info = info;
this.options = options;
this.textSource = textSource;
this.treeSource = treeSource;
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:15,代码来源:DocumentState.cs
示例14: TextDocumentState
protected TextDocumentState(
SolutionServices solutionServices,
DocumentInfo info,
SourceText sourceTextOpt,
ValueSource<TextAndVersion> textAndVersionSource,
ValueSource<DocumentStateChecksums> lazyChecksums)
{
this.solutionServices = solutionServices;
this.info = info;
this.sourceTextOpt = sourceTextOpt;
this.textAndVersionSource = textAndVersionSource;
// for now, let it re-calculate if anything changed.
// TODO: optimize this so that we only re-calcuate checksums that are actually changed
_lazyChecksums = new AsyncLazy<DocumentStateChecksums>(ComputeChecksumsAsync, cacheResult: true);
}
开发者ID:TyOverby,项目名称:roslyn,代码行数:16,代码来源:TextDocumentState.cs
示例15: ProjectState
private ProjectState(
ProjectInfo projectInfo,
ILanguageServiceProvider languageServices,
SolutionServices solutionServices,
ImmutableList<DocumentId> documentIds,
ImmutableDictionary<DocumentId, DocumentState> documentStates,
AsyncLazy<VersionStamp> lazyLatestDocumentVersion,
AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion)
{
this.projectInfo = projectInfo;
this.solutionServices = solutionServices;
this.languageServices = languageServices;
this.documentIds = documentIds;
this.documentStates = documentStates;
this.lazyLatestDocumentVersion = lazyLatestDocumentVersion;
this.lazyLatestDocumentTopLevelChangeVersion = lazyLatestDocumentTopLevelChangeVersion;
}
开发者ID:riversky,项目名称:roslyn,代码行数:17,代码来源:ProjectState.cs
示例16: ProjectState
private ProjectState(
ProjectInfo projectInfo,
HostLanguageServices languageServices,
SolutionServices solutionServices,
IEnumerable<DocumentId> documentIds,
ImmutableDictionary<DocumentId, DocumentState> documentStates,
AsyncLazy<VersionStamp> lazyLatestDocumentVersion,
AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion)
{
this.projectInfo = projectInfo;
this.solutionServices = solutionServices;
this.languageServices = languageServices;
this.documentIds = documentIds.ToImmutableReadOnlyListOrEmpty();
this.documentStates = documentStates;
this.lazyLatestDocumentVersion = lazyLatestDocumentVersion;
this.lazyLatestDocumentTopLevelChangeVersion = lazyLatestDocumentTopLevelChangeVersion;
}
开发者ID:pheede,项目名称:roslyn,代码行数:17,代码来源:ProjectState.cs
示例17: DocumentState
private DocumentState(
HostLanguageServices languageServices,
SolutionServices solutionServices,
DocumentInfo info,
ParseOptions options,
ValueSource<TextAndVersion> textSource,
ValueSource<TreeAndVersion> treeSource)
: base(solutionServices, info, textSource)
{
_languageServices = languageServices;
_options = options;
// If this is document that doesn't support syntax, then don't even bother holding
// onto any tree source. It will never be used to get a tree, and can only hurt us
// by possibly holding onto data that might cause a slow memory leak.
_treeSource = this.SupportsSyntaxTree
? treeSource
: ValueSource<TreeAndVersion>.Empty;
}
开发者ID:daking2014,项目名称:roslyn,代码行数:19,代码来源:DocumentState.cs
示例18: ProjectState
private ProjectState(
ProjectInfo projectInfo,
HostLanguageServices languageServices,
SolutionServices solutionServices,
IEnumerable<DocumentId> documentIds,
IEnumerable<DocumentId> additionalDocumentIds,
ImmutableDictionary<DocumentId, DocumentState> documentStates,
ImmutableDictionary<DocumentId, TextDocumentState> additionalDocumentStates,
AsyncLazy<VersionStamp> lazyLatestDocumentVersion,
AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion)
{
_projectInfo = projectInfo;
_solutionServices = solutionServices;
_languageServices = languageServices;
_documentIds = documentIds.ToImmutableReadOnlyListOrEmpty();
_additionalDocumentIds = additionalDocumentIds.ToImmutableReadOnlyListOrEmpty();
_documentStates = documentStates;
_additionalDocumentStates = additionalDocumentStates;
_lazyLatestDocumentVersion = lazyLatestDocumentVersion;
_lazyLatestDocumentTopLevelChangeVersion = lazyLatestDocumentTopLevelChangeVersion;
_lazyChecksums = new AsyncLazy<ProjectStateChecksums>(ComputeChecksumsAsync, cacheResult: true);
}
开发者ID:XieShuquan,项目名称:roslyn,代码行数:23,代码来源:ProjectState.cs
示例19: LoadTextAsync
private static async Task<TextAndVersion> LoadTextAsync(TextLoader loader, DocumentId documentId, SolutionServices services, CancellationToken cancellationToken)
{
try
{
using (ExceptionHelpers.SuppressFailFast())
{
var result = await loader.LoadTextAndVersionAsync(services.Workspace, documentId, cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
return result;
}
}
catch (OperationCanceledException)
{
// if load text is failed due to a cancellation, make sure we propagate it out to the caller
throw;
}
catch (IOException e)
{
services.Workspace.OnWorkspaceFailed(new DocumentDiagnostic(WorkspaceDiagnosticKind.Failure, e.Message, documentId));
return TextAndVersion.Create(SourceText.From(string.Empty, Encoding.UTF8), VersionStamp.Default, documentId.GetDebuggerDisplay());
}
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:21,代码来源:DocumentState.cs
示例20: CreateDocument
private static DocumentState CreateDocument(ProjectInfo projectInfo, DocumentInfo documentInfo, ILanguageServiceProvider languageServices, SolutionServices solutionServices)
{
var doc = DocumentState.Create(documentInfo, projectInfo.ParseOptions, languageServices, solutionServices);
if (doc.SourceCodeKind != documentInfo.SourceCodeKind)
{
doc = doc.UpdateSourceCodeKind(documentInfo.SourceCodeKind);
}
return doc;
}
开发者ID:riversky,项目名称:roslyn,代码行数:11,代码来源:ProjectState.cs
注:本文中的Microsoft.CodeAnalysis.SolutionServices类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论