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

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

Merged
merged 18 commits into from
Aug 15, 2021

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Aug 14, 2021

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
Copy link
Member

@pokey pokey left a comment

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 😅

src/inferFullTargets.ts Outdated Show resolved Hide resolved
src/NavigationMap.ts Show resolved Hide resolved
@pokey pokey added this to the 0.21.0 milestone Aug 14, 2021
Copy link
Member

@pokey pokey left a comment

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!

@@ -64,9 +65,63 @@ export default class NavigationMap {
this.map = {};
}

public getTokenForRange(range: Range) {
return Object.values(this.map).find(
public getTokenSelectionForSelection(
Copy link
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