gedit-source-code-browser icon indicating copy to clipboard operation
gedit-source-code-browser copied to clipboard

how to recognise .inc files as php

Open michaellenahan opened this issue 11 years ago • 5 comments

Hi there - thank you for such a great plug-in!

I'm using gedit for drupal development, and need to have these file extensions recognised as php, so that I can view the source code symbols when looking at these file types as well.

.engine .inc .module .theme .install

I think I need to configure the ctags setting on my machine (Ubuntu 12.04)

I tried the tip here: http://www.koumbit.org/en/articles/using-exuberant-ctags-drupal ... but it doesn't work ... I'd be grateful for any pointers.

michaellenahan avatar Sep 25 '12 13:09 michaellenahan

I believe the langmap argument is the right approach, but, I haven't done it myself. You would set it in the plugin settings as the ctags command. I think there are also ctags config files you can put in the home directory, but I'm not sure. It's been a while. I'll keep this issue open until we can confirm.

MicahCarrick avatar Sep 25 '12 23:09 MicahCarrick

Hi Michael. I was in the same boat as you so I made a fork which has support for overriding ctags language detection by using the current gedit highlighting mode. You can find my changes at https://github.com/patros/gedit-source-code-browser/tree/language_override

coderpatros avatar May 07 '13 12:05 coderpatros

Hi Patros,

I'm also a drupal dev. I just cloned you repository but I still get the empty source code windown problem, do you have any advise?

Ctags 5.9~svn20110310 Gedit 3.4.1 git clone https://github.com/patros/gedit-source-code-browser.git Ubuntu 12.04

@michaellenahan Did it work for you?

Thank you

Julian

manxon avatar Apr 29 '14 22:04 manxon

Hi Julian.

I didn't have my change merged into the master branch which you would of ended up with after the git clone.

Try a git checkout origin/language_override. I have now merged that change into master but it also includes a fix for Python 3 which I don't think is needed on Ubuntu 12.04 (and it probably won't work either).

coderpatros avatar Apr 30 '14 11:04 coderpatros

Hi Patros

I was a bit desperate to make it work yesterday, so I make it worked by hacking the ctags package in the file php.c and adding the extensions extern parserDefinition* PhpParser (void) { static const char const extensions [] = { "php", "php3", "phtml", "module", "inc", "engine", "install", NULL }; parserDefinition def = parserNew ("PHP"); def->extensions = extensions; def->initialize = installPHPRegex; def->regex = TRUE; return def; } Then I did a ./configure, make, make install and worked fine. I'll try your package cause it is a cleaner solution.

Thank you!!

manxon avatar Apr 30 '14 12:04 manxon