Sublime Forum

Hightlight function's name

#1

When I used go_to_difinition,I guess there is a data strutue to storage all the name of the functions.Why not use this to hightlight functions’ name?It is wierd.

0 Likes

#2

Define the term “highlight.”

0 Likes

#3

Sorry,I am not very good at english.What I say is to hightlight(maybe color) all abc show in this picture.

0 Likes

#4

I would guess that your color scheme is lacking of some scopes.

A clean ST 3126 works fine.

1 Like

#5

The aaaa in line 4 should be the same color with the one in first line in my mind so that we can identify which one is a funtion,since some languages can use funtions without bracket which make it look like a variable.

0 Likes

#6

It’s not that important since you can always make/customize a theme for yourself.
It shows that the parser has parsed the function call and assign it a scope.
However, the color is decided by the theme maker.

What ST does: parse codes and assign scopes
What a theme maker does: assign colors for scopes

So, if scopes are wrong, it’s ST’s fault. If scopes are correct but colors are wrong, it’s a problem of the theme you are using. In this case, it’s a problem of the theme.

To check the scope at the cursor, press Ctrl+Alt+Shift+P.

0 Likes

#7

oh,maybe that’s a bug with the parser.The abc in line 4 should be assigned with “entity.name.function…” addtionally.

0 Likes

#8

I won’t call it a bug. Scope naming is a kind of personal taste. Imo, the parser works well and the code is parsed without a problem. The problem is, there is no color assignment for in your theme.

0 Likes

#9

It seems no way to do that in a syntax difiniton file to do this.

0 Likes

#10

syntax definition file is responsible for parsing and assigning scopes to text.
color scheme is responsible for assigning color to scopes.

You can either change one of them to achieve your goal. However, the file being changed will be maintained by yourself. Maintaining a color scheme is lots of easier than maintaining a syntax definition imo.

0 Likes

#11

Oh, I get what you are saying that I should edit the color scheme to assign the same color to the scope named “meta.function.call.python”.But since most of scheme didn’t do this,it is better to make it assigned with “entity.name.function…” addtionally.And I don’t think the “meta.function-call.pyton” is assigned by a syntax file because it is imposible to identify which is a real funtion call with regex.But the parser can identify which one is a real funtion call according to the datastructure used to go_to_difinition.

0 Likes

#12

Your thoughts are for backward/wide compatibility. However, there are some “bad” practices in scope naming in the past. Because there is no official standard for naming, even official packages are in a mess as well. Wbond is trying to make scopes more consistent but I am not sure whether this function name/call scope change is intended or not.

You may open an issue on https://github.com/sublimehq/Packages .

0 Likes

#13

nope,if the cope named “meta.funtion-call…” is assigned by parser according to the datastructure used to go_to_difinition,then assignning it with “entity.name.function…” addtionally would solve this.It is more easier to solve this issue by this way than recommending all the color scheme author to add something to color “meta.function-call…”.

0 Likes

#14

It is happy to discuss with you since I know you are from Taiwan(we contacted by email once ) and I could discuss with you in Chinese.I wanted to do that originally,but I consider that it is negative to share information with others.That is funny.

0 Likes