Skip to content

Problems with terminating SQL highlighter #21

@Eccenux

Description

@Eccenux

Example code:

<?php
/**
	Query to be executed.
*/
$query = "
set search_path = '%SCHEMA%';

";

// test
function abc() {
	return "test";
}

Steps/problems

Normal PHP highlighting:
obraz

Once I type in "SELECT" the string becomes unterminated and brakes whole file basically:
obraz

Another example of broken highlighting because a comment happen to have "SELECT" in upper case:
obraz

Another example where both SELECT and --being-sql is used. Notice how function is not highlighted:
obraz

Expected

  1. I guess this auto-open, even in comments, is something some one would want, but it brakes my code. Would be great to be able to disable it in settings.
  2. Auto-open (with uppercase keywords) should only be triggered within strings (at least by default).
  3. String termination should terminate the highlighter (would also probably solve --beginsql, --endsql""" doesn't terminate highlighting #19).
  4. If you want to support SQL in comments then comment termination should also terminate the highlighter. That should be optional.
  5. When --begin-sql is used auto-open should not be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions