Author Topic: Project paths added as wildcards are not updating automatically  (Read 3804 times)

timur

  • Senior Community Member
  • Posts: 205
  • Hero Points: 3
Project paths added as wildcards are not updating automatically
« on: September 29, 2020, 07:40:41 PM »
I work with a project that frequently adds and removes files.  To simplify this, I use the "Add as wildcard" option when adding trees to the project.  The help for this option says, "Using this feature may cause performance degradation. When new files are added to the tree that match the include filespecs, they will be automatically added to the project. To do a one-time add of all files that are currently in this path, uncheck this option."

The boldfaced section is not true for me.  One file was renamed from gsptu101.c to gsptu102.c, but when I go to Project->Open Files from Project, it still thinks that gsptu101.c exists and it has no knowledge of gsptu102.c.

I tried using the "Refresh" option, but that does nothing.

How do I fix this?  I'm using SlickEdit Pro 2018 (v23.0.1.0 64-bit) on Linux.

« Last Edit: October 13, 2020, 01:31:30 AM by timur »

timur

  • Senior Community Member
  • Posts: 205
  • Hero Points: 3
Re: Project paths added as wildcards are not updating automatically
« Reply #1 on: September 29, 2020, 11:52:11 PM »
Update: the problem has resolved itself after closing and re-opening the workspace.  Is it expected that I re-open the workspace every time a file is added or removed in my project?  I sure hope not.
« Last Edit: September 30, 2020, 05:01:59 AM by timur »

timur

  • Senior Community Member
  • Posts: 205
  • Hero Points: 3
Re: Project paths added as wildcards are not updating automatically
« Reply #2 on: March 07, 2024, 09:42:18 PM »
I know this thread is 3.5 years old, and v23 is no longer supported, but I would actually like to fix it now. 

Does anyone have any suggestions on how to fix this?  The problem appears to be that ctlrefresh.lbutton_up() in project.e.  Specifically:

      if (iswildcard(line) && !file_exists(absolute(line,project_path))) {
         continue;
      }

file_exists() always returns false if the path is a wildcard, so the 'continue' is always executed for lines that are wildcards.  I think this is a bug.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Project paths added as wildcards are not updating automatically
« Reply #3 on: March 09, 2024, 05:14:19 AM »
I don't know whether Linux or Windows would give a notification of a rename to slickedit or not.  I don't understand what the "absolute" function will do as presumably the wildcard files can be anywhere in the tree and not just in the project path folder.  Can you post an example of the "line" string and the output of the call to the absolute function to show what it's doing wrong?  The same code is in the latest version of slick.  You could download the trial version and see if it works any better.  Instead of using the refresh button you might be able to "re-open" the workspace without closing it.


timur

  • Senior Community Member
  • Posts: 205
  • Hero Points: 3
Re: Project paths added as wildcards are not updating automatically
« Reply #4 on: March 20, 2024, 10:24:30 PM »
Take for example a project with these entries in the Project Files: dialog:

../camelot/README.md
../camelot/apps/*.h
../camelot/apps/*.c

So the loop in the function iterates over each of these lines.  For example, in the second path, 'line' is "../camelot/apps/*.h" and the absolute() function returns "/home/ttabi/camelot/apps/*.c".

The problem is that file_exists(absolute(line,project_path)) is always false when the filename has a wildcard.  That's because file_exists(x) always returns false if x is a filename with a wildcard in it.  After all, there is no file named "*.h" in ../camelot/apps/ so of course it returns false.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Project paths added as wildcards are not updating automatically
« Reply #5 on: March 22, 2024, 10:14:14 AM »
try the command workspace_refresh  - it's the "refresh" option in the project menu.

timur

  • Senior Community Member
  • Posts: 205
  • Hero Points: 3
Re: Project paths added as wildcards are not updating automatically
« Reply #6 on: April 04, 2024, 08:13:58 PM »
Quote
try the command workspace_refresh  - it's the "refresh" option in the project menu.
That actually worked, thanks!