mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
@@ -72,6 +72,8 @@ keywords_only_valid_as_leaf = (
|
|||||||
|
|
||||||
|
|
||||||
class KeywordName(AbstractNameDefinition):
|
class KeywordName(AbstractNameDefinition):
|
||||||
|
api_type = 'keyword'
|
||||||
|
|
||||||
def __init__(self, evaluator, name):
|
def __init__(self, evaluator, name):
|
||||||
self.string_name = name
|
self.string_name = name
|
||||||
self.parent_context = evaluator.BUILTINS
|
self.parent_context = evaluator.BUILTINS
|
||||||
|
|||||||
@@ -248,6 +248,14 @@ def test_type():
|
|||||||
for c in Script('import os; os.path.').completions():
|
for c in Script('import os; os.path.').completions():
|
||||||
assert c.type
|
assert c.type
|
||||||
|
|
||||||
|
def test_type_II():
|
||||||
|
"""
|
||||||
|
GitHub Issue #833, `keyword`s are seen as `module`s
|
||||||
|
"""
|
||||||
|
for c in Script('f').completions():
|
||||||
|
if c.name == 'for':
|
||||||
|
assert c.type == 'keyword'
|
||||||
|
|
||||||
|
|
||||||
class TestGotoAssignments(TestCase):
|
class TestGotoAssignments(TestCase):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user