Skip to content

Highlight class names in light mode #3225

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

Closed
InMatrix opened this issue Feb 23, 2019 · 10 comments
Closed

Highlight class names in light mode #3225

InMatrix opened this issue Feb 23, 2019 · 10 comments
Assignees
Milestone

Comments

@InMatrix
Copy link

Steps to Reproduce

I noticed that in the light theme, IntelliJ doesn't highlight Dart class names. This makes it harder to see the widget hierarchy, because widget names look similar to the "child" before them.

image

However, IntelliJ does highlight class names in the dark theme:

image

So as in VS Code:
image

Version info

[✓] Flutter (Channel dev, v1.2.2, on Mac OS X 10.14.1 18B75, locale en-US)
• Flutter version 1.2.2 at /Users/taodong/Development/flutter/flutter
• Framework revision 007a415c2a (21 hours ago), 2019-02-21 20:22:47 -0800
• Engine revision f1f19bba8f
• Dart version 2.2.0 (build 2.2.0-dev.2.1 c92d5ca288)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/taodong/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.0, Build version 10A255
• ios-deploy 2.0.0
• CocoaPods version 1.5.3

[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 33.1.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] IntelliJ IDEA Community Edition (version 2018.3.4)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin installed
• Dart plugin version 183.5901

[✓] VS Code (version 1.31.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.23.1

@InMatrix
Copy link
Author

Cc: @jacob314

@stevemessick
Copy link
Member

Flutter uses the highlighting convention provided for Dart. We might want to change that. The Dart convention has no special highlighting for class names.

@scheglov @alexander-doroshko @devoncarew

@stevemessick stevemessick added this to the Backlog milestone Feb 25, 2019
@alexander-doroshko
Copy link
Contributor

See Settings (Preferences) | Editor | Color Scheme | Dart, select Class in the list.
Class color is inherited from Classes -> Class name (Language Defaults).
The latter in its turn is inherited from Identifiers -> Default (Language Defaults).
And that one is set to regular black in light theme and to something more specific in a dark one.

I'm not sure why exactly such default colors are set.
I can only say that I think such defaults shouldn't be changed per language. I mean I wouldn't like to change the default color for a Dart class without changing Java, TypeScript, and dozens of other languages.
So, if a change is ever made, I think Classes -> Class name (Language Defaults) or Identifiers -> Default (Language Defaults) color should be changed, not Dart class.

For now everyone can adjust default colors to their needs, luckily all colors are configurable.

@InMatrix
Copy link
Author

I think the default setting matters a lot here. Is there precedent that a language/framework customized syntax highlighting or came with its own theme in IntelliJ?

@stevemessick
Copy link
Member

@InMatrix I have not looked into the details but I'm pretty sure we could change the default for Flutter projects if we wanted to. I wonder if this could be a topic for a user study?

@InMatrix
Copy link
Author

@stevemessick If the question is about picking the right highlighting color for class names in a Flutter project, yes, we can do a study or review existing light themes. Is this what you have in mind?

@stevemessick
Copy link
Member

@InMatrix Yes, I think we could make a good case for not using the system default if we had some data to back it up. I understand the reasoning for keeping all languages the same, but also think it may not be universal. Until quite recently the new keyword was prominently highlighted, tagging class names. Now that it has been removed we aren't really following the same conventions as Java.

@jacob314
Copy link
Contributor

jacob314 commented Mar 2, 2019

Steve, that explanation of why the syntax highlighting made sense before and does not work now makes a lot of sense to me.

@alexander-doroshko
Copy link
Contributor

Until quite recently the new keyword was prominently highlighted, tagging class names. Now that it has been removed we aren't really following the same conventions as Java.

Sounds fair.

@stevemessick
Copy link
Member

With IntelliJ 2019.1 there is a new ability to choose color themes. This won't apply to Android Studio for a while. Some of the themes include highlighted class names. There is a web site that offers a preview of them: http://color-themes.com/?view=index

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

4 participants