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

Delimiter selector updated #347

Merged
merged 9 commits into from
Dec 1, 2021
Merged

Delimiter selector updated #347

merged 9 commits into from
Dec 1, 2021

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Nov 30, 2021

  • Delimiter selector made more robust and usable for all languages
  • Added a lot of language specific play/test files. They have very little in them right now but the purpose is that each language should have a file with all the common structures making it easier to test while developing.

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.

I like this idea. A few things

  • Looks like the line endings got messed up or something? Strange diffs
  • Looks like a few junk files appeared, eg tmp.tsx and a couple empty files. The markdown one also looks strange
  • Please add tests for the things you fixed
  • I'd be tempted to put all the files, including hat-test, into a data/playground directory. I think "test" is probably a confusing name because they're not actually tests. Prob my fault for calling it "hat-test". I think I'd maybe go data/playground/hats.txt, data/playground/typescript.ts, etc?

src/languages/cpp.ts Show resolved Hide resolved
@AndreasArvidsson
Copy link
Member Author

Now I think everything is fixed :)

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.

This is really nice. Left a couple minor suggestions

src/languages/csharp.ts Show resolved Hide resolved
},
);
} else {
trailingDelimiterRange = makeRangeFromPositions(
Copy link
Member

Choose a reason for hiding this comment

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

What if we walked up parents until we find one with a previous sibling and then ask for end of previous sibling there? Not sure it's worth the effort but might make white space a bit cleaner

Copy link
Member Author

Choose a reason for hiding this comment

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

We can't try that

Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to say "we can try that?"

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we have to. So far no language has need of this with the current implementation.

@AndreasArvidsson AndreasArvidsson merged commit f2466d8 into main Dec 1, 2021
@AndreasArvidsson AndreasArvidsson deleted the delimiterSelector branch December 1, 2021 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants