Skip to content

Commit

Permalink
Minors (#2663)
Browse files Browse the repository at this point in the history
* Improve Tree expanding when running tests

* Improves keywords documentation search
  • Loading branch information
HelioGuilherme66 authored Oct 21, 2023
1 parent dbfdc80 commit 7b3a22c
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Force Tags settings, after Robot Framework 7.0

=== Changed

- Improved keywords documentation search, by adding current dir to search
- Improved Move up/down, ``Alt-UpArrow``/``Alt-DownArrow`` in Text Editor, to have proper indentation and selection
- Improved **RIDE Log** and **Parser Log** windows to allow Zoom In/Out with ``Ctrl-Mouse Wheel``
- Hide continuation markers in Project Tree
Expand Down
4 changes: 3 additions & 1 deletion src/robotide/application/CHANGELOG.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
</li><li class="listitem">
Drag and drop of variables defined with comments between resource files
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_changed"></a>1.3. Changed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Improved Move up/down, ``Alt-UpArrow``/``Alt-DownArrow`` in Text Editor, to have proper indentation and selection
Improved keywords documentation search, by adding current dir to search
</li><li class="listitem">
Improved Move up/down, <b>Alt-UpArrow</b>/<b>Alt-DownArrow</b> in Text Editor, to have proper indentation and selection
</li><li class="listitem">
Improved <span class="strong"><strong>RIDE Log</strong></span> and <span class="strong"><strong>Parser Log</strong></span> windows to allow Zoom In/Out with ``Ctrl-Mouse Wheel``
</li><li class="listitem">
Expand Down
1 change: 1 addition & 0 deletions src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def set_content(self, html_win, content):
</ul>
<p><strong>New Features and Fixes Highlights</strong></p>
<ul class="simple">
<li>Improved keywords documentation search, by adding current dir to search</li>
<li>Improved Move up/down, <b>Alt-UpArrow</b>/<b>Alt-DownArrow</b> in Text Editor, to have proper indentation and selection</li>
<li>Added auto update check when development version is installed</li>
<li>Added menu option <b>Help-&gt;Check for Upgrade</b> which allows to force update check and install development version</li>
Expand Down
18 changes: 16 additions & 2 deletions src/robotide/namespace/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,20 @@ def _set_pythonpath(self):
"""Add user configured paths to PYTHONAPATH.
"""
path_idx = 0
dp = os.getenv('RIDE_DOC_PATH')
if not dp:
doc_paths = ['.']
else:
doc_paths = dp.split(',')
for path in self.settings.get('pythonpath', []):
if os.path.isdir(path):
doc_paths.append(path.replace('/', os.sep))
if path not in sys.path:
normalized = path.replace('/', os.sep)
sys.path.insert(path_idx, normalized)
path_idx += 1
RideLogMessage(u'Inserted \'{0}\' to sys.path.'
.format(normalized)).publish()
RideLogMessage(u'Inserted \'{0}\' to sys.path.'.format(normalized)).publish()
os.environ['RIDE_DOC_PATH'] = ",".join(doc_paths)

def _setting_changed(self, message):
section, setting = message.keys
Expand All @@ -76,6 +83,13 @@ def update_exec_dir_global_var(self, exec_dir):
self._context_factory.reload_context_global_vars()

def update_cur_dir_global_var(self, cur_dir):
dp = os.getenv('RIDE_DOC_PATH')
parent_cur_dir=os.path.dirname(os.path.abspath(cur_dir))
if dp:
if cur_dir not in dp:
os.environ['RIDE_DOC_PATH'] = dp + f", {cur_dir}, {parent_cur_dir}"
else:
os.environ['RIDE_DOC_PATH'] = f"{cur_dir}, {parent_cur_dir}"
_VariableStash.global_variables['${CURDIR}'] = cur_dir
self._context_factory.reload_context_global_vars()

Expand Down
21 changes: 18 additions & 3 deletions src/robotide/spec/librarymanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from sqlite3 import OperationalError
from threading import Thread

import robotide.robotapi
from ..publish import RideLogException, RideLogMessage
from ..spec.librarydatabase import LibraryDatabase
from ..spec.libraryfetcher import get_import_result
Expand Down Expand Up @@ -77,9 +78,23 @@ def _handle_fetch_keywords_message(self, message):

def _fetch_keywords(self, library_name, library_args):
try:
path = get_path(
library_name.replace('/', os.sep), os.path.abspath('.'))
return get_import_result(path, library_args)
doc_paths = os.getenv('RIDE_DOC_PATH')
collection = []
path = get_path(library_name.replace('/', os.sep), os.path.abspath('.'))
if path:
results = get_import_result(path, library_args)
if results:
return results
if doc_paths:
for p in doc_paths.split(','):
path = get_path(library_name.replace('/', os.sep), p.strip())
if path:
results = get_import_result(path, library_args)
if results:
collection.extend(results)
if collection:
return collection
raise robotide.robotapi.DataError
except Exception as err:
try:
print('FAILED', library_name, err)
Expand Down
3 changes: 2 additions & 1 deletion src/robotide/spec/xmlreaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def _resolve_path(path, basedir):
if os.path.isdir(ret) and \
os.path.isfile(os.path.join(ret, '__init__.py')):
return ret
raise robotapi.DataError
return None
# DEBUG raise robotapi.DataError


def _get_library_name(name):
Expand Down
6 changes: 5 additions & 1 deletion src/robotide/ui/treeplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,12 @@ def _set_icon_from_execution_results(self, controller):
self.SetItemWindow(node, self._animctrl, False)
self._animctrl.Play()
# Make visible the running or paused test
self.EnsureVisible(node.GetParent())
parent = node.GetParent()
self.EnsureVisible(parent) # DEBUG add animation to parent if suite setup/teardown started
self.ExpandAllChildren(parent)
self.EnsureVisible(node)
self.ExpandAllChildren(node)
self.Update()

def _get_icon_index_for(self, controller):
if not self._execution_results:
Expand Down
2 changes: 1 addition & 1 deletion src/robotide/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.
#
# Automatically generated by `tasks.py`.
VERSION = 'v2.0.8dev24'
VERSION = 'v2.0.8dev25'

0 comments on commit 7b3a22c

Please sign in to comment.