tomi / vscode-rf-language-server

VSCode extension to support Robot Framework development
MIT License
53 stars 35 forks source link

Is it possible to highlight the keywords? #3

Open hellt opened 7 years ago

hellt commented 7 years ago

Wondering if this is possible? Would make my test suites much more readable...

tomi commented 7 years ago

Hi! I think it should be doable. I'll investigate this.

ghost commented 7 years ago

I would love to see the syntax highlighting as seen on the official RF site: image It has all the keywords/params/vars highlighted in a meaningful name

Because what I have now is a bit clumsy, keywords are not visually detached from named arguments, what makes it difficult to read for a non-robot person image

tomi commented 7 years ago

I completely agree that the syntax highlighting is a bit limited for the moment. Thanks for providing that image for reference, that is what we should aim for.

tomi commented 7 years ago

Hi! I just released version 0.5.1 which has much more powerful syntax highlighting. Please give it a try and let me know if it's missing anything!

hellt commented 7 years ago

Thanks @tomi for quickly responding to that request! Awesome work, though I think some things we might improve. Lets see how different themes react to the following boilerplate

*** Test Cases ***
# Testing Comment
Sample Test Name
    [Documentation]    Example test
    [Setup]    Open Application    App B
    [Arguments]    ${path}
    [Tags]    owner-mrx    not_ready
    ${return}=Keyword Name    ${org_admin}  # unnamed variable
    ...                       scalar value  # scalar value as positional arg
    ...                       password=cats  # named arg with scalar
    ...                       cats_org_name=${org_name}  # named arg with variable assigned
    ...                       cats_reuse=true            # boolean type
    [Teardown]    NONE

Ayu Dark/Light image image

  1. Does it make sense to color differently ${} and the name of the var inside it? Kinda overcolored?
  2. Seems like [Arguments] control world has different color scheme from [Documentation] and Teardowns
  3. Its hard to distinct named variable from its value. Take a look at password=cats parameter. Maybe we should color the named args somehow? Or color the variable value?
  4. Seems like its related to this theme, but *** Test Cases *** control world has a color in the same pallete as scalars and named variables

Material image Same comments for this theme

Sublime Material Theme image I thought that my favorite Ayu theme was the only one with an issue that *** Test Case *** control world has the same problem of the same (or almost the same) color as test name

tomi commented 7 years ago
  1. I was aiming for the same highlighting as RF has on their examples page. I agree that it's a bit confusing now. I'll see if a more neutral colour would work, like ... has.
  2. Yes this seems to be a bug. Need to fix this.
  3. I agree. They should have a different groups.
  4. Hmmm this is odd.. It has a different colour on my machine with Material theme:

screen shot 2017-04-05 at 20 26 33

hellt commented 7 years ago

Thanks for 0.6.1 release Now it looks quite good. Still cant say if the different color for ${} symbols and the name of the variable looks harmonized image

light one: image

hellt commented 7 years ago

KW Highlighting is lost when doing variables assign by KW return value image