mirrorsharp icon indicating copy to clipboard operation
mirrorsharp copied to clipboard

Add new document to the project

Open vrassouli opened this issue 6 years ago • 2 comments

Is it possible to create a ISetOptionsFromClientExtension like what is mentioned at #83 , and adding some documents of code to the project?

session.Roslyn.Project.AddDocument is immutable, and as I could find, adding documents require the workspace!

vrassouli avatar Jun 26 '19 15:06 vrassouli

@vrassouli Thanks for asking! This is something I was planning to add/test explicitly, but haven't got to yet. You can definitely do the Roslyn part:

session.Roslyn.Project = session.Roslyn.Project.AddDocument(...).Project;

However the MirrorSharp part might expect exactly one document in some places, and may fail otherwise.

ashmind avatar Jul 14 '19 08:07 ashmind

Thanks for your reply adding document this way, throws NotSupported exception: System.NotSupportedException: 'Adding documents is not supported.'

vrassouli avatar Jul 14 '19 12:07 vrassouli