Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Using a different set of characters as cell separator #200

Open
knight-corvi opened this issue Sep 27, 2017 · 13 comments
Open

Using a different set of characters as cell separator #200

knight-corvi opened this issue Sep 27, 2017 · 13 comments
Labels

Comments

@knight-corvi
Copy link

knight-corvi commented Sep 27, 2017

I currently use | as a separator (There is a space right after the | character) instead of the usual four spaces. As of now, it highlights everything in one single color.
Unless I misunderstood the instruction, changing the value in Robot.tmLanguage didn't work for me.
i.e. I'm trying to replicate the Pipe and space separated format as described in the RF docs.

Here is the content of the file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>name</key>
    <string>Robot Framework Preferences</string>
    <key>scope</key>
    <string>source.robot</string>
    <key>settings</key>
    <dict>
        <key>shellVariables</key>
        <array>
            <dict>
                <key>name</key>
                <string>RF_CELL</string>
                <key>value</key>
                <string><![CDATA[| ]]></string>
                <!-- <string><![CDATA[    ]]></string> -->
            </dict>
        </array>
    </dict>
    <key>uuid</key>
    <string>23650265-9dfb-4d5f-9ed0-0928ba59a796</string>
</dict>
</plist>
@aaltat
Copy link
Collaborator

aaltat commented Sep 27, 2017

I don't actively use and therefore I don't always remember to test pipe separated syntax. It very well might be that you have found a bug. But to fully understand your problem, would it be possible see a screen capture it example file which demonstrates the problem.

@knight-corvi
Copy link
Author

Here is the code:

*** Settings ***
Library       OperatingSystem

*** Variables ***
${MESSAGE}    Hello, world!

*** Test Cases ***
My Test
    [Documentation]    Example test
    Log    ${MESSAGE}
    My Keyword    /tmp

Another Test
    Should Be Equal    ${MESSAGE}    Hello, world!

*** Keywords ***
My Keyword
    [Arguments]    ${path}
    Directory Should Exist    ${path}


# Using Pipe Space Syntax
| *Settings* |
| Library | OperatingSystem |

| *Variables* |
| ${MESSAGE} | Hello world |

| *Test Cases* |
| My Test |
|  | [Documentation] | Example test |
|  | Log | ${MESSAGE} |
|  | My Keyword | /tmp |

| Another Test |
|  | Should Be Equal | ${MESSAGE} | Hello world |

| *Keywords* |
| My Keyword |
|  | [Arguments] | ${path} |
|  | Directory Should Exist | ${path} |

and a screenshot:
screen shot 2017-09-27 at 7 08 47 pm

@aaltat
Copy link
Collaborator

aaltat commented Sep 28, 2017

Ah, now I see. The problem is in the syntax highlighting definitions. Which is defined in here: https://github.com/andriyko/sublime-robot-framework-assistant/blob/master/Robot.YAML-tmLanguage and is the last definition in the file.

The keyword regexp is too aggressive at the moment and does not take in consideration the pipe separated format. The definitions are regexp and plain text files which everyone can edit. Would you be interested to find a fix and send a pull request? I am currently busy with SeleniumLibrary 3.0 release and I don't have time to investigate the problem deeper in the near future.

@knight-corvi
Copy link
Author

knight-corvi commented Sep 28, 2017 via email

@knight-corvi
Copy link
Author

n00b question: how do I go to test my changes? simply modifying the YAML-tmLanguage file doesn't seem to have any effect

@aaltat
Copy link
Collaborator

aaltat commented Sep 28, 2017

It could be that then it was this file, Sublime has strange syntax definition: https://github.com/andriyko/sublime-robot-framework-assistant/blob/master/Robot.tmLanguage

Also reboot of Sublime is needed

@aaltat
Copy link
Collaborator

aaltat commented Oct 11, 2017

Did you happen to solve the problem? If yes could perhaps provide pull request to solve the problem?

@aaltat aaltat added the bug label Oct 11, 2017
@knight-corvi
Copy link
Author

Still working on it, I'm still fairly new to regex. So far, I have managed to get the Table keywords to get highlighted properly. I'm currently have problems delimiting the scope of some of the highlighting keywords. I will start working on it again in the next few days since I have been busy with at work.

@aaltat
Copy link
Collaborator

aaltat commented Oct 11, 2017

No worries, take your time. It's good that you had some progress on the matter.

Unfortunately I am not able to help you with the problem solving, because my time is spent on the SeleniumLibrary release 3.0.

@knight-corvi
Copy link
Author

knight-corvi commented Oct 11, 2017 via email

@aaltat
Copy link
Collaborator

aaltat commented Oct 11, 2017

Could you send a pull request? It doesn't have to fully ready but it would be nice to see the changes.

@pavoltravnik
Copy link

Could be also nice to have fixed highlighting if somebody use TABs instead of spaces.

@aaltat
Copy link
Collaborator

aaltat commented Oct 27, 2017

@pavoltravnik please raise an separate issue about the tab support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants