madskristensen / RainbowBraces

A Visual Studio extension
Apache License 2.0
132 stars 7 forks source link

Adding brackets in a comment makes the other actual brackets switch colour #29

Open Pedrochu opened 1 year ago

Pedrochu commented 1 year ago

Describe the bug When adding a parenthese/bracket in a comment, all the other parentheses/brackets change colours when they shouldn't. I noticed this behaviour in a C# file, haven't tried with another file extension.

To Reproduce

  1. Add parentheses/brackets in a comment of any C# class.

Screenshots Before the parenthese: image

After: image I've simply censored in red the developpers' names from the screenshot.

madskristensen commented 1 year ago

I cannot reproduce this with the latest version 1.0.37, but I did see it in an earlier version. Can you verify that the issue still reproduces for you on the version 1.0.37 or if it can be closed as fixed?

Pedrochu commented 1 year ago

I do have the latest version 1.0.37 installed. That bug does not happen consistently on all of my C# classes though.

I created a dummy class below to try to reproduce that bug, when I try adding brackets to the summary comment all the others change colour. What's funny is that if I remove any of those StupidMethod, the bug is no more. Perhaps it has something to do with how many brackets there are in the file ? I have no idea honestly, but hopefully you'll be able to reproduce that bug now. If that matters at all, I'm using Microsoft Visual Studio Professional 2022 (64-bit) Version 17.3.4.

I've also noticed that if I unzoom until I can see the whole class on the VS window, the bug never happens. Perhaps that has something to do with it?

namespace bonjour
{
  /// <summary>
  /// 
  /// </summary>
  public class Bonjour
  {
    public Bonjour()
    {

    }

    public string GetGreeting()
    {
      return "bonjour";
    }

    public string GetGoodBye()
    {
      return "au revoir";
    }

    public void StupidMethod1()
    {
      List<int> myList = new() { 1, 2, 3, 4, 5 };
      foreach (var i in myList)
      {
        Console.Write(i);
      }
    }

    public void StupidMethod2()
    {
      List<int> myList = new() { 1, 2, 3, 4, 5 };
      foreach (var i in myList)
      {
        Console.Write(i);
      }
    }

    public void StupidMethod3()
    {
      List<int> myList = new() { 1, 2, 3, 4, 5 };
      foreach (var i in myList)
      {
        Console.Write(i);
      }
    }

    public void StupidMethod4()
    {
      List<int> myList = new() { 1, 2, 3, 4, 5 };
      foreach (var i in myList)
      {
        Console.Write(i);
      }
    }

    public void StupidMethod5()
    {
      List<int> myList = new() { 1, 2, 3, 4, 5 };
      foreach (var i in myList)
      {
        Console.Write(i);
      }
    }
  }
}