feat: go definitions
This commit is contained in:
parent
e0ae4ceb56
commit
bf65b1ebbd
2 changed files with 23 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ const TEST_CASES = [
|
|||
],
|
||||
},
|
||||
{
|
||||
nodeType: "function_definition (inside a class)",
|
||||
nodeType: "method_declaration",
|
||||
fileName: "file1.php",
|
||||
language: "PHP",
|
||||
cursorPosition: { line: 26, character: 35 },
|
||||
|
|
@ -69,6 +69,16 @@ const TEST_CASES = [
|
|||
{ row: 25, column: 61 }, // Address
|
||||
],
|
||||
},
|
||||
{
|
||||
nodeType: "function_declaration",
|
||||
fileName: "file1.go",
|
||||
language: "Go",
|
||||
cursorPosition: { line: 7, character: 21 },
|
||||
definitionPositions: [
|
||||
{ row: 6, column: 33 }, // models.User
|
||||
{ row: 6, column: 50 }, // models.Address
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
describe("RootPathContextService", () => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
(
|
||||
(function_declaration
|
||||
(parameter_list
|
||||
(parameter_declaration
|
||||
type: (_) @param_type
|
||||
)*
|
||||
)
|
||||
; Optional return type node before the block
|
||||
([_] @return_type)?
|
||||
(block)
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Reference in a new issue