NI Home > Community > NI Discussion Forums

LabVIEW Developers Feature Brainstorming

Showing results for 
Search instead for 
Do you mean 
Reply
Member
RobbieG
Posts: 23
0 Kudos

Searching through your source code

Hello,
I'm spearheading two related brainstorms, which I want to keep separate.  This one deals with finding things in your source code, the other ("Finding how to do something in LabVIEW" in this same forum) deals with finding what you want to use in LabVIEW. 
 
This type of find is when you want to look through your source code (project and/or VIs) for particular text, VIs, or objects.  There are basically just two ways to do this--the Find Dialog/Search Results and Find Project Items.  There are several "entry points" to these two mechanisms.  Find all Instances, Find References, Find Terminal, Find Local Variables, and Find Property/Invoke Nodes all bypass the Find Dialog and bring up the Search Results directly.  Find all Callers and Find all SubVIs are entry points for the Find Project Items dialog.
 
I want to open up the discussion on these two mechanisms.  Find Project Items is new, but the Find Dialog hasn't undergone significant changes in a long time.  Where do you think these two mechanisms can be improved?  Do you think it would make sense for them to be combined somehow?  And I'm especially interested if there are times when you feel like you can't do something you expected to be able to do related to searching through your source code. 
 
Thanks,
Robbie
Knight of NI
altenbach
Posts: 27,390

Re: Searching through your source code

[ Edited ]

I would prefer if the search results window would stay topmost after we double-click an entry (It could even be made semi-transparent so we don't miss stuff that is underneath).

After I double-click an entry, the entry should show in a different color (like a "visited link" in a browser) so I can easily tell which ones I haven't looked at yet in that particular search session. (right now we have the checkmark, which is less intuitive).

This is maybe related:
We can e.g. "replace all" in the find dialog to globally replace one subVI with a different one (something that is often needed when updating some old code). This also could be simplified.

  • Right now, we need to do a "find all instances" in the herarchy, select the new VI, followed by a "replace all".
  • I would think it would be sufficiently intuitive if we could just right-click in the VI herarchy and do a simple "replace". Since the hierarchy entry already represents all instances of that VI, a "replace" there would seem to logically apply to all instances, saving us a few steps.
  • It should act exactly the way we can currently right-click on a VI on the diagram and do a "replace".
  • Maybe the entry could be called "replace all" when used in the hierarchy for extra clarity, but otherwise act the same.

 

Message Edited by altenbach on 09-14-2007 08:22 AM


LabVIEW Champion . Do more with less code and in less time .

Member
Lavezza
Posts: 120

Re: Searching through your source code

1) Find Dialog should have the option to search all VIs in a project. Right now the Find Dialog only has the options to search the current VI, a user selected list of VIs in memory or all VIs in memory. All VIs in Project would be a nice new feature (of course, LV would have to load those VIs into memory and then close when after searching). We need this because we call a lot of VIs dynamically, so they aren't normally loaded when working on the project.
 
2) When searching for text, there is an options button that is very useful. For instance, we wanted to find all instances where a cluster item was being set. Our first text search returned A LOT of VIs because that cluster was on almost every front panel. Using the options button we limited that search to only the block diagrams. Now our search results were limited to just those VIs that were actually bundling or unbundling that cluster item (plus a few comments, I think). While this was great, LV remembers the option settings! Since the current settings aren't displayed unless you press the options button, I ended up crippling my text search until I realized what happened.
 
3) Of course, it would have been even better if we could have searched for a bundle node for that cluster item. As it is now, we can search for bundle nodes (and get all of them) or search for the text (and get bundle, unbundle, comments, etc.). So, it would be nice if there was the option of more complicated searches. For instance, we could do something like FIND: ObjectType is BundleNode AND ObjectText contains "frequency" AND [only in VIs along path "C:\code\subVIs" OR only in VIs along path "D:\code\commonVIs"]
 
Pat
Trusted Enthusiast
Albert.Geven
Posts: 3,336
0 Kudos

Re: Searching through your source code

I strongly support the find text in bundle/unbundle functions.
That is the way you find particular assignments in your code.

greetings from the Netherlands
Trusted Enthusiast
TCPlomp
Posts: 3,097
0 Kudos

Re: Searching through your source code

And I was hoping that this thread was about a plugin for Google Desktop for VIs so that you could search your whole repository on VI descriptions.
That would really be a good step from NI.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Knight of NI
Knight of NI
tst
Posts: 10,857
0 Kudos

Re: Searching through your source code



altenbach wrote:

I would prefer if the search results window would stay topmost after we double-click an entry (It could even be made semi-transparent so we don't miss stuff that is underneath).


How about using Ctrl+G and Ctrl+Shift+G to move forwards and backwards through the results? Then you don't need the window. Of course this means that you have to go through all the results.

Another useful shortcut is Ctrl+Shift+F which brings up the last search you performed.


___________________
Try to take over the world!
Knight of NI
johnsold
Posts: 10,099
0 Kudos

Re: Searching through your source code

I like Christian's suggestion for a Replace all.

In addition a replace option when loading a program which cannot find a subVI would be a significant time saver. Main program A.vi calls B.vi multiple places. While A.vi is closed, a modification to is made to the subVI which is changed to B.2.vi. B.vi either no longer exists or, more likely, has been moved to an archive in case we need to revert. When A.vi is opened the next time the entire search path is checked and then a file dialog asks for B.vi. Currently you have to cancel, let the VI finish loading, get a broken run arrow, then manually replace B.vi with B.2.vi. At the file dialog an option to substitute B.2.vi for B.vi would be very nice. Of course this would probably generate a warning (or several) in the warning dialog which is being discussed in a separate thread.

Lynn
Knight of NI
Knight of NI
tst
Posts: 10,857
0 Kudos

Re: Searching through your source code



johnsold wrote:

At the file dialog an option to substitute B.2.vi for B.vi would be very nice.
This already exists in 8.something (probably 8.0 or 8.2).

___________________
Try to take over the world!
Active Participant PJS
Active Participant
PJS
Posts: 629
0 Kudos

Re: Searching through your source code

I had posted a while back for a microsoft desktop ifilter for searching VIs.  So I agree with TON.  Very useful, especially for long time programmers. 

Paul <--Always Learning!!!
Philips Respironics.
sense and simplicity.
Browse my sample VIs?
Knight of NI
johnsold
Posts: 10,099
0 Kudos

Re: Searching through your source code

tst,

Thanks! I did not realize that the Browse button would allow that. I always used it just to navigate to where a VI of the same name and connector pane was located. I just tried using it to substitute something very different and it worked. So different that the top level VI was broken.

RobbieG,

Perhaps this could be labeled differently to make clear that substitution as well as navigation is possible.

Lynn