Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting for SQL strings #695

Open
jjnilton opened this issue May 10, 2022 · 2 comments
Open

Syntax highlighting for SQL strings #695

jjnilton opened this issue May 10, 2022 · 2 comments

Comments

@jjnilton
Copy link

This is a feature request for syntax highlighting in SQL strings. It seems to be feature of other popular editors and maybe it would be good to have in php-mode as well.

Current behavior (Emacs 27.1):
image

Expected (capture of Sublime Text 4):
image

Thanks for sharing this great package!

@zonuexe
Copy link
Member

zonuexe commented May 11, 2022

@jjnilton
Thank you for your suggestion.

I agree that it is useful as some text editors and IDEs such as PhpStorm support this feature. However, it's not a good implementation for Emacs's major mode to support highlighting in another embedded language, so this feature is currently the first choice provided by Polymode.

Switching major modes is not an easy operation for many users, so we are considering including poly-php in PHP Mode in the future.

Those tasks will be done in my spare time, so if you want the feature as soon as possible, please submit a PR.

@claytonrcarter
Copy link

Another case where this comes up in with HEREDOC/NOWDOC strings. The cases I'm familiar with look something like this:

$jsSnippet = <<<JS
    let foo = { bar }
JS;

where the editor is able to infer that the JS indicates that the string contents should be highlighted as Javascript/ECMAScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants