-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add immediate commands to the eDSL #827
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goetzrrGit
commented
Mar 29, 2023
goetzrrGit
force-pushed
the
add_immediate_commands
branch
from
March 29, 2023 21:41
2eaf178
to
cab3a6e
Compare
goetzrrGit
force-pushed
the
add_immediate_commands
branch
from
March 29, 2023 22:30
cab3a6e
to
d64f701
Compare
A FSWCommand from the command dictionary was a Command STEP from the spec we can't use it as a immediate command. To get around this we are creating double interfaces and methods for the FSWCommand as both a Command STEP and Immediate Command.
…mand>, A.<command>, and E.<command> are added to the immediate_command section of a sequence. Currently, there is an issue with typechecking that permits the addition of C.<command>, A.<command>, and E.<command> to the immediate_command section of a sequence. Although this is invalid, TypeScript (TS) is unable to perform a type check due to the immediate type being a subset of the command type. To resolve this, a possible solution is to incorporate "type: immediate" to the Immediate type. However, the SeqJSON team does not want to include this redundancy in the JSON specification. Thus, as a workaround, an error is generated in SeqJSON to alert the user of this invalid action.
goetzrrGit
force-pushed
the
add_immediate_commands
branch
from
March 30, 2023 20:46
d64f701
to
d997307
Compare
camargo
approved these changes
Mar 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tested locally and ran UI e2e tests against it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We had to make a change to how we define FSWCommands in the
CommandTypescriptLib.ts
file. Previously, FSWCommands in the Command Dictionary were defined as a single interface (CommandStem
), but we now generate two interfaces: one forImmediateStems
and one forCommandStems
in the eDSL.When a user writes out a command in the editor, ex.
Bake_Banana
the IntelliSense presented a list of commands that areimmediateCommand
type. However,immediateCommand
types cannot be added to thestep[]
in theSequence
as defined by the TS Spec, which includes [Command, Ground_Event, Ground_Block, Activate, Load].To add an FSWCommand to the
step[]
, you will have to use time literal methods, such asC.Bake_Banana
. This will present the users with a list of commands that are ofCommand
type. The aim of this change is to enable the editor to ensure that you are not passing a command with time attributes into animmediate_command[]
unnecessarily, and vice versa.Furthermore, this change enables us to detect potential issues with invalid seqJSON that may be generated, which could adversely impact downstream processes. By restricting the types of commands that can be added to the
step[]
andimmediate_commands
, we can catch any potential problems earlier.We are currently in discussions with the SeqJSON Spec team to add a
type: immediate
for theImmediateCommand
type. Within theimmediate_command[]
array, the editor is not flaggingC.<Command>
. In TypeScript, an object literal can be used as a value of an interface if the object has all the same properties, and optionally some more, with compatible types as specified in the interface. However, addingtype: immediate
will resolve this issue. I have included a check in the generation of SeqJSON to notify the user, but we also want the editor to notify the user earlier.Ex. with immediate commands
Ex. Invalid
Verification
Updated and ran e2e test