Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Update php.cson to detect SQL CTEs #427

Merged
merged 1 commit into from
May 11, 2021
Merged

Conversation

NSExceptional
Copy link
Contributor

@NSExceptional NSExceptional commented Apr 26, 2021

Description of the Change

Update php.cson to detect SQL CTEs by making it detect "WITH ... " (both single and double quoted) as an SQL string.

SQL "common table expressions" (CTE) begin with the WITH keyword. More info:
https://docs.microsoft.com/en-us/sql/t-sql/queries/with-common-table-expression-transact-sql?view=sql-server-ver15#examples

Benefits

CTEs are syntax highlighted. Currently they are not, but they are still valid SQL.

Possible Drawbacks

None See #418

Copy link
Contributor

@KapitanOczywisty KapitanOczywisty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is slight possibility for false-positives, but shouldn't be too serious.

https://grep.app/search?q=%5B%27%22%5DWITH%5Cs&regexp=true&case=true&filter[lang][0]=PHP

@NSExceptional
Copy link
Contributor Author

Yeah, stuff like #418 is generally inevitable without complicating the pattern. It's a tradeoff most of us are okay with I think

@sadick254 sadick254 merged commit 089613d into atom:master May 11, 2021
@NSExceptional NSExceptional deleted the patch-1 branch May 11, 2021 19:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants