From 806ae13b71d9aa3b9ecf34765918decd87bff102 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 7 Apr 2018 12:40:52 +0200 Subject: [PATCH] Better goto definition for fstrings --- jedi/api/helpers.py | 2 +- test/completion/fstring.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jedi/api/helpers.py b/jedi/api/helpers.py index 4a899672..878ebf66 100644 --- a/jedi/api/helpers.py +++ b/jedi/api/helpers.py @@ -195,7 +195,7 @@ def evaluate_goto_definition(evaluator, context, leaf): return evaluate_call_of_leaf(context, leaf) elif isinstance(leaf, tree.Literal): return eval_atom(context, leaf) - elif leaf.type == 'fstring_string': + elif leaf.type in ('fstring_string', 'fstring_start', 'fstring_end'): return get_string_context_set(evaluator) return [] diff --git a/test/completion/fstring.py b/test/completion/fstring.py index d84c7efc..52e81123 100644 --- a/test/completion/fstring.py +++ b/test/completion/fstring.py @@ -23,5 +23,5 @@ Fr'a{Foo.bar' #? str() Fr'sasdf' -#? 7 +#? 7 str() Fr'''sasdf''' + ''