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

[PyCharm] robotCodeFormatter expects JSONArray, but code checks for string #490

Closed
mptok opened this issue Nov 2, 2021 · 2 comments
Closed
Labels
bug Something isn't working robotframework-ls

Comments

@mptok
Copy link

mptok commented Nov 2, 2021

Description
In Pycharm robotCodeFormatter expects JSONArray, but code checks for string. Check "To Reproduce" for more.

To Reproduce
Steps to reproduce the behavior:

  1. Go to: File > Settings > Languages & Frameworks > Robot Framework (Global) . Or go to: File > Settings > Languages & Frameworks > Robot Framework (Project)
  2. Scroll down to "Code Formatter".
    It says: "Allows the configuration of the code-formatter engine to be used. One of: robotidy, builtinTidy.
    Note: expected format: JSON Array"
  3. Input "robotidy" as a plain string or input ["robotidy"] as JSON Array.
    It does not accept them.
  4. Go to: "robotframework-lsp-master\robotframework-intellij\src\main\java\robocorp\robot\intellij\RobotProjectPreferencesPage.java" Or go to: "robotframework-lsp-master\robotframework-intellij\src\main\java\robocorp\robot\intellij\RobotPreferencesPage.java"
  5. Search for validateRobotCodeFormatter.
    It looks like it wants to convert plain string to JsonArray and then check if it is equal to "robotidy" or "builtinTidy".

Expected behavior
It should expect string, don't convert it, then check if it is "robotidy" or "builtinTidy". Or it should expect JSON Array, get strings from the array, then check if it is "robotidy" or "builtinTidy".

Screenshots
I am not a Java dev, but that part of the code just looks suspicious to me.
Error in the settings and snap of the code.
image

Versions:

  • OS: Windows 10
  • Robot Framework Version 4.1.2
  • Robot Framework Language Server Version 0.27.0
  • Client Version PyCharm 2021.2.3 Community

Logs
Nope

@mptok mptok added bug Something isn't working robotframework-ls labels Nov 2, 2021
@fabioz fabioz closed this as completed in d32efe0 Nov 3, 2021
@fabioz
Copy link
Collaborator

fabioz commented Nov 3, 2021

I'm sorry about that... this was fixed in the package.json, but the files that depend on it in Intellij weren't regenerated.

I've just fixed this (until a new official build goes out with this fix, you can get a binary from: https://github.com/robocorp/robotframework-lsp/actions/runs/1414776714 -- see: https://github.com/robocorp/robotframework-lsp/blob/master/robotframework-ls/docs/faq.md#how-to-install-a-build-from-github-on-intellij for details on how to install it).

@mptok
Copy link
Author

mptok commented Nov 3, 2021

Thanks for fast resposne. I will check fixed binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working robotframework-ls
Projects
None yet
Development

No branches or pull requests

2 participants