mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 13:11:49 +00:00
site-config: Make symbols not required in syntaxHighlighting (#57276)
* site-config: Make symbols not required in syntaxHighlighting * add nil checks
This commit is contained in:
parent
a3dbd371eb
commit
325e120317
@ -27,7 +27,7 @@ func init() {
|
||||
// Validation only: Do NOT set any values in the configuration in this function.
|
||||
conf.ContributeValidator(func(c conftypes.SiteConfigQuerier) (problems conf.Problems) {
|
||||
configuration := c.SiteConfig().SyntaxHighlighting
|
||||
if configuration == nil {
|
||||
if configuration == nil || configuration.Symbols == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -104,7 +104,7 @@ func CreateEngineMap(siteConfig schema.SiteConfiguration) map[string]ParserType
|
||||
|
||||
// Set any relevant overrides
|
||||
configuration := siteConfig.SyntaxHighlighting
|
||||
if configuration != nil {
|
||||
if configuration != nil && configuration.Symbols != nil {
|
||||
for lang, engine := range configuration.Symbols.Engine {
|
||||
lang = languages.NormalizeLanguage(lang)
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ Sourcegraph uses the following JSON Schemas:
|
||||
# Modifying a schema
|
||||
|
||||
1. Edit the `*.schema.json` file in this directory.
|
||||
1. Run `bazel run :write_generated_schema`.
|
||||
1. Run `bazel run //schema:write_generated_schema`.
|
||||
1. Commit the changes to both files.
|
||||
1. Run `sg start` to automatically update TypeScript schema files.
|
||||
|
||||
|
||||
@ -2978,7 +2978,7 @@ type SyntaxHighlighting struct {
|
||||
Engine SyntaxHighlightingEngine `json:"engine"`
|
||||
Languages SyntaxHighlightingLanguage `json:"languages"`
|
||||
// Symbols description: Configure symbol generation
|
||||
Symbols SymbolConfiguration `json:"symbols"`
|
||||
Symbols *SymbolConfiguration `json:"symbols,omitempty"`
|
||||
}
|
||||
type SyntaxHighlightingEngine struct {
|
||||
// Default description: The default syntax highlighting engine to use
|
||||
|
||||
@ -877,7 +877,7 @@
|
||||
"title": "SyntaxHighlighting",
|
||||
"description": "Syntax highlighting configuration",
|
||||
"type": "object",
|
||||
"required": ["engine", "languages", "symbols"],
|
||||
"required": ["engine", "languages"],
|
||||
"properties": {
|
||||
"engine": {
|
||||
"title": "SyntaxHighlightingEngine",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user