fix: default lsp config opts not being rendered (#433)

The handlebar templates for lsp completion popovers, were not being escaped.
Therefore they were not being rendered in final config generation.
This commit is contained in:
Tillman Jex 2024-07-11 10:53:56 +02:00 committed by GitHub
parent 53df87974c
commit 6134873a5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 8 deletions

View File

@ -5,9 +5,9 @@ import (
"path/filepath"
"strings"
toml "github.com/pelletier/go-toml"
"github.com/zk-org/zk/internal/util/errors"
"github.com/zk-org/zk/internal/util/opt"
toml "github.com/pelletier/go-toml"
)
// Config holds the user configuration.
@ -23,6 +23,10 @@ type Config struct {
Extra map[string]string
}
// NOTE: config generation occurs in core.Init. The below function is used
// for test cases and as a program level default if the user conf is missing or
// has values missing.
// NewDefaultConfig creates a new Config with the default settings.
func NewDefaultConfig() Config {
return Config{
@ -522,7 +526,7 @@ type tomlNoteConfig struct {
IDLength int `toml:"id-length"`
IDCase string `toml:"id-case"`
Exclude []string `toml:"exclude"`
Ignore []string `toml:"ignore"` // Legacy alias to `exclude`
Ignore []string `toml:"ignore"` // Legacy alias to `exclude`
}
type tomlGroupConfig struct {

View File

@ -332,11 +332,11 @@ dead-link = "error"
# Customize the completion pop-up of your LSP client.
# Show the note title in the completion pop-up, or fallback on its path if empty.
#note-label = "{{title-or-path}}"
#note-label = "\{{title-or-path}}"
# Filter out the completion pop-up using the note title or its path.
#note-filter-text = "{{title}} {{path}}"
#note-filter-text = "\{{title}} \{{path}}"
# Show the note filename without extension as detail.
#note-detail = "{{filename-stem}}"
#note-detail = "\{{filename-stem}}"
# NAMED FILTERS

View File

@ -142,11 +142,11 @@ $ cat .zk/config.toml
># Customize the completion pop-up of your LSP client.
>
># Show the note title in the completion pop-up, or fallback on its path if empty.
>#note-label = ""
>#note-label = "\{{title-or-path}}"
># Filter out the completion pop-up using the note title or its path.
>#note-filter-text = " "
>#note-filter-text = "\{{title}} \{{path}}"
># Show the note filename without extension as detail.
>#note-detail = ""
>#note-detail = "\{{filename-stem}}"
>
>
># NAMED FILTERS