|
1 | | -# RobotCode - Language support for Robot Framework for Visual Studio Code |
2 | 1 |
|
3 | | -[](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode) |
| 2 | +# RobotCode - Language Support for Robot Framework in Visual Studio Code |
| 3 | + |
| 4 | +[](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode) |
4 | 5 | [](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode) |
5 | 6 | [](https://github.com/robotcodedev/robotcode/actions?query=workflow:build_test_package_publish) |
6 | 7 | [](https://github.com/robotcodedev/robotcode/blob/master/LICENSE) |
7 | 8 |
|
8 | 9 | [](https://pypi.org/project/robotcode) |
9 | | -[](https://pypi.org/project/robotcode) |
10 | | -[](https://pypi.org/project/robotcode/) |
11 | | - |
12 | | ----- |
13 | | - |
14 | | -An [extension](https://marketplace.visualstudio.com/VSCode) which brings support for [RobotFramework](https://robotframework.org/) |
15 | | -to [Visual Studio Code](https://code.visualstudio.com/), including [features](#features) like code completion, debugging, test explorer, refactoring and more! |
| 10 | +[](https://pypi.org/project/robotcode) |
| 11 | +[](https://pypi.org/project/robotcode) |
16 | 12 |
|
17 | | -## Quick start |
| 13 | +--- |
18 | 14 |
|
19 | | -1. [Install a supported version of Python on your system](https://code.visualstudio.com/docs/python/python-tutorial#_prerequisites) |
20 | | -(note: only Python 3.8 and above are supported) |
| 15 | +**RobotCode** is a Visual Studio Code extension that enhances your workflow with [Robot Framework](https://robotframework.org/). It offers features like code completion, debugging, test discovery and execution, refactoring, and more! |
21 | 16 |
|
22 | | -2. [Install a supported version of RobotFramwork on your system](https://github.com/robotframework/robotframework/blob/master/INSTALL.rst) (note: only RobotFramework 4.1 and above are supported) |
23 | | - |
24 | | -3. [Install the RobotCode extension for Visual Studio Code](https://code.visualstudio.com/docs/editor/extension-gallery). |
25 | | -4. Open or create a robot file and start coding! 😉 |
| 17 | +## Key Features |
26 | 18 |
|
| 19 | +- **Code Editing**: Enjoy code auto-completion, navigation, syntax checking, and more. |
| 20 | +- **Command Line Tools**: A wide array of tools to assist in setting up and managing Robot Framework environments. |
| 21 | +- **Code Formatting**: Format your code using Robot Framework’s built-in tools like `robot.tidy` or [Robotidy](https://robotidy.readthedocs.io/). |
| 22 | +- **Test Running and Debugging**: Run and debug Robot Framework test cases directly within VS Code. |
| 23 | +- **Multi-root Workspace Support**: Manage multiple Robot Framework projects with different Python environments simultaneously. |
| 24 | +- **Code Analysis with Robocop**: Install [Robocop](https://robocop.readthedocs.io/) for additional code analysis. |
27 | 25 |
|
28 | 26 | ## Requirements |
29 | 27 |
|
30 | | -* Python 3.8 or above |
31 | | -* Robotframework 4.1 and above |
32 | | -* VSCode version 1.82 and above |
33 | | - |
34 | | - |
35 | | -## Features |
36 | | - |
37 | | -With RobotCode you can edit your code with auto-completion, code navigation, syntax checking and many more. |
38 | | -Here is a list of Features: |
39 | | - |
40 | | -- [RobotCode - Language support for Robot Framework for Visual Studio Code](#robotcode---language-support-for-robot-framework-for-visual-studio-code) |
41 | | - - [Quick start](#quick-start) |
42 | | - - [Requirements](#requirements) |
43 | | - - [Features](#features) |
44 | | - - [Autocomplete and IntelliSense](#autocomplete-and-intellisense) |
45 | | - - [Code Navigation](#code-navigation) |
46 | | - - [Diagnostics and Linting](#diagnostics-and-linting) |
47 | | - - [Code Formatting](#code-formatting) |
48 | | - - [Running and Debugging](#running-and-debugging) |
49 | | - - [Multi-root Workspace folders](#multi-root-workspace-folders) |
50 | | - - [Installed extensions](#installed-extensions) |
51 | | - - [Setting up your environment](#setting-up-your-environment) |
52 | | - - [With pipenv](#with-pipenv) |
53 | | - - [Customization](#customization) |
54 | | - - [Editor Style](#editor-style) |
55 | | - |
56 | | -### Autocomplete and IntelliSense |
57 | | - |
58 | | -Autocompletion for: |
59 | | -- Libraries with parameters |
60 | | -- Resources, |
61 | | -- Variables |
62 | | -- Keywords with parameters |
63 | | -- Namespaces |
64 | | - |
65 | | - |
66 | | - |
67 | | -Autocompletion supports all supported variables types |
68 | | - - local variables |
69 | | - - variables from resource files |
70 | | - - variables from variables file (.py and .yaml) |
71 | | - - static and dynamic |
72 | | - - command line variables |
73 | | - - builtin variables |
74 | | - |
75 | | - |
76 | | - |
77 | | -### Code Navigation |
78 | | - |
79 | | -- Symbols |
80 | | -- Goto definitions and implementations |
81 | | - - Keywords |
82 | | - - Variables |
83 | | - - Libraries |
84 | | - - Resources |
85 | | -- Find references |
86 | | - - Keywords |
87 | | - - Variables |
88 | | - - Imports |
89 | | - - Libraries |
90 | | - - Resources |
91 | | - - Variables |
92 | | - - Tags |
93 | | -- Errors and Warnings |
94 | | - |
95 | | -### Diagnostics and Linting |
96 | | - |
97 | | -RobotCode analyse your code and show diagnostics for: |
98 | | -- Syntax Errors |
99 | | -- Unknown keywords |
100 | | -- Duplicate keywords |
101 | | -- Missing libraries, resource and variable imports |
102 | | -- Duplicate libraries, resource and variable imports |
103 | | -- ... and many more |
104 | | - |
105 | | -For most things RobotCode uses the installed RobotFramework version to parse and analyse the code, so you get the same errors as when you run it. |
106 | | - |
107 | | - |
108 | | -Get additional code analysis with [Robocop](https://robocop.readthedocs.io/). Just install it in your python environment. |
109 | | - |
110 | | -### Code Formatting |
111 | | - |
112 | | -RobotCode can format your code with the internal RobotFramework robot.tidy tool (deprecated), but also with [Robotidy](https://robotidy.readthedocs.io/). Just install it. |
113 | | - |
114 | | -### Running and Debugging |
115 | | - |
116 | | -RobotCode supports running and debugging of RobotFramework testcases and tasks out of the box, directly from the definition of the test or suite. |
117 | | - |
118 | | - |
119 | | - |
120 | | -In the debug console you can see all log messages of the current run and navigate to the keyword the message was written by. |
121 | | - |
122 | | -### Multi-root Workspace folders |
123 | | - |
124 | | -RobotCodes support for [Multi-root Workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces), enables loading and editing different Robotframework projects/folders with different RobotFramework/Python environments and settings at the same time or you can share the same RobotFramework/Python environment and settings for all folders in the workspace. |
125 | | - |
126 | | - |
127 | | -## Installed extensions |
128 | | - |
129 | | -RobotCode will automatically install [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python). |
130 | | - |
131 | | -Extensions installed through the marketplace are subject to the [Marketplace Terms of Use](https://cdn.vsassets.io/v/M146_20190123.39/_content/Microsoft-Visual-Studio-Marketplace-Terms-of-Use.pdf). |
132 | | - |
133 | | - |
134 | | -## Setting up your environment |
135 | | - |
136 | | -You can alway use your local python environment, just select the correct python interpreter in Visual Studio Code. |
137 | | - |
138 | | -### With pipenv |
139 | | - |
140 | | -This is the simpliest way to create an running environment. |
141 | | - |
142 | | -- As a prerequisite you need to install [pipenv](https://pipenv.pypa.io/) like this: |
143 | | - |
144 | | - ```bash |
145 | | - python -m pip install pipenv |
146 | | - ``` |
147 | | - |
148 | | - |
149 | | -- Create your project directory (robottest is just an example) |
150 | | - ```bash |
151 | | - mkdir robottest |
152 | | - cd robottest |
153 | | - ``` |
154 | | -- Install robotframework |
155 | | - ```bash |
156 | | - python -m pipenv install robotframework |
157 | | - ``` |
158 | | -- Open project in VSCode |
159 | | -- Set the python interpreter to the created virtual environment |
160 | | - |
161 | | - |
162 | | -## Customization |
163 | | - |
164 | | -### Editor Style |
165 | | - |
166 | | -You can change some stylings for RobotFramework files in VSCode editor, independently of the current theme. (see [Customizing a Color Theme](https://code.visualstudio.com/docs/getstarted/themes#_customizing-a-color-theme)) |
167 | | - |
168 | | -See the difference: |
169 | | - |
170 | | -| Before | After | |
171 | | -| ---------------------------------------------------------------- | ---------------------------------------------------------- | |
172 | | -|  |  | |
173 | | - |
| 28 | +- Python 3.8 or newer |
| 29 | +- Robot Framework 4.1 or newer |
| 30 | +- Visual Studio Code 1.86 or newer |
174 | 31 |
|
175 | | -As a template you can put the following code to your user settings of VSCode. |
| 32 | +## Getting Started |
176 | 33 |
|
177 | | -Open the user `settings.json` like this: |
| 34 | +1. Install the [RobotCode extension](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode) from the Visual Studio Marketplace. |
| 35 | +2. Configure your Robot Framework environment with the command-line tools provided by the extension. |
| 36 | +3. Start writing and running your Robot Framework tests! |
178 | 37 |
|
179 | | -<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd> or <kbd>CMD</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> |
| 38 | +For a more detailed guide, check out the [Let's get started](https://robotcode.io/02_get_started/) Guide on the [RobotCode](https://robotcode.io) website. |
180 | 39 |
|
181 | | -and then type: |
| 40 | +## Extensions |
182 | 41 |
|
183 | | -`Preferences: Open Settings (JSON)` |
| 42 | +RobotCode automatically installs the [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) and the [Python Debugger](https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy) extension. Additional extensions may be required depending on your project needs. |
184 | 43 |
|
185 | | -put this to the `settings.json` |
| 44 | +## Documentation |
186 | 45 |
|
187 | | -```jsonc |
188 | | -"editor.tokenColorCustomizations": { |
189 | | - "textMateRules": [ |
190 | | - { |
191 | | - "scope": "variable.function.keyword-call.inner.robotframework", |
192 | | - "settings": { |
193 | | - "fontStyle": "italic" |
194 | | - } |
195 | | - }, |
196 | | - { |
197 | | - "scope": "variable.function.keyword-call.robotframework", |
198 | | - "settings": { |
199 | | - //"fontStyle": "bold" |
200 | | - } |
201 | | - }, |
202 | | - { |
203 | | - "scope": "string.unquoted.embeddedArgument.robotframework", |
204 | | - "settings": { |
205 | | - "fontStyle": "italic" |
206 | | - } |
207 | | - }, |
208 | | - { |
209 | | - "scope": "entity.name.function.testcase.name.robotframework", |
210 | | - "settings": { |
211 | | - "fontStyle": "bold underline" |
212 | | - } |
213 | | - }, |
214 | | - { |
215 | | - "scope": "entity.name.function.keyword.name.robotframework", |
216 | | - "settings": { |
217 | | - "fontStyle": "bold italic" |
218 | | - } |
219 | | - }, |
220 | | - { |
221 | | - "scope": "variable.name.readwrite.robotframework", |
222 | | - "settings": { |
223 | | - //"fontStyle": "italic", |
224 | | - } |
225 | | - }, |
226 | | - { |
227 | | - "scope": "keyword.control.import.robotframework", |
228 | | - "settings": { |
229 | | - "fontStyle": "italic" |
230 | | - } |
231 | | - }, |
232 | | - { |
233 | | - "scope": "keyword.other.header.setting.robotframework", |
234 | | - "settings": { |
235 | | - "fontStyle": "bold underline" |
236 | | - } |
237 | | - }, |
238 | | - { |
239 | | - "scope": "keyword.other.header.variable.robotframework", |
240 | | - "settings": { |
241 | | - "fontStyle": "bold underline" |
242 | | - } |
243 | | - }, |
244 | | - { |
245 | | - "scope": "keyword.other.header.testcase.robotframework", |
246 | | - "settings": { |
247 | | - "fontStyle": "bold underline" |
248 | | - } |
249 | | - }, |
250 | | - { |
251 | | - "scope": "keyword.other.header.keyword.robotframework", |
252 | | - "settings": { |
253 | | - "fontStyle": "bold underline" |
254 | | - } |
255 | | - }, |
256 | | - { |
257 | | - "scope": "keyword.other.header.setting.robotframework", |
258 | | - "settings": { |
259 | | - "fontStyle": "bold underline" |
260 | | - } |
261 | | - }, |
262 | | - { |
263 | | - "scope": "keyword.other.header.comment.robotframework", |
264 | | - "settings": { |
265 | | - "fontStyle": "bold italic underline" |
266 | | - } |
267 | | - }, |
268 | | - { |
269 | | - "scope": "string.unquoted.escape.robotframework", |
270 | | - "settings": { |
271 | | - //"foreground": "#FF0000", |
272 | | - } |
273 | | - } |
274 | | - ] |
275 | | -}, |
| 46 | +For more details on installation, setup, and usage, refer to the [official RobotCode documentation](https://robotcode.io). |
276 | 47 |
|
277 | | -"editor.semanticTokenColorCustomizations": { |
278 | | - "rules": { |
279 | | - "*.documentation:robotframework": { |
280 | | - "fontStyle": "italic", |
281 | | - //"foreground": "#aaaaaa" |
282 | | - } |
283 | | - } |
284 | | -} |
| 48 | +## License |
285 | 49 |
|
286 | | -``` |
| 50 | +This project is licensed under the [Apache 2.0 License](https://spdx.org/licenses/Apache-2.0.html). |
0 commit comments