C#: Extract different trivia types#4976
Conversation
48de5e4 to
3684b3c
Compare
This comment has been minimized.
This comment has been minimized.
c2546ed to
8dc04c0
Compare
…nt extraction related classes
8dc04c0 to
7ede726
Compare
hvitved
left a comment
There was a problem hiding this comment.
Great work, Tamas. And thanks for splitting it up into separately reviewable commits.
| if (!cx.Extractor.Standalone) | ||
| { | ||
| var assembly = Assembly.CreateOutputAssembly(cx); | ||
| trapFile.preprocessor_directive_assembly(this, assembly); |
There was a problem hiding this comment.
Would it be better to map to the compilation instead? I realize that the output assembly will, in most cases, determine the compilation, but we might have two compilations that output the same assembly.
There was a problem hiding this comment.
We could do that, but I think we would need to change the Compilation to be a cached entity then. Should I do it?
There was a problem hiding this comment.
Or perhaps just store it in a field on the Context?
There was a problem hiding this comment.
I thought this would work, but adding the compilation entity to the context is also not straightforward for two reasons:
- syntax tree extraction and compilation extraction have different
contextinstances, - extraction happens on multiple threads, so we can't be sure that compilation is extracted before directives.
| or | ||
| e instanceof TupleType | ||
| or | ||
| e instanceof ConditionalDirective |
There was a problem hiding this comment.
Why not include all preprocessor directives?
There was a problem hiding this comment.
We can do that, but only ConditionalDirectives have expressions underneath them.
e351e7c to
cba2567
Compare
ed204e9 to
5e114db
Compare
5e114db to
4a63f82
Compare
|
Closing this in favour of #5005 |
This PR extracts preprocessor directives from Roslyn trivias.
Missing