Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e379f64
Development version
HelioGuilherme66 Jan 29, 2025
53c2fac
Fix bad selection of items in Project Explorer with Right Click.
HelioGuilherme66 Jan 30, 2025
683ba00
Simplify execution with .exe. Removed main panel scrollbars at Grid E…
HelioGuilherme66 Feb 8, 2025
4c3aefe
update package w/ to solve upgrade rom dev
HelioGuilherme66 Feb 13, 2025
12a1721
update docs
HelioGuilherme66 Feb 13, 2025
4e9db26
Improve restoring of preferences/configobj when upgrade from development
HelioGuilherme66 Feb 13, 2025
7282955
Add syntax colorization for GROUP marker. Improve Gherking recognitio…
HelioGuilherme66 Feb 14, 2025
b1838a4
Improve localized Gherkin in Grid Editor
HelioGuilherme66 Feb 16, 2025
2f834a6
Improve Gherkin recognition for localized docs in autocomplete
HelioGuilherme66 Feb 16, 2025
5c4db64
Create directory in New Project dialog, if needed.
HelioGuilherme66 Feb 17, 2025
5fc5595
Update README.adoc
HelioGuilherme66 Feb 17, 2025
babf686
Add tab marker lines to Text Editor. Ongoing collapse/expand blocks.
HelioGuilherme66 Feb 17, 2025
1195bbb
Add folding markers in Text Editor
HelioGuilherme66 Feb 18, 2025
3daec3a
Fix colors of line numbers in Text Editor, add folding and tab markers
HelioGuilherme66 Feb 20, 2025
5cd453e
Fix broken Code Editor launch
HelioGuilherme66 Feb 21, 2025
5c66c19
Fix text color in row labels in Grid Editor
HelioGuilherme66 Feb 22, 2025
ba1381d
First increment in autocomplete Text Editor, breaks Editor.
HelioGuilherme66 Feb 24, 2025
6dbcb73
Improve autocomplete in Editor
HelioGuilherme66 Feb 27, 2025
64f6109
Remove details fo str in Editor, improve autocomplete list TextEditor
HelioGuilherme66 Mar 1, 2025
3a6af93
Better but slower autocomplete list TextEditor
HelioGuilherme66 Mar 3, 2025
24c3bc3
DEBUG get_suggestions, returning many non matching words
HelioGuilherme66 Mar 3, 2025
2b42d24
More debuggings on TextEditor
HelioGuilherme66 Mar 4, 2025
de8c31c
Fixed matchin list on TextEditor
HelioGuilherme66 Mar 6, 2025
49fdf1b
Increase unit tests
HelioGuilherme66 Mar 17, 2025
6f0d8ee
Improve autocomplete lists
HelioGuilherme66 Mar 17, 2025
7771dd6
Set SonarQube project version to 2.1.3
HelioGuilherme66 Mar 18, 2025
59bbe28
When saving in Text Editor the cursor remains at position
HelioGuilherme66 Mar 22, 2025
2294b7f
Improve search element in Text Edit. Does not tab after autocomplete.
HelioGuilherme66 Mar 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@ All notable changes to this project will be documented in this file.
The format is based on http://keepachangelog.com/en/1.0.0/[Keep a Changelog]
and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioning].

<!-- == https://github.com/robotframework/RIDE[Unreleased] -->
== https://github.com/robotframework/RIDE[Unreleased]

=== Added
- Added syntax colorization for the ``GROUP`` marker.
- Added on Text Editor, tab indentation markers and ``tab markers`` boolean setting with default ``True``.
- Added on Text Editor, folding margin with markers style configurable with ``fold symbols`` in settings.cfg.

=== Changed
- Better Search element in Text Editor which allows to be cleared.
- When saving in Text Editor, the cursor remains at position, instead of jumping to Tree selection.
- Improved autocompletion lists, by using existing words in Test Suite file (still needs more improvements).
- Create directories when needed in New Project dialog.
- Improved the recognition of BDD/Gherkin prefixes when localized in autocomplete on Grid Editor.
- Improved colorization for multiple Gherkin words, for example in the French language.

=== Fixed
- Fixed not set text color on row labels in Grid Editor. Now the General ``secondary foreground`` is applied.
- Fixed multiple scroll bars in Grid Editor when editing Test Cases or Keywords. This caused bad navigation on cells.
- Regression fix from v2.1b1 - Fix wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.
When right clicking over Tree elements, to, for example, expand or select tests, we want to keep the Editor in the same file or position.

== https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride-2.1.2.rst[2.1.2] - 2025-01-28

Expand Down
8 changes: 4 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ See the https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride
**Version https://github.com/robotframework/RIDE/tree/release/1.7.4.2[1.7.4.2] was the last release supporting Python 2.7**


**The current development version is based on 2.1,2, supports Python from 3.8 up to 3.13 (28th January 2025).**
**The current development version is based on 2.1.2, supports Python from 3.8 up to 3.13 (28th January 2025).**

Currently, the unit tests are tested on Python 3.10, 3.11 and 3.13 (but 3.12 is the recommended version).
Currently, the unit tests are tested on Python 3.10, 3.11 and 3.13 (3.13 is the recommended version).
Likewise, the current version of wxPython, is 4.2.2, but RIDE is known to work with 4.0.7 and 4.1.1 versions.

(3.8 &lt;= python &lt;= 3.12) Install current released version (*2.1.2*) with:
(3.8 &lt;= python &lt;= 3.13) Install current released version (*2.1.2*) with:

`pip install -U robotframework-ride`

(3.8 &lt;= python &lt;= 3.13) Install current development version (**2.1.2**) with:
(3.8 &lt;= python &lt;= 3.13) Install current development version (**2.2dev14**) with:

`pip install -U https://github.com/robotframework/RIDE/archive/develop.zip`

Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sonar.projectKey=HelioGuilherme66_RIDE
sonar.organization=helioguilherme66
sonar.host.url=https://sonarcloud.io
sonar.python.version=3.10
sonar.projectVersion=v2.1
sonar.projectVersion=v2.1.3
sonar.sources=src/
sonar.tests=utest/
sonar.exclusions=**/lib/robot/**/*
Expand Down
2 changes: 1 addition & 1 deletion src/robotide/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def writelines(self, sequence):
""" Override """
pass

if sys.executable.endswith('pythonw.exe'):
if sys.executable.endswith('.exe'):
# In windows, when launching RIDE with pythonw.exe
# sys.stderr and sys.stdout will be None
if sys.stderr is None:
Expand Down
123 changes: 74 additions & 49 deletions src/robotide/application/CHANGELOG.html

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def set_content(self, html_win, content):
<p><a class="reference external" href="https://github.com/robotframework/RIDE/">RIDE (Robot Framework IDE)</a>
{VERSION} is a new release with some enhancements and bug fixes. The reference for valid arguments is
<a class="reference external" href="https://robotframework.org/">Robot Framework</a> previous version, which was 7.1.1
(currently is 7.2). However, internal library code is originally based on version 3.1.2, but adapted for new versions.</p>
(currently is 7.2.2). However, internal library code is originally based on version 3.1.2, but adapted for new versions.</p>
<ul class="simple">
<li>This version supports Python 3.8 up to 3.13.</li>
<li>There are some changes, or known issues:<ul>
Expand All @@ -168,8 +168,19 @@ def set_content(self, html_win, content):
</ul>
<p><strong>New Features and Fixes Highlights</strong></p>
<ul class="simple">
<li><em>Partial fix</em> of no update of renaming resource prefixed keywords. Issue #1230 from 29 Jan 2013.</li>
<li>Fixed no recognition of keywords with embedded arguments and full name. Issue #1106 from 12 Sep 2012.</li>
<li>Better Search element in Text Editor which allows to be cleared.</li>
<li>When saving in Text Editor, the cursor remains at position, instead of jumping to Tree selection.</li>
<li>Improved autocompletion lists, by using existing words in Test Suite file (still needs more improvements).</li>
<li>Fixed not set text color on row labels in Grid Editor. Now the General <b>secondary foreground</b> is applied.</li>
<li>Added on Text Editor, tab indentation markers and <b>tab markers</b> boolean setting with default <b>True</b>.</li>
<li>Added on Text Editor, folding margin with markers style configurable with <b>fold symbols</b> in settings.cfg.</li>
<li>Create directories when needed in New Project dialog.</li>
<li>Improved the recognition of BDD/Gherkin prefixes when localized in autocomplete on Grid Editor.</li>
<li>Added syntax colorization for the <em>GROUP</em> marker. Improved colorization for multiple Gherkin words, for
example in the French language.</li>
<li>Fixed multiple scroll bars in Grid Editor when editing Test Cases or Keywords. This caused bad navigation on cells.</li>
<li>Regression fix from v2.1b1 - Fix wrong item selection, like Test Suite, when doing right-click actions in
Project Explorer.</li>
</ul>
<!-- <p>We hope to implement or complete features and make fixes on next major version 2.1 (in mid Autumm of 2024).</p>
-->
Expand Down Expand Up @@ -224,7 +235,7 @@ def set_content(self, html_win, content):
<pre class="literal-block">python -m robotide.postinstall -install</pre>
<p>or</p>
<pre class="literal-block">ride_postinstall.py -install</pre>
<p>RIDE {VERSION} was released on 28/January/2025.</p>
<p>RIDE {VERSION} was released on 24/March/2025.</p>
<!-- <br/>
<h3>May The Fourth Be With You!</h3>
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>
Expand Down
25 changes: 24 additions & 1 deletion src/robotide/application/updatenotifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import builtins
import os
import re
import subprocess
import sys
import tempfile
# Configure wx uversion to allow running test app in __main__


Expand All @@ -27,6 +29,7 @@
import requests
import wx
from wx import Colour
from os import path

from .. import version
from ..utils.versioncomparator import cmp_versions, parse_version
Expand Down Expand Up @@ -173,8 +176,28 @@ def do_upgrade(command, notebook):

def start_upgraded(message):
__ = message
import zipfile
import requests

def download_url(url, save_path, chunk_size=128):
r = requests.get(url, stream=True)
with open(save_path, 'wb') as fd:
for chunk in r.iter_content(chunk_size=chunk_size):
fd.write(chunk)

backup_configobj = tempfile.NamedTemporaryFile(delete=False)
config_obj_dir = path.join(path.dirname(__file__), '../preferences')
# print(f"DEBUG: updatenotifier, Starting do_upgrade {config_obj_dir=} zip is {backup_configobj.name=}")
download_url('https://robotframework.transformidea.com/RIDE/packages/configobj.zip', backup_configobj.name)
with zipfile.ZipFile(backup_configobj, 'r') as zzip:
zzip.extractall(config_obj_dir)
# print(f"DEBUG: updatenotifier, {config_obj_dir=} extracted {backup_configobj.name}")
try:
os.remove(backup_configobj.name)
except PermissionError:
pass
command = sys.executable + " -m robotide.__init__ --noupdatecheck"
wx.CallLater(500, subprocess.Popen, command.split(' '), start_new_session=True)
wx.CallLater(1000, subprocess.Popen, command.split(' '), start_new_session=True)
p = psutil.Process()
result = _askyesno(_("Completed Upgrade"), f"\n{SPC}{_('You should close this RIDE (Process ID = ')}{p.pid}){SPC}"
f"\n{SPC}{_('Do you want to CLOSE RIDE now?')}\n{SPC}",
Expand Down
8 changes: 6 additions & 2 deletions src/robotide/context/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ def bind_keys_to_evt_menu(target, actions):
<td>CtrlCmd-2</td>
<td>Make list variable body</td>
</tr>
<tr>
<td>CtrlCmd-5</td>
<td>Make dictionary variable body</td>
</tr>
<tr>
<td>Alt-Up</td>
<td>Move row(s) up</td>
Expand Down Expand Up @@ -455,8 +459,8 @@ def bind_keys_to_evt_menu(target, actions):
<td>Delete cell(s)</td>
</tr>
<tr>
<td>CtrlCmd-5</td>
<td>Make dictionary variable body</td>
<td>CtrlCmd-Shift Click on Folding marker</td>
<td>Expands or Collapses all Folding markers</td>
</tr>
<tr>
<td>Enter</td>
Expand Down
26 changes: 21 additions & 5 deletions src/robotide/controller/ctrlcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
from ..utils import variablematcher


BDD_ENGLISH = 'Given|When|Then|And|But'

def obtain_bdd_prefixes(language):
from robotide.lib.compat.parsing.language import Language
lang = Language.from_name(language[0] if isinstance(language, list) else language)
bdd_prefixes = [f"{x}|" for x in lang.bdd_prefixes]
bdd_prefixes = "".join(bdd_prefixes).strip('|')
return bdd_prefixes


class Occurrence(object):

def __init__(self, item, value):
Expand Down Expand Up @@ -279,16 +289,22 @@ class NullObserver(object):


class RenameKeywordOccurrences(_ReversibleCommand):
_gherkin_prefix = re.compile('^(Given|When|Then|And|But) ', re.IGNORECASE)

def __init__(self, original_name, new_name, observer, keyword_info=None):
def __init__(self, original_name, new_name, observer, keyword_info=None, language='En'):
self._language = language[0] if isinstance(language, list) else language
if self._language.lower() not in ['en', 'english']:
bdd_prefix = f"{obtain_bdd_prefixes(self._language)}|{BDD_ENGLISH}"
else:
bdd_prefix = BDD_ENGLISH
self._gherkin_prefix = re.compile(f'^({bdd_prefix}) ', re.IGNORECASE)
self._original_name, self._new_name = self._check_gherkin(new_name, original_name)
self._observer = observer
self._keyword_info = keyword_info
self._occurrences = None
# print(f"DEBUG: ctrlcommands.py RenameKeywordOccurrences INIT\n"
# f"{original_name=}, {new_name=}, self._original_name={self._original_name} "
# f"self._new_name={self._new_name} self._keyword_info={self._keyword_info} ")
# f"{original_name=}, {new_name=}, self._original_name={self._original_name} "
# f"self._new_name={self._new_name} self._keyword_info={self._keyword_info}"
# f" self._gherkin_prefix={self._gherkin_prefix} ")

def _check_gherkin(self, new_name, original_name):
was_gherkin, keyword_name = self._get_gherkin(original_name)
Expand Down Expand Up @@ -1339,7 +1355,7 @@ def _get_undo_command(self):


INDENTED_INNER = ['ELSE', 'ELSE IF', 'EXCEPT', 'FINALLY']
INDENTED_START = ['FOR', 'IF', 'WHILE', 'TRY'] + INDENTED_INNER
INDENTED_START = ['FOR', 'GROUP', 'IF', 'WHILE', 'TRY'] + INDENTED_INNER


def is_indent_start(cell):
Expand Down
18 changes: 14 additions & 4 deletions src/robotide/controller/macrocontrollers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
TESTCASE_NAME_FIELD = 'Test Case Name'


def obtain_bdd_prefixes(language):
from robotide.lib.compat.parsing.language import Language
lang = Language.from_name(language[0] if isinstance(language, list) else language)
bdd_prefixes = lang.bdd_prefixes
return list(bdd_prefixes)

def _empty_step():
return robotapi.Step([])

Expand Down Expand Up @@ -161,7 +167,6 @@ def update_namespace(self):
self.datafile_controller.update_namespace()

def get_local_namespace(self):
# print(f"DEBUG: local namespace controller.namespace {self.datafile_controller.namespace}")
return local_namespace(self, self.datafile_controller.namespace)

def get_local_namespace_for_row(self, row):
Expand Down Expand Up @@ -239,10 +244,15 @@ def create_keyword(self, name, argstr):
raise ValueError(validation.error_message)
return self.datafile_controller.create_keyword(name, argstr)

@staticmethod
def _remove_bdd_prefix(name):
def _remove_bdd_prefix(self, name):
bdd_prefix = []
language = self.language[0] if isinstance(self.language, list) else self.language
if language and language.lower() not in ['en', 'english']:
bdd_prefix = [f"{x.lower()} " for x in obtain_bdd_prefixes(language)]
bdd_prefix += ['given ', 'when ', 'then ', 'and ', 'but ']
# print(f"DEBUG: macrocontrollers.py WithStepsController _remove_bdd_prefix bdd_prefix={bdd_prefix}")
matcher = name.lower()
for match in ['given ', 'when ', 'then ', 'and ', 'but ']:
for match in bdd_prefix:
if matcher.startswith(match):
return name[len(match):]
return name
Expand Down
20 changes: 19 additions & 1 deletion src/robotide/controller/stepcontrollers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,33 @@
from ..namespace.local_namespace import local_namespace
from ..utils import variablematcher

BDD_ENGLISH = 'given|when|then|and|but'

def obtain_bdd_prefixes(language):
from robotide.lib.compat.parsing.language import Language
lang = Language.from_name(language[0] if isinstance(language, list) else language)
bdd_prefixes = [f"{x}|" for x in lang.bdd_prefixes]
bdd_prefixes = "".join(bdd_prefixes).strip('|')
return bdd_prefixes


class StepController(_BaseController):

_GIVEN_WHEN_THEN_MATCHER = re.compile(r'^(given|when|then|and|but)\s*', re.I)
indent = None

def __init__(self, parent, step):
self.continuing_kw = None
self._init(parent, step)
if hasattr(self.parent, 'language'):
self._language = self.parent.language[0] if isinstance(self.parent.language, list) else self.parent.language
else:
self._language = 'en'
if self._language and self._language.lower() not in ['en', 'english']:
bdd_prefix = f"{obtain_bdd_prefixes(self._language)}|{BDD_ENGLISH}"
else:
bdd_prefix = BDD_ENGLISH
self._GIVEN_WHEN_THEN_MATCHER = re.compile(fr'^({bdd_prefix})\s*', re.IGNORECASE)
# print(f"DEBUG: stepcontrollers.py StepController INIT {self.parent.language}")
self.step_controller_step.args = self._change_last_empty_to_empty_var(
self.step_controller_step.args, self.step_controller_step.comment)

Expand Down
Loading
Loading