Closed atf1206 closed 4 years ago
@atf1206 Thanks for the PR! I don't know much about syntax file so it's good to have a PR from you. I did a comparison and just have a few comments:
if
and symbol ` is now highlighted correctly, so that's great!$
, #
, ?
, @
, .
, etc?\xxx
functions too (i.e. \d
)()
. But for ,
, because it is a join function, it's clearer to see the color (see line 16):
in line 33 to be highlighted as well (and also line 41 :val
)files@:where
, the file
shouldn't be highlighted?k
and q_output
. would be nice to include those as well?Hi @Komsit37 thanks for the review.
*2. The main question, I think, is that this version does NOT highlight operators ($, #, ? etc), only highlighting keywords. This is maybe a matter of opinion; I see that coloring is used for similar operators in python, but I am not used to it from (e.g.) c/c++.
*4, 5. This is also why for 4. we do not color commas, nor the colon in 5., since I consider return to be an operator (colons ARE highlighted for assignment and i/o, i.e. 0: 1: 2: ).
*6. The new version also handles compound assignment, so I believe that 6. is being handled correctly (compound assignment with apply).
*3. Since anything after \ is a system command, do you think there should be coloring only for kdb-specific commands (e.g. d, as you suggested), or all commands (e.g. \free)?
*7. It seemed easier to make them a separate PR, especially since they are newer and have not been tested much. But yes I would love to get them included in the future.
For 2, 4 - yeah this may be a matter of opinion. I feel some code like Line 15 is more readable with operator color. So unless many people prefer the changes, I'd like to keep it this way.
6 - ok . nice
3 - preferably only valid command, but that would require a hard code list of valid command in the syntax file. so to keep things simpler, just highlight all commands should be ok
7 - sure, sounds good
Updated! Sorry about the delay.
Operator color added back in.
Cool, thanks!
Rework of q syntax file for sublime see https://github.com/atf1206/q-kdb-syntax for readme