Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Parsing the open text document is done for two main purposes:
1) To update the project type context
2) To have an AST of the current file
Only files that are compile into the main assembly, e.g. C# files with Compile build action - need #1. But pretty much all files that have parsers need #2, for various reasons, which include outlining, folding, and code completion.
IMO we need to separate #1 from #2. The text editor should run a single background parse so that the document has an up to date AST, but it should not be automatically inserted into the project type context.
Instead, there should be some mechanism for choosing whether to insert the parse into the project type context, e.g. ShouldInsertIntoProjectContext(ProjectFile file), or maybe even something that can choose which context to insert it into. I'm not sure where this decision should be made - the parser, or the project, or the completion extension, or some new extension point.
This same mechanism can be used by the background file parser.
there is already one.
parsed document flag:
Flags |= ParsedDocumentFlags.NonSerializable;
The type system provider should set it - that one has all the information about including the file in the type system or not.
That didn't change from the old project system - it was always be there. As long as we find a use case where it doesn't work I think it's safe to let the provider (=parser) decide.
Ok, I didn't realize that the parser has access to the project.
However, there's still room for improvement - if we make the decision separate from the parse we could avoid redundant background parsing. And the flag definitely needs to be renamed to something like InsertIntoProjectContext (and inverted).
Feel free to give it a better name :)
I think this can be closed since that has a new model in 6.0