mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
Closes #38316 This graduates the go import search extension. The extension currently has two usages: 1. A query of the form `go.imports:<something>` is transformed to look for go import strings of `<something>`. 2. A user config option that, when enabled, shows an "show all usages" button next to import statements: [Screenshot 2022-08-19 at 16 14 53](https://user-images.githubusercontent.com/458591/185638652-c9ea82e4-f1cf-4d60-8478-84db5854adee.png) We decided to only migrate 1) since 2) is not enabled by default, currently broken on Web (won't render at all) and broken on code hosts (the link it creates is dead). We plan on tracking usages of this transformation and will very likely deprecate this later. |
||
|---|---|---|
| .. | ||
| aws_codecommit.schema.json | ||
| batch_spec.schema.json | ||
| bitbucket_cloud.schema.json | ||
| bitbucket_server_util.go | ||
| bitbucket_server.schema.json | ||
| changeset_spec.schema.json | ||
| extension_schema.go | ||
| gen.go | ||
| gen.sh | ||
| gerrit.schema.json | ||
| github_util.go | ||
| github.schema.json | ||
| gitlab_util.go | ||
| gitlab.schema.json | ||
| gitolite.schema.json | ||
| go-modules.schema.json | ||
| json-schema-draft-07.schema.json | ||
| jvm-packages.schema.json | ||
| npm-packages.schema.json | ||
| other_external_service.schema.json | ||
| pagure.schema.json | ||
| perforce.schema.json | ||
| phabricator.schema.json | ||
| python-packages.schema.json | ||
| README.md | ||
| rust-packages.schema.json | ||
| schema.go | ||
| settings.schema.json | ||
| site.schema.json | ||
| stringdata.go | ||
| tsconfig.json | ||
Sourcegraph JSON Schemas
JSON Schema is a way to define the structure of a JSON document. It enables typechecking and code intelligence on JSON documents.
Sourcegraph uses the following JSON Schemas:
settings.schema.jsoncritical.schema.jsonsite.schema.jsonextension.schema.json(not codegenned into Go structs)
Modifying a schema
- Edit the
*.schema.jsonfile in this directory. - Run
go generateto update the*_stringdata.jsonfile. - Commit the changes to both files.
- Run
sg startto automatically update TypeScript schema files. - When the change is ready for release, update the documentation.
Known issues
- The JSON Schema IDs (URIs) are of the form
https://sourcegraph.com/v1/*.schema.json#, but these are not actually valid URLs. This means you generally need to supply them to JSON Schema validation libraries manually instead of having the validator fetch the schema from the web.