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

[NFR] Uppercase keywords #84

Open
quasipickle opened this issue Oct 26, 2015 · 8 comments
Open

[NFR] Uppercase keywords #84

quasipickle opened this issue Oct 26, 2015 · 8 comments

Comments

@quasipickle
Copy link

I have patched my local copy to automatically uppercase any reserved keywords. So a submitted query like:

select * from blah as b

Gets formatted into

SELECT
  *
FROM
  blah AS b

Is there any interest in me making a full pull request of this functionality?

@michalklabnik
Copy link

👍

1 similar comment
@morphiaz
Copy link

👍

@SmetDenis
Copy link

Cool!

@quasipickle
Copy link
Author

Until I hear back from @jdorn, here's my changes:

Line 144:

public static $uppercase = true;

Line 692:

if(self::$uppercase && in_array($token[self::TOKEN_TYPE],array(self::TOKEN_TYPE_RESERVED,self::TOKEN_TYPE_RESERVED_NEWLINE,self::TOKEN_TYPE_RESERVED_TOPLEVEL))){
   $highlighted = strtoupper($highlighted);
}

@jdorn
Copy link
Owner

jdorn commented Nov 22, 2015

That looks fine if you want to create a pull request. Just make sure self::$uppercase defaults to false to keep it backwards compatible.

@quasipickle
Copy link
Author

Request made: #86

@zobzn
Copy link

zobzn commented Mar 3, 2016

👍 awesome

@acicali
Copy link

acicali commented Aug 9, 2016

Just wanted to add my 2 cents here...

Why not just add CSS classes instead of inline styles? Then not only could this be accomplished in CSS, but changing colors could be done easily without modifying the codebase. I'd also like to add backticks to the queries... classes would solve that as well.

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

7 participants