microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.56k stars 899 forks source link

Ability to Change Specific Keyword Colors #2170

Open breadboi opened 6 years ago

breadboi commented 6 years ago

I think it would be great to have more syntax tokens available so that I can change specific keywords. For example, changing my "UPDATE" colors to be pink, my "AND"/"OR" colors to be grey, SPs to be brown, and my other keywords to stay blue. If this is already possible, I apologize for my ignorance. Keep up the good work!

yualan commented 6 years ago

I was looking into this article: https://medium.com/@caludio/how-to-write-a-visual-studio-code-color-theme-from-scratch-7ccb7e5da2aa

The specific part about Ctrl+Shift+P and Developer: Inspect TM scopes was interesting. However, this fits more with a feature suggestion as tagged since a change like this would affect all reserved keywords, and may not be able to get the granularity of handling specific T-SQL keywords.

breadboi commented 6 years ago

For anyone who wants a similar color scheme to SSMS, I found a workaround.

If you go to "C:\Program Files\SQL Operations Studio\resources\app\extensions\sql\syntaxes" and edit the sql.tmLanguage.json file to remove "|update|" on line 142, you can then include it in a match somewhere else. I put mine on line 206 next to getdate and then in SQL Ops Studio I added the following to my settings.

"editor.tokenColorCustomizations": { 
        "[Default Dark SQL Operations Studio]": {
            "textMateRules": [
                {
                    "scope": "support.function",
                    "settings": {
                        "foreground": "#C972BD"
                    }
                }
            ]
        }   
    }

This will change everything in the support.function scope to have that pinkish color seen in SSMS.

Hope this helps someone!