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

TM cleanups #957

Merged
merged 28 commits into from Jun 10, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f61a64b
Remove the TagEntrySetArglistFunction hook
techee Jan 11, 2016
7be40f5
Initialize ctags at a single place instead of four
techee Mar 11, 2016
1de1398
Improve ctags callback API
techee Jan 11, 2016
75c5cb6
Use G_BEGIN_DECLS/G_END_DECLS
techee Mar 9, 2016
4dcc829
Remove unused tm_tagmanager.h
techee Mar 9, 2016
103d2c5
Move code related to various tag file formats into tm_source_file.c
techee Mar 10, 2016
1c4aaa0
Add an API-like ctags layer
techee Mar 9, 2016
b72b859
Clean up messy tm_workspace_create_global_tags()
techee Mar 11, 2016
aea7d78
Remove some unused return values and unnecessary checks
techee Mar 10, 2016
5d9376e
Add explicit mapping of ctags tag types to Geany tag types
techee Mar 22, 2016
2bdc967
Use proper C prototypes
b4n May 4, 2016
7411f9b
Remove an unused variable
b4n May 4, 2016
056e53c
Make our convenience libraries more self-contained
b4n May 4, 2016
fdc4510
Don't use char array subscript as it may be signed
b4n May 4, 2016
4036d7d
Remove not useless tm_source_file_ctags_init() indirection
b4n May 4, 2016
0833974
Convert parser map size check to a static assertion
b4n May 4, 2016
f147f36
Reduce some repetitions in tag type mapping code
b4n May 5, 2016
9b188a2
Use g_error() instead of g_warning() in parser type verification
techee May 6, 2016
c05e3ea
Split tm_ctags_callback into two
techee May 6, 2016
8c27ea1
Remove invalid part of a comment
techee May 6, 2016
9ae93e3
Check return value of write_tag()
techee May 6, 2016
bd9d26a
Fix crash in lookup_includes()
techee May 6, 2016
084c23b
Use g_strdup() instead of strdup()
techee May 6, 2016
7fe549d
Make sure not to leak tmp_errfile if only outf creation fails
techee May 6, 2016
b959801
Rename append_to_temp_file() to combine_include_files()
techee May 6, 2016
6e89ee5
Check for fclose() success
techee May 6, 2016
379eefa
Use '\0' for non-existent tag kind instead of '-'
techee Jun 9, 2016
27e4455
Drop g_list_reverse()
techee Jun 9, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tagmanager/ctags/actionscript.c
Expand Up @@ -50,7 +50,7 @@ static void installActionScriptRegex (const langType language)

/* Getters and setters */
addTagRegex (language, "^[ \t]*[(public|static|internal|final|override)( \t)]*function[ \t]+(set|get)[ \t]+([A-Za-z0-9_]+)[ \t]*\\(",
"\\2 \\1", "f,field,fields", NULL);
"\\2 \\1", "l,field,fields", NULL);

/* Variables */
addTagRegex (language, "^[ \t]*[(private|public|static|protected|internal)( \t)]*var[ \t]+([A-Za-z0-9_]+)([ \t]*\\:[ \t]*([A-Za-z0-9_]+))*[ \t]*",
Expand Down Expand Up @@ -82,7 +82,7 @@ static void installActionScriptRegex (const langType language)

/* Prototypes (Put this in for AS1 compatibility...) */
addTagRegex (language, ".*\\.prototype\\.([A-Za-z0-9 ]+)[ \t]*\\=([ \t]*)function( [ \t]?)*\\(",
"\\1", "p,prototype", NULL);
"\\1", "r,prototype", NULL);
}

/* Create parser definition structure */
Expand Down
8 changes: 4 additions & 4 deletions tagmanager/ctags/asm.c
Expand Up @@ -65,10 +65,10 @@ typedef struct {
static langType Lang_asm;

static kindOption AsmKinds [] = {
{ TRUE, 'd', "macro", "defines" },
{ TRUE, 'l', "namespace", "labels" },
{ TRUE, 'm', "function", "macros" },
{ TRUE, 't', "struct", "types (structs and records)" }
{ TRUE, 'd', "define", "defines" },
{ TRUE, 'l', "label", "labels" },
{ TRUE, 'm', "macro", "macros" },
{ TRUE, 't', "type", "types (structs and records)" }
};

static const asmKeyword AsmKeywords [] = {
Expand Down
8 changes: 4 additions & 4 deletions tagmanager/ctags/basic.c
Expand Up @@ -39,12 +39,12 @@ typedef struct {
} KeyWord;

static kindOption BasicKinds[] = {
{TRUE, 'c', "macro", "constants"},
{TRUE, 'c', "constant", "constants"},
{TRUE, 'f', "function", "functions"},
{TRUE, 'l', "namespace", "labels"},
{TRUE, 't', "struct", "types"},
{TRUE, 'l', "label", "labels"},
{TRUE, 't', "type", "types"},
{TRUE, 'v', "variable", "variables"},
{TRUE, 'g', "externvar", "enumerations"}
{TRUE, 'g', "enum", "enumerations"}
};

static KeyWord freebasic_keywords[] = {
Expand Down
14 changes: 7 additions & 7 deletions tagmanager/ctags/c.c
Expand Up @@ -332,13 +332,13 @@ typedef enum
} javaKind;

static kindOption JavaKinds [] = {
{ TRUE, 'c', "class", "classes"},
{ TRUE, 'f', "field", "fields"},
{ TRUE, 'i', "interface", "interfaces"},
{ TRUE, 'm', "method", "methods"},
{ TRUE, 'p', "package", "packages"},
{ TRUE, 'e', "enumerator", "enumerators (values inside an enumeration)"},
{ TRUE, 'g', "enum", "enumeration names"},
{ TRUE, 'c', "class", "classes"},
{ TRUE, 'f', "field", "fields"},
{ TRUE, 'i', "interface", "interfaces"},
{ TRUE, 'm', "method", "methods"},
{ TRUE, 'p', "package", "packages"},
{ TRUE, 'e', "enumConstant", "enum constants"},
{ TRUE, 'g', "enum", "enum types"},
};

typedef enum
Expand Down
14 changes: 7 additions & 7 deletions tagmanager/ctags/cobol.c
Expand Up @@ -20,18 +20,18 @@

static void installCobolRegex (const langType language)
{
addTagRegex (language, "^[ \t]*[0-9]+[ \t]+([A-Z0-9][A-Z0-9-]*)[ \t]+(BLANK|OCCURS|IS|JUST|PIC|REDEFINES|RENAMES|SIGN|SYNC|USAGE|VALUE)",
"\\1", "d,variable,data items", "i");
addTagRegex (language, "^[ \t]*[0-9]+[ \t]+([A-Z0-9][A-Z0-9-]*)[ \t]+(BLANK|OCCURS|IS|JUST|PIC|REDEFINES|RENAMES|SIGN|SYNC|USAGE|VALUE)",
"\\1", "d,data,data items", "i");
addTagRegex (language, "^[ \t]*[FSR]D[ \t]+([A-Z0-9][A-Z0-9-]*)\\.",
"\\1", "f,function,file descriptions (FD, SD, RD)", "i");
"\\1", "f,file,file descriptions (FD, SD, RD)", "i");
addTagRegex (language, "^[ \t]*[0-9]+[ \t]+([A-Z0-9][A-Z0-9-]*)\\.",
"\\1", "g,struct,group items", "i");
"\\1", "g,group,group items", "i");
addTagRegex (language, "^[ \t]*([A-Z0-9][A-Z0-9-]*)\\.",
"\\1", "p,macro,paragraphs", "i");
"\\1", "p,paragraph,paragraphs", "i");
addTagRegex (language, "^[ \t]*PROGRAM-ID\\.[ \t]+([A-Z0-9][A-Z0-9-]*)\\.",
"\\1", "P,class,program ids", "i");
"\\1", "P,program,program ids", "i");
addTagRegex (language, "^[ \t]*([A-Z0-9][A-Z0-9-]*)[ \t]+SECTION\\.",
"\\1", "n,namespace,sections", "i");
"\\1", "s,section,sections", "i");
}

extern parserDefinition* CobolParser (void)
Expand Down
4 changes: 2 additions & 2 deletions tagmanager/ctags/css.c
Expand Up @@ -19,8 +19,8 @@ typedef enum eCssKinds {

static kindOption CssKinds [] = {
{ TRUE, 'c', "class", "classes" },
{ TRUE, 's', "struct", "selectors" },
{ TRUE, 'v', "variable", "identities" }
{ TRUE, 's', "selector", "selectors" },
{ TRUE, 'i', "id", "identities" }
};

typedef enum {
Expand Down
4 changes: 2 additions & 2 deletions tagmanager/ctags/erlang.c
Expand Up @@ -32,8 +32,8 @@ static kindOption ErlangKinds[] = {
{TRUE, 'd', "macro", "macro definitions"},
{TRUE, 'f', "function", "functions"},
{TRUE, 'm', "module", "modules"},
{TRUE, 'r', "struct", "record definitions"},
{TRUE, 't', "typedef", "type definitions"},
{TRUE, 'r', "record", "record definitions"},
{TRUE, 't', "type", "type definitions"},
};

/*
Expand Down
16 changes: 8 additions & 8 deletions tagmanager/ctags/fortran.c
Expand Up @@ -215,22 +215,22 @@ static unsigned int contextual_fake_count = 0;

/* indexed by tagType */
static kindOption FortranKinds [TAG_COUNT] = {
{ TRUE, 'b', "block data", "block data"},
{ TRUE, 'c', "macro", "common blocks"},
{ TRUE, 'b', "blockData", "block data"},
{ TRUE, 'c', "common", "common blocks"},
{ TRUE, 'e', "entry", "entry points"},
{ TRUE, 'f', "function", "functions"},
{ TRUE, 'i', "interface", "interface contents, generic names, and operators"},
{ TRUE, 'k', "member", "type and structure components"},
{ TRUE, 'k', "component", "type and structure components"},
{ TRUE, 'l', "label", "labels"},
{ FALSE, 'L', "local", "local, common block, and namelist variables"},
{ TRUE, 'm', "namespace", "modules"},
{ TRUE, 'm', "module", "modules"},
{ TRUE, 'n', "namelist", "namelists"},
{ TRUE, 'p', "struct", "programs"},
{ TRUE, 's', "method", "subroutines"},
{ TRUE, 't', "class", "derived types and structures"},
{ TRUE, 'p', "program", "programs"},
{ TRUE, 's', "subroutine", "subroutines"},
{ TRUE, 't', "type", "derived types and structures"},
{ TRUE, 'v', "variable", "program (global) and module variables"},
{ TRUE, 'E', "enum", "enumerations"},
{ TRUE, 'F', "enumerator", "enumeration values"},
{ TRUE, 'N', "enumerator", "enumeration values"},
};

/* For efinitions of Fortran 77 with extensions:
Expand Down
10 changes: 5 additions & 5 deletions tagmanager/ctags/go.c
Expand Up @@ -93,11 +93,11 @@ typedef enum {
} goKind;

static kindOption GoKinds[] = {
{TRUE, 'p', "namespace", "packages"},
{TRUE, 'f', "function", "functions"},
{TRUE, 'c', "macro", "constants"},
{TRUE, 't', "typedef", "types"},
{TRUE, 'v', "variable", "variables"},
{TRUE, 'p', "package", "packages"},
{TRUE, 'f', "func", "functions"},
{TRUE, 'c', "const", "constants"},
{TRUE, 't', "type", "types"},
{TRUE, 'v', "var", "variables"},
{TRUE, 's', "struct", "structs"},
{TRUE, 'i', "interface", "interfaces"},
{TRUE, 'm', "member", "struct members"}
Expand Down
2 changes: 1 addition & 1 deletion tagmanager/ctags/html.c
Expand Up @@ -28,7 +28,7 @@ static void installHtmlRegex (const langType language)
"[ \t]+name=\"?([^>\"]+)\"?"
POSSIBLE_ATTRIBUTES
"[ \t]*>",
"\\2", "m,member,named anchors", "i");
"\\2", "a,anchor,named anchors", "i");

addTagRegex (language, "^[ \t]*function[ \t]*([A-Za-z0-9_]+)[ \t]*\\(",
"\\1", "f,function,JavaScript functions", NULL);
Expand Down
4 changes: 2 additions & 2 deletions tagmanager/ctags/js.c
Expand Up @@ -138,8 +138,8 @@ static kindOption JsKinds [] = {
{ TRUE, 'f', "function", "functions" },
{ TRUE, 'c', "class", "classes" },
{ TRUE, 'm', "method", "methods" },
{ TRUE, 'p', "member", "properties" },
{ TRUE, 'C', "macro", "constants" },
{ TRUE, 'p', "property", "properties" },
{ TRUE, 'C', "constant", "constants" },
{ TRUE, 'v', "variable", "global variables" }
};

Expand Down
12 changes: 6 additions & 6 deletions tagmanager/ctags/json.c
Expand Up @@ -69,12 +69,12 @@ typedef enum {
static langType Lang_json;

static kindOption JsonKinds [] = {
{ TRUE, 'o', "member", "objects" },
{ TRUE, 'a', "member", "arrays" },
{ TRUE, 'n', "member", "numbers" },
{ TRUE, 's', "member", "strings" },
{ TRUE, 'b', "member", "booleans" },
{ TRUE, 'z', "member", "nulls" }
{ TRUE, 'o', "object", "objects" },
{ TRUE, 'a', "array", "arrays" },
{ TRUE, 'n', "number", "numbers" },
{ TRUE, 's', "string", "strings" },
{ TRUE, 'b', "boolean", "booleans" },
{ TRUE, 'z', "null", "nulls" }
};

static tokenInfo *newToken (void)
Expand Down
2 changes: 1 addition & 1 deletion tagmanager/ctags/make.c
Expand Up @@ -30,7 +30,7 @@ typedef enum {

static kindOption MakeKinds [] = {
{ TRUE, 'm', "macro", "macros"},
{ TRUE, 't', "function", "targets"}
{ TRUE, 't', "target", "targets"}
};

/*
Expand Down
2 changes: 1 addition & 1 deletion tagmanager/ctags/parse.c
Expand Up @@ -31,7 +31,7 @@
*/
static parserDefinitionFunc* BuiltInParsers[] = { PARSER_LIST };
parserDefinition** LanguageTable = NULL;
static unsigned int LanguageCount = 0;
unsigned int LanguageCount = 0;
tagEntryFunction TagEntryFunction = NULL;
void *TagEntryUserData = NULL;

Expand Down
1 change: 1 addition & 0 deletions tagmanager/ctags/parse.h
Expand Up @@ -83,6 +83,7 @@ typedef void (*regexCallback) (const char *line, const regexMatch *matches, unsi
*/
extern parserDefinitionFunc PARSER_LIST;
extern parserDefinition** LanguageTable;
extern unsigned int LanguageCount;
/* Legacy interface */
extern boolean includingDefineTags (void);
extern void processLegacyKindOption (const char *const parameter);
Expand Down
2 changes: 1 addition & 1 deletion tagmanager/ctags/pascal.c
Expand Up @@ -30,7 +30,7 @@ typedef enum {

static kindOption PascalKinds [] = {
{ TRUE, 'f', "function", "functions"},
{ TRUE, 'f', "function", "procedures"}
{ TRUE, 'p', "procedure", "procedures"}
};

/*
Expand Down
12 changes: 6 additions & 6 deletions tagmanager/ctags/perl.c
Expand Up @@ -38,12 +38,12 @@ typedef enum {
} perlKind;

static kindOption PerlKinds [] = {
{ TRUE, 'e', "enum", "constants" },
{ TRUE, 'o', "other", "formats" },
{ TRUE, 'm', "macro", "labels" },
{ TRUE, 'p', "package", "packages" },
{ TRUE, 'f', "function", "subroutines" },
{ FALSE, 'p', "prototype", "subroutine declarations" },
{ TRUE, 'c', "constant", "constants" },
{ TRUE, 'f', "format", "formats" },
{ TRUE, 'l', "label", "labels" },
{ TRUE, 'p', "package", "packages" },
{ TRUE, 's', "subroutine", "subroutines" },
{ FALSE, 'd', "subroutineDeclaration", "subroutine declarations" },
};

/*
Expand Down
4 changes: 2 additions & 2 deletions tagmanager/ctags/php.c
Expand Up @@ -114,12 +114,12 @@ typedef enum {

static kindOption PhpKinds[COUNT_KIND] = {
{ TRUE, 'c', "class", "classes" },
{ TRUE, 'm', "macro", "constant definitions" },
{ TRUE, 'd', "define", "constant definitions" },
{ TRUE, 'f', "function", "functions" },
{ TRUE, 'i', "interface", "interfaces" },
{ FALSE, 'l', "local", "local variables" },
{ TRUE, 'n', "namespace", "namespaces" },
{ TRUE, 's', "struct", "traits" },
{ TRUE, 't', "trait", "traits" },
{ TRUE, 'v', "variable", "variables" }
};

Expand Down
6 changes: 2 additions & 4 deletions tagmanager/ctags/python.c
Expand Up @@ -31,11 +31,9 @@ typedef enum {
static kindOption PythonKinds[] = {
{TRUE, 'c', "class", "classes"},
{TRUE, 'f', "function", "functions"},
{TRUE, 'm', "method", "class methods"},
{TRUE, 'm', "member", "class members"},
{TRUE, 'v', "variable", "variables"},
/* defined as externvar to get those excluded as forward type in symbols.c:goto_tag()
* so we can jump to the real implementation (if known) instead of to the import statement */
{TRUE, 'x', "externvar", "imports"}
{TRUE, 'x', "unknown", "name referring a classe/variable/function/module defined in other module"}
};

typedef enum {
Expand Down
6 changes: 3 additions & 3 deletions tagmanager/ctags/r.c
Expand Up @@ -36,8 +36,8 @@ typedef enum {

static kindOption RKinds [KIND_COUNT] = {
{ TRUE, 'f', "function", "functions" },
{ TRUE, 's', "other", "libraries" },
{ TRUE, 's', "other", "sources" },
{ TRUE, 'l', "library", "libraries" },
{ TRUE, 's', "source", "sources" },
};
#endif

Expand Down Expand Up @@ -190,7 +190,7 @@ extern parserDefinition* RParser (void)
parserDefinition* const def = parserNew ("R");
#ifndef R_REGEX
def->kinds = RKinds;
def->kindCount = 4;
def->kindCount = KIND_COUNT (RKinds);
#endif
def->extensions = extensions;
#ifndef R_REGEX
Expand Down
4 changes: 2 additions & 2 deletions tagmanager/ctags/ruby.c
Expand Up @@ -36,8 +36,8 @@ typedef enum {
static kindOption RubyKinds [] = {
{ TRUE, 'c', "class", "classes" },
{ TRUE, 'f', "method", "methods" },
{ TRUE, 'm', "namespace", "modules" },
{ TRUE, 'F', "member", "singleton methods" },
{ TRUE, 'm', "module", "modules" },
{ TRUE, 'F', "singletonMethod", "singleton methods" },
#if 0
/* Following two kinds are reserved. */
{ TRUE, 'd', "describe", "describes and contexts for Rspec" },
Expand Down
4 changes: 2 additions & 2 deletions tagmanager/ctags/rust.c
Expand Up @@ -47,10 +47,10 @@ typedef enum {
} RustKind;

static kindOption rustKinds[] = {
{TRUE, 'n', "namespace", "module"},
{TRUE, 'n', "module", "module"},
{TRUE, 's', "struct", "structural type"},
{TRUE, 'i', "interface", "trait interface"},
{TRUE, 'c', "class", "implementation"},
{TRUE, 'c', "implementation", "implementation"},
{TRUE, 'f', "function", "Function"},
{TRUE, 'g', "enum", "Enum"},
{TRUE, 't', "typedef", "Type Alias"},
Expand Down
10 changes: 5 additions & 5 deletions tagmanager/ctags/sql.c
Expand Up @@ -218,18 +218,18 @@ static kindOption SqlKinds [] = {
{ FALSE, 'l', "local", "local variables" },
{ TRUE, 'L', "label", "block label" },
{ TRUE, 'P', "package", "packages" },
{ TRUE, 'n', "namespace", "procedures" },
{ TRUE, 'p', "procedure", "procedures" },
{ FALSE, 'r', "record", "records" },
{ TRUE, 's', "subtype", "subtypes" },
{ TRUE, 't', "class", "tables" },
{ TRUE, 'T', "macro", "triggers" },
{ TRUE, 't', "table", "tables" },
{ TRUE, 'T', "trigger", "triggers" },
{ TRUE, 'v', "variable", "variables" },
{ TRUE, 'i', "struct", "indexes" },
{ TRUE, 'i', "index", "indexes" },
{ TRUE, 'e', "event", "events" },
{ TRUE, 'U', "publication", "publications" },
{ TRUE, 'R', "service", "services" },
{ TRUE, 'D', "domain", "domains" },
{ TRUE, 'm', "member", "views" },
{ TRUE, 'V', "view", "views" },
{ TRUE, 'n', "synonym", "synonyms" },
{ TRUE, 'x', "mltable", "MobiLink Table Scripts" },
{ TRUE, 'y', "mlconn", "MobiLink Conn Scripts" },
Expand Down
6 changes: 3 additions & 3 deletions tagmanager/ctags/tcl.c
Expand Up @@ -27,9 +27,9 @@ typedef enum {

static kindOption TclKinds [] = {
{ TRUE, 'c', "class", "classes" },
{ TRUE, 'f', "member", "methods" },
{ TRUE, 'p', "function", "procedures" },
{ TRUE, 'm', "namespace", "modules" }
{ TRUE, 'm', "method", "methods" },
{ TRUE, 'p', "procedure", "procedures" },
{ TRUE, 'n', "module", "modules" }
};

/*
Expand Down
14 changes: 7 additions & 7 deletions tagmanager/ctags/verilog.c
Expand Up @@ -58,14 +58,14 @@ static int Lang_verilog;
static jmp_buf Exception;

static kindOption VerilogKinds [] = {
{ TRUE, 'c', "variable", "constants (define, parameter, specparam)" },
{ TRUE, 'e', "typedef", "events" },
{ TRUE, 'c', "constant", "constants (define, parameter, specparam)" },
{ TRUE, 'e', "event", "events" },
{ TRUE, 'f', "function", "functions" },
{ TRUE, 'm', "class", "modules" },
{ TRUE, 'n', "variable", "net data types" },
{ TRUE, 'p', "variable", "ports" },
{ TRUE, 'r', "variable", "register data types" },
{ TRUE, 't', "function", "tasks" }
{ TRUE, 'm', "module", "modules" },
{ TRUE, 'n', "net", "net data types" },
{ TRUE, 'p', "port", "ports" },
{ TRUE, 'r', "register", "register data types" },
{ TRUE, 't', "task", "tasks" }
};

static keywordAssoc VerilogKeywordTable [] = {
Expand Down