MCPcopy Create free account
hub / github.com/nsf/gocode / deduce_cursor_decl

Method deduce_cursor_decl

cursorcontext.go:264–270  ·  view source on GitHub ↗

this function is called when the cursor is at the '.' and you need to get the declaration before that dot

(iter *token_iterator)

Source from the content-addressed store, hash-verified

262// this function is called when the cursor is at the '.' and you need to get the
263// declaration before that dot
264func (c *auto_complete_context) deduce_cursor_decl(iter *token_iterator) (*decl, ast.Expr) {
265 expr, err := parser.ParseExpr(iter.extract_go_expr())
266 if err != nil {
267 return nil, nil
268 }
269 return expr_to_decl(expr, c.current.scope), expr
270}
271
272// try to find and extract the surrounding struct literal type
273func (c *auto_complete_context) deduce_struct_type_decl(iter *token_iterator) *decl {

Callers 1

deduce_cursor_contextMethod · 0.95

Calls 2

expr_to_declFunction · 0.85
extract_go_exprMethod · 0.80

Tested by

no test coverage detected