Socket
Book a DemoInstallSign in
Socket

sourcegraph-configurable-references

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sourcegraph-configurable-references

Lets you configure reference finding using regular expressions

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Sourcegraph Configurable References

travis npm

A Sourcegraph extension allowing you to add and configure reference finding for custom entities (for instance 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

Defaults

If your Sourcegraph configuration does not have a "customReferences" field, the extension will create it, and include by default the configuration for string literal references

FAQs

Package last updated on 29 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts