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
d1090f75
Commit
d1090f75
authored
Oct 15, 2014
by
Maxime Perrotin
Browse files
Autocompletion dict update on text area
parent
d1bfcf98
Changes
3
Hide whitespace changes
Inline
Side-by-side
ogAST.py
View file @
d1090f75
...
...
@@ -687,11 +687,6 @@ class TextArea(object):
''' Text area (raw content for rendering only) '''
self
.
inputString
=
'-- Declare your variables
\n\n
'
\
'-- Syntax: DCL <variable name> <type name>;
\n\n
'
# DCL variables in the text area {name: (sort, default_value), ...}
self
.
variables
=
{}
# fpar and timers are also listed, useful when using autocompletion
self
.
fpar
=
[]
self
.
timers
=
[]
self
.
line
=
None
self
.
charPositionInLine
=
None
# Set default coordinates and width/height
...
...
@@ -699,6 +694,13 @@ class TextArea(object):
self
.
pos_y
=
0
self
.
width
=
170
self
.
height
=
140
# DCL variables in the text area {name: (sort, default_value), ...}
self
.
variables
=
{}
# fpar and timers are also listed, useful when using autocompletion
self
.
fpar
=
[]
self
.
timers
=
[]
# inner procedures - useful to get autocompletion params
self
.
procedures
=
[]
# optional hyperlink
self
.
hyperlink
=
None
...
...
ogParser.py
View file @
d1090f75
...
...
@@ -2257,6 +2257,8 @@ def text_area_content(root, ta_ast, context):
context
.
content
.
inner_procedures
.
append
(
proc
)
# Add to context to make it visible at scope level
context
.
procedures
.
append
(
proc
)
# And add it to the TextArea AST for the text autocompletion
ta_ast
.
procedures
.
append
(
proc
)
elif
child
.
type
==
lexer
.
FPAR
:
params
,
err
,
warn
=
fpar
(
child
)
errors
.
extend
(
err
)
...
...
sdlSymbols.py
View file @
d1090f75
...
...
@@ -49,7 +49,7 @@ SDL_BLACKBOLD = ['\\b{word}\\b'.format(word=word) for word in (
'LENGTH'
,
'PRESENT'
,
'FPAR'
,
'TODO'
,
'FIXME'
,
'XXX'
,
'CHECKME'
,
'PROCEDURE'
,
'EXTERNAL'
,
'IN'
,
'OUT'
,
'TIMER'
,
'SET_TIMER'
,
'RESET_TIMER'
,
'VIA'
,
'ENTRY'
,
'EXIT'
,
'SYNTYPE'
,
'ENDSYNTYPE'
,
'CONSTANTS'
,
'SYNTYPE'
,
'ENDSYNTYPE'
,
'CONSTANTS'
,
'ENDPROCEDURE'
,
'NEWTYPE'
,
'ENDNEWTYPE'
,
'ARRAY'
,
'STRUCT'
,
'SYNONYM'
)]
SDL_REDBOLD
=
[
'
\\
b{word}
\\
b'
.
format
(
word
=
word
)
for
word
in
(
...
...
@@ -745,6 +745,7 @@ class TextSymbol(HorizontalSymbol):
ast
,
_
,
_
,
_
,
_
=
self
.
parser
.
parseSingleElement
(
'text_area'
,
pr_text
)
CONTEXT
.
variables
.
update
(
ast
.
variables
)
CONTEXT
.
timers
=
list
(
set
(
CONTEXT
.
timers
+
ast
.
timers
))
CONTEXT
.
procedures
=
list
(
set
(
CONTEXT
.
procedures
+
ast
.
procedures
))
try
:
CONTEXT
.
fpar
.
extend
(
ast
.
fpar
)
except
AttributeError
:
...
...
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