Skip to content

Commit b13a75e

Browse files
Merge pull request #2951 from HelioGuilherme66/improve_kweditor
Improve kweditor auto-complete
2 parents 86eb469 + 9ff42f2 commit b13a75e

File tree

15 files changed

+489
-62
lines changed

15 files changed

+489
-62
lines changed

.github/workflows/package.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Linux
2+
on:
3+
push:
4+
branches-ignore:
5+
- '**/sources/**'
6+
- '**/windows/**'
7+
- '**/macos/**'
8+
paths-ignore:
9+
- '.github/workflows/sources.yml'
10+
- '.github/workflows/sonar.yml'
11+
- '.github/workflows/macos.yml'
12+
- '.github/workflows/windows.yml'
13+
- 'tools/**'
14+
- 'rtest/**'
15+
- 'doc/**'
16+
- '.appveyor.yml'
17+
- '.coveragerc'
18+
- '.gitattributes'
19+
- '.pylintrc'
20+
- '.travis.yml'
21+
- '.whitesource'
22+
- 'AUTHORS.txt'
23+
- 'BUILD.rest'
24+
- 'CHANGELOG.adoc'
25+
- 'CONTRIBUTING.adoc'
26+
- 'COPYRIGHT.txt'
27+
- 'LICENSE.txt'
28+
- 'MANIFEST.in'
29+
- 'README.adoc'
30+
- 'README.rest'
31+
- 'rfgen.py'
32+
- 'tox.ini'
33+
pull_request:
34+
paths-ignore:
35+
- '.github/workflows/sources.yml'
36+
- '.github/workflows/sonar.yml'
37+
- '.github/workflows/macos.yml'
38+
- '.github/workflows/windows.yml'
39+
- 'tools/**'
40+
- 'rtest/**'
41+
- 'doc/**'
42+
- '.appveyor.yml'
43+
- '.coveragerc'
44+
- '.gitattributes'
45+
- '.pylintrc'
46+
- '.travis.yml'
47+
- '.whitesource'
48+
- 'AUTHORS.txt'
49+
- 'BUILD.rest'
50+
- 'CHANGELOG.adoc'
51+
- 'CONTRIBUTING.adoc'
52+
- 'COPYRIGHT.txt'
53+
- 'LICENSE.txt'
54+
- 'MANIFEST.in'
55+
- 'README.adoc'
56+
- 'README.rest'
57+
- 'rfgen.py'
58+
- 'tox.ini'
59+
60+
jobs:
61+
fedora:
62+
name: Fedora py313
63+
runs-on: ubuntu-22.04
64+
container:
65+
image: fedora:41
66+
options: --privileged
67+
steps:
68+
- name: Configure container environment
69+
run: |
70+
sudo dnf update -y
71+
sudo dnf install -y git
72+
git config --global --add safe.directory ${GITHUB_WORKSPACE}
73+
- uses: actions/[email protected]
74+
with:
75+
submodules: false
76+
- name: Setup environment
77+
run: |
78+
sudo dnf install -y sdl12-compat python3-wxpython4 xorg-x11-server-Xvfb python3-pip python3-tkinter psmisc
79+
# sudo dnf downgrade -y mesa* --refresh
80+
git submodule update --init --recursive
81+
pip install -r requirements-dev.txt
82+
pip install robotframework
83+
- name: Run tests
84+
run: |
85+
Xvfb &
86+
export DISPLAY=:0
87+
export GITHUB_ACTIONS=True
88+
git submodule update --init --recursive
89+
invoke test-ci
90+
- uses: actions/upload-artifact@v4
91+
with:
92+
name: coverage-report
93+
include-hidden-files: true
94+
path: |
95+
.coverage.1
96+
.coverage.2
97+
.coverage-reports/coverage.xml
98+
.coverage-reports/htmlcov
99+
- name: Create Package
100+
run: |
101+
git submodule update --init --recursive
102+
pip install -r requirements-dev.txt
103+
python -m build
104+
- uses: actions/upload-artifact@v4
105+
with:
106+
name: package
107+
include-hidden-files: true
108+
path: |
109+
dist/*

BUILD.rest

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,13 @@ wxPython
3939
Version 2.8.12.1 of wxPython__ was the last for the 2 series.
4040
Together with version 3.0.2, they are called the wxPython Classic.
4141

42-
The current recommended version of wxPython is 4.0.7.post2 and was called wxPhoenix.
43-
RIDE is not fully compatible with newest wxPython 4.1.
44-
45-
RIDE on Python 2.7 still runs with any version of those Classic or wxPhoenix.
46-
On Python 3.6+, only wxPhoenix is supported (and in the future we will only
47-
support those).
42+
The current recommended version of wxPython is 4.2.3, the project was called wxPhoenix.
4843

4944
**VERSION 1.7.4.2 IS THE LAST RELEASE SUPPORTING PYTHON 2.7 AND WXPYTHON <3.0.3**
5045

51-
**wxPython will be updated to current version 4.0.7.post2**
46+
**Version 2.0.8.1 was the last release supporting Python 3.6 and 3.7**
5247

48+
<!--
5349
For testing purposes, users can select which version to use, by creating the
5450
file ``wx.pth`` containing the directory name of the wxPython to use. That
5551
directory must contain the two wxPython directories (moved into)::
@@ -69,6 +65,7 @@ Example::
6965
# wx-4.0.4
7066
# wx-4.0.6
7167
# wx-4.0.7
68+
-->
7269

7370

7471
It is highly recommended, if you want to program with wxPython to download and
@@ -96,6 +93,11 @@ Unit tests are in `utest` directory. They can be executed with::
9693

9794
invoke test
9895

96+
or, to have coverage report:
97+
98+
invoke test-ci
99+
100+
99101
There is also a shell script (requiring customization for your environment).
100102
It allows to run the test files stopping when errors are found.
101103
Example::
@@ -169,10 +171,9 @@ Creating distributions
169171

170172
invoke clean
171173

172-
3. Create and validate source distribution in zip format and universal (i.e.
173-
Python 2 and 3 compatible) `wheel <http://pythonwheels.com>`_::
174+
3. Create and validate source distribution and `wheel <http://pythonwheels.com>`_::
174175

175-
python setup.py sdist --formats zip bdist_wheel --universal
176+
python -m build
176177
ls -l dist
177178
twine check dist/*
178179

@@ -190,7 +191,7 @@ Creating distributions
190191
pip install --pre --upgrade robotframework-ride
191192

192193

193-
* Announce on usergroup, robot homepage, forum, slack, and twitter
194+
* Announce on usergroup, robot homepage, forum, slack, and LinkedIn
194195

195196

196197
Settings migration

CHANGELOG.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
1818
when selecting in Tree shows the filename in StatusBar.
1919

2020
=== Changed
21+
- Improved auto-complete in Grid Editor, to allow several matches
2122
- Changed some informative dialogs and JSON Editor to use the customized colors.
2223
- Modified import statements to allow running RIDE without Robot Framework installed or versions older than 6.0.
2324
- On Windows ignore false modification on files when opening Test Suites, causing confirmation dialog.

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Likewise, the current version of wxPython, is 4.2.3, but RIDE is known to work w
4141

4242
`pip install -U robotframework-ride`
4343

44-
(3.8 &lt;= python &lt;= 3.13) Install current development version (**2.2dev25**) with:
44+
(3.8 &lt;= python &lt;= 3.13) Install current development version (**2.2dev26**) with:
4545

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

pyproject.toml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "robotframework-ride"
7+
dynamic = ["version"]
8+
description = "RIDE :: Robot Framework Test Data Editor"
9+
license = "Apache-2.0"
10+
license-files = { paths = ["LICENSE.txt"] }
11+
requires-python = ">=3.8, <3.15"
12+
authors = [
13+
{ name = "Robot Framework Developers", email = "[email protected]" },
14+
]
15+
maintainers = [
16+
{ name = "Hélio Guilherme", email = "[email protected]" },
17+
]
18+
keywords = [
19+
"robotframework",
20+
"testautomation",
21+
"testing",
22+
"test editor",
23+
"IDE",
24+
]
25+
classifiers = [
26+
"Development Status :: 5 - Production/Stable",
27+
"License :: OSI Approved :: Apache Software License",
28+
"Operating System :: OS Independent",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
"Programming Language :: Python :: 3.13",
35+
"Programming Language :: Python :: 3.14",
36+
"Topic :: Software Development :: Testing",
37+
]
38+
dependencies = [
39+
"psutil",
40+
"Pygments",
41+
"PyPubSub",
42+
"Pywin32; platform_system == 'Windows'",
43+
"wxPython",
44+
]
45+
46+
[project.urls]
47+
Download = "https://pypi.python.org/pypi/robotframework-ride"
48+
Homepage = "https://github.com/robotframework/RIDE/"
49+
50+
[tool.uv]
51+
# python-preference = "only-system"
52+
53+
[tool.hatch.version]
54+
path = "src/robotide/version.py"
55+
56+
[tool.hatch.build.targets.sdist]
57+
include = [
58+
"/src",
59+
]
60+
[tool.hatch.build.targets.wheel]
61+
packages = ["src/robotide"]
62+
63+
[project.scripts]
64+
ride_postinstall = "robotide.postinstall:main"
65+
66+
[project.gui-scripts]
67+
ride = "robotide:main"
68+
69+
[tool.hatch.envs.test]
70+
dependencies = [
71+
"pytest",
72+
"coverage",
73+
]
74+
75+
[[tool.hatch.envs.test.matrix]]
76+
python = ["3.13"]
77+
version = ["2.1.4"]
78+
79+
[tool.poetry]
80+
name = "robotframework-ride"
81+
version = "2.1.4"
82+
description = "RIDE :: Robot Framework Test Data Editor"
83+
authors = ["Robot Framework Developers <[email protected]>"]
84+
license = "Apache-2.0 license"
85+
readme = "README.adoc"
86+
packages = [{include = "robotide"}]
87+
88+
[tool.poetry.dependencies]
89+
python = "^3.8"
90+
wxPython = "^4.1.1"
91+
pywin32 = { version = "*", markers = "sys_platform == 'win32'" }
92+
pygments = "*"
93+
robotframework = "*"
94+
pypubsub = "*"
95+
psutil = "*"
96+
97+
[tool.poetry.group.test.dependencies]
98+
pytest = "*"
99+
pytest-mock = "*"
100+
coverage = "*"

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
setuptools>=70.0.0
2+
build
23
mockito
34
invoke
45
urllib3>=2.2.2 # not directly required, pinned by Snyk to avoid a vulnerability

src/robotide/application/CHANGELOG.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
1515
when selecting in Tree shows the filename in StatusBar.
1616
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_changed"></a>1.2. Changed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
17+
Improved auto-complete in Grid Editor, to allow several matches
18+
</li><li class="listitem">
1719
Changed some informative dialogs and JSON Editor to use the customized colors.
1820
</li><li class="listitem">
1921
Modified import statements to allow running RIDE without Robot Framework installed or versions older than 6.0.

src/robotide/application/releasenotes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def set_content(self, html_win, content):
172172
</ul>
173173
<p><strong>New Features and Fixes Highlights</strong></p>
174174
<ul class="simple">
175+
<li>Improved auto-complete in Grid Editor, to allow several matches.</li>
175176
<li>Fixed white blocks on Tree due to failed animation when test execution is too rapid, causing crash on Windows.</li>
176177
<li>Added Settings Editor button to Preferences dialog, to edit settings.cfg.</li>
177178
<li>Created backup of settings.cfg to allow recovering some settings when broken upgrades.</li>
@@ -237,7 +238,7 @@ def set_content(self, html_win, content):
237238
<pre class="literal-block">python -m robotide.postinstall -install</pre>
238239
<p>or</p>
239240
<pre class="literal-block">ride_postinstall.py -install</pre>
240-
<p>RIDE {VERSION} was released on 15/May/2025.</p>
241+
<p>RIDE {VERSION} was released on 18/May/2025.</p>
241242
<!-- <br/>
242243
<h3>May The Fourth Be With You!</h3>
243244
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>

src/robotide/editor/contentassist.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15+
from operator import index
1516

1617
import wx
1718
from wx import Colour
@@ -262,22 +263,39 @@ def on_focus_lost(self, event, set_value=True):
262263
event.Skip()
263264
if not self._popup.is_shown():
264265
return
265-
if self.gherkin_prefix:
266-
value = self.gherkin_prefix + self._popup.get_value() or self.GetValue()
267-
else:
268-
value = self._popup.get_value() or self.GetValue()
266+
value = self._get_popup_suggestion()
269267
if set_value and value:
270268
self.SetValue(value)
271269
self.SetInsertionPoint(len(value)) # DEBUG was self.Value
272270
else:
271+
# print(f"DEBUG: contentassist.py ContentAssistTextCtrlBase on_focus_lost CALL CLEAR {value}")
273272
self.Clear()
274273
self.hide()
275274

276-
def fill_suggestion(self):
275+
def _get_popup_suggestion(self, in_value=None):
276+
initial_value = self.GetValue()
277+
if not in_value:
278+
popup_value = self._popup.get_value()
279+
else:
280+
popup_value = in_value
281+
if popup_value and popup_value.lower() in initial_value.lower():
282+
initial_value = initial_value.replace(initial_value, '')
283+
parts = initial_value.split()
284+
for p in parts:
285+
if popup_value and popup_value.lower().startswith(p.strip('}])').lower()):
286+
idx = initial_value.index(p)
287+
initial_value = initial_value[:idx]
288+
break
277289
if self.gherkin_prefix:
278-
value = self.gherkin_prefix + self._popup.get_value() or self.GetValue()
290+
initial_value = initial_value.replace(self.gherkin_prefix, '') # Should be left replace
291+
value = self.gherkin_prefix + initial_value + popup_value # or self.GetValue()
279292
else:
280-
value = self._popup.get_value() or self.GetValue()
293+
value = initial_value + popup_value # or self.GetValue()
294+
return value
295+
296+
def fill_suggestion(self, value=None):
297+
value = self._get_popup_suggestion(value)
298+
# print(f"DEBUG: contentassist.py ContentAssistTextCtrlBase fill_suggestion writting value={value}")
281299
if value:
282300
wrapper_view = self.GetParent().GetParent()
283301
if hasattr(wrapper_view, 'open_cell_editor'):
@@ -604,15 +622,14 @@ def select_and_scroll(self, key_code):
604622
pos = self._selection + 14 if count - self._selection > 14 else count - 1
605623
elif key_code == wx.WXK_PAGEUP:
606624
pos = self._selection - 14 if self._selection > 14 else 0
607-
self._select_and_scroll(pos)
625+
return self._select_and_scroll(pos)
608626

609627
def _select_and_scroll(self, selection):
610628
self._selection = selection
611629
self._list.Select(self._selection)
612630
self._list.EnsureVisible(self._selection)
613631
value = self.get_value()
614-
if value:
615-
self._parent.SetValue(value)
632+
return value
616633

617634
def dismiss(self):
618635
if not self._list.HasFocus():

0 commit comments

Comments
 (0)