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

specify file extension for abbreviations #348

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

chenson2018
Copy link
Contributor

This is my attempt to implement what was suggested on Zulip for allowing the lean.nvim abbreviations for other file extensions.

The usage here would be that you call something like require('lean.abbreviations').enable('*.tex', {}) to add a file extension. As I've not ever written much Lua or nvim plugins previously I'm not sure at all about what is considered idiomatic, so please give feedback as needed!

@Julian
Copy link
Owner

Julian commented Aug 8, 2024

Awesome! Thanks a ton for giving this a shot. I'll take a closer look in a bit (likely tomorrow) -- at first glance it seems good! One additional thing you might try is to add a test to the spec file which tests this functionality.

You should mostly be able to copy a test that's there and simply create a file with some other file extension.

In order to run the tests locally you'll need just (brew install just on macOS if you're there) -- or otherwise you can just rely on GitHub actions running them, though it'll take a bit longer obviously. Ask if that's not specific enough help!

@chenson2018
Copy link
Contributor Author

I took a stab at the unit testing, making changes to the existing helper function set_unique_name_so_we_always_have_a_separate_fake_file to support different file extensions and copying over a test as suggested.

@Julian
Copy link
Owner

Julian commented Aug 9, 2024

Awesome! I did that test modification in a slightly different way, but now merging! Thanks again, and let me know how this goes!

@Julian Julian merged commit e98d529 into Julian:main Aug 9, 2024
5 checks passed
@chenson2018
Copy link
Contributor Author

I saw your follow up commit to the testing, that's much cleaner. Thanks!

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