Skip to content
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

Emacs tree-sitter #7

Open
slalomsk8er opened this issue Jan 4, 2024 · 2 comments
Open

Emacs tree-sitter #7

slalomsk8er opened this issue Jan 4, 2024 · 2 comments

Comments

@slalomsk8er
Copy link

I'm missing the robot-ts-mode major mode and for now stay with robot-mode.
While playing with the treesit-explore-mode minor mode, I found some strange behavior:

*** Settings ***
Documentation       A simple web scraper robot.
...                 Opens a website.
...                 Stores the web page text in a file in the output directory.
...                 Saves a screenshot of an element in the output directory.

Library             RPA.Browser.Selenium
Library             RPA.FileSystem

*** Tasks ***
Store Web Page Content
    Open Available Browser    https://robotframework.org/
    ${text}=    Get Text    css:body
    Create File    ${OUTPUT_DIR}${/}text.txt    ${text}    overwrite=True
    Screenshot    css:h1    ${OUTPUT_DIR}${/}screenshot.png
    [Teardown]    Close Browser
---
emacs modeline: task.robot
---
(source_file
 (section
  (settings_section (section_header)
   (setting_statement
    (arguments
     (argument (text_chunk))
     (continuation (ellipses)
      (argument (text_chunk)))
     (continuation (ellipses)
      (argument (text_chunk)))
     (continuation (ellipses)
      (argument (text_chunk)))))
   (setting_statement
    (arguments
     (argument (text_chunk))))))
 (ERROR
  (argument (text_chunk))
  (ERROR (ERROR) SPC (ERROR) (ERROR) SPC (ERROR) SPC (ERROR) SPC (ERROR) (ERROR) SPC (ERROR) SPC (ERROR) (ERROR)
   (ERROR ${ (ERROR) } = (ERROR) SPC (ERROR))
   (ERROR)
   (ERROR (ERROR) SPC (ERROR) ${ (ERROR) } ${ (ERROR) } (ERROR) ${ (ERROR) })
   (ERROR) = (ERROR) (ERROR) (ERROR) ${ (ERROR) } ${ (ERROR) } (ERROR))
  (ERROR) SPC (ERROR)))
---
emacs modeline: *tree-sitter explorer for task.robot*

Why the ERRORS? The first one would be the Library on line 8 but I have no idea it isn't resulting in a setting_statement like the Library on line 7.

Is it me and my limited Emacs and Tree-Sitter skills or did I find a bug?

@Hubro
Copy link
Owner

Hubro commented Jan 4, 2024

Thanks for the report!

I think I've forgotten to add *** Tasks *** as a valid section header. Could you try replacing it with *** Test Cases *** to make sure?

Strange that it would invalidate the second "Library" setting though 🤔

@slalomsk8er
Copy link
Author

Nice catch. I forgot that *** Test Case *** is the normal and *** Tasks *** was added later by https://github.com/robocorp, if I got it right, for RPA.
Screenshot_20240104_170916

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

2 participants