Kaydet (Commit) f1c98e54 authored tarafından Colomban Wendling's avatar Colomban Wendling

Merge pull request #481 from techee/go

Go ctags parser, Scintilla lexer and Geany support improvements

Closes #238.
......@@ -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]
......
......@@ -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
......
......@@ -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)
{
......@@ -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);
}
}
......
......@@ -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;
}
......@@ -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;
}
......
This diff is collapsed.
......@@ -243,6 +243,7 @@ test_sources = \
refcurs.sql \
regexp.js \
return-hint.zep \
return-types.go \
rules.t2t \
sample.t2t \
secondary_fcn_name.js \
......
package main
func foo() *struct {a int; b func()} {
return nil
}
func bar() (a int, b func(a int), c interface{}, d string) {
return 0, nil, nil, ""
}
func baz() *[20*3+1]map[chan<- /* map[int]int */<-chan int]map[interface{}]*string {
return nil
}
func main() {
}
\ No newline at end of file
# format=tagmanager
barÌ16Í()Ö0Ï(a int, b func(a int), c interface{}, d string)
bazÌ16Í()Ö0Ï*[20*3+1]map[chan<- <-chan int]map[interface{}]*string
fooÌ16Í()Ö0Ï*struct {a int; b func()}
mainÌ16Í()Ö0Ï
mainÌ256Ö0
......@@ -15,8 +15,11 @@ type (
)
type T6 struct {
a, b, c, d int
e float32
_a, _b, _c, _d int
int
T1 `annotation`
*T2
_e float32
//ignored int
}
......@@ -44,4 +47,4 @@ func (tt * T7) f4(a func () func ()) (func (), int) {return func (){}, 1};func f
func main() {
go func (){}()
fmt.Println("Hello, 世界")
}
}
\ No newline at end of file
......@@ -12,23 +12,28 @@ T1
T240960
T340960
T440960
T540960
T640960
T5320
T620480
T740960
T840960
T940960
_a64T60
_b64T60
_c64T60
_d64T60
_e64T60
a163840
b163840
c163840
d163840
e163840
f163840
f1160
f2160
f3160
f4160
f5160
f116()0
f216()0
f316()0(a, b int)
f416(a func () func ())0(func (), int)
f516()0
g163840
h163840
main160
main16()0
main2560
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment