atom / language-sql

SQL package for Atom
Other
38 stars 50 forks source link

Lack of validation for missing DELIMITER in triggers #81

Closed mcandre closed 5 years ago

mcandre commented 5 years ago

MySQL rejects statements within TRIGGER declarations, which typically require semicolons, unless an alternative DELIMITER is defined prior to the trigger declaration.

It would be really helpful to highlight TRIGGER declarations in SQL code that are missing custom DELIMITERs, so that the user catches this mistake in the editor, as opposed to later at runtime. As a bonus, it would also be helpful to point out when SQL code neglects to explicitly reset DELIMITER ; following each trigger declaration.

rsese commented 5 years ago

Thanks for the suggestion - I chatted with another maintainer about this and wanted to share that for the language packages (especially those without a Tree-sitter grammar), highlighting specific errors isn't something these packages would generally do and not something we would likely add. For functionality like this, a something like a linter would probably be more appropriate.

Since this isn't something the team would work on, I'm going to go ahead and close this issue but thanks again for the suggestion.