Posted 13 years ago
by 7Alpha7
When scaning an AST to look at some expression matching some needs, it's necessary to resolve the AST expression. I understand I need to use a Resolver and I am told that it's good to provide a context for this purpose.
But once more the context is easilly found from a open document, with CSharpContextFactory that needs a TextSnapshotOffset, when in a closed file or a text string there is not such thing (or I don't know yet how to get it).
What I don't know is what is the risk of not providing a context to resolve a source string ? I bet it would not be enough to decide the matching needed.
In fact my purpose is to scan source files in a project, not open in a SyntaxEditor, and use a resolver to find what I want, but providing it the right solution context, I mean all the IProjectAssembly etc... so that the types of the source string would be resolved inside the right context of the solution (a project, and its references).
[Modified at 12/10/2011 12:42 PM]
But once more the context is easilly found from a open document, with CSharpContextFactory that needs a TextSnapshotOffset, when in a closed file or a text string there is not such thing (or I don't know yet how to get it).
What I don't know is what is the risk of not providing a context to resolve a source string ? I bet it would not be enough to decide the matching needed.
In fact my purpose is to scan source files in a project, not open in a SyntaxEditor, and use a resolver to find what I want, but providing it the right solution context, I mean all the IProjectAssembly etc... so that the types of the source string would be resolved inside the right context of the solution (a project, and its references).
[Modified at 12/10/2011 12:42 PM]