RobotCode

repository·main·Indexed 43 days ago

https://github.com/robotcodedev/robotcode

A complete toolkit for Robot Framework providing a language server, IDE extensions for VS Code and JetBrains, and a powerful CLI. Version 2.7.0 offers IntelliSense, linting, test execution, debugging via DAP, code formatting, and refactoring. It includes specialized packages such as robotcode-analyze, robotcode-debugger, robotcode-language-server, and robotcode-repl, and supports integration with AI agents like Claude Code and GitHub Copilot CLI.

Tokens
159.6K
Snippets
410
Records
701
Agent score
54%

What's inside RobotCode

  1. What is robotcode-debugger?

    main
    The robotcode-debugger package provides a Debug Adapter Protocol (DAP) implementation specifically for debugging Robot Framework tests. It is a core component of the RobotCode ecosystem, enabling IDEs and editors to interface with Robot Framework for step-through debugging, breakpoint management, and variable inspection.
  2. Overview of RobotCode features

    main

    RobotCode is a toolkit for Robot Framework development that leverages the Language Server Protocol (LSP) to provide a consistent experience across different IDEs (IntelliJ, VS Code, Neovim, etc.).

    Core Capabilities

    • Smart Code Editing: Includes auto-completion, syntax highlighting, and seamless navigation.
    • Refactoring: Supports renaming variables, keywords, and arguments across the entire project.
    • Integrated Debugging: Allows you to debug Robot Framework tests directly within the IDE using the Debug Adapter Protocol (DAP).
    • Test Management: Tools to discover, run, and monitor tests, including viewing detailed test results and logs.
    • Code Analysis & Formatting: Integrates with Robocop for linting, static analysis, and consistent code formatting.
    • Project Configuration: Full support for robot.toml to manage Robot Framework projects.
  3. What is RobotCode?

    main

    RobotCode is a comprehensive toolset designed for working with the Robot Framework. It provides extensions and plugins for various IDEs (Visual Studio Code, IntelliJ Platform) and command-line tools.

    Key architectural principles:

    • Built on Robot Framework Core: Uses the official parser to ensure syntax validation, error messages, and behavior are identical to running Robot Framework directly.
    • Language Server Protocol (LSP) Powered: Uses LSP to provide consistent language support across different editors (including Neovim and Sublime Text).
    • DAP Compatible: Uses the Debug Adapter Protocol (DAP), meaning any IDE supporting DAP can use the RobotCode debugger.
  4. Core features of RobotCode

    main

    RobotCode is a complete toolkit for Robot Framework development, offering several key capabilities:

    • Code Intelligence: Context-aware completion for keywords (including embedded arguments), variables, libraries, and resources. Includes hover documentation, go-to-definition, find references, signature help, and live diagnostics. It can optionally integrate with Robocop for additional linting and formatting.
    • Project-wide Refactoring: Safely rename keywords, arguments, variables, and files across your entire workspace (including resources and multi-root setups) with a preview of changes.
    • Run, Debug & Test Explorer: Discover and run tests via the editor's test panel or CLI. Supports setting breakpoints, stepping through keywords, and inspecting variables via the Debug Adapter Protocol.
    • Unified Configuration: Uses a single robot.toml file for Editor, CLI, and CI environments. Supports profiles for different setups (dev, staging, CI, OS-specific, or browser-specific).
    • Powerful CLI: A project-aware, JSON-friendly command-line interface for running, discovering, analyzing, and inspecting projects.
    • REPL & Notebooks: Interactive keyword testing via robotcode repl and .robotbook files (Jupyter Notebook-style UI) for experimentation and debugging.
    • Multi-IDE Support: A single language server powers VS Code, JetBrains, Neovim, Sublime Text, and other LSP-capable editors, ensuring consistent capabilities across different IDEs.
  5. RobotCode Core Features Overview

    main

    RobotCode provides a comprehensive toolkit for Robot Framework development, covering three main areas:

    1. Editor / IDE Intelligence

    • Code Intelligence: Completion for keywords, variables, libraries, and resources; hover documentation; go-to-definition; find references; and signature help.
    • Keywords Explorer: A dedicated sidebar to browse and insert keywords from imported resources.
    • Refactoring: Project-wide renaming of keywords, variables, and arguments.
    • Diagnostics: Live error/warning detection (with optional Robocop integration).
    • Debugging: Debugging via the Debug Adapter Protocol (DAP) with breakpoints and step-through control.
    • Test View: Discover, run, and inspect tests in a dedicated panel.
    • Interactive Tools: REPL and .robotbook (Jupyter-style) notebooks.

    2. Unified Configuration

    • Uses robot.toml or pyproject.toml to sync settings between IDE and CI.
    • Supports Profiles for environment-specific settings (dev, staging, etc.).

    3. Command Line Toolkit

    • Automated Execution: Runs tests with all profiles, paths, and variables automatically applied.
    • Advanced Filtering: Find tests by suites, tags, sources, documentation, or keyword calls.
    • Failure Analysis: Explore logs and compare current runs against previous runs without manual XML parsing.
    • CI Integration: Provides JSON output for automation and project-wide static analysis that matches IDE diagnostics.
  6. Use robotcode-language-server for IDE features

    main

    The robotcode-language-server provides the following features via the Language Server Protocol (LSP):

    • Code completion: Provides suggestions for Robot Framework keywords.
    • Real-time linting: Performs error checking as you write code.
    • Navigation: Enables code navigation within your Robot Framework files.
    • Multi-workspace support: Works effectively in environments with multiple workspaces.
  7. Overview of `robotcode results` subcommands

    main

    The robotcode results tool provides a scriptable way to analyze Robot Framework execution results (output.xml or output.json) directly from the terminal or CI/CD pipelines. It supports five main subcommands, all of which share common filter, search, and output-format options.

    SubcommandUse it when you want to …
    summary… see the headline counts and overall status
    show… list individual tests (with sort, filter, search)
    log… inspect the per-test execution tree
    stats… aggregate by tag, suite, or status
    diff… compare two runs and find new failures
  8. Scope-confined variable renaming

    main

    When renaming variables, RobotCode respects scope boundaries to prevent shadowing issues.

    • Local Variables: If a variable is found within a DefinitionBlock.local_variables, the rename is confined to that specific block's line range using enclosing_definition_block().
    • Global/Suite/File Scope: Variables defined at these levels span the workspace and will be renamed across all relevant files/suites.

    This ensures that renaming a local loop variable like ${i} does not affect a variable named ${i} in a different keyword or scope.

  9. How nested variable resolution works

    main

    RobotCode performs static resolution for nested variables (e.g., ${cfg_${env}}) during analysis. This allows the tool to resolve the outer variable if the inner variable's value is known at compile time.

    The Resolution Process:

    1. Inner Resolution: The analyzer independently resolves inner variables (e.g., ${env}). These receive full first-class treatment (hover, go-to-definition, and diagnostics).
    2. Static Substitution: The analyzer attempts to substitute the inner variable's known value into the outer variable's name.
    3. Outcome:
      • If substitution succeeds, the outer variable is resolved.
      • If the inner variable is not found, an ERROR diagnostic is emitted.
      • If the inner variable exists but its value is unknown at analysis time, a HINT is emitted.

    Diagnostics for Nested Variables:

    • VARIABLE_NAME_NOT_RESOLVABLE (ERROR): An inner variable in a nested name was not found in the scope.
    • VARIABLE_NAME_NOT_STATICALLY_RESOLVABLE (HINT): The inner variable exists, but its value cannot be determined at analysis time.
    • VARIABLE_REFERENCE_NOT_STATICALLY_RESOLVABLE (HINT): A variable reference contains nested variables that cannot be resolved.
  10. What constitutes a 'low-context' automated submission

    main

    Submissions that appear to be generated without real understanding, reproduction, or project context may be rejected. This includes:

    • Superficial scans of issues or code.
    • Ignoring the contribution guide.
    • Lack of meaningful verification.
    • Broad, unrelated changes or mechanical refactoring.
    • Adding unnecessary abstraction, boilerplate, comments, or tests.
    • Misunderstanding project architecture or user-facing behavior.
    • Requiring maintainers to perform the investigation, integration, or validation work.