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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rcrsr/rill-language-service

v0.21.0

Published

Language service tooling for rill

Readme

@rcrsr/rill-language-service

Language service tooling for rill — outline, semantic tokens, formatting, scope resolution, hover, go-to-definition, completion, and a static checker.

Experimental. Breaking changes will occur before stabilization.

Install

npm install @rcrsr/rill-language-service @rcrsr/rill

@rcrsr/rill is a required peer dependency. This package's peerDependencies field declares the supported range, and your package manager warns when the installed version falls outside it. The AST crosses the package boundary, so a single shared copy keeps AST types and AST values consistent. Every entry point takes a ParseResult from its parseWithRecovery, so parse once and pass the result to each call.

Quick Start

import { parseWithRecovery, tokenize } from '@rcrsr/rill';
import { documentSymbols, semanticTokens, formatDocument } from '@rcrsr/rill-language-service';
import { runRules } from '@rcrsr/rill-language-service/rules';
import { getHover } from '@rcrsr/rill-language-service/scope';

const source = '5 => $x\n$x -> log\n';
const parsed = parseWithRecovery(source);

const outline = documentSymbols(parsed);
const tokens = semanticTokens(parsed, tokenize(source), source);
const edits = formatDocument(parsed, source);
const diagnostics = runRules(parsed, source, { rules: {} });
const hover = getHover(parsed, 9); // offset of `$x` on line 2 → variable `x`

parseWithRecovery does not throw on malformed input. It reports success: false and still returns a partial AST, so tooling keeps working while the user types.

Exports

The package ships three subpaths.

@rcrsr/rill-language-service

| Export | Purpose | |--------|---------| | documentSymbols(parsed) | Outline symbols for a document | | semanticTokens(parsed, tokens, source) | Semantic tokens for highlighting | | formatDocument(parsed, source) | Format a document, returning TextEdit[] | | spanToRange(span) | Convert a SourceSpan to a line/column Range | | version | Package version string |

@rcrsr/rill-language-service/scope

| Export | Purpose | |--------|---------| | resolveScopeAt(parsed, offset) | Bindings visible at an offset | | findDefinition(parsed, offset) | Go to definition; null when unresolved | | getHover(parsed, offset) | Hover info; null when nothing is under the offset | | getCompletions(parsed, offset) | Completion candidates |

@rcrsr/rill-language-service/rules

| Export | Purpose | |--------|---------| | RULES | Default rule registry; each rule carries a category | | runRules(parsed, source, config, rules?) | Run the checker, returning Diagnostic[] | | capturesInSubtree(node) | Capture facts for a subtree |

runRules defaults to RULES; pass a rule array to run a subset. config is a CheckConfig, whose rules field holds per-rule state and whose optional checkerMode selects 'strict' or 'permissive'. The registry holds 42 rules.

Documentation

See the Language Service API reference for full signatures and types.

License

MIT