apainintheneck / crystal-linenoise Goto Github PK
View Code? Open in Web Editor NEWCrystal bindings for the Linenoise library
Home Page: https://apainintheneck.github.io/crystal-linenoise/
License: MIT License
Crystal bindings for the Linenoise library
Home Page: https://apainintheneck.github.io/crystal-linenoise/
License: MIT License
The automatic completions currently show the next alphabetic matching completion not the next shortest alphabetic completion which would be more accurate and nicer.
The main Linenoise
repo is somewhat abandoned. Though it provided a good foundation it has a large number of bug reports and pending fixes/improvements. Some of those pending fixes and improvements might be useful to add to this repo in a pinch. That is especially true for bug fixes.
It might also be interesting to look at some forks to see if they have any changes we can pull in that would be useful.
Testing will be a bit tricky here since at the very least the hints are just a visual phenomenon. That being said we should be able to test some of the behavior with something like expect
or a similar wrapper in pure Crystal.
expect
seemed like a good enough way to test that Linenoise completions were working correctly but I ran into two problems with it. First, I couldn't get it working on CI so I had to just make sure to run it locally. That was inconvenient but not that big of a deal. Second, I just found out that the default expect
on macOS doesn't support UTF-8 characters by default which means that I can't automatically test new PRs like #27.
Ideally, there'd be a library in Crystal to do this but I'm not aware of any of them. Likely, I'll have to use something written in another language or maybe port something to Crystal. There are definitely a bunch of options out there.
The Linenoise::Completion
logic seems to be broken now. It doesn't consistently return the expected results. This should also be easily testable so regression tests need to be added too here.
I found out about this while updating https://github.com/apainintheneck/gitsh to v0.2.0 and started seeing missing completions for common git
commands like push
and pull
.
This is not the only line editing library for Crystal (maybe I wouldn't have started working on it if I had known that two weeks ago...). It'd be good to add those other libraries as alternatives to the readme.
These can be generated by running crystal docs
but as a user I'd usually like to see this sorts of stuff online or in the repo itself before I have to download and run any code.
The key here will be to add a check on CI for outdated docs.
These should explain how to get this project up and running. This means referencing the makefile and talking about updating the Linenoise library which might be necessary at some point. There is also the whole thing with manual testing using the example/example.cr
program.
These should be easily testable without needing to run an interactive REPL like we do already with the expect
tests.
Most of the usage documentation should flow pretty directly from the inline documentation (try crystal docs
with this repo) along with the code already in example/example.cr
.
I'd kind of like to implement a minimal programming language REPL here but that might go beyond the intended scope. Something simple though that uses most of the features would be great. This should be implemented in a separate repo and then linked to from the readme.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.