Open Den1552 opened 2 months ago
Currently working on Note:
In file tstCompletions.ts, comment: // TBD will need to change how this is done during the fix for issue #170 The way I get the completion for TEST.SUBPROGRAM is a little bit of a hack and will need to change Currently, I send a fake TEST.VALUE:unit. line to get the list of subprograms But currently, the Python strips coded_tests_driver in function: getFunctionList()
-- > Check how to get autocompletion for TEST.SUBPROGRAM without hardcoding it & get correct autocompletion items.
Problem is: I need the unit
. So either:
Some ideas / brainstorming:
1) Retrieve unit with getNearest
in ts and add it as an additional
param
--> Additional param
--> Very specific (what if we need in future more than just the unit
in python?)
--> Send JSON?
2) Save tst to temp file and send abs path as additional param and retrieve the unit in python --> Would be on an "logical level" the correct place imo --> Good if we need the whole tst for later stuff --> - Additional read/write, even though we read it already in ts
3) Get Unit with getNearest
in ts, concat
it as
TEST.SUBPROGRAM:<unit>
and send it to get autocompletion
--> No big implementation changes since getFunctionList
gets
called here
--> Just add <<INIT>>
and <<COMPOUND>>
at the end
--> But is weird, since TEST.SUBPROGRAM:<unit>
is wrong and maintainability would suffer since you do not expect that it works that way.
--> Will do 1) first, as I think that additional params can just be added in the json if needed.
Currently working on Note:
In file tstCompletions.ts, comment: // TBD will need to change how this is done during the fix for issue #170 The way I get the completion for TEST.SUBPROGRAM is a little bit of a hack and will need to change Currently, I send a fake TEST.VALUE:unit. line to get the list of subprograms But currently, the Python strips coded_tests_driver in function: getFunctionList()
-- > Check how to get autocompletion for TEST.SUBPROGRAM without hardcoding it & get correct autocompletion items.
Problem is: I need the
unit
. So either:Some ideas / brainstorming:
1) Retrieve unit with
getNearest
in ts and add it as an additional param --> Additional param --> Very specific (what if we need in future more than just the unit in python?) --> Send JSON?2) Save tst to temp file and send abs path as additional param and retrieve the unit in python --> Would be on an "logical level" the correct place imo --> Good if we need the whole tst for later stuff
3) Get Unit with
getNearest
in ts,concat
it asTEST.SUBPROGRAM:<unit>
and send it to get autocompletion --> No big implementation changes sincegetFunctionList
gets called here --> Just add<<INIT>>
and<<COMPOUND>>
at the end --> But is weird, sinceTEST.SUBPROGRAM:<unit>
is wrong and maintainability would suffer since you do not expect that it works that way.--> Will do 1) first, as I think that additional params can just be added in the json if needed.
Can you elaborate on the 2? Where and what would actually be implemented (python/ts, which function)? Could you pass around some string instead of having a tempfile? Whichever option you implement should be in a separate branch off of this branch
Can you elaborate on the 2? Where and what would actually be implemented (python/ts, which function)? Could you pass around some string instead of having a tempfile? Whichever option you implement should be in a separate branch off of this branch
Currently working on Note:
In file tstCompletions.ts, comment: // TBD will need to change how this is done during the fix for issue #170 The way I get the completion for TEST.SUBPROGRAM is a little bit of a hack and will need to change Currently, I send a fake TEST.VALUE:unit. line to get the list of subprograms But currently, the Python strips coded_tests_driver in function: getFunctionList()
-- > Check how to get autocompletion for TEST.SUBPROGRAM without hardcoding it & get correct autocompletion items. Problem is: I need the
unit
. So either: Some ideas / brainstorming: 1) Retrieve unit withgetNearest
in ts and add it as an additional param --> Additional param --> Very specific (what if we need in future more than just the unit in python?) --> Send JSON? 2) Save tst to temp file and send abs path as additional param and retrieve the unit in python --> Would be on an "logical level" the correct place imo --> Good if we need the whole tst for later stuff 3) Get Unit withgetNearest
in ts,concat
it asTEST.SUBPROGRAM:<unit>
and send it to get autocompletion --> No big implementation changes sincegetFunctionList
gets called here --> Just add<<INIT>>
and<<COMPOUND>>
at the end --> But is weird, sinceTEST.SUBPROGRAM:<unit>
is wrong and maintainability would suffer since you do not expect that it works that way. --> Will do 1) first, as I think that additional params can just be added in the json if needed.Can you elaborate on the 2? Where and what would actually be implemented (python/ts, which function)? Could you pass around some string instead of having a tempfile? Whichever option you implement should be in a separate branch off of this branch
Here the idea was to basically have the whole tst document in python ready. And the easiest way to have the whole document ready would be probably to save it in a temp file and then load it again in python.
Your idea of parsing a string is basically idea 1). Just that I do not want to parse the whole tst string as it will get executed in a command line.
If the file becomes too large, it could lead to issues (I think).
The idea is to create an object (like JSON) that carries the necessary parameters. For example, currently, I would have {params: {unit: "moo"}}
. If more parameters are needed later, they can be easily added.
Summary
Updates script editing to support coded tests and resolves #170.
Added
Syntax Support for
TEST.CODED_TEST_FILE
:TEST.CODED_TEST_FILE
as a valid syntax in.tst
files.TEST.CODED_TEST_FILE
after typingTEST.
.:
.Behavior When
TEST.SUBPROGRAM
iscoded_tests_driver
:TEST.CODED_TEST_FILE
without error diagnostics.TEST.VALUE
andTEST.EXPECTED
lines, ensuring they give error diagnostics.Behavior When
TEST.SUBPROGRAM
is Notcoded_tests_driver
:TEST.CODED_TEST_FILE
, ensuring it gives an error diagnostic.coded_tests_driver
from the subprogram list forTEST.VALUE
andTEST.EXPECTED
lines.Error Handling Enhancements:
Tests