public CSharpProjectShim( ICSharpProjectRoot projectRoot, VisualStudioProjectTracker projectTracker, Func <ProjectId, IVsReportExternalErrors> reportExternalErrorCreatorOpt, string projectSystemName, IVsHierarchy hierarchy, IServiceProvider serviceProvider, VisualStudioWorkspaceImpl visualStudioWorkspaceOpt, HostDiagnosticUpdateSource hostDiagnosticUpdateSourceOpt, ICommandLineParserService commandLineParserServiceOpt) : base(projectTracker, reportExternalErrorCreatorOpt, projectSystemName, hierarchy, LanguageNames.CSharp, serviceProvider, visualStudioWorkspaceOpt, hostDiagnosticUpdateSourceOpt, commandLineParserServiceOpt) { _projectRoot = projectRoot; _warningNumberArrayPointer = Marshal.AllocHGlobal(0); // Ensure the default options are set up ResetAllOptions(); UpdateOptions(); projectTracker.AddProject(this); ProjectCodeModel = new ProjectCodeModel(this.Id, this, visualStudioWorkspaceOpt, ServiceProvider); }
public int CreateFileCodeModel( string fileName, object parent, out EnvDTE.FileCodeModel ppFileCodeModel ) { ppFileCodeModel = ProjectCodeModel.GetOrCreateFileCodeModel(fileName, parent); return(VSConstants.S_OK); }
public EnvDTE.FileCodeModel GetFileCodeModel(EnvDTE.ProjectItem item) { if (!item.TryGetFullPath(out var filePath)) { return(null); } return(ProjectCodeModel.GetOrCreateFileCodeModel(filePath, item)); }
public virtual void Disconnect() { _batchScopeCreator.StopTrackingProject(VisualStudioProject); VisualStudioProjectOptionsProcessor?.Dispose(); ProjectCodeModel.OnProjectClosed(); VisualStudioProject.RemoveFromWorkspace(); // Unsubscribe IVsHierarchyEvents DisconnectHierarchyEvents(); }
protected void RemoveFile(string filename) { // We have tests that assert that XOML files should not get added; this was similar // behavior to how ASP.NET projects would add .aspx files even though we ultimately ignored // them. XOML support is planned to go away for Dev16, but for now leave the logic there. if (filename.EndsWith(".xoml")) { return; } VisualStudioProject.RemoveSourceFile(filename); ProjectCodeModel.OnSourceFileRemoved(filename); }
public CPSProject( VisualStudioProjectTracker projectTracker, Func <ProjectId, IVsReportExternalErrors> reportExternalErrorCreatorOpt, string projectDisplayName, string projectFilePath, IVsHierarchy hierarchy, string language, Guid projectGuid, string binOutputPath, IServiceProvider serviceProvider, VisualStudioWorkspaceImpl visualStudioWorkspaceOpt, HostDiagnosticUpdateSource hostDiagnosticUpdateSourceOpt, ICommandLineParserService commandLineParserServiceOpt) : base(projectTracker, reportExternalErrorCreatorOpt, projectDisplayName, projectFilePath, hierarchy, language, projectGuid, serviceProvider, visualStudioWorkspaceOpt, hostDiagnosticUpdateSourceOpt, commandLineParserServiceOpt) { // We need to ensure that the bin output path for the project has been initialized before we hookup the project with the project tracker. NormalizeAndSetBinOutputPathAndRelatedData(binOutputPath); // Now hook up the project to the project tracker. projectTracker.AddProject(this); ProjectCodeModel = new ProjectCodeModel(this.Id, new CPSCodeModelInstanceFactory(this), (VisualStudioWorkspaceImpl)this.Workspace, ServiceProvider); }
public int CreateCodeModel(object parent, out EnvDTE.CodeModel codeModel) { codeModel = ProjectCodeModel.GetOrCreateRootCodeModel((EnvDTE.Project)parent); return(VSConstants.S_OK); }
public EnvDTE.CodeModel GetCodeModel(EnvDTE.Project parent) { return(ProjectCodeModel.GetOrCreateRootCodeModel(parent)); }