Commit 95279b67 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix context updater for procedure autocompletion

Procedure textually declared were being duplicated in the autocompletion
list each time the symbol was edited
parent bd389399
......@@ -902,6 +902,9 @@ class Block(object):
self.processes = []
# list of ogAST.Procedure
self.procedures = []
# Block formal parameters - list of dict (unused)
# [{'name': str, 'type': str}]
self.fpar = []
class System(object):
......
......@@ -115,7 +115,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '1.2.1'
__version__ = '1.2.2'
if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated)
......
......@@ -817,7 +817,10 @@ class TextSymbol(HorizontalSymbol):
# context may not have variables/timers (eg if context = block)
pass
try:
CONTEXT.procedures = list(set(CONTEXT.procedures + ast.procedures))
existing = {proc.inputString.lower()
for proc in CONTEXT.procedures}
CONTEXT.procedures += [proc for proc in ast.procedures
if proc.inputString.lower() not in existing]
CONTEXT.fpar.extend(ast.fpar)
except AttributeError:
pass
......@@ -826,7 +829,7 @@ class TextSymbol(HorizontalSymbol):
Signalroute.completion_list |= set(sig['name']
for sig in ast.signals)
except AttributeError:
# no AST, e.g. in cae of syntax errors in the text area
# no AST, e.g. in case of syntax errors in the text area
pass
@property
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment