Hi all,
I need to get the comments associated with a particular node in the AST, but I can't find an easy way of doing it. For example, for the following fileI need to be able to get the preceeding and trailing comments for each of these nodes. Any idea how I would go about this? It is important that we keep the comments associated with the correct code element, as we are re-ordering and reformatting the code and need to put the comments back where they should be. We need to be able to differentiate between preceeding and trailing comments.
Thanks in advance,
Jamie
I need to get the comments associated with a particular node in the AST, but I can't find an easy way of doing it. For example, for the following file
namespace Namespace1
{
/// <summary> Some documentation </summary>
public class Class1 // Trailing Comment
{
// Preceeding Comment
public int i = 0; // Trailing Comment
// Preceeding Comment
public int j - 1; // Trailing Comment
}
}
Thanks in advance,
Jamie