Author Topic: C# - attributes not considered part of blocks  (Read 4333 times)

asipe

  • Senior Community Member
  • Posts: 113
  • Hero Points: 4
C# - attributes not considered part of blocks
« on: January 07, 2009, 10:17:18 PM »
Just a quick bug report.

When using C#, the attributes associated with blocks are not included correctly when doing block operations.

You can reproduce this with a basic method:

Code: [Select]
   
    [Test]
    public void TestNothingSpecial() {
      Assert.IsTrue(true);
    }

Position the cursor on the last brace and hit 'select code block'.   The method is correctly selected, but the attribute(s) are not.  The same problem occurs when doing quick refactorings in C#.

Interestingly, the same problem doesn't occur when the block is a class.

Code: [Select]
namespace Blah.Blah {
  using NUnit.Framework;

  [TestFixture]
  [Serializable]
  public sealed class SomeTest {
    [Test]
    public void TestNothingSpecial() {
      Assert.IsTrue(true);
    }
  }
}

Position the cursor on the 2nd to last brace and doing a 'select code block' correctly selects both class level attributes.

-andy


Dennis

  • Senior Community Member
  • Posts: 3965
  • Hero Points: 517
Re: C# - attributes not considered part of blocks
« Reply #1 on: January 20, 2009, 08:39:07 PM »
Thanks for letting us know about this.  I have filed a defect in our tracking system so we can address this at a future time.