Possible Feature Request: $WorkspaceName

Post here any ideas/problems/suggestions you have regarding CodeLite's ExternalTools plugin
marvin_littlewood
CodeLite Enthusiast
Posts: 13
Joined: Mon Dec 14, 2009 6:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

Possible Feature Request: $WorkspaceName

Post by marvin_littlewood » Wed Feb 17, 2010 4:06 am

Hi!

I have a workspace (lst) with multiple projects (st, libLst & test) and have set up Doxygen to work through them all, using a configuration file based on the name of the workspace (lst.cfg).

In order to avoid having to switch applications, I wanted to set up Doxygen as an external tool which used "lst.cfg". Unfortunately there was no macro that expanded to the workspace name, although there was one for the project name.

For now, I renamed the Doxygen configuration file to that of the active project (test) and used the $ProjectName macro, but I wondered if there was any value to extending the set of macros to include one that expanded to the workspace name?

Many thanks

Marv

User avatar
eranif
CodeLite Plugin
Posts: 5924
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Possible Feature Request: $WorkspaceName

Post by eranif » Thu Feb 18, 2010 4:35 pm

I added new macro in trunk: $(WorkspaceName)

Eran
Make sure you have read the HOW TO POST thread

marvin_littlewood
CodeLite Enthusiast
Posts: 13
Joined: Mon Dec 14, 2009 6:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Possible Feature Request: $WorkspaceName

Post by marvin_littlewood » Sat Feb 20, 2010 3:01 am

Hi Eran

Many thanks...

I look forward to using it on the next published update.

Marv

User avatar
kspes
CodeLite Enthusiast
Posts: 41
Joined: Sat Jan 30, 2010 2:18 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Possible Feature Request: $WorkspaceName

Post by kspes » Sat Feb 20, 2010 4:15 pm

I took a look at what you made in revision 3771 and have a question: why do you have macros defined at two separate locations? one in globals.cpp:DoExpandAllVariables() and one in macromanager.cpp: MacroManager::Expand()

User avatar
eranif
CodeLite Plugin
Posts: 5924
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Possible Feature Request: $WorkspaceName

Post by eranif » Sat Feb 20, 2010 5:14 pm

This is from the methods in the 'globals.h':

Code: Select all

/**
 * [DEPRECATED] DONT USE THIS METHOD ANYMORE - USE IMacroManager
 * Expand variables to their real value, if expanding fails
 * the return value is same as input. The variable is expanded
 * in the project context
 */
wxString ExpandVariables(const wxString &expression, ProjectPtr proj, IEditor *editor);

/**
 * * [DEPRECATED] DONT USE THIS METHOD ANYMORE - USE IMacroManager
 * \brief accepts expression string and expand all known marcos (e.g. $(ProjectName))
 * \param expression expression
 * \param projectName project name (to be used for $(ProjectName) macro)
 * \param fileName file name, to help expand the $(CurrentFile) macro family
 * \return an expanded string. If a macro is unknown it is replaced by empty string
 */
wxString ExpandAllVariables(const wxString &expression, Workspace *workspace, const wxString &projectName, const wxString &selConf, const wxString &fileName);
Note the deprecated part.
Those functions are deprecated and wont get extend in the future. However, they are in use in several location in the code which currently to remove them completely needs some refactoring.

Since adding $(WorksapceName) involved in 1 line, I did not mind adding to the old methods as well. However, plugins are encouraged to use the new interface (it was introduced a week ago)

Eran
Make sure you have read the HOW TO POST thread

petah
CodeLite Expert
Posts: 231
Joined: Sat Nov 24, 2012 8:04 pm
Genuine User: Yes
IDE Question: c++
Location: Los Angeles
Contact:

Re: Possible Feature Request: $WorkspaceName

Post by petah » Sun Jun 23, 2013 2:49 am

Btw an optional, non-disruptive $TaskbarTitle macro would be great, esp. to identify multiple opened CL proects.

The default value would be "($CurrentFileFullPath) CodeLite $(CodeLiteGitRevision)$(DirtyFileChar)" so the current behavior applies unless the user overrides it, f.ex. $TaskbarTitle="CL: $(ProjectName) - $(CurrentFileName)$(DirtyFileChar)".

-- p
main: Debian Jessie x64 + custom wxTrunk

Post Reply