Sublime Forum

Sublime C# syntax highlighting issue with single line property getter definition

#1

As you can see in the above screenshot, sublime is incorrectly highlighting the file, which causes most of the file to be highlighted as a string. It seems it is not parsing the single line property getter correctly

edit:
just wanted to confirm to you that I did check that the file is being interpreted as a C# file from sublime View->Syntax->C#

0 Likes

#2

Can you paste the code for a minimal example that repoduces this? It might already be fixed in the master branch of https://github.com/sublimehq/Packages.

1 Like

#4

namespace TEST
{
[CustomEditor(typeof(PlayerSettings))]
internal partial class PlayerSettingsEditor : Editor
{
static class Styles
{
public static readonly GUIContent blah = EditorGUIUtility.TextContent(“libmono”);

        public static string undoChangedBundleIdentifierString { get { return LocalizationDatabase.GetLocalizedString("Changed macOS bundleIdentifier"); } }
        public static string undoChangedBuildNumberString { get { return LocalizationDatabase.GetLocalizedString("Changed macOS build number"); } }
        public static string undoChangedBatchingString { get { return LocalizationDatabase.GetLocalizedString("Changed Batching Settings"); } }
        public static string undoChangedIconString { get { return LocalizationDatabase.GetLocalizedString("Changed Icon"); } }
        public static string undoChangedGraphicsAPIString { get { return LocalizationDatabase.GetLocalizedString("Changed Graphics API Settings"); } }

        static Styles()
        {
            categoryBox.padding.left = 14;
        }
    }
}

}

0 Likes

#5

I can confirm that this has been fixed in the master branch:

my understanding is that the next ST Dev build will be available soon, but if you can’t wait then you can follow the instructions on the aforementioned GitHub repo to get the latest C# syntax changes

3 Likes