diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..bfc43dbcd --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,137 @@ +# RobotCode Development Guidelines + +> Last Updated: 2025-01-25 +> Version: 1.0 +> Override Priority: Highest + + + + - Process development patterns in sequential order + - Use exact patterns and templates provided + - Follow MUST/ALWAYS/REQUIRED directives strictly + - Never deviate from established architectural patterns + + + - encoding: UTF-8 + - line_endings: LF + - indent: 2 spaces (Python) / 4 spaces (TypeScript) + - package_structure: packages/ for Python, vscode-client/ for TypeScript + + + +RobotCode is a comprehensive Robot Framework toolkit that provides IDE extensions (VS Code, IntelliJ), CLI tools, and Language Server Protocol implementation. It uses Robot Framework's native parser for full compatibility while extending it with modern development tools like DAP debugging, test discovery, and multi-workspace support. + +## Agent Communication Guidelines + +### Core Rules + +- **REVIEW/ANALYZE/CHECK/EXAMINE:** READ-ONLY operations. Provide analysis and feedback, NEVER make changes +- **IMPLEMENT/ADD/CREATE/FIX/CHANGE:** Implementation required. ALWAYS ask for confirmation and wait for explicit user choice before proceeding +- **IMPROVE/OPTIMIZE/REFACTOR:** Always ask for specific approach before implementing +- **MANDATORY WAIT:** When presenting implementation options, ALWAYS wait for explicit user choice before proceeding + +### Communication Flow + +1. **Recognize Intent:** Review request vs. Implementation request? +2. **For Reviews:** Analyze and suggest, but don't change anything +3. **For Implementation:** + - ALWAYS ask for confirmation before implementing + - If multiple approaches exist, present numbered options A), B), C), D), ...) + - ALWAYS end with "Other approach" + - WAIT for user response before proceeding + - NEVER start implementation until user explicitly chooses an option +4. **Critical Rule:** When presenting options, STOP and wait for user input. Do not continue with any implementation. + +## Tech Stack + +### Core Technologies +- **Language Server:** Python 3.8-3.13 with asyncio +- **Protocol:** Language Server Protocol (LSP) + Debug Adapter Protocol (DAP) +- **Parser:** Robot Framework native parser for full compatibility +- **Build System:** Hatch for package management and testing + +### VS Code Extension +- **Language:** TypeScript +- **Pattern:** Manager-based lifecycle with proper disposal +- **Dependencies:** @vscode/test-electron, webpack, esbuild + +### IntelliJ Plugin +- **Language:** Kotlin +- **Integration:** LSP4IJ for Language Server communication +- **Build:** Gradle with kotlin-gradle-plugin + +### Testing Matrix +- **Python Versions:** 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 +- **Robot Framework:** 5.0, 6.0, 6.1, 7.0, 7.1, 7.2, 7.3 +- **Test Framework:** pytest with regtest2 for snapshot testing + +## General Coding Guidelines + +### Clean Code Principles +- **Readability First:** Code is read more often than written - prioritize clarity over cleverness +- **Meaningful Names:** Use descriptive names for variables, functions, and classes that express intent +- **Single Responsibility:** Each function/class should have one reason to change +- **Small Functions:** Keep functions focused and under 20 lines when possible +- **No Magic Numbers:** Use named constants or enums instead of hardcoded values +- **Avoid Deep Nesting:** Use early returns and guard clauses to reduce cyclomatic complexity + +### Code Organization +- **Consistent Structure:** Follow established patterns within each package +- **Separation of Concerns:** Keep business logic separate from infrastructure code +- **Interface Segregation:** Create focused interfaces rather than monolithic ones +- **Dependency Inversion:** Depend on abstractions, not concrete implementations + +### Error Handling +- **Explicit Error Handling:** Use proper exception/error types and hierarchies +- **Fail Fast:** Validate inputs early and provide clear error messages +- **Resource Management:** Use appropriate resource cleanup patterns (try-with-resources, RAII, etc.) +- **Logging:** Provide meaningful log messages at appropriate levels + +### Documentation Standards +- **Function Documentation:** All public functions/methods must have comprehensive documentation +- **Type Annotations:** Use static type checking where available (TypeScript, Python type hints, etc.) +- **README Files:** Each package/module should have clear usage documentation +- **Inline Comments:** Explain *why*, not *what* - the code should be self-documenting + +### Testing Requirements +- **Test Coverage:** Maintain high test coverage with meaningful test cases +- **Test Naming:** Use descriptive test names that explain the scenario +- **Test Structure:** Organize tests clearly with setup, execution, and verification phases +- **Test Independence:** Each test should be able to run in isolation + +### Performance Considerations +- **Async Patterns:** Use proper asynchronous programming patterns where applicable +- **Resource Efficiency:** Minimize memory allocations and resource usage in hot paths +- **Lazy Loading:** Load resources only when needed +- **Caching Strategy:** Implement appropriate caching for expensive operations + +## Architecture Patterns + +### Package Structure +``` +packages/ +├── core/ # Base utilities and shared functionality +├── language_server/ # LSP implementation for IDE integration +├── debugger/ # Debug Adapter Protocol implementation +├── runner/ # Enhanced Robot Framework execution tools +├── analyze/ # Static code analysis and validation +├── jsonrpc2/ # JSON-RPC communication layer +├── plugin/ # Plugin system foundation +├── repl/ # Interactive Robot Framework shell +├── repl_server/ # REPL server for remote connections +├── robot/ # Robot Framework integration utilities +└── modifiers/ # Code transformation tools + +vscode-client/ # VS Code extension (TypeScript) +├── extension/ # Main extension code with manager pattern +└── rendererLog/ # Log rendering components + +intellij-client/ # IntelliJ/PyCharm plugin (Kotlin) +├── src/main/kotlin/ # Plugin implementation via LSP4IJ +└── build.gradle.kts # Gradle build configuration +``` + +### Multi-Platform Support +- **Python CLI:** Cross-platform command-line tools +- **VS Code:** TypeScript extension with manager pattern +- **IntelliJ:** Kotlin plugin via LSP4IJ bridge diff --git a/.github/instructions/kotlin-intellij.instructions.md b/.github/instructions/kotlin-intellij.instructions.md new file mode 100644 index 000000000..21a835163 --- /dev/null +++ b/.github/instructions/kotlin-intellij.instructions.md @@ -0,0 +1,77 @@ +--- +description: Kotlin IntelliJ Plugin Development Rules for RobotCode +applyTo: intellij-client/** +--- + +# Kotlin IntelliJ Plugin Development Rules + + + + - Process XML blocks first for structured data + - Execute instructions in sequential order + - Use exact patterns and templates provided + - Follow MUST/ALWAYS/REQUIRED directives strictly + + + - encoding: UTF-8 + - line_endings: LF + - indent: 4 spaces + - plugin_structure: intellij-client/src/main/kotlin/ + + + +## Plugin Architecture + +### LSP4IJ Integration +- **Language:** Kotlin +- **Integration:** LSP4IJ for Language Server communication +- **Build:** Gradle with kotlin-gradle-plugin + +### Plugin Structure +``` +intellij-client/ +├── src/main/kotlin/ # Plugin implementation via LSP4IJ +└── build.gradle.kts # Gradle build configuration +``` + +## Development Commands + +### Building & Packaging +```bash +cd intellij-client && gradle buildPlugin # IntelliJ plugin +``` + +## LSP4IJ Best Practices + +### Language Server Communication +- **IMPLEMENT** proper LSP4IJ bridge patterns +- **HANDLE** multiple workspace folders with error isolation +- **MAINTAIN** robust communication with RobotCode language server + +### Multi-Platform Consistency +- **ENSURE** consistent behavior with VS Code extension +- **MAINTAIN** unified configuration approach +- **DOCUMENT** platform-specific differences where necessary + +## Configuration System + +### robot.toml Integration +- **SUPPORT** robot.toml parsing and profile management +- **VALIDATE** configuration options consistently with other platforms +- **MAINTAIN** cross-platform configuration compatibility + +## Error Handling Standards + +### Plugin Lifecycle +- **IMPLEMENT** proper plugin lifecycle management +- **HANDLE** startup and shutdown gracefully +- **MANAGE** resources properly to prevent memory leaks + +### LSP Communication +- **ISOLATE** error handling per workspace +- **MAINTAIN** robust communication with language server +- **HANDLE** connection failures gracefully + +--- + +*These Kotlin development rules ensure consistent, high-quality IntelliJ plugin development.* diff --git a/.github/instructions/python-development.instructions.md b/.github/instructions/python-development.instructions.md new file mode 100644 index 000000000..527b86194 --- /dev/null +++ b/.github/instructions/python-development.instructions.md @@ -0,0 +1,70 @@ +--- +description: Python Development Rules for RobotCode +applyTo: **/*.py +--- + +# Python Development Rules + + + + - Process XML blocks first for structured data + - Execute instructions in sequential order + - Use exact patterns and templates provided + - Follow MUST/ALWAYS/REQUIRED directives strictly + + + - encoding: UTF-8 + - line_endings: LF + - indent: 2 spaces + - package_structure: packages/ directory + + + +## Package Development + +### Package Structure +- **ALWAYS** develop in packages/ directory +- **REQUIRED** follow package-based architecture +- **MUST** use proper __init__.py files for package imports + +### Code Style Standards +- **Formatting:** we use ruff for formatting +- **Type Hints:** Required for all APIs +- **Docstrings:** Google style for modules, classes, and functions, but follows clean code principles +- **linting:** use ruff for static analysis and mypy for type checking + + +### Code Quality +```bash +hatch run lint:all # All linting checks (black, isort, flake8) +hatch run lint:fix # Auto-fix style issues +``` + +### Testing Requirements + +### Python Interpreter +- **ask your tools** wich python interpreter to use for the project/workspace + +### Matrix Testing +- **COMPREHENSIVE** testing across Python 3.8-3.13 +- **MATRIX** testing with Robot Framework 5.0-7.3 +- **INTEGRATION** tests in tests/robotcode/ with real scenarios +- **SNAPSHOT** testing with pytest regtest2 + +### Test Execution + +**IMPORTANT**use the correct Python environment selected in your IDE + +- **USE** `pytest .` to run unit tests, +- **USE** `pytest --regtest2-reset` to update snapshots +- **RUN** specific environments: `hatch run test.rf70.py311:test` +- **COVERAGE** reporting with `hatch run cov` + +## Multi-Platform Consistency +- **ENSURE** consistent behavior across VS Code and IntelliJ +- **MAINTAIN** unified configuration approach +- **DOCUMENT** platform-specific differences + +--- + +*These Python development rules ensure consistent, high-quality code across all RobotCode packages.* diff --git a/.github/instructions/typescript-vscode.instructions.md b/.github/instructions/typescript-vscode.instructions.md new file mode 100644 index 000000000..2f200f9b3 --- /dev/null +++ b/.github/instructions/typescript-vscode.instructions.md @@ -0,0 +1,130 @@ +--- +description: TypeScript VS Code Extension Development Rules for RobotCode +applyTo: vscode-client/**/*.ts + +--- + +# TypeScript VS Code Extension Development Rules + + + + - Process XML blocks first for structured data + - Execute instructions in sequential order + - Use exact patterns and templates provided + - Follow MUST/ALWAYS/REQUIRED directives strictly + + + - encoding: UTF-8 + - line_endings: LF + - indent: 4 spaces + - extension_structure: vscode-client/extension/ + + + +## Extension Architecture + +### Manager Pattern +- **MUST** implement disposal pattern for all managers +- **REQUIRED** proper lifecycle management +- **ALWAYS** register disposables in constructor + +### Manager Template +```typescript +class XyzManager { + private _disposables: vscode.Disposable; + + constructor() { + this._disposables = vscode.Disposable.from( + // ... register all disposables + ); + } + + dispose(): void { + this._disposables.dispose(); + } +} +``` + +## Code Style Standards + +### TypeScript Formatting +- **Formatting:** 4-space indentation, semicolons required +- **Naming:** PascalCase for classes, camelCase for methods/variables +- **Patterns:** Manager pattern with dispose() lifecycle +- **Exports:** Named exports preferred over default exports + +### File Organization +- **Manager-based structure** in vscode-client/extension/ +- **Manager files:** `*Manager.ts` pattern +- **Tests:** Mirror source structure + +## Development Commands + +### Building & Packaging +```bash +npm run compile && npm run package # VS Code extension (.vsix) +``` + +## Critical Development Patterns + +### Test Discovery Protocol +**ALWAYS** use `--read-from-stdin` with real-time document content: +```typescript +const openFiles = {}; +vscode.workspace.textDocuments.forEach(doc => { + if (this.isRobotFrameworkFile(doc)) { + openFiles[doc.uri.toString()] = doc.getText(); + } +}); + +const result = await this.executeRobotCode( + folder, + ["discover", "--read-from-stdin", "all"], + [], + JSON.stringify(openFiles) +); +``` + +### Race Condition Prevention +**MUST** use mutex for async operations: +```typescript +await this.refreshMutex.dispatch(async () => { + await this.refreshItem(item, token); +}); +``` + +### Multi-Workspace Support +- **HANDLE** Multiple Robot Framework projects simultaneously +- **ISOLATE** Error handling per workspace +- **ENSURE** Proper context switching + +## Error Handling Standards + +### Extension Manager Disposal +- **IMPLEMENT** proper disposal pattern to prevent memory leaks +- **REGISTER** all disposables in constructor + +### LSP Communication +- **HANDLE** multiple workspace folders with error isolation +- **MAINTAIN** robust communication with language server + +### Development Server Conflicts +- **CHECK** for running development servers before starting tasks +- **PREVENT** port conflicts during testing + +## VS Code Extension Development Workflow + +### Adding New Features +1. **ALWAYS** Use manager pattern for new functionality +2. **REQUIRED** Implement proper disposal +3. **MUST** Handle race conditions with mutex +4. **ESSENTIAL** Test discovery with `--read-from-stdin` + +### Manager Lifecycle +- **MUST** follow consistent lifecycle pattern +- **REQUIRED** proper disposal implementation +- **ALWAYS** register disposables in constructor + +--- + +*These TypeScript development rules ensure consistent, high-quality VS Code extension development.* diff --git a/.github/workflows/build-test-package-publish.yml b/.github/workflows/build-test-package-publish.yml index 1eb31bfd3..bdc7e6205 100644 --- a/.github/workflows/build-test-package-publish.yml +++ b/.github/workflows/build-test-package-publish.yml @@ -33,7 +33,7 @@ jobs: matrix: os: [macos-latest, ubuntu-latest, windows-latest] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] - robot-version: ["rf41", "rf50", "rf60", "rf61", "rf70", "rf71", "rf72"] + robot-version: ["rf50", "rf60", "rf61", "rf70", "rf71", "rf72", "rf73"] exclude: - os: macos-latest python-version: "3.8" diff --git a/.gitignore b/.gitignore index 5d712265e..4deccd5cc 100644 --- a/.gitignore +++ b/.gitignore @@ -331,4 +331,7 @@ output.xml bundled/libs # robotframework -results/ \ No newline at end of file +results/ + +# kilocode +.kilocode/ \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 10a90faf1..41dc7df83 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,14 +19,6 @@ repos: args: [] - repo: local hooks: - - id: lint_package_update - name: Update package for lint environment - entry: hatch run lint:install-packages - pass_filenames: false - language: system - stages: [pre-commit] - types: - - "python" - id: python_style name: Check Python Style entry: hatch run lint:style diff --git a/.vscode/launch.json b/.vscode/launch.json index f54f3f660..a7ead887e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,29 +6,50 @@ "version": "0.2.0", "configurations": [ { - "name": "Attach to Node Process", - "port": 9229, + "name": "Python: Attach Prompt", + "type": "debugpy", "request": "attach", - "skipFiles": [ - "/**" - ], - "type": "node", - "autoAttachChildProcesses": true + "connect": { + "host": "localhost", + "port": "${input:portNumber}" + } }, - - { - "name": "esbuild.mjs", - "program": "${workspaceFolder}/esbuild.mjs", + "name": "Python: Attach to 5678", + "type": "debugpy", + "request": "attach", + "connect": { + "host": "localhost", + "port": 5678 + }, + "justMyCode": false, + "subProcess": true, + "showReturnValue": true, + }, + { + "name": "Python: Attach using Process Id", + "type": "debugpy", + "request": "attach", + "processId": "${command:pickProcess}", + "justMyCode": false + }, + { + "name": "Python: Create Cmd Line Doc", + "type": "debugpy", "request": "launch", - "skipFiles": [ - "/**" - ], - "type": "node", + "program": "scripts/create_cmdline_doc.py", "console": "integratedTerminal", - "runtimeArgs": [ - "--experimental-modules" - ] + "justMyCode": false, + "cwd": "${workspaceFolder}", + }, + { + "name": "Python: Current File", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "justMyCode": false, + "cwd": "${workspaceFolder}", }, { "name": "Python: Debug in terminal", @@ -39,6 +60,81 @@ ], "justMyCode": false }, + { + "name": "Python: Debug Tests", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "purpose": [ + "debug-test" + ], + "console": "integratedTerminal", + "justMyCode": false + }, + { + "name": "Python: Pytest All Test", + "type": "debugpy", + "request": "launch", + "module": "pytest", + "args": [ + "." + ], + "console": "integratedTerminal", + "justMyCode": false, + "cwd": "${workspaceFolder}", + }, + { + "name": "Python: Pytest Current File", + "type": "debugpy", + "request": "launch", + "module": "pytest", + "args": [ + "${file}" + ], + "console": "integratedTerminal", + "justMyCode": false, + "cwd": "${workspaceFolder}", + }, + { + "name": "Python: Pytest Some Test", + "type": "debugpy", + "request": "launch", + "module": "pytest", + "args": [ + "--full-trace", + "--tb=native", + "--regtest2-reset", + //"--regtest-reset", + //"tests/robotcode/language_server/robotframework/parts/test_foldingrange.py" + //"tests/robotcode/language_server/robotframework/parts/test_references.py" + //"./tests/robotcode/language_server/robotframework/parts/test_discovering.py::test_workspace_discovery" + //"tests/robotcode/language_server/robotframework/parts/test_document_highlight.py" + //"tests/robotcode/utils/test_dataclasses.py::test_really_complex_data" + //"tests/robotcode/language_server/robotframework/parts/test_foldingrange.py" + //"tests/robotcode/language_server/robotframework/parts/test_document_symbols.py", + // "./tests/robotcode/language_server/robotframework/parts/test_semantic_tokens.py " + "tests/robotcode/language_server/robotframework/parts/test_foldingrange.py::test[False-foldingrange.robot-123-001-try end]" + ], + "console": "integratedTerminal", + "justMyCode": false, + "cwd": "${workspaceFolder}", + }, + { + "name": "Python: Remote-Attach", + "type": "debugpy", + "request": "attach", + "connect": { + "host": "localhost", + "port": 5678 + }, + "pathMappings": [ + { + "localRoot": "${workspaceFolder}", + "remoteRoot": "." + } + ], + "justMyCode": true + }, { "name": "Python: RobotCode", "type": "debugpy", @@ -98,102 +194,17 @@ // "package.json" // "-v", // "asd:asd" - ] }, { - "name": "Python: Attach using Process Id", - "type": "debugpy", - "request": "attach", - "processId": "${command:pickProcess}", - "justMyCode": false - }, - { - "name": "Python: Current File", + "name": "Python: RobotCode Debugger", "type": "debugpy", "request": "launch", - "program": "${file}", - "console": "integratedTerminal", - "justMyCode": false, - "cwd": "${workspaceFolder}", - }, - { - "name": "Python: Create Cmd Line Doc", - "type": "debugpy", - "request": "launch", - "program": "scripts/create_cmdline_doc.py", - "console": "integratedTerminal", - "justMyCode": false, - "cwd": "${workspaceFolder}", - }, - { - "name": "Python: Attach to 5678", - "type": "debugpy", - "request": "attach", - "connect": { - "host": "localhost", - "port": 5678 - }, - "justMyCode": false, - "subProcess": true, - "showReturnValue": true, - }, - { - "name": "Python: Attach Prompt", - "type": "debugpy", - "request": "attach", - "connect": { - "host": "localhost", - "port": "${input:portNumber}" - } - }, - { - "name": "Python: Pytest All Test", - "type": "debugpy", - "request": "launch", - "module": "pytest", - "args": [ - "." - ], - "console": "integratedTerminal", - "justMyCode": false, - "cwd": "${workspaceFolder}", - }, - { - "name": "Python: Pytest Some Test", - "type": "debugpy", - "request": "launch", - "module": "pytest", - "args": [ - "--full-trace", - "--tb=native", - "--regtest2-reset", - //"--regtest-reset", - //"tests/robotcode/language_server/robotframework/parts/test_foldingrange.py" - //"tests/robotcode/language_server/robotframework/parts/test_references.py" - //"./tests/robotcode/language_server/robotframework/parts/test_discovering.py::test_workspace_discovery" - //"tests/robotcode/language_server/robotframework/parts/test_document_highlight.py" - //"tests/robotcode/utils/test_dataclasses.py::test_really_complex_data" - //"tests/robotcode/language_server/robotframework/parts/test_foldingrange.py" - //"tests/robotcode/language_server/robotframework/parts/test_document_symbols.py", - // "./tests/robotcode/language_server/robotframework/parts/test_semantic_tokens.py " - "tests/robotcode/language_server/robotframework/parts/test_foldingrange.py::test[False-foldingrange.robot-123-001-try end]" - ], - "console": "integratedTerminal", - "justMyCode": false, - "cwd": "${workspaceFolder}", - }, - { - "name": "Python: Pytest Current File", - "type": "debugpy", - "request": "launch", - "module": "pytest", + "module": "robotcode.ci", "args": [ - "${file}" + "debugger", + "--no-wait-for-client" ], - "console": "integratedTerminal", - "justMyCode": false, - "cwd": "${workspaceFolder}", }, { "name": "Python: robotcode language_server", @@ -208,72 +219,68 @@ ] }, { - "name": "Run Extension", + "name": "Extension Tests", "type": "extensionHost", "request": "launch", + "runtimeExecutable": "${execPath}", "args": [ "--extensionDevelopmentPath=${workspaceFolder}", + "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" ], - "debugWebviews": true, - "debugWebWorkerHost": true, "outFiles": [ - "${workspaceFolder}/out/**/*.js" + "${workspaceFolder}/out/test/**/*.js" ], "preLaunchTask": "npm: compile" }, { - "name": "Run Extension With Gherkin", + "name": "Run Extension", "type": "extensionHost", "request": "launch", "args": [ "--extensionDevelopmentPath=${workspaceFolder}", - "--extensionDevelopmentPath=${workspaceFolder}/../robotframework-gherkin-parser", ], + "debugWebviews": true, + "debugWebWorkerHost": true, "outFiles": [ "${workspaceFolder}/out/**/*.js" ], "preLaunchTask": "npm: compile" }, { - "name": "Extension Tests", + "name": "Run Extension With Gherkin", "type": "extensionHost", "request": "launch", - "runtimeExecutable": "${execPath}", "args": [ "--extensionDevelopmentPath=${workspaceFolder}", - "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" + "--extensionDevelopmentPath=${workspaceFolder}/../robotframework-gherkin-parser", ], "outFiles": [ - "${workspaceFolder}/out/test/**/*.js" + "${workspaceFolder}/out/**/*.js" ], "preLaunchTask": "npm: compile" }, { - "name": "Python: Debug Tests", - "type": "debugpy", - "request": "launch", - "program": "${file}", - "purpose": [ - "debug-test" + "name": "Attach to Node Process", + "port": 9229, + "request": "attach", + "skipFiles": [ + "/**" ], - "console": "integratedTerminal", - "justMyCode": false + "type": "node", + "autoAttachChildProcesses": true }, { - "name": "Python: Remote-Attach", - "type": "debugpy", - "request": "attach", - "connect": { - "host": "localhost", - "port": 5678 - }, - "pathMappings": [ - { - "localRoot": "${workspaceFolder}", - "remoteRoot": "." - } + "name": "esbuild.mjs", + "program": "${workspaceFolder}/esbuild.mjs", + "request": "launch", + "skipFiles": [ + "/**" ], - "justMyCode": true + "type": "node", + "console": "integratedTerminal", + "runtimeArgs": [ + "--experimental-modules" + ] } ], "inputs": [ diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3efa76dad..73ce3f13d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,12 +3,6 @@ { "version": "2.0.0", "tasks": [ - { - "label": "robotcode: lint fix", - "type": "shell", - "command": "hatch run lint:fix", - "problemMatcher": [] - }, { "label": "robotcode: lint all", "type": "shell", diff --git a/CHANGELOG.md b/CHANGELOG.md index 835b3c48b..f096a77a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,20 +2,159 @@ All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines. -## [Unreleased] +## [1.7.0](https://github.com/robotcodedev/robotcode/compare/v1.6.0..v1.7.0) - 2025-07-31 ### Bug Fixes +- **diagnostics:** Correct overriding of imported variables in suite variables ([afed6db](https://github.com/robotcodedev/robotcode/commit/afed6db7cf9d5293b62a01eaaeba621517894ebd)) + + +### Features + +- **docs:** Add generated llms.txt and llms-full.txt to website ([1f23559](https://github.com/robotcodedev/robotcode/commit/1f23559ff9f26cb2dd9977c001b883493f1f32b4)) + + +### Refactor + +- **jsonrpc:** Fix some spellings and split up some methods ([3c71ce6](https://github.com/robotcodedev/robotcode/commit/3c71ce64f8a797a4f0db925c2379800a3e48a987)) + + +## [1.6.0](https://github.com/robotcodedev/robotcode/compare/v1.5.0..v1.6.0) - 2025-07-30 + +### Bug Fixes + +- **core:** Remove unnecessary socket option for address reuse in find_free_port ([1ee754a](https://github.com/robotcodedev/robotcode/commit/1ee754abc7b27a8d2d70e15f39dad8ec0febc4da)) +- **debugger:** Enhance error handling in DAPClient and simplify port allocation for new testrun sessions ([43f242d](https://github.com/robotcodedev/robotcode/commit/43f242d61dc0e249e1912ac0d7be8df63478d802)) + + - every new test run gets it's own tcp port + +- **debugger:** Only sync when not in CallKeyword state ([709798a](https://github.com/robotcodedev/robotcode/commit/709798ac5cfbdf84ede7282d396bcae03a7e33f7)) + + +### Documentation + +- Remove robotframework-tidy from docs ([c259a0f](https://github.com/robotcodedev/robotcode/commit/c259a0f42819e25603ff333afdf6fc9c00b6b279)) + + +### Features + +- **debug:** Better synchronization between test view and execution in intellij-client, part 2 ([4ce87a2](https://github.com/robotcodedev/robotcode/commit/4ce87a2a86c72c944fab5de1288d08ecc33928e7)) +- **debugger:** Better synchronization between test view and execution in vscode, part 1 ([63c895f](https://github.com/robotcodedev/robotcode/commit/63c895f8d78ba0db64c32c4100ab09bf42941232)) +- **robotcode:** Remove robotframework-tidy from optional-dependencies ([205cfd1](https://github.com/robotcodedev/robotcode/commit/205cfd1a93aae3bfc4e062d1d16b0dd3ad2e4f98)) + + +### Refactor + +- **debugger:** Split get_variables method and splitup version specific behavior for exception handling ([c828202](https://github.com/robotcodedev/robotcode/commit/c828202021d8b0eb0e4862fec0e96713977cfe62)) +- **debugger:** Break down complex evaluate() method ([4c6b9af](https://github.com/robotcodedev/robotcode/commit/4c6b9afc988a0b4838e16bd9f57b4d57db278721)) +- **debugger:** Optimize cache management and improve regex matching performance ([2edfeea](https://github.com/robotcodedev/robotcode/commit/2edfeea3d884b486b19d3c6ab4b6e76e03572b57)) +- **debugger:** Enhance type safety by introducing protocols and type definitions for log messages and attributes ([a65b9b9](https://github.com/robotcodedev/robotcode/commit/a65b9b95cf66d3b513da2c50d1409a56887c9963)) +- **debugger:** Replace magic numbers with named constants for better readability ([65b0912](https://github.com/robotcodedev/robotcode/commit/65b091218e2ed5552e6d2a84ab61600ecbdc75a3)) +- **debugger:** Replace instance method calls with property access for consistency ([8ea82e4](https://github.com/robotcodedev/robotcode/commit/8ea82e45f4d343431aa42dfd525ed5ccb09d4df7)) +- **instructions:** Clarify implementation guidelines and communication flow ([b37be1c](https://github.com/robotcodedev/robotcode/commit/b37be1c683467ba4f3557127cb6337d5baad19c3)) +- **langserver:** Improve performance and memory consumption for semantic tokens ([e8297ff](https://github.com/robotcodedev/robotcode/commit/e8297ffc2f093cbab7eeff0bbecc7fba3dd5f330)) +- **langserver:** Remove unused semantic token types and update regression tests ([6b262b5](https://github.com/robotcodedev/robotcode/commit/6b262b54d3aa53e55f4661b289f7959baf1f260a)) +- **langserver:** Remove unused methods to simplify code ([96ba516](https://github.com/robotcodedev/robotcode/commit/96ba5162238fe04ca9b2473dcc512b94efc8cf7f)) +- **langserver:** Optimize memory consumption and perfomance in semantic token highlighter ([7e5e8e3](https://github.com/robotcodedev/robotcode/commit/7e5e8e3b9ebc0a3a1ce0a0dccee4cdf160d7bdb5)) +- **langserver:** Remove some unneeded casts ([c82a604](https://github.com/robotcodedev/robotcode/commit/c82a6040ea9b6d786e0af9cf5078780e2aaf7437)) + + +## [1.5.0](https://github.com/robotcodedev/robotcode/compare/v1.4.0..v1.5.0) - 2025-07-07 + +### Features + +- **cli:** Add new command line switch `--log-config` to specify a python json log configuration ([31a11f2](https://github.com/robotcodedev/robotcode/commit/31a11f27b96fba6c879218c9b13cdea5f8bb89c3)) +- **jsonrpcl:** Simplify error message formatting in JsonRPCProtocol for better readability in clients ([75614b0](https://github.com/robotcodedev/robotcode/commit/75614b05820f57c98c416949abced03970e0b429)) + + +### Refactor + +- **langserver:** Remove some unused code ([fa429a5](https://github.com/robotcodedev/robotcode/commit/fa429a502e1901cfc0d4126c4047994a5fd5ee39)) +- **langserver:** Simplify keyword renaming ([3836362](https://github.com/robotcodedev/robotcode/commit/3836362073599bcc32d9cb38425645d34d681f91)) +- **langserver:** Simplify variable renaming ([779fd70](https://github.com/robotcodedev/robotcode/commit/779fd703339ce81124f03f08b73e2639d0729212)) + + +### Testing + +- Update regression tests for RF 7.3.2 ([fd1b89a](https://github.com/robotcodedev/robotcode/commit/fd1b89ac17b1f378bc66c6d944afc92252f13ecf)) + + +## [1.4.0](https://github.com/robotcodedev/robotcode/compare/v1.3.0..v1.4.0) - 2025-06-30 + +### Bug Fixes + +- **langserver:** Remove timing messages from diagnostics in log ([c908485](https://github.com/robotcodedev/robotcode/commit/c90848514f713805fa330ccfc4344cc8775d0118)) + + - if you want to see it again, then you have to enable the log output for the language server + + + +### Documentation + +- Update Python and Robot Framework version requirements and deprecation notice ([6396b7e](https://github.com/robotcodedev/robotcode/commit/6396b7ef76fd8d41c3d79afc0bab871342eb8622)) + + +### Features + +- **langserver:** Improve and unify Robocop 6 configuration loading ([b3c5dd3](https://github.com/robotcodedev/robotcode/commit/b3c5dd3c50308116fc1e1de7adc156a6086cd8fd)) + + - Enhance configuration loading process + - Add notifications for faulty configurations + + + +### Refactor + +- Simpify some logging code ([5ea1ca1](https://github.com/robotcodedev/robotcode/commit/5ea1ca1c77269df8ebcc70e9a86e77a89d9249a6)) +- Switch lint environment to python 3.10 and corrected all linting errors and warnings ([19a2632](https://github.com/robotcodedev/robotcode/commit/19a26325454ba1b5e53b8548a16c0a3fbe8d5422)) + + +## [1.3.0](https://github.com/robotcodedev/robotcode/compare/v1.2.0..v1.3.0) - 2025-06-16 + +### Bug Fixes + +- **cli:** Set case_sensitive default to False in EnumChoice ([3fd27d4](https://github.com/robotcodedev/robotcode/commit/3fd27d47cec9f515bc618b330b2dccf1acc6255d)) - **cli:** Corrected monkey patching for click>=8.2.0 ([425e64d](https://github.com/robotcodedev/robotcode/commit/425e64ddf8c6a9a54ec6fe3d801253c2e3a2156a)) +- **debugger:** Improve termination handling ([a890264](https://github.com/robotcodedev/robotcode/commit/a890264547341c190eaef5e0240f0cc81deb3c70)) +- **formatting:** Improve message clarity for robocop formatting ([f71d15d](https://github.com/robotcodedev/robotcode/commit/f71d15df40f8bfd1f9f325d35e1ba73bcf16c9aa)) +- **imports:** Corrected caching of already loaded resources ([4606c4f](https://github.com/robotcodedev/robotcode/commit/4606c4ff12906b54edfeb1e29927f61b2130332c)) +- **langserver:** Implemented support for robocop >= 6 checks ([8dc2f3c](https://github.com/robotcodedev/robotcode/commit/8dc2f3ce94bf6c6a771b6ffcc6a969ae617397e6)) +- **langserver:** Disable on-demand startup for the documentation server to ensure it launches on initialization ([81d63fa](https://github.com/robotcodedev/robotcode/commit/81d63faa5f0cfbcf95e293c53daeb80840117438)) +- **listener:** Add 'robocop.toml' to monitored project files to allow detection of changes in robocop configuration ([987ea42](https://github.com/robotcodedev/robotcode/commit/987ea421f22b133851a462b921b7c3e1e5802a4a)) +- **net:** Move SO_REUSEADDR socket option setting to the correct location to speeding up port discovery and preventing bind failures. ([b54cc93](https://github.com/robotcodedev/robotcode/commit/b54cc9300abb4c7060bfa94cb2e1bfa272936eda)) - **textmate:** Corrected highlightning of comments in variable section ([5204afb](https://github.com/robotcodedev/robotcode/commit/5204afbfdd7f745c3e00ebc8d59fa3ad992ec0a8)) - **textmate:** Enhance variable assignment handling ([7333eb9](https://github.com/robotcodedev/robotcode/commit/7333eb9b2f46e2af25583af2d5346b4b92dd1137)) - Corrected detection of robocop ([f06bcbc](https://github.com/robotcodedev/robotcode/commit/f06bcbc1c2514326567399f8e5179da6ff5f9ed7)) +### Documentation + +- **contributing:** Enhance development setup and workflow instructions ([b23331b](https://github.com/robotcodedev/robotcode/commit/b23331b8622ddd97c2030de96212323f5e7d4171)) + + Updated the contributing guide to include detailed development environment setup options, IDE configuration, and a comprehensive development workflow. Improved clarity and added troubleshooting tips for common issues. + + + ### Features +- **analyzer:** Support for converting resolvable variables with types ([17123a0](https://github.com/robotcodedev/robotcode/commit/17123a046015e57fc64aa73f1227309b78bed4a2)) +- **analyzer:** Support for types in embedded arguments ([35526a0](https://github.com/robotcodedev/robotcode/commit/35526a05fbfdccc2a250f86a8fe3d51bf510607c)) +- **analyzer:** Improve 'keyword not found' messages for old `FOR:` syntax ([94cdc54](https://github.com/robotcodedev/robotcode/commit/94cdc54dd017e6e3892ead8a4cd9d8068b6b88ca)) +- **debugger:** Update delayed logging handling for Robot Framework 7.3 compatibility ([0b51afc](https://github.com/robotcodedev/robotcode/commit/0b51afce6acace2de358120dae365f190719cd05)) - **intellij:** Reimplement and simplified parsing and syntax highlightning ([2dcdf7c](https://github.com/robotcodedev/robotcode/commit/2dcdf7ce846e8483fb427cdc7945a084fe4c3232)) +- **langserver:** Show variable type in hover for RF 7.3 ([10d981f](https://github.com/robotcodedev/robotcode/commit/10d981f657ba34db1449984fe4a28623632c5b64)) +- **langserver:** Implemented robocop 6.0 formatting and deprecate old robotidy ([310bc54](https://github.com/robotcodedev/robotcode/commit/310bc544be8306fb85a329698763b562cd9d85aa)) - **langserver:** Better support for indexed assignments ([6fad9b1](https://github.com/robotcodedev/robotcode/commit/6fad9b161b85b2412b6a9d5169e69b4ce37c43c3)) +- **robot:** Unify variable handling and prepare for RF 7.3 type parsing ([73cda66](https://github.com/robotcodedev/robotcode/commit/73cda6698959fd3cbdce0901b87a40701cbe4966)) + + - Added support for parse_type parameter in Robot Framework 7.3+ + - Unified variable processing across different RF versions + +- **vscode:** Deprecate some robocop settings ([1b23965](https://github.com/robotcodedev/robotcode/commit/1b23965aec6dc00618bfe5c4927c9889f44cc4d1)) +- **vscode:** Add language model tool to get the library and resource imports from a robot file ([e5631f0](https://github.com/robotcodedev/robotcode/commit/e5631f042e42810b35d8694649cb76819b7b5866)) +- **vscode:** Add language model tools for retrieving library documentation and environment details ([a311e99](https://github.com/robotcodedev/robotcode/commit/a311e996cf95b2afaacc4b4402a4e2749b8d46bc)) +- **vscode:** Add deprecation messages for robotframework-tidy in configuration ([37c5371](https://github.com/robotcodedev/robotcode/commit/37c5371919d10a7ea1f46c91f1f7707b63fa96ce)) +- Basic support for Robot Framework 7.3 ([e6ffef7](https://github.com/robotcodedev/robotcode/commit/e6ffef7ded23ccab2bf3359891e5698f65a99ec4)) - Show editor hint for Python/Robot Framework issues instead of throwing error ([4c2a43b](https://github.com/robotcodedev/robotcode/commit/4c2a43b8fd2ece7f905fc10695f2d5b9487dc52a)) @@ -24,7 +163,14 @@ All notable changes to this project will be documented in this file. See [conven ### Refactor +- **analyzer:** Some renamings ([5f1f5c3](https://github.com/robotcodedev/robotcode/commit/5f1f5c37f62ae6cb32bf7a1db5c6ddbb592d8337)) - **intellij:** Some code cleanup ([479a9c3](https://github.com/robotcodedev/robotcode/commit/479a9c3e6b1bc117e5c1222953b755a198cbc8c2)) +- **vscode:** Some refactorings and code cleanup ([d8eac38](https://github.com/robotcodedev/robotcode/commit/d8eac3808e23320fcb7efa92e85c574988d1a7ef)) + + +### Testing + +- Update regression tests for RF 7.3.1 ([93bef41](https://github.com/robotcodedev/robotcode/commit/93bef414711e069fe097251892e3cc63fccf6392)) ## [1.2.0](https://github.com/robotcodedev/robotcode/compare/v1.1.0..v1.2.0) - 2025-05-07 @@ -3196,4 +3342,6 @@ All notable changes to this project will be documented in this file. See [conven - Add tests for workspace discovery ([61f82ce](https://github.com/robotcodedev/robotcode/commit/61f82ced19f227c311fea3b64c9b53394d92feeb)) +## [0.2.0](https://github.com/robotcodedev/robotcode/compare/v0.19.1..v0.2.0) - 2021-09-16 + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 05109c96f..e9554b827 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,12 +5,12 @@ First off, thanks for taking the time to contribute! ❤️ All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 -> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: -> - Star the project -> - Tweet about it -> - Refer this project in your project's readme -> - Mention the project at local meetups and tell your friends/colleagues -> - Sponsor this project by clicking on the sponsor button on the project page +And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: +- Star the project +- Tweet about it +- Refer this project in your project's readme +- Mention the project at local meetups and tell your friends/colleagues +- Sponsor this project by clicking on the sponsor button on the project page ## Table of Contents @@ -21,6 +21,15 @@ All types of contributions are encouraged and valued. See the [Table of Contents - [Reporting Bugs](#reporting-bugs) - [Suggesting Enhancements](#suggesting-enhancements) - [Your First Code Contribution](#your-first-code-contribution) + - [Development Environment Setup](#development-environment-setup) + - [IDE Configuration](#ide-configuration) + - [Development Workflow](#development-workflow) + - [Pull Request Guidelines](#pull-request-guidelines) + - [Running Tests](#running-tests) + - [Building the Project](#building-the-project) + - [Additional Development Commands](#additional-development-commands) + - [Troubleshooting Development Setup](#troubleshooting-development-setup) + - [Development Tools & Code Generation](#development-tools--code-generation) - [Improving The Documentation](#improving-the-documentation) - [Styleguides](#styleguides) - [Commit Messages](#commit-messages) @@ -37,7 +46,7 @@ to . ## I Have a Question -> If you want to ask a question, we assume that you have read the available [Documentation](https://robotcode.io). +If you want to ask a question, we assume that you have read the available [Documentation](https://robotcode.io). Before you ask a question, it is best to search for existing [Issues](https://github.com/robotcodedev/robotcode/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. @@ -80,7 +89,9 @@ A good bug report shouldn't leave others needing to chase you up for more inform - Make sure that you are using the latest version. - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://robotcode.io). If you are looking for support, you might want to check [this section](#i-have-a-question)). -- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/robotcodedev/robotcodeissues?q=label%3Abug). +- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/robotcodedev/robotcode/issues?q=label%3Abug). +- Look or ask in the [Robot Framework Slack](https://robotframework.slack.com) in the channel [#vscode](https://robotframework.slack.com/archives/C0103745J7P) or in the [Robot Framework Forum](https://forum.robotframework.org) in the [Tools/Visual Studio Code(ium)](https://forum.robotframework.org/c/tools/vscode/28) category to see if other users have experienced (and potentially already solved) the same issue you are having. + - for questions about the intellj plugin there are also channels for pycharm - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. - Collect information about the bug: - Stack trace (Traceback) @@ -137,33 +148,419 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/robotc ### Your First Code Contribution - +Welcome to your first code contribution! Here's how to set up your development environment and get started. + +#### Development Environment Setup + +**Option 1: Using GitHub Codespaces (Easiest)** + +The quickest way to get started without any local setup: + +1. **Setup:** + - Go to the [robotcode repository](https://github.com/robotcodedev/robotcode) + - Click the green "Code" button + - Select "Codespaces" tab + - Click "Create codespace on main" + - Wait for the codespace to initialize (this uses the same dev container configuration) + +GitHub Codespaces provides a full VS Code environment in your browser with all dependencies pre-installed. + +**Option 2: Using Dev Container (Local)** + +For local development with containers: + +1. **Prerequisites:** + - Install [Docker](https://www.docker.com/get-started) + - Install [Visual Studio Code](https://code.visualstudio.com/) + - Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) + +2. **Setup:** + - Clone the repository: `git clone https://github.com/robotcodedev/robotcode.git` + - Open the project in VS Code + - When prompted, click "Reopen in Container" or use the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`) and select "Dev Containers: Reopen in Container" + - The container will automatically install all dependencies including Python, Node.js, and required packages + +**Option 3: Local Development** + +If you prefer to set up locally: + +1. **Prerequisites:** + - Python 3.8+ (system Python is fine) + - Node.js 16+ + - Git + +2. **Setup:** + ```bash + git clone https://github.com/robotcodedev/robotcode.git + cd robotcode + + # Install Hatch (choose one method): + # Option A: Using system package manager (if available) + # Ubuntu/Debian: sudo apt install hatch + # Fedora: sudo dnf install hatch + # Arch: sudo pacman -S hatch + + # Option B: Using pipx (recommended if not in package manager) + pip install pipx + pipx install hatch + + # Option C: Check https://hatch.pypa.io/latest/install/ for other methods + + # Create development environment + hatch env create devel + + # install needed packages for the vscode and intellij packaging + hatch run build:install-bundled-editable -TODO... + # Install Node.js dependencies + npm install --also-dev + ``` + +#### IDE Configuration + +The project includes VS Code settings optimized for development: +- Python testing with pytest +- Code formatting with Prettier and Ruff +- Type checking with mypy +- Debugging configuration +- Recommended extensions are automatically suggested + +**Important: Python Interpreter Selection** + +After setting up the development environment with `hatch env create devel`, you need to select the correct Python interpreter in VS Code: + +1. Open the Command Palette (`Cmd+Shift+P` or `Ctrl+Shift+P` or `F1`) +2. Type "Python: Select Interpreter" +3. Choose the interpreter from the Hatch environment +4. Select the desired Python/Robot Framework version environment + +Hatch creates separate Python environments for each supported Python/Robot Framework version combination in your system's cache directory. + +You can also check available environments with: `hatch env show` + +#### Development Workflow + +1. **Create a branch:** `git checkout -b feature/your-feature-name` +2. **Make your changes** following the project's coding standards +3. **Run tests:** `hatch run devel.py312-rf73:test` (single combination for faster development) +4. **Run linting:** `hatch run lint:all` (or use the VS Code task) +5. **Fix linting issues:** `hatch run lint:style` for formatting +6. **Commit your changes** with a descriptive commit message +7. **Push and create a pull request** + +#### Pull Request Guidelines + +Before submitting your pull request: + +1. **Ensure all tests pass:** Run `hatch run test.rf73:test` (or your preferred combination) +2. **Check linting:** Run `hatch run lint:all` and fix any issues +3. **Write descriptive PR description:** + - Explain what changes you made and why + - Reference any related issues + - Include screenshots for UI changes + - List any breaking changes +4. **Keep PRs focused:** One feature/fix per PR when possible +5. **Update documentation:** Include relevant documentation updates +6. **Sign your commits:** All commits must be signed (see [Signed Commits](#signed-commits-required)) + +**PR Review Process:** +- Automated checks must pass (tests, linting, etc.) +- At least one maintainer review is required +- Address any feedback promptly +- Keep your PR up to date with the main branch + +#### Running Tests + +**Basic Test Execution:** +- Use VS Code's built-in test runner (Testing tab in the sidebar) +- Or run from terminal: `hatch run test` (⚠️ **Warning**: This runs tests against ALL Python/Robot Framework combinations in the matrix - can take a very long time!) +- Run specific tests: `hatch run test tests/specific_test.py` (also runs against all matrix combinations) + +**Testing with Specific Python/Robot Framework Versions:** + +The project supports multiple Python and Robot Framework versions. You can run tests against specific combinations: + +```bash +# Run tests with specific Robot Framework versions (single combination) +hatch run test:test # ⚠️ Runs ALL matrix combinations (RF 4.1-7.3) +hatch run test.rf70:test # Robot Framework 7.0.x +hatch run test.rf71:test # Robot Framework 7.1.x +hatch run test.rf72:test # Robot Framework 7.2.x +hatch run test.rf73:test # Robot Framework 7.3.x (recommended for development) +hatch run test.rf61:test # Robot Framework 6.1.x +hatch run test.rf60:test # Robot Framework 6.0.x +hatch run test.rf50:test # Robot Framework 5.0.x +hatch run test.rf41:test # Robot Framework 4.1.x + +# Run tests in specific development environments (single combination) +hatch run devel:test # ⚠️ Runs ALL matrix combinations (Python 3.8-3.13 × RF 4.1-7.3) +hatch run devel.py39-rf73:test # Python 3.9 with Robot Framework 7.3.x (single combination) +hatch run devel.py311-rf70:test # Python 3.11 with Robot Framework 7.0.x (single combination) +hatch run devel.py312-rf73:test # Python 3.12 with Robot Framework 7.3.x (single combination) +hatch run devel.py313-rf73:test # Python 3.13 with Robot Framework 7.3.x (single combination) + +# Test against development versions of Robot Framework +hatch run rfbeta:test # Robot Framework beta/RC versions +hatch run rfmaster:test # Robot Framework master branch +hatch run rfdevel:test # Local Robot Framework development version +``` + +**⚠️ Important Matrix Behavior:** +- `hatch run test` executes tests for **all combinations** in the matrix (48 combinations: 6 Python versions × 8 RF versions) +- `hatch run devel:test` also runs **all matrix combinations** +- For faster development, use specific combinations like `hatch run devel.py312-rf73:test` +- For CI/full testing, use the matrix commands + +**Available Environment Matrix:** +- **Python versions**: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 +- **Robot Framework versions**: 4.1.x, 5.0.x, 6.0.x, 6.1.x, 7.0.x, 7.1.x, 7.2.x, 7.3.x + +#### Building the Project + +- Package for distribution: `hatch run build:package` + +#### Additional Development Commands + +**Code Quality & Linting:** +- Type checking: `hatch run lint:typing` +- Code style check and formatting: `hatch run lint:style` +- Run all linting checks: `hatch run lint:all` + +**Project Maintenance & Code Generation:** +- Generate Robot Framework syntax files: `hatch run generate-tmlanguage` +- Create JSON schema for robot.toml: `hatch run create-json-schema` +- Generate Robot Framework options: `hatch run generate-rf-options` +- Install bundled packages in editable mode: `hatch run build:install-bundled-editable` + +**Release & Documentation:** +- Update changelog: `hatch run build:update-changelog` +- Update git versions: `hatch run build:update-git-versions` +- Bump version: `hatch run build:bump [major|minor|patch]` +- Package for distribution: `hatch run build:package` +- Publish to PyPI, VS Code Marketplace, etc.: `hatch run build:publish` + - you need the specific credentials set up in your environment for this to work + +#### Troubleshooting Development Setup + +**Common Issues:** + +1. **Hatch environment creation fails:** + ```bash + # Clear Hatch cache and try again + hatch env prune + hatch env create devel + ``` + +2. **VS Code doesn't find the Python interpreter:** + - Use `hatch env find devel` to get the exact path + - Manually select the interpreter in VS Code using this path + +3. **Tests fail with import errors:** + - Ensure you're in the correct hatch environment + - Run `hatch run build:install-bundled-editable` to install development packages + +4. **Node.js dependencies issues:** + ```bash + # Clean and reinstall npm dependencies + rm -rf node_modules package-lock.json + npm install --also-dev + ``` + +#### Development Tools & Code Generation + +The robotcode project includes several development tools and code generation scripts: + +**Syntax & Language Support:** +- `hatch run generate-tmlanguage` - Regenerate VS Code syntax highlighting files for Robot Framework +- `hatch run create-json-schema` - Create JSON schema for robot.toml configuration validation +- `hatch run generate-rf-options` - Generate Robot Framework command-line options documentation + +**Maintenance & Release Tools:** +- `hatch run build:update-changelog` - Update project changelog +- `hatch run build:update-git-versions` - Update version information from git +- `hatch run build:update-doc-links` - Update documentation links +- `hatch run build:bump [major|minor|patch]` - Bump project version using semantic versioning + +These tools are typically used by maintainers, but contributors might need some of them when working on specific features (e.g., syntax highlighting changes require `generate-tmlanguage`). ### Improving The Documentation - +Documentation is crucial for helping users understand and use robotcode effectively. Here are ways you can help improve it: + +#### Types of Documentation Contributions + +1. **User Documentation** (`docs/` folder) + - Getting started guides + - Feature explanations + - Configuration examples + - Troubleshooting guides + +2. **Code Documentation** + - Docstrings for classes and functions + - Inline comments for complex logic + - Type hints and annotations + +3. **README Updates** + - Installation instructions + - Quick start examples + - Feature highlights + +#### Documentation Setup + +The documentation is built using modern web technologies and is located in the `docs/` folder: -TODO ... +```bash +cd docs +npm install +npm run dev # Start development server at http://localhost:3000 +npm run build # Build for production +npm run preview # Preview production build +``` + +#### Documentation Standards + +- **Clear and concise:** Write for users of all skill levels +- **Examples:** Include practical code examples +- **Screenshots:** Add visual aids where helpful (stored in `docs/images/`) +- **Links:** Reference related concepts and external resources +- **Testing:** Verify that code examples actually work + +#### Making Documentation Changes + +1. **Small fixes:** Edit files directly and submit a pull request +2. **Major changes:** Open an issue first to discuss the approach +3. **New sections:** Follow the existing structure in the `docs/` folder +4. **Images:** Store in `docs/images/` and use relative paths + +#### Documentation Review Process + +- All documentation changes go through the same review process as code +- Maintainers will check for accuracy, clarity, and consistency +- Community feedback is encouraged on documentation pull requests ## Styleguides ### Commit Messages - +Good commit messages help maintain a clean project history and make it easier to understand changes. Please follow these guidelines: + +#### Format + +``` +(): + + + +