numere-org / NumeRe

Framework for numerical computations, data analysis and visualisation
https://www.numere.org
GNU General Public License v3.0
20 stars 7 forks source link

Go to procedure definition does not work on external procedures #52

Closed numeredev closed 1 year ago

numeredev commented 1 year ago

DESCRIPTION

Describe the bug If we have an external procedure in an external folder, which does not belong to the default paths, and we want to go to the definition, an error message appears that the name contains invalid characters.

To Reproduce Steps to reproduce the behavior:

  1. Create an external procedure
  2. Reference that in an internal file (e.g. a script)
  3. Select "Go to procedure definition" or press Ctrl+.
  4. See error message

Expected behavior The external procedure file should be opened up.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

(Do not write below this line)


DEVS' SECTION

ANALYSIS

The problem is located in void NumeReEditor::FindAndOpenProcedure(const wxString& procedurename) in editor.cpp, where we test for invalid characters but do not distinguish between external and internal procedures. Instead we try to check both at the same time, which does not work, of course.

Change that so that external procedures (like $'PATH/TO/PROC/FILE'()) are checked for valid file names and simplify internal procedure checks.

IMPLEMENTATION STEPS

(see also our Wiki for implementation guidelines)

DOCUMENTATION STEPS

(see also our Wiki for further information)

PULL REQUEST