| 1 | = !CodeLite-2.0 = |
| 2 | |
| 3 | The attached files in the directories below provide partial support in |
| 4 | !CodeLite-2 (starting from 2.0.3365) for cobra language development. |
| 5 | |
| 6 | == What is supported == |
| 7 | * Syntax colorization |
| 8 | * Project Templates for debug, release and turbo builds of |
| 9 | * Console: Simple cobra executable (single file) |
| 10 | * User Templates: cobra executable |
| 11 | * User Templates: cobra library |
| 12 | * User Templates: cobra executable with embedded runtime |
| 13 | * cobra builds, build error capture and parsing. |
| 14 | * Running the executable made |
| 15 | * Some elements of tags-like/cscope capability |
| 16 | - See Note below |
| 17 | |
| 18 | == What is not supported (yet) == |
| 19 | * Code structure browser (Outline) |
| 20 | * word and call completion (intellisense) |
| 21 | * Debugger/debugging |
| 22 | |
| 23 | == Prerequisites == |
| 24 | |
| 25 | * Installed version of the cobra compiler installation. |
| 26 | Specifically you will need to know the path to the compiler |
| 27 | executable cobra.exe |
| 28 | * gzipped tar dearchiver (gzip, gnu tar, 7-zip, winRar) |
| 29 | - if obtained this file in a tar archive |
| 30 | |
| 31 | == Installation == |
| 32 | |
| 33 | * Download an installation binary for !CodeLite version 2.0 from the !CodeLite website. |
| 34 | |
| 35 | * Install it and take note of the installation directory |
| 36 | |
| 37 | * If necessary for each text file below this directory modify |
| 38 | line endings to conform to those of the platform you are running on.[[BR]] |
| 39 | ( see the le program in cobra compiler source ./Supplements/le.cobra)[[BR]] |
| 40 | Currently these are multiple files under three directories that are intended to be copied into the !CodeLite installation. |
| 41 | - config |
| 42 | - templates |
| 43 | - lexer |
| 44 | {{{ |
| 45 | cd <this dir> |
| 46 | cp -pr config/* /wbin/CodeLite/config/ |
| 47 | cp -pr lexers/* /wbin/CodeLite/lexers/ |
| 48 | cp -pr templates/* /wbin/CodeLite/templates/ |
| 49 | |
| 50 | }}} |
| 51 | |
| 52 | * All of the files are additional to the default !CodeLite |
| 53 | installation except for files in config. These copies replace the |
| 54 | existing files in the installed config directory (they should be a |
| 55 | superset). |
| 56 | If you are feeling paranoid you might want to backup the !CodeLite installation originals before the copy. |
| 57 | |
| 58 | Alternatively the file ./00-config.patch has the mods to the |
| 59 | config directory files as a patch file against a 2.0.3365 installation. |
| 60 | If you run the patch program against the patch file you can attempt to |
| 61 | patch the !CodeLite installation files in place. |
| 62 | {{{ |
| 63 | cd <this dir> |
| 64 | patch -p0 -i ./00-config.patch |
| 65 | }}} |
| 66 | Note that you'll need to have patch installed and you may have problems with version skew if the installation files change.[[BR]] |
| 67 | The patch file assumes the !CodeLite Installation is in {{{ /Program\ Files/CodeLite}}} - if thats not the case you will need to change |
| 68 | all occurrences of that path to your installation dir before running the patch.... Luck |
| 69 | |
| 70 | * Start !CodeLite - select menubar 'Settings' item '!BuildSettings'. |
| 71 | In the popup dialog that appears you should see a box on the left |
| 72 | hand side containing a possibly expanded entry for Cobra. |
| 73 | |
| 74 | * You now need to tell !CodeLite the path to the cobra compiler. |
| 75 | o In the above dialog (menubar 'Settings'/'Build Settings...' |
| 76 | under the cobra Tree entry click on 'Tools'. |
| 77 | |
| 78 | The RHS of the dialog will show a form the top line of which has an entry similar to |
| 79 | {{{'Compiler Name: C:\some\path\to\cobra.exe'}}}. [[BR]] |
| 80 | Change the path to that of your cobra compiler (fwd or back slashes are equally recognised).[[BR]] |
| 81 | Press 'OK' btn to save the change. |
| 82 | |
| 83 | o Select from !MenuBar menu 'Settings'/'Environment Variables...'. |
| 84 | edit the 'cobrac' entry to specify the full path to the cobra compiler |
| 85 | and save your changes. |
| 86 | |
| 87 | == Tested On == |
| 88 | |
| 89 | Installation Tested on Windows (XP-pro SP3). |
| 90 | |
| 91 | == Usage == |
| 92 | |
| 93 | * Workspace/New Project |
| 94 | |
| 95 | Select type of cobra project from cobra templates supplied: |
| 96 | {{{ |
| 97 | Console/Simple Executable(Cobra) |
| 98 | or |
| 99 | User Templates/Cobra-executable |
| 100 | /Cobra-library |
| 101 | /Cobra-embedded-RT |
| 102 | }}} |
| 103 | and enter the project name and path to your project directory |
| 104 | and press OK. |
| 105 | |
| 106 | * In the generated project tree select the project name and add (for existing) or create your cobra sources. |
| 107 | |
| 108 | * You'll notice that where theres a '''Resources''' virtual dir made for a project theres a file 'build-file' which is a build-list file for the cobra compiler to use |
| 109 | (for apps that require multiple source files)[[BR]] |
| 110 | Unfortunately you currently have to maintain the contents of this yourself as we cant get hold of !CodeLites sourcelist.[[BR]] |
| 111 | Just add filename entries to it as you add/create your source files. |
| 112 | |
| 113 | |
| 114 | == Notes == |
| 115 | |
| 116 | === Syntax Colorization === |
| 117 | !CodeLite uses the Scintilla editing component which supports syntax |
| 118 | colorization for a number of languages.[[BR]] |
| 119 | The Cobra configuration uses the python lexer |
| 120 | for colorization currently which works for everything except cobras |
| 121 | block commenting construct (/# ... #/) - we'll have to get a modified |
| 122 | lexer to support that. |
| 123 | |
| 124 | There are two colorization schemes available for cobra. The minimalist and |
| 125 | install default one ('Cobra') is exactly the same as that for python. |
| 126 | |
| 127 | I made a modified one for my preference which is called '!CobraAlt'.[[BR]] |
| 128 | If you would like to enable it use the |
| 129 | menuBar 'Settings/SyntaxHighlight and Fonts..' to get to the |
| 130 | Syntax Highlight dialog. [[BR]] |
| 131 | You'll notice the settings for the Cobra scheme specify a file mask of '*.cobra' while that for !CobraAlt specifies '*.cobra-A'. |
| 132 | To enable the alt scheme you will need to swap these:[[BR]] |
| 133 | i.e change the Cobra scheme filemask to something else (*.cobra00 say) |
| 134 | and the !CobraAlt scheme filemask to the std cobra extension (*.cobra)[[BR]] - !CodeLite/Scintilla doesnt seem to handle multiple schemes with the same file mask.[[BR]] |
| 135 | |
| 136 | After that you'll need to reload the workspace to get the color changes |
| 137 | (menuBar 'Workspace/ReloadWorkspace'). |
| 138 | |
| 139 | |
| 140 | === Ctags Capabilities === |
| 141 | |
| 142 | !CodeLite supports ctags and cscope for file navigation - currently the inbuilt tagger seems tied to C/C++. |
| 143 | However You can get this to work in some fashion either by using ctags ([http://ctags.sourceforge.net/ exuberant ctags]) |
| 144 | manually or adding an 'external tool' setup to CodeLite to run it. (In either case you'll need to get and install the ctags binary) |
| 145 | |
| 146 | The file {{{../ctags/home.ctags }}} in this tree provides minimal support for recognising and tagging .cobra files.[[BR]] |
| 147 | Take it and install it in your home directory as .ctags (i.e $HOME/.ctags). |
| 148 | |
| 149 | Now you should be able to make a tags file for your cobra sources by |
| 150 | running 'ctags -R *.cobra'.[[BR]] |
| 151 | Copy the generated 'tags' file into your codeLite workspace file |
| 152 | overwriting (the empty) tags file thats there. |
| 153 | |
| 154 | (There are settings in !CodeLite - 'tags settings' - to do this but |
| 155 | the dialog is currently wired to forcing C/C++ files which has the |
| 156 | effect of generating an empty tags file for cobra sources which doesnt |
| 157 | do us much good). |
| 158 | |
| 159 | Within codelite the 'Find this C symbol' and 'Find this global symbol' |
| 160 | then provide results, the caller/callee searches dont return anything |
| 161 | |
| 162 | === Tasks tab === |
| 163 | The wired buttons (TODO/FIXME/ATTN/...) and search doesnt work for cobra as is. |
| 164 | |
| 165 | Modify the task entry line to search 'all files' rather than C/C++ files.[[BR]] |
| 166 | You then need to use the 'Customize' button to bring up a customized search dialog; [[BR]] |
| 167 | modify the search pattern to look for a # comment prefix rather than '/*' |
| 168 | the pattern should be something like {{{'#[ \t]*(TODO|FIXME|BUG|ATTN) *:*'}}} |
| 169 | and change the 'Look in these filetypes' line to '*.cobra' |
| 170 | |
| 171 | Search hits will display in the 'Find Results' Tab. |