# sourcegraph-custom-references

> Lets you configure reference finding for custom entities (HTTP routes, build tasks) using regular expressions

Latest version **1.0.3** (published 2018-10-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install sourcegraph-custom-references
pnpm add sourcegraph-custom-references
yarn add sourcegraph-custom-references
bun add sourcegraph-custom-references
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-10-29 |
| First published | 2018-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | l.guychard@gmail.com |
| Maintainers | lguychard |

## Links

- npm: https://www.npmjs.com/package/sourcegraph-custom-references
- npm.io page: https://npm.io/package/sourcegraph-custom-references

## Recent versions

- 1.0.3 (latest) — 2018-10-29
- 1.0.2 — 2018-10-29
- 1.0.1 — 2018-10-29

## README

# Sourcegraph Custom References

A Sourcegraph extension allowing you to add reference finding for custom entities (HTTP routes, build tasks, string literals...) using regular expressions.

## Configuration

Custom references can be added through the `"customReferences"` property of the Sourcegraph client settings. Here is an example configuration to add reference finding for HTTP routes in go:

```
"customReferences": [
    {
      "name": "HTTP Route",
      "preview": ": `\"/$1\"`",
      "definitions": [{
          "search": "/httpPost\\(ctx, req.Repo, \"$1/",
          "capture": "httpPost\\(ctx, req\\.Repo, \"/?([^\"]+)\""
        }],
      "references": [{
          "search": "mux.HandleFunc\\(\\\"\\/$1",
          "capture": "mux.HandleFunc\\(\"/([^\"]+)"
      }],
      "implementations": [],
    }
  ]
```

With this configuration, hovering HTTP route definitions will trigger a tooltip a tooltip allowing to find references:

![example](./example.png)

---
_Source: https://npm.io/package/sourcegraph-custom-references · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
