Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to recognise .inc files as php #21

Open
michaellenahan opened this issue Sep 25, 2012 · 5 comments
Open

how to recognise .inc files as php #21

michaellenahan opened this issue Sep 25, 2012 · 5 comments

Comments

@michaellenahan
Copy link

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.

@MicahCarrick
Copy link
Owner

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.

@coderpatros
Copy link

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

@manxon
Copy link

manxon commented Apr 29, 2014

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

@coderpatros
Copy link

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).

@manxon
Copy link

manxon commented Apr 30, 2014

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!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants