We're looking for a default delimiter to use when inserting the string
literal. In case there are unescaped double quotes, we choose to wrap the
string by default in single quotes. If not, we prefer double quotes as the
default choice.

The default is overridden at insertion time if the query string starts with
a particular delimiter.

On Feb 20, 2013, at 7:33 PM, Raymond Lim <notifications@github.com> wrote:

In src/extensions/default/JavaScriptCodeHints/HintUtils.js:

> +        return globals.map(function (t) {
> +            t.global = true;
> +            return t;
> +        });
> +    }
> +
> +    /*
> +     * Annotate a list of tokens as literals of a particular kind;
> +     * if string literals, annotate with an appropriate delimiter.
> +     */
> +    function annotateLiterals(literals, kind) {
> +        return literals.map(function (t) {
> +            t.literal = true;
> +            t.kind = kind;
> +            if (/[\\\\]*[^\\]"/.test(t.value)) {
> +                t.delimeter = SINGLE_QUOTE;

Why do we set delimeter to single quote when it matches to the double quote
in your regular expression?

—
Reply to this email directly or view it on
GitHub<https://github.com/adobe/brackets/pull/2873/files#r3093255>.