Find in Project - looking in .h files (crossworks version 2)

Comments

18 comments

  • Avatar
    Paul Curtis

    There will be an option to Find in Project + Dependencies; Find in Project only searches the sources you specify in the project, nothing else.

    0
    Comment actions Permalink
  • Avatar
    Tom Engelberth

    So the Find in Project + Dependencies does not yet exist correct?  I assume then it is something planned for a latter version.

    For the Find in Files choice how do I get it to remember the last directories I have searched in and to present that list to me when I do a Find in Files?    Version 1.7 did this but Version 2.X does not seem to do it or I do not have it correctly set to do it.

    I am currently running version  2.0.7.2010061501.7937  and see that version 2.09 is out so is this issue resolved in 2.09?   (did not see anything in the release note that sounded like it would be).

    Thanks

    Tom

     

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    > For the Find in Files choice how do I get it to remember the last directories I have searched in and to present that list to me when I do a Find in Files

    Possibly you don't.

    Is it resolved in 2.0.9?  No.


    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    This is now all scooped up and should be in the next release.

    0
    Comment actions Permalink
  • Avatar
    Stephen Hersey

    Apparently, 2.1 doesn't search the headers even with the Dependencies box checked; at least, the search results show no hits in .h files. This is of interest to me because I'm hunting down a weird dependency issue that I suspect is caused by two identically-named header files with different contents; I trust that the benefit of displaying search hits in header files is obvious.

     

    Am I missing something about the way this feature is supposed to work?

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    Alt+U does not search dependencies, no.  It is not documented as searching dependencies.  If you need that, use the Find and Replace window.

    0
    Comment actions Permalink
  • Avatar
    Stephen Hersey

    So, the Search menu's Find in Project and Find in Solution don't search headers? Find in Files works for searching headers, but it's a hideous pig to use, 'cause the default search folder doesn't contain the third-party header files, referenced in the project, that often contain the declarations I'm looking for. Moreover, for some reason I cannot make it search file types "*.c,*.h", so I'm stuck with either JUST searching *.h, or else searching *.*, meaning that it ransacks the build artifacts as well.

     

    All in all, while I can get the job done using Find in Files, it's rather clunkier than I would expect from an expensive commercial development tool, and I cannot fathom the reasons behind excluding header files from a text search in a programming toolset. Not jumping ship to Keil or Atollic just yet, but NOT a happy camper.

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    > So, the Search menu's Find in Project and Find in Solution don't search headers?

    It says "In Project" and "In Solution".  Only files that are in the project and solution are searched, not ones they #include unless they are added as header files to the project.  Any file in the project will be searched, but not ones indirectly included.

    > All in all, while I can get the job done using Find in Files

    If you are using V2.1, Find in Files and the Find and Replace window have a "Search Dependencies" checkbox.  Use it.  If you are using v2.0 then upgrade to v2.1.  If you are using v1.7 then upgrade to v2.1.

    0
    Comment actions Permalink
  • Avatar
    Stephen Hersey

    I've already started using 2.1, which is why I'm curious about its behavior. So, the advice is that I should explicitly add the header files to the project so the Search Dependencies will search them. I've tried adding one header, and the search does indeed find the symbols therein; so far, so good. Does adding the header files to the project have any other effects, as for example on dependency checking when the compiler decides what needs recompilation? I'm being painfully precise here because I have several rather large and complicated project files with many headers, and I want to avoid doing a time-consuming task that causes me more grief than it cures.

     

    Moreover, I cannot seem to find any examples of CrossStudio projects (even your sample projects) that include header files in the projects, which had initially led me to think this wasn't a viable option. Is this just happenstance?

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    > So, the advice is that I should explicitly add the header files to the project so the Search Dependencies will search them. 

    No.  Search Dependencies will search any #included file as long as the dependencies are up to date.  Show the dependencies in the Project Explorer and you will see all #included files; you can configure whether they go into a folder in the project or directly under the node they are dependencies of .  You can then search them by checking "Dependencies" in the Find in Files dialog or the Find and Replace window.

    > Moreover, I cannot seem to find any examples of CrossStudio projects (even your sample projects) that include header files in the projects,

    That's because they all use standard libraries rather than provide their own header and C files.

    0
    Comment actions Permalink
  • Avatar
    Stephen Hersey

    OK, that seems to work. Or rather, it seems to work some of the time and not other times. I've set the Tools/Options/File Search options/Search Dependencies setting to "yes" (did that several program restarts ago, and left it at "yes"), but even then, the Search Entire Solution function doesn't search the headers although the Find and Replace pane lists "dependencies" under "additional options" when the search results come up. The only way I get headers searched is to repeat the search by expanding the "additional options" item in the Find and Replace pane (which unaccountably shows the "dependencies" box being UNchecked!), manually check that box, and repeat the search by pressing the "Find" button in the Find and Replace pane. It is now apparent that there's a bug in the implementation of this option, which explains why I didn't think it worked.Whether or not the include files are searched depends on how you trigger the search.

     

    Thanks for your patience with this extended dialog...

     

    Regards, Steve

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    > It is now apparent that there's a bug in the implementation of this option, which explains why I didn't think it worked.

    Don't think so.  It's working as designed.  The search options are saved from the last search and if you use Alt+U they get reset to what Alt+U is programmed to do.  You can watch this by opening the Find and Replace dialog and doing an Alt+U search.

    > Whether or not the include files are searched depends on how you trigger the search.

    Correct.

    0
    Comment actions Permalink
  • Avatar
    Stephen Hersey

    > Don't think so.  It's working as designed.  The search options are saved from the last search and if you use Alt+U they get reset to what Alt+U

    > is programmed to do.  You can watch this by opening the Find and Replace dialog and doing an Alt+U search.

    I still call it a bug if I enable "search dependencies" in the IDE settings, and the search then defaults to NOT searching dependencies, and REdefaults to not searching dependencies if I close the Find and Replace dialog. Especially since the Find and Replace dialog is telling me that Search Dependencies is ENABLED while it does an Alt-U search that, from its results, clearly is not searching them. That mismatch is what I'm calling a bug.

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    > I still call it a bug if I enable "search dependencies" in the IDE settings, and the search then defaults to NOT searching dependencies.

    Alt+U sets the defaults according to what the cursor is on in the editor and whether there is a selection.  If there is no selection then the IDE sets "whole word match" to true; if there is a selection, then "whole word match" is set off.

    > and REdefaults to not searching dependencies if I close the Find and Replace dialog

    Closing the dialog does not "redefault" anything.  If you open the dialog you will find the Dependency setting as you left if.  The Find and Replace dialog will set the Whole Word based on where the cursor is and what the selection is as Alt+U does.

    If you only use the Find and Replace window then the settings will not change--until you use Alt+U or Alt+Shift+U.

    I would consider changing Alt+U to "Find in Solution" and Alt+Shift+U to "Find in Solution and Dependencies". At present the IDE is working as designed, it is not a bug.  I am willing to be guided by user expectation, however.

    > Search Dependencies is ENABLED while it does an Alt-U search that, from its results, clearly is not searching them

    Alt+U unchecks Dependencies by design.  Your expectation is, however, different.

    0
    Comment actions Permalink
  • Avatar
    Stephen Hersey

    > I would consider changing Alt+U to "Find in Solution" and Alt+Shift+U to "Find in Solution and Dependencies".

    That would be useful. However, I cannot seem to find any mechanism in the IDE (at least, not in the Windows version) for changing the key bindings. I can SEE the keyboard map, but I don't have any readily apparent way to change it. Nor is there a "Find in Solution and Dependencies" command or option anywhere I can find.

    > Alt+U unchecks Dependencies by design.

    And this is documented where, exactly? As mentioned above, a search of the online help is unrewarding ion the entire subject of searching dependencies.  While we're on the subject, what exactly is the "Search Dependencies" setting in the "File Search Options" section of the "Environment" tab of the "Environment Options" dialog box actually supposed to do, since it obviously doesn't cause a search of the files in the solution to search the dependencies, i.e., the headers? I rather thought that was what started off this whole thread, the desire to make searches include header dependencies by default.

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    This has all turned a little off-topic, but still:

    > I cannot seem to find any mechanism in the IDE (at least, not in the Windows version) for changing the key bindings.

    We don't advertise the fact you can do this.  I find it amazingly annoying to do this through the IDE (and Visual Studio is a pain also).  You can, however, use Files > Open Directory in File Explorer > Studio Directory, navigate to the 'bin' directory and open studio.xml.  In there you will find complete control of the IDE, including where things are put in the menus and the key mappings and names.

    > Nor is there a "Find in Solution and Dependencies" command or option anywhere I can find.

    I would need to add this.

    > And this is documented where, exactly?

    Good question.  I have a good answer, but I feel that would only inflame matters for those who are not acquainted with my sense of humour.  :-( 

    > ...Search Dependencies" setting in the "File Search Options" section of the "Environment" tab of the "Environment Options" dialog box actually supposed to do

    Do this:

    Choose Search > Find and Replace

    In the Find and Replace window, open the Additional Options disclosure to show the four check boxes.

    Choose Tools > Options

    Change the setting of Search Dependencies from Yes to No and watch the setting change in the Find and Replace window.

    > since it obviously doesn't cause a search of the files in the solution to search the dependencies

    As I said, it does.  But not through Alt+U.  I don't know how many times I have said this now, this is by design because this is the way that I use it and the way I like it, because I wrote that part of the IDE for me.  If you stay in the Find and Replace window and do not use the Alt+U shortcut then dependencies are searched.

    > I rather thought that was what started off this whole thread, the desire to make searches include header dependencies by default.

    To do this, simply live in the Find and Replace window and do not use Alt+U for the present.  Alt+U and Alt+Shift+U is directly tailored to the way that *I* want it to work.  The fact it doesn't do what you want cuts very little ice, but, as I said, I am willing to make some changes.  CrossStudio already has so many options spread all over the place and also in Tools > Options and in projects and solutions that it happens to be a tremendously complex place to work.  Adding more options means more complexity, something that has already been a bone of contention with users requiring a "simple" development environment for ARM.  There is no such thing, unless you cut down configurability and the number of targets supported.

    0
    Comment actions Permalink
  • Avatar
    Stephen Hersey

    > Good question.  I have a good answer, but I feel that would only inflame matters for those who are not acquainted with my sense of humour.  :-( 

    I have a similar sense of humor (although it is spelt differently, me being an upstart Colonial), so I have some understanding of that. And I *do* understand the tedium of trying to document __everything__ in a complex product.

    >  If you stay in the Find and Replace window and do not use the Alt+U shortcut then dependencies are searched.

    OK, I've tried the sequence you suggested, and it shows me that the behavior of the Search Dependencies environment  variable is non-persistent. Doing a Shift-Alt-U search or unchecking the box in the Find and Replace window CLEARS the corresponding setting in the Tools->Options dialog, which is not what I would have expected of an environment setting. As far as I can see, that setting in the Options box adds no value at all, as it does nothing that the checkbox in the Search and Replace window doesn't do, and gets nuked by an Alt-U search anyway. It appears that my mistake here was in assuming that the environment variable would be persistent.

    > To do this, simply live in the Find and Replace window and do not use Alt+U for the present.  Alt+U and Alt+Shift+U is directly tailored to the way that *I* want it to work.  The fact it doesn't do what you want cuts very little ice ...

    OK, Alt-U is off the table for me; I can live with this feature as it is, though I will never like it. At the risk of being contentious, however, I'd like to point out two things:

    1) the way *I* like to work involves being able to see more than the first 30 columns of text in the source window, which is why I try to avoid having the search pane open all the time. Screen clutter gets in my way. I use a wide-screen monitor to write code for that exact reason. Doing maintenance programming that involves hunting down lots of #defines and function prototypes in other folks' obscure header files means I *must* search them, and the way *you* want it to work makes *my* job harder.

    2) If the desires of one of YOUR corporate customers that has spent the better part of $7000 on YOUR products in the past year or so cuts very little ice with you because their work style differs from yours, then you might want to consider who's paying the bills and why their work styles might just be worth taking into account in your product design. If you disparage your customers' preferences, I can assure you that there are other vendors who don't. I am repeatedly asked why we stay with CrossStudio instead of using more familiar toolsets such as Keil; interactions of this sort don't exactly provide me with great incentive to resist that pressure. I'll work with the tools I have to, and I'll live with the way they work, but I won't recommend vendors who don't think my opinions count.

     

    Regards, Steve

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    > Doing a Shift-Alt-U search or unchecking the box in the Find and Replace window CLEARS the corresponding setting in the Tools->Options dialog, 

    It does.

    > It appears that my mistake here was in assuming that the environment variable would be persistent.

    It persists but is cleared by Alt+U.

    > the way *I* like to work involves being able to see more than the first 30 columns of text in the source window, which is why I try to avoid having the search pane open all the time. 

    You can move the Find and Replace window somewhere else, like to the bottom or to a HUD.  This will be easier in a subsequent release.

    > Doing maintenance programming that involves hunting down lots of #defines and function prototypes in other folks' obscure header files means I *must* search them, and the way *you* want it to work makes *my* job harder.

    I have already said what I would consider in way of making changes.

    > 2) If the desires of one of YOUR corporate customers that has spent the better part of $7000 on YOUR products in the past year or so cuts very little ice with you because their work style differs from yours, then you might want to consider who's paying the bills and why their work styles might just be worth taking into account in your product design.

    You've made your point.  I have also said what I am prepared to do to support your expectations.  One assumes you have chosen CrossWorks over IAR or Keil using criteria that favour us rather than them.

    > If you disparage your customers' preferences, I can assure you that there are other vendors who don't. I am repeatedly asked why we stay with CrossStudio instead of using more familiar toolsets such as Keil; interactions of this sort don't exactly provide me with great incentive to resist that pressure.

    I have explained why those options arose and work as designed.  Not only that, I have said what I am prepared to do because of your expectations.  Do you think that Keil will go and change their software, or even respond in an absolutely open way, in public, like this?  Last time I looked, the Keil and IAR IDEs do not provide anything like the searching ability built into CrossWorks.

    There is a site that is set up specifically to request changes: rowley.uservoice.com.  There you can make requests, track them, and see what others are asking for.  It's hardly like we hide them away, or we don't respond.  When we decline a request, we indicate why.  When we accept and complete a request, you know about it.  And there is a history of interaction on each request made.  

    > I'll work with the tools I have to, and I'll live with the way they work, but I won't recommend vendors who don't think my opinions count.

    I have said that I am prepared to change CrossStudio, and proposed such a change.  I've told you how you can have Dependencies always searched.  It's not as if you can't do this, it's just that a single shortcut doesn't do what you expect but does what I expect and intended.

    It is simple to add a "...and search dependencies" shortcut.  You can then assign this to Alt+U if you so desire by editing up the studio.xml file.

    0
    Comment actions Permalink

Please sign in to leave a comment.