npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

idris-ide-client

v0.1.6

Published

A library for talking to the Idris IDE.

Downloads

16

Readme

idris-ide-client

A TypeScript library for communicating with an Idris IDE process.

Usage

import { IdrisClient } from "idris-ide-client"

// Create an Idris process
const idrisProc = spawn("idris", ["--ide-mode"])

// Instantiate the client
const client = new IdrisClient(idrisProc.stdin, idrisProc.stdout)

// Load a file
await client.loadFile("test/resources/test.idr")

// Make a request
const reply = await client.typeOf("n")

// Do something with the reply
if (reply.ok) {
  console.log(reply.typeOf) // => "n : Nat"
} else {
  console.warn(reply.err)
}

// Close the process
idrisProc.kill()

What’s it for?

It’s primarily intended to serve as the foundation for my VSCode extension. By keeping it as a separate layer, it can easily be reused in case someone wants to make their own extension. Or for another editor that supports TypeScript.

Types are great documentation, and I’ve typed all of the s-expressions that the IDE returns in TypeScript. As the IDE protocol documentation is a bit spare, hopefully this will be of help to anyone implementing something similar in the future.

Status

It works with Idris 1.3.X on all OSes.

It is also compatible with the most recent release of Idris 2, currently v0.6.0. This will not maintain backwards compatibility with older versions of Idris 2 until it stabilises.

Not all IDE commands have been completely implemented in Idris2, see the issues for their current status.

If you experience any problems on other versions or OSes, please raise an issue. Confirming compatability should be as simple as running the tests.

A few request-types related to tt-terms have not been implemented yet, because I don’t understand what they’re supposed to do.

Known Issues

The handling for unexpected errors could use a bit of work. For example, in Idris 1.3.4, you can cause the IDE to crash by passing in a line number that doesn’t exist, and there’s nothing at the moment to restart the IDE if it dies unexpectedly.

Upgrade idris for CI

from the root:

niv update nixpkgs -b nixos-22.05
niv update nixpkgs-unstable -b nixpkgs-unstable

this will update to the newest nixos-unstable branch of nixpkgs.

To test the idris versions in the nix shell you can then use

nix-shell nix/idris1and2.nix

to get dropped into a shell with both idris and idris2.

To directly run the tests in the nix shell use:

nix-shell nix/idris1and2.nix --run "npm test"