Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
bd4c6cff
Commit
bd4c6cff
authored
Oct 15, 2014
by
Maxime Perrotin
Browse files
Autocompletion in tasks, filter variables based on left side of
assignment
parent
55b8b5dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
sdlSymbols.py
View file @
bd4c6cff
...
...
@@ -669,9 +669,27 @@ class Task(VerticalSymbol):
@
property
def
completion_list
(
self
):
''' Set auto-completion list '''
return
chain
(
variables_autocompletion
(
self
),
ogParser
.
SPECIAL_OPERATORS
.
viewkeys
())
elems
=
unicode
(
self
).
lower
().
strip
().
split
()
asn1_filter
=
[]
if
len
(
elems
)
==
2
and
elems
[
1
]
==
':='
:
# Find type of variable on the left and filter accordingly
varname
=
elems
[
0
]
try
:
fpar
=
{
fp
[
'name'
]:
(
fp
[
'type'
],
None
)
for
fp
in
CONTEXT
.
fpar
}
except
AttributeError
:
# not in the context of a procedure
fpar
=
{}
constants
=
{
name
:
(
cty
.
type
,
None
)
for
name
,
cty
in
AST
.
asn1_constants
.
viewitems
()}
for
name
,
(
asn1ty
,
_
)
in
chain
(
CONTEXT
.
variables
.
viewitems
(),
CONTEXT
.
global_variables
.
viewitems
(),
constants
.
viewitems
(),
fpar
.
viewitems
()):
if
name
==
varname
:
asn1_filter
=
[
asn1ty
]
break
return
chain
(
variables_autocompletion
(
self
,
asn1_filter
),
ogParser
.
SPECIAL_OPERATORS
.
viewkeys
())
# pylint: disable=R0904
class
ProcedureCall
(
VerticalSymbol
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment