So developers like CI... for everything! We do this because we like things to be automated.
Building software is tedious and risky. If we can push a commit and let things happen in the cloud to give our change confidence, we absolutely will do that to reduce that potential risk.
Now let's get into what this blog is about, brace yourself...

I've been using Neovim for a few years now and maintain my own config. Updating Neovim or my plugins is often considered scary because you are trusting a whole lot of maintainers to not make a breaking change that could bring you to a screeching halt.
One day I had a wild idea. Is it possible to test the most critical part of my workflow? To me that's the TypeScript LSP which gives me hover diagnostics, go to definitions, and of course, the red squiggles.
Now the implementation is somewhat involved but you can take a peek at my dotfiles repo to learn more about how it works, I won't dive too deep here.
Originally I only supported Docker because it's been one of my toolchains for a long time, over a decade at this point. I recently learned about Finch, an open source project by AWS which allows you to build and run containers.
Finch is a drop-in replacement for Docker so I updated my CLI (hack) to let me specify docker or finch via an env var (HACK_CONTAINER_RUNTIME) or CLI flag (--runtime).
So I can start a run with Finch:
hack --runtime finch
Once the build and tests finish, you should see output showing that the TypeScript LSP was able to report diagnostics, which gives me confidence that my Neovim setup isn't broken.
⌛ Starting TypeScript LSP validation...
📊 TypeScript diagnostics found: 1
[1] Type 'number' is not assignable to type 'string'.
✅ LSP validation completed successfully!
✅ Neovim test ran successfully...
NVIM v0.12.2
Build type: Release
LuaJIT 2.1.1774638290
Vim versions: 8.1, 8.2, 9.0, 9.1, 9.2
What happened at a high level after running the hack CLI:
- Builds the container image with Finch
- Installs Neovim and development tools in the container
- Links the Neovim configuration into the container
- Starts the test container in Finch
- Neovim opens a TypeScript test file
- Runs a custom Neovim command to verify the TypeScript LSP works
- Success 🥳
My test is pretty narrow but solves my use case of ensuring my TypeScript LSP will work when new plugins and Neovim updates land.
Give Finch a try for running containers locally and let me know what you think in the comments.
Happy Coding 🙂!
Follow AWS for more articles like this
Follow me for all things tech

Top comments (0)