Author Topic: Per-project C Preprocessing for tag files?  (Read 22017 times)

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Per-project C Preprocessing for tag files?
« Reply #15 on: August 20, 2008, 12:15:38 PM »
Good idea to use conditional parts in usercpp.h ! HP++
That seems to be a reasonable workaround although the direct editing of this file is a bit clumsy...
HS2

I'm not sure if it's officially supported to do this but it's working fine for me.  Yeah it's perhaps a bit clumsy but I suspect it's more powerful than a GUI could be  - I don't know how you would generalize what I would want into a GUI.  Editing usercpp also makes it easier to find things and see what the current defines are than a GUI would be.  Maybe the exisitng GUI could be improved by separating usercpp from syscpp stuff but it's not a problem any more.  I guess I could also write a macro that switched usercpp settings automatically when I switched projects - or maybe usercpp could allow interrogation of things like current project/ current workspace etc- or access "defines" that are set in project properties.  You wouldn't need to rebuild the tag file every time you switched workspaces, even though usercpp is technically changing when the workspace changes.

Graeme
« Last Edit: August 20, 2008, 12:20:23 PM by Graeme »

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Per-project C Preprocessing for tag files?
« Reply #16 on: August 20, 2008, 02:18:32 PM »
The idea is to have a <workspace>cpp.h corresponding to a <workspace> and it's associated tagfile and e.g. to use the global 'usercpp.h' as fallback if the user doesn't specify a specific one.
This is basically the same as using ONE conditional usercpp.h but it 'd allow to use the GUI-based configuration as usual.
HS2

Phil Barila

  • Senior Community Member
  • Posts: 745
  • Hero Points: 61
Re: Per-project C Preprocessing for tag files?
« Reply #17 on: August 20, 2008, 04:20:29 PM »
I'd like to see SlickEdit take the workspace tag config much further.  I'd like to be able to limit the workspace to a subset of the compiler tag files, so if I have a workspace that builds with Cygwin, I can exclude the Visual Studio tag files entirely.  Taking that thought a little further, I'd like to make that a part of the build configs in the project, so I can select different configs and have them select tagfiles appropriately.  The default for all of that would be all tagfiles, of course, you have to set the option to limit things.  That would really enhance my particular workflow.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Per-project C Preprocessing for tag files?
« Reply #18 on: August 20, 2008, 06:55:29 PM »
@Phil: AFAIK the compiler tagfile is already automagically selected according to the per project compiler.
Hmm - this could cause minor problems when editing a (workspace) file which belongs to another project with a different compiler setup ???
HS2

Phil Barila

  • Senior Community Member
  • Posts: 745
  • Hero Points: 61
Re: Per-project C Preprocessing for tag files?
« Reply #19 on: August 20, 2008, 07:29:57 PM »
@Phil: AFAIK the compiler tagfile is already automagically selected according to the per project compiler.
Hmm - this could cause minor problems when editing a (workspace) file which belongs to another project with a different compiler setup ???
HS2
I've not seen that behavior.  I always get all the tags that match.  I'd love to know how to limit that.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Per-project C Preprocessing for tag files?
« Reply #20 on: August 20, 2008, 08:01:36 PM »
This works for me (SE >= v12.0.3) with the 'C Compiler Configuration Tag Files' and the appr. compiler set for the current project.
HS2

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Per-project C Preprocessing for tag files?
« Reply #21 on: August 20, 2008, 09:49:31 PM »
I get the same problem as Phil gets, but not consistently.  I haven't reported it to support yet because I still don't understand what determines whether I'll see tags from all compiler tagfiles in existence, versus only the compiler tagfile for the current project/compiler configuration.  In 12.0.3, 13.0.0, and 13.0.1 often when I try to look up symbols it will show hits from 3 different C compilers plus C# tags too (I don't use C# anywhere).  I need to find time to nail down the repro steps so I can post a well-formed actionable report.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Per-project C Preprocessing for tag files?
« Reply #22 on: August 20, 2008, 10:50:17 PM »
Strange - this ;)

I could imagine that e.g. when using Find Symbol TB with 'Look in' set to anything different to 'Use Context Tagging ®' leads to undesired results. But AFAIK 'push-tag' is fixed to 'Context Tagging ®'...
HS2
« Last Edit: August 20, 2008, 10:54:55 PM by hs2 »

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Per-project C Preprocessing for tag files?
« Reply #23 on: August 20, 2008, 11:12:06 PM »
Sorry - forgot to mention that I still refer to v12.0.3 r35... HS2

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Per-project C Preprocessing for tag files?
« Reply #24 on: August 21, 2008, 01:19:44 AM »
For real:  :(

See attached screen shots.
I have 3 C compilers:  Windows Mobile, VS 2005, CodeWarrior for Palm OS.

Symbols for all 3 show up.
The screen shots show an example of "strcmp" showing up from the WM and VS2K5 compilers.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Per-project C Preprocessing for tag files?
« Reply #25 on: August 21, 2008, 10:04:01 AM »
Ok - I've double checked it with v12.0.3 and I get the appropriate tag hits for a VS2005 solution and a GNU Project (C/C++) with a specific compiler setup (it's not the default cygwin compiler).
I've also used 'strcmp' and tried push-tag and Find Symbol TB. Sorry, but it's working fine for me. Seems that's a v13.0.x problem.
HS2

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Per-project C Preprocessing for tag files?
« Reply #26 on: September 04, 2008, 08:40:45 PM »
Good idea to use conditional parts in usercpp.h ! HP++
That seems to be a reasonable workaround although the direct editing of this file is a bit clumsy...
HS2

oops, I think using conditional compilation in usercpp.h doesn't work after all.  Not sure why I thought it did.  Still, commenting out stuff does work as long as you don't do a save in the GUI dialog.  (I guess Dennis didn't read this thread yet!).  Oh well, it's not that hard to automate switching usercpp.h if anyone really wants to.

Graeme

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Per-project C Preprocessing for tag files?
« Reply #27 on: September 04, 2008, 09:18:10 PM »
That's a pitty... (didn't tried it yet).
Right, you shouldn't use the GUI after manually changing usercpp.h. It's alpha sorted on GUI-save etc.
And yes, messing around with per workspace usercpp.h copies is a workaround on my long term todo list.
But fortunately pressure wasn't high enough to start with up to now...
HS2