Code AI platform with Code Search & Cody
Go to file
Ólafur Páll Geirsson 39a494eb92
Add fuzzy file finder with keyboard shortcut t. (#20921)
Previously, there was no way to interactively search for a file that
matches a given fuzzy query. This commit adds a new modal that activates
on the keyboard shortcut `t` and allows the user to quickly open a file
that fuzzily matches a given query.

The implementation in this commit is specifically designed to handle
large repositories with >100k source files. The fuzzy finder achieves
low-latency by:

1) implementating all the filtering inside the browser on the
   client-side
2) using bloom filters to quickly discard buckets of filenames that are
   guaranteed to not match a given query.  This technique is used by the
   Scala language server and documented in this blog post
   https://scalameta.org/metals/blog/2019/01/22/bloom-filters.html

The downside of this approach:

1) it can take a while to first download all filenames in the
   repository, especially for large repos like chromium/chromium. It should be
   possible to optimize some parts of this on the backend.
2) the bloom filter algorithm is sometimes more strict compared to the
   fuzzy finder in VS Code and IntelliJ. There are techniques to make
   the fuzzy finder more fuzzy, for example we could make all-lowercase
   queries case-insensitive. It's also worth consider whether we want
   use a different filtering algorithm for smaller repositories (<25k source files)
2021-05-25 09:48:33 +02:00
.buildkite default to GH_TOKEN envvar (#20099) 2021-04-16 14:44:19 -05:00
.github Add self to users tagged when batch changes are mentioned (#21253) 2021-05-21 15:13:57 -07:00
.vscode Configure eslint for wildcard and branded packages in vscode (#20353) 2021-05-20 13:35:14 +02:00
client Add fuzzy file finder with keyboard shortcut t. (#20921) 2021-05-25 09:48:33 +02:00
cmd serveRepoRefresh: Share request context with EnqueueRepoUpdate (#21225) 2021-05-25 12:22:21 +05:30
dev gqltest: check default search limits (#21282) 2021-05-24 16:19:42 +02:00
doc ci: rename master-dry-run prefix to main-dry-run (#21239) 2021-05-24 14:43:46 +02:00
docker-images Update codeintel-db postgres image (#20712) 2021-05-07 11:50:57 -03:00
enterprise ci: rename master-dry-run prefix to main-dry-run (#21239) 2021-05-24 14:43:46 +02:00
internal Move symbol search out of graphqlbackend (#21316) 2021-05-24 17:02:59 -06:00
lib all: go mod download and tidy (#21276) 2021-05-24 11:10:18 +00:00
migrations codeintel: ingest, process, and expose API documentation data (#21037) 2021-05-19 13:26:12 -07:00
monitoring Fix incorrect labeling for Postgres exporter alert (#21208) 2021-05-20 19:53:26 +00:00
schema Add fuzzy file finder with keyboard shortcut t. (#20921) 2021-05-25 09:48:33 +02:00
third-party-licenses add sourcegraph/codeintelutils into sourcegraph/sourcegraph (#18665) 2021-03-01 14:38:18 -08:00
ui/assets Upgrade Monaco (#19943) 2021-05-13 10:51:00 -07:00
.dockerignore web: flatten frontend packages inside of the client folder (#19378) 2021-03-26 15:35:26 +08:00
.editorconfig ci: replace codecov helper with codecov script (#20128) 2021-04-19 14:03:25 +00:00
.eslintignore web: flatten frontend packages inside of the client folder (#19378) 2021-03-26 15:35:26 +08:00
.eslintrc.js web: bump @sourcegraph/eslint-config version (#19966) 2021-04-13 19:55:24 +08:00
.gitattributes Support multiple GraphQL schema files (#20077) 2021-04-19 14:35:49 +02:00
.gitignore Apply content-hashing to app.bundle.js and app.bundle.css filenames (#19479) 2021-04-14 13:42:41 +01:00
.gitmodules Publish Sourcegraph as open source 🚀 2018-09-30 23:13:36 -07:00
.golangci.yml Replace .golangci.yml with .golangci.enforced.yml (#19568) 2021-03-30 17:43:56 -06:00
.graphqlrc.yml Support multiple GraphQL schema files (#20077) 2021-04-19 14:35:49 +02:00
.mailmap Add Camden to mailmap (#19488) 2021-03-26 16:32:13 +00:00
.mocharc.js Move all client code into client/ folder (#14480) 2020-10-07 22:23:53 +02:00
.nvmrc Update Node.js to v14.15.4 (#16981) 2021-01-06 14:46:23 +01:00
.percy.yml Disable 960px screenshots in Percy (#20511) 2021-04-29 12:52:14 +01:00
.prettierignore web: moved Storybook config into a new package (#19569) 2021-04-08 17:16:26 +08:00
.stylelintignore docs: extension architecture (#15679) 2020-12-02 21:17:24 -05:00
.stylelintrc.json Publish Sourcegraph as open source 🚀 2018-09-30 23:13:36 -07:00
.tool-versions tool-versions: update github-cli (#19619) 2021-03-31 12:55:36 -07:00
.yarnrc Ignore workspace root check (#19608) 2021-03-31 15:30:11 +01:00
babel.config.js Unpin and upgrade babel to latest version (#21016) 2021-05-18 12:47:57 +02:00
CHANGELOG.md Remove deprecated icon field (#21310) 2021-05-24 22:49:56 +00:00
CODENOTIFY Deglobalize CODENOTIFY settings for eseliger (#16710) 2020-12-14 15:50:22 +01:00
CONTRIBUTING.md fix: update broken link to code of conduct (#7781) 2020-01-15 13:45:14 -08:00
doc.go Publish Sourcegraph as open source 🚀 2018-09-30 23:13:36 -07:00
go.mod gomod: update zoekt (#21194) 2021-05-21 08:00:06 +02:00
go.sum all: go mod download and tidy (#21276) 2021-05-24 11:10:18 +00:00
graphql-schema-linter.config.js Support multiple GraphQL schema files (#20077) 2021-04-19 14:35:49 +02:00
gulpfile.js web: add CSS-modules support (#19919) 2021-04-14 18:46:49 +08:00
jest.config.base.js web: flatten frontend packages inside of the client folder (#19378) 2021-03-26 15:35:26 +08:00
jest.config.js web: moved Storybook config into a new package (#19569) 2021-04-08 17:16:26 +08:00
LICENSE Move all client code into client/ folder (#14480) 2020-10-07 22:23:53 +02:00
LICENSE.apache Move all client code into client/ folder (#14480) 2020-10-07 22:23:53 +02:00
LICENSE.enterprise clarify license (#2543) 2019-03-03 16:39:46 +08:00
package.json Add fuzzy file finder with keyboard shortcut t. (#20921) 2021-05-25 09:48:33 +02:00
postcss.config.js Add @custom-media support (#20696) 2021-05-10 11:35:01 +01:00
prettier.config.js Publish Sourcegraph as open source 🚀 2018-09-30 23:13:36 -07:00
README.md Revert "dev: Go 1.16 is necessary now" 2021-04-20 12:27:28 -07:00
renovate.json web: enable cross-theme screenshots in Chromatic (#20349) 2021-04-28 22:19:55 +08:00
SECURITY.md consolidate security policy (#7906) 2020-01-21 10:03:11 -08:00
sg.config.yaml frontend: warm default repo cache before serving traffic (#21238) 2021-05-24 14:14:53 +02:00
tsconfig.all.json web: moved Storybook config into a new package (#19569) 2021-04-08 17:16:26 +08:00
tsconfig.json web: flatten frontend packages inside of the client folder (#19378) 2021-03-26 15:35:26 +08:00
yarn.lock Add fuzzy file finder with keyboard shortcut t. (#20921) 2021-05-25 09:48:33 +02:00

Sourcegraph

build apache license

Sourcegraph OSS edition is a fast, open-source, fully-featured code search and navigation engine. Enterprise editions are available.

Screenshot

Features

Try it yourself

Development

Prerequisites

  • Git
  • Go (1.15 or later)
  • Docker
  • PostgreSQL (v11 or higher)
  • Node.js (version 8 or 10)
  • Redis
  • Yarn

For a detailed guide to installing prerequisites, see these instructions.

Installation

Prebuilt Docker images are the fastest way to use Sourcegraph Enterprise. See the quickstart installation guide.

To use Sourcegraph OSS:

  1. Initialize the PostgreSQL database

  2. Ensure Docker is running

  3. Configure the HTTPS reverse proxy

  4. Start the development server

    ./dev/start.sh
    

Sourcegraph should now be running at https://sourcegraph.test:3443.

For detailed instructions and troubleshooting, see the local development documentation.

Documentation

The doc directory has additional documentation for developing and understanding Sourcegraph:

License

Sourcegraph OSS is available freely under the Apache 2 license. Sourcegraph OSS comprises all files in this repository except those in the enterprise/ and client/web/src/enterprise directories.

All files in the enterprise/ and client/web/src/enterprise/ directories are subject to the Sourcegraph Enterprise license.