[geany/geany] 258c4f: PHP: generate tags for local variables (disabled by default)

Colomban Wendling git-noreply at xxxxx
Wed Jul 3 17:42:00 UTC 2013


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 15 Apr 2013 16:54:42 UTC
Commit:      258c4fa65d7dc154e0da0c8b29eaf874af4f166e
             https://github.com/geany/geany/commit/258c4fa65d7dc154e0da0c8b29eaf874af4f166e

Log Message:
-----------
PHP: generate tags for local variables (disabled by default)


Modified Paths:
--------------
    tagmanager/ctags/php.c

Modified: tagmanager/ctags/php.c
17 files changed, 11 insertions(+), 6 deletions(-)
===================================================================
@@ -100,6 +100,7 @@
 	K_DEFINE,
 	K_FUNCTION,
 	K_INTERFACE,
+	K_LOCAL_VARIABLE,
 	K_VARIABLE,
 	COUNT_KIND
 } phpKind;
@@ -109,6 +110,7 @@
 	{ TRUE, 'm', "macro",		"constant definitions" },
 	{ TRUE, 'f', "function",	"functions" },
 	{ TRUE, 'i', "interface",	"interfaces" },
+	{ FALSE, 'l', "local",		"local variables" },
 	{ TRUE, 'v', "variable",	"variables" }
 };
 
@@ -885,18 +887,21 @@ static boolean parseVariable (tokenInfo *const token)
 	boolean readNext = TRUE;
 	accessType access = CurrentStatement.access;
 
-	/* don't generate variable tags inside functions */
-	if (token->parentKind == K_FUNCTION)
-		return TRUE;
-
 	name = newToken ();
 	copyToken (name, token, TRUE);
 
 	readToken (token);
 	if (token->type == TOKEN_EQUAL_SIGN)
 	{
+		phpKind kind = K_VARIABLE;
+
+		if (token->parentKind == K_FUNCTION)
+			kind = K_LOCAL_VARIABLE;
+
 		readToken (token);
-		if (token->type == TOKEN_KEYWORD && token->keyword == KEYWORD_function)
+		if (token->type == TOKEN_KEYWORD &&
+			token->keyword == KEYWORD_function &&
+			PhpKinds[kind].enabled)
 		{
 			if (parseFunction (token, name))
 				readToken (token);
@@ -904,7 +909,7 @@ static boolean parseVariable (tokenInfo *const token)
 		}
 		else
 		{
-			makeSimplePhpTag (name, K_VARIABLE, access);
+			makeSimplePhpTag (name, kind, access);
 			readNext = FALSE;
 		}
 	}



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list