Skip to content
3 changes: 2 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
- Added on Text Editor, folding margin with markers style configurable with ``fold symbols`` in settings.cfg.

=== Changed
- 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.
Expand Down
4 changes: 4 additions & 0 deletions src/robotide/application/CHANGELOG.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
</li><li class="listitem">
Added on Text Editor, folding margin with markers style configurable with ``fold symbols`` in settings.cfg.
</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">
Improved autocompletion lists, by using existing words in Test Suite file (still needs more improvements).
</li><li class="listitem">
Create directories when needed in New Project dialog.
</li><li class="listitem">
Improved the recognition of BDD/Gherkin prefixes when localized in autocomplete on Grid Editor.
</li><li class="listitem">
Improved colorization for multiple Gherkin words, for example in the French language.
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_fixed"></a>1.3. Fixed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Fixed not set text color on row labels in Grid Editor. Now the General ``secondary foreground`` is applied.
</li><li class="listitem">
Fixed multiple scroll bars in Grid Editor when editing Test Cases or Keywords. This caused bad navigation on cells.
</li><li class="listitem">
Regression fix from v2.1b1 - Fix wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.
Expand Down
4 changes: 3 additions & 1 deletion src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ def set_content(self, html_win, content):
</ul>
<p><strong>New Features and Fixes Highlights</strong></p>
<ul class="simple">
<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>
Expand Down Expand Up @@ -231,7 +233,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 21/February/2025.</p>
<p>RIDE {VERSION} was released on 17/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
1 change: 0 additions & 1 deletion src/robotide/controller/macrocontrollers.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,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
32 changes: 23 additions & 9 deletions src/robotide/editor/contentassist.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from wx.lib.filebrowsebutton import FileBrowseButton
from os.path import relpath, dirname, isdir

from .gridbase import GridEditor
from .. import context, utils
from ..context import IS_MAC, IS_WINDOWS, IS_WX_410_OR_HIGHER
from ..namespace.suggesters import SuggestionSource
Expand Down Expand Up @@ -74,6 +75,8 @@ def __init__(self, suggestion_source, language='En', **kw):
@staticmethod
def _get_auto_suggestion_config():
from robotide.context import APP
if not APP:
return True
settings = APP.settings['Grid']
return settings.get(_AUTO_SUGGESTION_CFG_KEY, False)

Expand Down Expand Up @@ -357,7 +360,8 @@ def __init__(self, parent, plugin, controller, language='En'):
""" According to class MRO, super().__init__ in _ContentAssistTextCtrlBase will init ExpandoTextCtrl
instance """

_ContentAssistTextCtrlBase.__init__(self, SuggestionSource(plugin, controller), language=language,
self.suggestion_source = SuggestionSource(plugin, controller)
_ContentAssistTextCtrlBase.__init__(self, self.suggestion_source, language=language,
parent=parent, size=wx.DefaultSize,
style=wx.WANTS_CHARS | wx.TE_NOHIDESEL)
self.SetBackgroundColour(context.POPUP_BACKGROUND)
Expand Down Expand Up @@ -481,9 +485,9 @@ def _get_choices(self, value, row):
@staticmethod
def _get_duplicate_names(choices):
results = set()
normalized_names = [utils.normalize(ch.name) for ch in choices]
normalized_names = [utils.normalize(ch.name if hasattr(ch, 'name') else ch) for ch in choices]
for choice in choices:
normalized = utils.normalize(choice.name)
normalized = utils.normalize(choice.name if hasattr(choice, 'name') else choice)
if normalized_names.count(normalized) > 1:
results.add(normalized)
return results
Expand All @@ -493,17 +497,24 @@ def _format_choices(self, choices, prefix, duplicate_names):
choices]

def _format(self, choice, prefix, duplicate_names):
return choice.name if self._matches_unique_shortname(
choice, prefix, duplicate_names) else choice.longname
if hasattr(choice, 'name'):
return choice.name if self._matches_unique_shortname(
choice, prefix, duplicate_names) else choice.longname
elif self._matches_unique_shortname(choice, prefix, duplicate_names):
return choice

@staticmethod
def _matches_unique_shortname(choice, prefix, duplicate_names):
if isinstance(choice, VariableInfo):
return True
if not utils.normalize(choice.name).startswith(
if hasattr(choice, 'name'):
name = choice.name
else:
name = choice
if not utils.normalize(name).startswith(
utils.normalize(prefix)):
return False
if utils.normalize(choice.name) in duplicate_names:
if utils.normalize(name) in duplicate_names:
return False
return True

Expand Down Expand Up @@ -532,8 +543,11 @@ def content_assist_for(self, value, row=None):
self._choices = self._suggestions.get_for(value, row=row)
if not self._choices:
self._list.ClearAll()
self._parent.hide()
if not isinstance(self._parent, GridEditor):
self._parent.hide()
return False
self._choices = list(set([c for c in self._choices if c is not None]))
# print(f"DEBUG: contentassist.py ContentAssistPopup content_assist_for CALL POPULATE Choices={self._choices}")
self._list.populate(self._choices)
return True

Expand Down Expand Up @@ -616,7 +630,7 @@ def on_list_item_activated(self, event):
def on_list_item_selected(self, event):
self._selection = event.GetIndex()
item = self._suggestions.get_item(event.GetText())
if item.details:
if hasattr(item, 'details') and item.details:
self._details_popup.Show()
self._details_popup.set_content(item.details, item.name)
elif self._details_popup.IsShown():
Expand Down
2 changes: 2 additions & 0 deletions src/robotide/editor/gridbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def __init__(self, parent, num_rows, num_cols, popup_creator=None):
self.GetGridColLabelWindow().SetForegroundColour(Colour(self.color_secondary_foreground))
self.GetGridRowLabelWindow().SetBackgroundColour(Colour(self.color_secondary_background))
self.GetGridRowLabelWindow().SetForegroundColour(Colour(self.color_secondary_foreground))
self.SetLabelBackgroundColour(Colour(self.color_secondary_background))
self.SetLabelTextColour(Colour(self.color_secondary_foreground))
self._popup_creator = popup_creator or PopupCreator()
"""
DEBUG: This block adds aditional scrollbars in mains Grid Editor, making hard to focus on cells keeping the
Expand Down
27 changes: 27 additions & 0 deletions src/robotide/editor/kweditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,32 @@ def is_json(json_str):
return False
return True

"""
def words_cache(self, doc_size: int):
if doc_size != self.doc_size:
words_list = self.collect_words(SOME_CONTENT)
self._words_cache.update(words_list)
self.doc_size = doc_size
return sorted(self._words_cache)

@staticmethod
def collect_words(text: str):
if not text:
return ['']

def var_strip(txt:str):
return txt.strip('$&@%{[(')

words = set()
words_ = list(text.replace('\r\n', ' ').replace('\n', ' ').split(' '))
for w in words_:
wl = var_strip(w)
if wl and wl[0].isalpha():
words.add(w)

print(f"DEBUG: texteditor.py SourceEditor collect_words returning {words=}")
return sorted(words)
"""

class ContentAssistCellEditor(GridCellEditor):

Expand Down Expand Up @@ -1257,6 +1283,7 @@ def execute_sharp_uncomment(self):

def Create(self, parent, idd, evthandler):
self._tc = ExpandingContentAssistTextCtrl(parent, self._plugin, self._controller, self._language)
# self._tc.suggestion_source.update_from_local(self._controller.datafile, self._language)
self.SetControl(self._tc)
if evthandler:
self._tc.PushEventHandler(evthandler)
Expand Down
Loading
Loading