/// <summary> /// Creates a new WorkspaceProvider using a <see cref="ModuleReferenceResolver"/> to identify DScript module references /// </summary> public WorkspaceProvider( IWorkspaceStatistics workspaceStatistics, List <IWorkspaceModuleResolver> resolvers, WorkspaceConfiguration configuration, PathTable pathTable, SymbolTable symbolTable) : this(workspaceStatistics, resolvers, new ModuleReferenceResolver(pathTable), configuration, pathTable, symbolTable) { }
/// <nodoc/> public WorkspaceProvider( IWorkspaceStatistics workspaceStatistics, List <IWorkspaceModuleResolver> resolvers, IModuleReferenceResolver moduleReferenceResolver, WorkspaceConfiguration configuration, PathTable pathTable, SymbolTable symbolTable) { Contract.Requires(workspaceStatistics != null); Contract.Requires(configuration != null); Contract.Requires(moduleReferenceResolver != null); Contract.Requires(pathTable != null); Statistics = workspaceStatistics; m_moduleReferenceResolver = moduleReferenceResolver; PathTable = pathTable; Configuration = configuration; SymbolTable = symbolTable; m_resolvers = resolvers; }
/// <nodoc/> public static bool TryCreate( [CanBeNull] Workspace mainConfigurationWorkspace, IWorkspaceStatistics workspaceStatistics, FrontEndFactory frontEndFactory, PathTable pathTable, SymbolTable symbolTable, WorkspaceConfiguration configuration, bool useDecorator, bool addBuiltInPreludeResolver, out IWorkspaceProvider workspaceProvider, out IEnumerable <Failure> failures) { // mainConfigurationWorkspace can be null for some tests var mainFile = mainConfigurationWorkspace != null ? mainConfigurationWorkspace.ConfigurationModule.Definition.MainFile : AbsolutePath.Invalid; if (!TryCreateResolvers( frontEndFactory, configuration, pathTable, mainFile, addBuiltInPreludeResolver, out var resolvers, out failures)) { workspaceProvider = default(IWorkspaceProvider); return(false); } var provider = new WorkspaceProvider(workspaceStatistics, resolvers, configuration, pathTable, symbolTable); provider.m_mainConfigurationWorkspace = mainConfigurationWorkspace; workspaceProvider = useDecorator ? (IWorkspaceProvider) new WorkspaceProviderStatisticsDecorator(workspaceStatistics, provider) : provider; return(true); }
/// <inheritdoc /> public TestWorkspaceFiltering() { m_symbolTable = new SymbolTable(m_pathTable.StringTable); }
/// <summary> /// Attempts to get the full symbol of the combined symbols. If this value represents a full symbol /// it is returned unmodified. /// </summary> public bool TryGetFullSymbol(SymbolTable symbolTable, FullSymbol root, out FullSymbol fullSymbol) { fullSymbol = this; return(true); }
public FullSymbol Combine(SymbolTable table, FullSymbol symbol) { Contract.Requires(table != null, "table != null"); return(!symbol.IsValid ? this : Combine(table, symbol.GetParent(table)).Combine(table, symbol.GetName(table))); }
/// <summary> /// Converts the symbol to its string representation /// </summary> public string ToString(SymbolTable symbolTable) { return(ToString(symbolTable.StringTable)); }
/// <summary> /// Attempts to get the full symbol of the combined symbols. If this value represents a full symbol /// it is returned unmodified. /// </summary> public bool TryGetFullSymbol(SymbolTable symbolTable, FullSymbol root, out FullSymbol fullSymbol) { return(root.TryGet(symbolTable, this, out fullSymbol)); }
/// <summary> /// Appends a string representation of <paramref name="fullSymbol"/> into <paramref name="builder"/>. /// </summary> public static void Append(this StringBuilder builder, FullSymbol fullSymbol, SymbolTable symbolTable) { builder.Append(fullSymbol.ToStringAsCharArray(symbolTable)); }