Page MenuHomePhabricator

add autocomplete values for config for scalar union types
ClosedPublic

Authored by prha on Jan 15 2020, 12:24 AM.

Details

Summary

Test Plan

Generated solid with scalar inputs, made sure that autocompleted suggestions
worked for:

  • CompositeConfigType suggestions on the ScalarUnion field line
  • Scalar suggestions (for Bool) on the field line
  • CompositeConfigType only in the child
  • Nested CompositeConfigType in the child

Diff Detail

Repository
R1 dagster
Branch
prha/autocomplete_scalar_union
Lint
Lint OK
Unit
No Unit Test Coverage

Event Timeline

prha created this revision.Jan 15 2020, 12:24 AM
prha updated this revision to Diff 8718.Jan 15 2020, 12:40 AM

flip token logic

prha edited the summary of this revision. (Show Details)Jan 15 2020, 12:40 AM
prha added reviewers: schrockn, bengotow.
schrockn accepted this revision.Jan 15 2020, 5:07 PM

very nice. thanks

js_modules/dagit/src/configeditor/codemirror-yaml/mode.tsx
449

whats the prevToken check for? logic complicated enough to be comment-worthy i think

This revision is now accepted and ready to land.Jan 15 2020, 5:07 PM
This revision was automatically updated to reflect the committed changes.
prha added inline comments.Jan 15 2020, 7:29 PM
js_modules/dagit/src/configeditor/codemirror-yaml/mode.tsx
449

contextually, we want to change the suggested fields depending on the cursor position (e.g. detecting whether or not we are on the same line as the type key or not).

scalarUnionKey: |

vs

scalarUnionKey:
  |

(where | is the cursor position)

I added some comments to make this more clear.