private async Task <string> GetTestCommandArgumentsAsync(string source, TestCommandType testType = TestCommandType.Single) { var workspace = await TestHelpers.CreateSimpleWorkspace(source); var context = new DnxContext(); var projectName = "project.json"; var projectCounter = 1; context.ProjectContextMapping.Add(projectName, projectCounter); context.Projects.Add(projectCounter, new Project { Path = "project.json", Commands = { { "test", "Xunit.KRunner" } } }); ITestCommandProvider testCommandProvider = new DnxTestCommandProvider(context, new FakeEnvironment(), new FakeLoggerFactory(), new NullEventEmitter()); var controller = new TestCommandService(workspace, new [] { testCommandProvider }); var lineColumn = TestHelpers.GetLineAndColumnFromDollar(source); var request = new TestCommandRequest { Line = lineColumn.Line, Column = lineColumn.Column, FileName = "dummy.cs", Buffer = source.Replace("$", ""), Type = testType }; await workspace.BufferManager.UpdateBuffer(request); var testCommand = await controller.Handle(request); return(testCommand.TestCommand); }
public ProjectSystemController(DnxContext dnxContext, MSBuildContext msbuildContext, ScriptCsContext scriptCsContext, OmnisharpWorkspace workspace) { _dnxContext = dnxContext; _msbuildContext = msbuildContext; _scriptCsContext = scriptCsContext; _workspace = workspace; }
public ProjectEventForwarder(DnxContext dnxContext, MSBuildContext msbuildContext, OmnisharpWorkspace workspace, IEventEmitter emitter) { _dnxContext = dnxContext; _msbuildContext = msbuildContext; _workspace = workspace; _emitter = emitter; _workspace.WorkspaceChanged += OnWorkspaceChanged; }
public DnxWorkspaceInformation(DnxContext context) { _context = context; Projects = context.Projects.Values.Select(p => new DnxProject(p)); RuntimePath = context.RuntimePath; DesignTimeHostPort = context.DesignTimeHostPort; }
internal void LoadAspNetProjectSystem(Solution solution) { UnloadProjectSystem(); applicationLifetime = new MonoDevelopApplicationLifetime(); context = new DnxContext(); var factory = new AspNet5ProjectSystemFactory(); projectSystem = factory.CreateProjectSystem(solution, applicationLifetime, context); projectSystem.Initalize(); }
void UnloadProjectSystem() { if (applicationLifetime != null) { applicationLifetime.Stopping(); applicationLifetime.Dispose(); applicationLifetime = null; projectSystem.Dispose(); projectSystem = null; context = null; } }
void UnloadProjectSystem() { initializeError = String.Empty; if (applicationLifetime != null) { applicationLifetime.Stopping(); applicationLifetime.Dispose(); applicationLifetime = null; if (projectSystem != null) { projectSystem.Dispose(); projectSystem = null; } context = null; } }
void LoadDnxProjectSystem(Solution solution) { UnloadProjectSystem(); applicationLifetime = new MonoDevelopApplicationLifetime(); context = new DnxContext(); var factory = new DnxProjectSystemFactory(); projectSystem = factory.CreateProjectSystem(solution, applicationLifetime, context); projectSystem.Initalize(); if (context.RuntimePath == null) { string error = GetRuntimeError(projectSystem); throw new ApplicationException(error); } }
void LoadDnxProjectSystem(Solution solution) { UnloadProjectSystem(); applicationLifetime = new MonoDevelopApplicationLifetime(); context = new DnxContext(); var factory = new DnxProjectSystemFactory(); projectSystem = factory.CreateProjectSystem(solution, applicationLifetime, context); try { projectSystem.Initalize(); } catch (Win32Exception ex) { if (ex.NativeErrorCode == 2) { throw new DotNetCoreNotFoundException(); } else { throw; } } }
public DnxProjectSystem CreateProjectSystem( Solution solution, IApplicationLifetime appLifetime, DnxContext context) { var workspace = new OmnisharpWorkspace(); var env = new OmnisharpEnvironment(solution.BaseDirectory); var options = new OmniSharpOptionsWrapper(); var loggerFactory = new LoggerFactory(); var cache = new MetadataFileReferenceCache(); var emitter = new EventEmitter(); var watcher = new FileSystemWatcherWrapper(env); return(new DnxProjectSystem( workspace, env, options, loggerFactory, cache, appLifetime, watcher, emitter, context)); }
public CurrentProjectFacts() { _context = new DnxContext(); _workspace = new OmnisharpWorkspace(); }
public DnxProjectLocator(DnxContext context) { this.context = context; }
public CurrentProjectFacts() { _workspace = new OmnisharpWorkspace(new HostServicesBuilder(Enumerable.Empty <ICodeActionProvider>())); _context = new DnxContext(); _projectSystem = new DnxProjectSystem(_workspace, null, new FakeLoggerFactory(), null, null, null, null, _context); }
public AspNetProjectLocator(DnxContext context) { this.context = context; }
public ProductsController(DnxContext context) { _context = context; }
public AspNetProjectReferenceMaintainer(DnxContext context) { this.context = context; }