Skip to content

[BUG] IntelliJ: IllegalArgumentException when Opening Non-Python Projects #421

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

Open
cspurk opened this issue Mar 24, 2025 · 2 comments
Open
Labels
bug Something isn't working

Comments

@cspurk
Copy link

cspurk commented Mar 24, 2025

Opening non-Python projects in IntelliJ with the plugin enabled yields an “IDE Internal Error” like this one:

java.lang.IllegalArgumentException: PythonSDK is not defined or robot version is not valid for project FOOBAR
	at dev.robotcode.robotcode4ij.RobotCodeHelpersKt.buildRobotCodeCommandLine(RobotCodeHelpers.kt:101)
	at dev.robotcode.robotcode4ij.RobotCodeHelpersKt.buildRobotCodeCommandLine$default(RobotCodeHelpers.kt:92)
	at dev.robotcode.robotcode4ij.testing.RobotCodeTestManager.refresh$lambda$14(RobotCodeTestManager.kt:229)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport$executeOnPooledThread$2.call(AnyThreadWriteThreadingSupport.kt:195)
	at com.intellij.util.concurrency.ContextCallable.lambda$call$1(ContextCallable.java:85)
	at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:94)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:103)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:103)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:109)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:103)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
	at java.base/java.lang.Thread.run(Thread.java:1583)

A comment on #400 recommends configuring a Python interpreter, however, that doesn’t seem to make sense for non-Python projects.

Even if a Python SDK should be needed for RobotCode, it should not be mandatory for IDE projects which don’t use the Robot Framework.

  • RobotCode Version: 1.0.3
  • OS: Linux
  • Python Version: N/A
  • RobotFramework Version: N/A
@cspurk cspurk added the bug Something isn't working label Mar 24, 2025
@d-biehl
Copy link
Member

d-biehl commented Mar 24, 2025

Which IDE are you using — PyCharm or IntelliJ? And what exactly do you mean by “non‑Python projects”?
The language server should normally only start when it detects Robot Framework files or a pyproject.toml/robot.toml.

The exception you’re seeing is due to the project’s early development stage; it will be handled more gracefully in a future release.

@cspurk
Copy link
Author

cspurk commented Mar 24, 2025

Thanks for your prompt response! I use IntelliJ. By “non-Python projects” I mean IDE projects which don’t use Python in any way; they might be using Java, Scala, etc. The error definitely occurs also for projects without any pyproject.toml/robot.toml files.

Maybe I should note that I often have multiple projects opened, some of which may contain pyproject.toml files and/or use the Robot Framework. However, the error also occurs when I only open projects that don’t use any of this (e.g., classical Java projects without Robot Framework usage).

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

No branches or pull requests

2 participants