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

[Feature] Highlighted language variables (this, super...) #287

Merged
merged 3 commits into from
Mar 3, 2019
Merged

[Feature] Highlighted language variables (this, super...) #287

merged 3 commits into from
Mar 3, 2019

Conversation

JonGarbayo
Copy link
Contributor

Hi @Binaryify!

Thanks for this great theme! I wanted to open an issue, but I decided to improve it myself :)
This is my first pull request ever, please be indulgent.

Motivations

As I work daily with PHP and JavaScript, I was disappointed to see this highlighted in yellow in .js files and not $this in .php ones. Alos, in PHP, parent is highlighted, but not super in JavaScript (yes, it's shown italic, but not in other languages like Java).

Result

With my modifications, all variables.language will be highlighted in every supported languages. I tested with PHP and JavaScript of course, but also in TypeScript, JSX, C++ and Java.
All of them now have this, super and all that stuff highlighted in yellow :)

You can see the result in the following screenshots:

  • top left, JavaScript
  • bottom left, TypeScript
  • top right, Java
  • bottom right, PHP

Before

one-dark-pro-before

After

one-dark-pro-after

…variable.php" entry

The "variable" scope is applied for the variable name and the dollar, so no need to specify it.
Variables like "$this" in PHP, or "super" in Java, ES6 JavaScript, TypeScript, JSX, etc. will be highlighted.
…age.this.js,variable.language.this.ts,variable.language.this.jsx,variable.language.this.tsx" entry

The new "variable.language" scope is applied for "this" on every supported language. So scoping "this" in JavaScript and TypeScript is no longer useful.
@Binaryify
Copy link
Owner

great~

@Binaryify Binaryify merged commit 7765461 into Binaryify:master Mar 3, 2019
Binaryify pushed a commit that referenced this pull request Mar 3, 2019
Binaryify added a commit that referenced this pull request Aug 8, 2019
[Feature] Highlighted language variables (this, super...)
Binaryify added a commit that referenced this pull request Aug 8, 2019
Binaryify pushed a commit that referenced this pull request Aug 8, 2019
The b5c8825 commit reintroduced some deleted lines from the pull request #287. So in PHP, "$this" was bicolour ("$" was red, "this" was yellow).
Binaryify pushed a commit that referenced this pull request Aug 8, 2019
The 7e3c935 commit reintroduced again some deleted lines from the pull request #287. So in PHP, "$this" was bicolour ("$" was red, "this" was yellow).
Binaryify added a commit that referenced this pull request Aug 8, 2019
[Feature] Highlighted language variables (this, super...)
Binaryify added a commit that referenced this pull request Aug 8, 2019
Binaryify pushed a commit that referenced this pull request Aug 8, 2019
The b5c8825 commit reintroduced some deleted lines from the pull request #287. So in PHP, "$this" was bicolour ("$" was red, "this" was yellow).
Binaryify pushed a commit that referenced this pull request Aug 8, 2019
The 7e3c935 commit reintroduced again some deleted lines from the pull request #287. So in PHP, "$this" was bicolour ("$" was red, "this" was yellow).
Binaryify added a commit that referenced this pull request Aug 8, 2019
[Feature] Highlighted language variables (this, super...)
Binaryify added a commit that referenced this pull request Aug 8, 2019
Binaryify pushed a commit that referenced this pull request Aug 8, 2019
The b5c8825 commit reintroduced some deleted lines from the pull request #287. So in PHP, "$this" was bicolour ("$" was red, "this" was yellow).
Binaryify pushed a commit that referenced this pull request Aug 8, 2019
The 7e3c935 commit reintroduced again some deleted lines from the pull request #287. So in PHP, "$this" was bicolour ("$" was red, "this" was yellow).
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

Successfully merging this pull request may close these issues.

2 participants