atom / language-csharp

C# language support for Atom
Other
62 stars 52 forks source link

Highlighting stops working halfway through a file #93

Closed chylex closed 6 years ago

chylex commented 7 years ago

Hey, I'm coming here from GitHub Linguist repository after noticing an issue with highlighting in one of my files on GitHub.

Halfway through the file, the highlighting gets a bit messed up, where some keywords and names are no longer highlighted properly. Example (everything after the highlighted line is incorrect):

obrazek

and here is the file in question on my repository. Note that the file is syntactically valid and can be compiled without errors.


Also I noticed in another file (probably unrelated problem, let me know if I should make a separate issue for it) that extension methods are not highlighted correctly either, for example here, both 'this' and the name of the object should have a special color to be consistent with parameter highlighting elsewhere:

obrazek

michaelblyons commented 7 years ago

This looks like a bug that disappears if you put the comment on a new line.

namespace TweetDck.Core{
    sealed partial class FormBrowser : Form{

        private void FormBrowser_ResizeEnd(object sender, EventArgs e){ // also triggers when the window moves
            if (!isLoaded)return;

            if (Location != ControlExtensions.InvisibleLocation){
                Config.BrowserWindow.Save(this);
                Config.Save();
            }
        }
    }
}
namespace TweetDck.Core{
    sealed partial class FormBrowser : Form{

        private void FormBrowser_ResizeEnd(object sender, EventArgs e){
            // also triggers when the window moves
            if (!isLoaded)return;

            if (Location != ControlExtensions.InvisibleLocation){
                Config.BrowserWindow.Save(this);
                Config.Save();
            }
        }
    }
}