Closed michaelalandawson closed 4 years ago
Thanks for reporting, I have tried to improve the top
matching in st3-v0.29.1
.
Thank you very much. It looks great. I did find another instance to tweak the highlighting regarding a query param and the SQL "limit" keyword.
This example highlights ":limit" as an SQL keyword when, in this case, is only a query parameter. My use of ":limit" as a query parameter is valid. Perhaps the matching could look for a leading colon, and if found, consider it a parameter.
If I rename the query parameter, highlighting works, as expected.
If you will allow me to go one step further, the following can be added to the "top" keyword: "percent" and "percent with ties"
Again, thank you for making this package.
I am glad that the original issue has been resolved.
In the first screenshots, the issue was that the SQL syntax was not being used at all, whereas in these latest ones the issue has to do with the SQL syntax itself. The SQL syntax comes from Sublime Text, it is not part of this package. It is a generic syntax, so SQL Server specific syntax is unlikely to be supported well.
As far as recognizing CFML parameters (e.g. :param
), that might be possible down the road, but it would probably involve creating a custom syntax. So I don't think I can address it right now.
Understood. Thank you for looking at this.
There are a few instances where the TOP keyword is not recognized correctly and this causes the SQL syntax highlighting to revert to default text. I hope these examples can help improve the syntax highlighting.
Here is a basic query that is displayed correctly.
If I add the "top" keyword, the syntax doesn't change, but this is not a valid SQL statement.
If I bring up a column to the same line as the "top" keyword, the syntax highlighting fails. This is still invalid SQL, but is basically the same logic as the previous invalid example that uses syntax highlighting.
Here is an example of valid SQL using "select top n". (This is no longer recommended by Microsoft, but is still supported.)
This is valid SQL using Microsoft's recommendation of "top(n)". Syntax highlighting doesn't recognize this.
This is an example of using a SQL variable in the "top()" keyword.
Finally, an example of using a parameter in the "top()" keyword.