Skip to content
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

experiment with hatdocs / txtar #1768

Closed

Conversation

josharian
Copy link
Collaborator

@josharian josharian commented Aug 11, 2023

For voice discussion. Lots of important caveats and explaining required.

interesting fixtures:

  • packages/cursorless-vscode-e2e/src/suite/fixtures/recorded//everyRange/clearEveryFunkNameFinePastBlueDrum.yml
  • packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scss/moveFirstWordZipBeforeFineTakeFine.yml
  • packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/actions/giveEqualsPastColon.yml
type RangeDoc struct {
	Content string
	Ranges  []NamedRangeSet // "hats", "selections", "that", etc.
}

type NamedRangeSet struct {
	Name   string
	Ranges []AnnotatedRange // ranges along with annotations
}

type AnnotatedRange struct {
	Annotation    string
	AnnotationEnd int // how many chars into the range should the annotatin end (e.g. for hats); zero means "don't care", which we will interpret for now as "center"
	Range         Range
	Direction     Direction
}

type Range struct {
	Start Position `yaml:"start,flow"`
	End   Position `yaml:"end,flow"`
}

type Direction int

const (
	DirectionNone Direction = iota
	DirectionStart
	DirectionEnd
)
range
!
#
[]
[-]
[--]

directed range
!
>
<
[>
<]
[->
<-]
--- raw notes ---
- Q: primary cursor: how? range? use a hat ref? can't quite cram that last single bool in there :/
- Q: visible vs invisible contents using > vs <?
- Q: how to sync with scope tests, subtle differences due to different needs
- Q: unicode? tabs?

txtar: way to combine hatdoc + metadata for other purposes
- hat tests: hats, tokens (set of ranges), split editors, multi-stage assignment (either file naming conventinos or config at top)
- test fixtures: extract initial/final docs and some ranges (maybe now can run some of these editor-free?!)
- txtar makes it easier to update just part, do diffs, do multi-step things, do multi-editor things, etc.

# problems

currently losing some thatMark (etc) metadata: reversed, explicit, etc.
ranges need lots more metadata (isReversed, explicit, etc) / annotations :(


# stats test

given doc + other metadata:

number of 0, 1, 2 penalty hats
nubmer of hats on first letter of word
percent of tokens with no hat
distance to nearest token with no hat

@josharian
Copy link
Collaborator Author

1ac8931

@pokey
Copy link
Member

pokey commented Aug 11, 2023

Fwiw if you mark a PR as draft, as you've done, we won't merge it, and will assume it's WIP, so you don't need the big all-caps caveat in the title 😄. We also have a to discuss tag you can put on it which indicates it should be discussed in a meet-up

@pokey
Copy link
Member

pokey commented Aug 11, 2023

Also, I'm guessing you've seen #1524, but figured I'd mention it just in case as it seems possibly relevant based on the PR description

@josharian josharian changed the title experiment with hatdocs / txtar (WIP, DO NOT REVIEW, DO NOT MERGE) experiment with hatdocs / txtar Aug 11, 2023
@josharian josharian added the to discuss Plan to discuss at meet-up label Aug 11, 2023
@josharian
Copy link
Collaborator Author

I'm guessing you've seen #1524

This was very much inspired by #1524. Unfortunately due to different needs, they diverged in minor ways, and continue to do so. I was designing for hat tests and then got distracted by attempting to re-use for other fixtures. #1767 is an added wrinkle I'm still pondering.

@josharian josharian force-pushed the josh/txtar-hatdoc-fixtures branch from 7c2c16f to 02d88ae Compare August 11, 2023 16:43
@josharian josharian force-pushed the josh/txtar-hatdoc-fixtures branch from 6d9ee99 to 0415195 Compare August 17, 2023 02:08
@josharian
Copy link
Collaborator Author

this is actually ready to discuss a bit now. will need voice intro, though, for sure.

@josharian
Copy link
Collaborator Author

outcome from meetup: as anticipated, the advantages of having a single uniform data format are outweighed by the disadvantages of it not being a perfect fit for any particular use case.

plan is that @pokey (and maybe @AndreasArvidsson?) are going to look through a few of the interesting fixtures in case there are any ideas they want to steal, and we will put this on ice. :)

@josharian josharian closed this Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to discuss Plan to discuss at meet-up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants