Skip to content

Commit

Permalink
Merge pull request #481 from techee/go
Browse files Browse the repository at this point in the history
Go ctags parser, Scintilla lexer and Geany support improvements

Closes #238.
  • Loading branch information
b4n committed May 28, 2015
2 parents b5702f0 + dde13c7 commit f1c98e5
Show file tree
Hide file tree
Showing 10 changed files with 274 additions and 68 deletions.
10 changes: 7 additions & 3 deletions data/filetypes.go
Expand Up @@ -4,13 +4,17 @@

[keywords]
# all items must be in one line
primary=break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var
secondary=byte bool rune int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float32 float64 complex64 complex128 uintptr string
primary=break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var true false iota nil
secondary=bool byte complex64 complex128 error float32 float64 int int8 int16 int32 int64 rune string uint uint8 uint16 uint32 uint64 uintptr

# these are the Doxygen keywords
docComment=a addindex addtogroup anchor arg attention author authors b brief bug c callergraph callgraph category cite class code cond copybrief copydetails copydoc copyright date def defgroup deprecated details dir dontinclude dot dotfile e else elseif em endcode endcond enddot endhtmlonly endif endinternal endlatexonly endlink endmanonly endmsc endrtfonly endverbatim endxmlonly enum example exception extends file fn headerfile hideinitializer htmlinclude htmlonly if ifnot image implements include includelineno ingroup interface internal invariant latexonly li line link mainpage manonly memberof msc mscfile n name namespace nosubgrouping note overload p package page par paragraph param post pre private privatesection property protected protectedsection protocol public publicsection ref related relatedalso relates relatesalso remark remarks result return returns retval rtfonly sa section see short showinitializer since skip skipline snippet struct subpage subsection subsubsection tableofcontents test throw throws todo tparam typedef union until var verbatim verbinclude version warning weakgroup xmlonly xrefitem

[lexer_properties=C]
[lexer_properties]
lexer.cpp.backquoted.strings=1
styling.within.preprocessor=1
lexer.cpp.allow.dollars=0
fold.preprocessor=0

[settings]

Expand Down
1 change: 1 addition & 0 deletions src/document.c
Expand Up @@ -2649,6 +2649,7 @@ void document_highlight_tags(GeanyDocument *doc)
case GEANY_FILETYPES_OBJECTIVEC:
case GEANY_FILETYPES_VALA:
case GEANY_FILETYPES_RUST:
case GEANY_FILETYPES_GO:
{

/* index of the keyword set in the Scintilla lexer, for
Expand Down
7 changes: 4 additions & 3 deletions src/editor.c
Expand Up @@ -1790,7 +1790,7 @@ static gboolean append_calltip(GString *str, const TMTag *tag, filetype_id ft_id
if (! tag->arglist)
return FALSE;

if (ft_id != GEANY_FILETYPES_PASCAL)
if (ft_id != GEANY_FILETYPES_PASCAL && ft_id != GEANY_FILETYPES_GO)
{ /* usual calltips: "retval tagname (arglist)" */
if (tag->var_type)
{
Expand All @@ -1815,14 +1815,15 @@ static gboolean append_calltip(GString *str, const TMTag *tag, filetype_id ft_id
g_string_append(str, tag->arglist);
}
else
{ /* special case Pascal calltips: "tagname (arglist) : retval" */
{ /* special case Pascal/Go calltips: "tagname (arglist) : retval"
* (with ':' omitted for Go) */
g_string_append(str, tag->name);
g_string_append_c(str, ' ');
g_string_append(str, tag->arglist);

if (!EMPTY(tag->var_type))
{
g_string_append(str, " : ");
g_string_append(str, ft_id == GEANY_FILETYPES_PASCAL ? " : " : " ");
g_string_append(str, tag->var_type);
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/symbols.c
Expand Up @@ -698,7 +698,7 @@ static void add_top_level_items(GeanyDocument *doc)
&(tv_iters.tag_variable), _("Variables"), "classviewer-var",
&(tv_iters.tag_macro), _("Macros"), "classviewer-macro",
&(tv_iters.tag_member), _("Methods"), "classviewer-member",
&(tv_iters.tag_other), _("Other"), "classviewer-other", NULL,
&(tv_iters.tag_other), _("Other"), "classviewer-other",
NULL);
break;
}
Expand All @@ -707,10 +707,13 @@ static void add_top_level_items(GeanyDocument *doc)
tag_list_add_groups(tag_store,
&(tv_iters.tag_namespace), _("Package"), "classviewer-namespace",
&(tv_iters.tag_function), _("Functions"), "classviewer-method",
&(tv_iters.tag_macro), _("Constants"), "classviewer-macro",
&(tv_iters.tag_interface), _("Interfaces"), "classviewer-struct",
&(tv_iters.tag_struct), _("Structs"), "classviewer-struct",
&(tv_iters.tag_type), _("Types"), "classviewer-struct",
&(tv_iters.tag_macro), _("Constants"), "classviewer-macro",
&(tv_iters.tag_variable), _("Variables"), "classviewer-var",
&(tv_iters.tag_other), _("Other"), "classviewer-other", NULL,
&(tv_iters.tag_member), _("Members"), "classviewer-member",
&(tv_iters.tag_other), _("Other"), "classviewer-other",
NULL);
break;
}
Expand Down

0 comments on commit f1c98e5

Please sign in to comment.