diff --git a/jedi/evaluate/syntax_tree.py b/jedi/evaluate/syntax_tree.py index 6d08c5a9..8ef5697b 100644 --- a/jedi/evaluate/syntax_tree.py +++ b/jedi/evaluate/syntax_tree.py @@ -69,7 +69,7 @@ def eval_node(context, element): debug.dbg('eval_node %s@%s in %s', element, element.start_pos, context) evaluator = context.evaluator typ = element.type - if typ in ('name', 'number', 'string', 'atom', 'strings', 'keyword'): + if typ in ('name', 'number', 'string', 'atom', 'strings', 'keyword', 'fstring'): return eval_atom(context, element) elif typ == 'lambdef': return ContextSet([FunctionContext.from_context(context, element)]) @@ -221,6 +221,8 @@ def eval_atom(context, atom): right = eval_atom(context, string) context_set = _eval_comparison(context.evaluator, context, context_set, u'+', right) return context_set + elif atom.type == 'fstring': + return compiled.get_string_context_set(context.evaluator) else: c = atom.children # Parentheses without commas are not tuples. diff --git a/test/completion/fstring.py b/test/completion/fstring.py index 97cc1cc0..32f29e9b 100644 --- a/test/completion/fstring.py +++ b/test/completion/fstring.py @@ -32,3 +32,7 @@ f'xyz'.uppe #? 3 [] f'f' + +# Github #1248 +#? int() +{"foo": 1}[f"foo"]