Skip to content

Bugfixes: past token, past end of, subtoken out of range, sort tokens#229

Merged
AndreasArvidsson merged 18 commits into
masterfrom
tokenRange
Aug 15, 2021
Merged

Bugfixes: past token, past end of, subtoken out of range, sort tokens#229
AndreasArvidsson merged 18 commits into
masterfrom
tokenRange

Conversation

@AndreasArvidsson

@AndreasArvidsson AndreasArvidsson commented Aug 14, 2021

Copy link
Copy Markdown
Member

fixes #221
fixes #222
fixes #201
fixes #209
fixes #200
fixes #198

@AndreasArvidsson AndreasArvidsson changed the title Support take token past Bugfixes: past token, subtoken out of range Aug 14, 2021
@AndreasArvidsson AndreasArvidsson changed the title Bugfixes: past token, subtoken out of range Bugfixes: past token, past end of, subtoken out of range Aug 14, 2021
@AndreasArvidsson AndreasArvidsson changed the title Bugfixes: past token, past end of, subtoken out of range Bugfixes: past token, past end of, subtoken out of range, sort tokens Aug 14, 2021

@pokey pokey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok nice fixes; left a few comments tho. Also would be good to add a test with same initial state as "take token past trap" (eg cursor in middle of first token), but say "take past trap" to make sure it doesn't expand to first token. Could see us messing that one up down the road if there's no test 😅

Comment thread src/inferFullTargets.ts Outdated
Comment thread src/NavigationMap.ts
Comment thread src/test/suite/fixtures/recorded/surroundingPair/takeFirstChar.yml
Comment thread src/test/suite/fixtures/recorded/surroundingPair/takeFirstChar5.yml
@pokey pokey added this to the 0.21.0 milestone Aug 14, 2021

@pokey pokey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a couple changes but otherwise looks good to me!

Comment thread src/NavigationMap.ts

public getTokenForRange(range: Range) {
return Object.values(this.map).find(
public getTokenSelectionForSelection(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code doesn't really fit in the navigation map. Earmarking to move it for cursorless engine 2.0 work, as it should become a proper scope type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants