Skip to content

Commit 99a0fa5

Browse files
committed
Handle more cases when searching for callback reference
the tag will be searched only if its signature is void and it's not being skipped for other reasons
1 parent 667cc98 commit 99a0fa5

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/arduino.cc/builder/ctags/ctags_parser.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ func parseTag(row string) *types.CTag {
236236

237237
parts = parts[2:]
238238

239-
signature := ""
240239
returntype := ""
241240
for _, part := range parts {
242241
if strings.Contains(part, ":") {
@@ -253,7 +252,7 @@ func parseTag(row string) *types.CTag {
253252
case "typeref":
254253
tag.Typeref = value
255254
case "signature":
256-
signature = value
255+
tag.Signature = value
257256
case "returntype":
258257
returntype = value
259258
case "class":
@@ -265,7 +264,7 @@ func parseTag(row string) *types.CTag {
265264
}
266265
}
267266
}
268-
tag.Prototype = returntype + " " + tag.FunctionName + signature + ";"
267+
tag.Prototype = returntype + " " + tag.FunctionName + tag.Signature + ";"
269268

270269
if strings.Contains(row, "/^") && strings.Contains(row, "$/;") {
271270
tag.Code = row[strings.Index(row, "/^")+2 : strings.Index(row, "$/;")]

src/arduino.cc/builder/ctags/ctags_to_prototypes.go

+3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ func functionNameUsedAsFunctionPointerIn(tag *types.CTag, functionNames []string
7070
if strings.Index(tag.Code, "&"+functionName) != -1 {
7171
return true
7272
}
73+
if strings.Index(tag.Code, functionName) != -1 {
74+
return true
75+
}
7376
}
7477
return false
7578
}

src/arduino.cc/builder/types/types.go

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ type CTag struct {
252252
Filename string
253253
Typeref string
254254
SkipMe bool
255+
Signature string
255256

256257
Prototype string
257258
Function string

0 commit comments

Comments
 (0)