| Summary: | Add a variable like 'base_filename' to the code template variables | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Dirk Wibben <dirk.wibben> |
| Component: | cdt-editor | Assignee: | Anton Leherbauer <aleherb+eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | Anton Leherbauer <aleherb+eclipse> |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | cdtdoug |
| Version: | 7.0.2 | ||
| Target Milestone: | 8.0 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
I'll add a variable named "file_base", because that's already available for file/code templates. That sounds great. Exactly what I was looking for. THX a lot. Committed. *** cdt cvs genie on behalf of aleherbau *** Bug 341086 - Add a variable like 'base_filename' to the code template variables [*] TranslationUnitContextType.java 1.14 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TranslationUnitContextType.java?root=Tools_Project&r1=1.13&r2=1.14 [*] TemplateMessages.properties 1.8 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.properties?root=Tools_Project&r1=1.7&r2=1.8 [*] TemplateMessages.java 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.java?root=Tools_Project&r1=1.5&r2=1.6 |
Build Identifier: CDT 7.0.2.201102110609 Our coding standards require a 'namespace' identifier before every element (variables, constants, functions, macros, etc.), which consists of the basename of the C-file. Example: Test.c: #define Test_OneMacro() (...) unsigned char Test_OneVariable; void Test_OneFunction(void); I have coded several Editor-Templates for inserting/adding such elements, but what I miss in the list of available Variables is something like ${basefilename}. There is already ${file}, but this is alway expanded to 'Test.c'. What I would like to have is 'Test' WITHOUT the extention. So far I use ${file}, but I always have to edit the inserted code afterwards to delete the extention. Reproducible: Always