test(config): cover link_severity in parity harnesses and docs
Both editor harnesses now emit diagnostic.link_severity and exercise a
non-default override ('error') in the sample scenario, diffed against the
shared golden. Drop the README "not wired" caveat now that the value flows
through, and document the g:nuwiki_link_severity global.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3,11 +3,13 @@ wiki_root=~/vimwiki
|
||||
file_extension=.wiki
|
||||
syntax=vimwiki
|
||||
log_level=warn
|
||||
diagnostic.link_severity=warn
|
||||
[sample]
|
||||
wiki_root=/tmp/base
|
||||
file_extension=.md
|
||||
syntax=vimwiki
|
||||
log_level=debug
|
||||
diagnostic.link_severity=error
|
||||
wikis[0].diary_rel_path=journal
|
||||
wikis[0].file_extension=.wiki
|
||||
wikis[0].index=home
|
||||
|
||||
@@ -15,6 +15,9 @@ function! s:dump(payload) abort
|
||||
call add(s:lines, 'file_extension=' . a:payload.file_extension)
|
||||
call add(s:lines, 'syntax=' . a:payload.syntax)
|
||||
call add(s:lines, 'log_level=' . a:payload.log_level)
|
||||
if has_key(a:payload, 'diagnostic')
|
||||
call add(s:lines, 'diagnostic.link_severity=' . a:payload.diagnostic.link_severity)
|
||||
endif
|
||||
if has_key(a:payload, 'wikis')
|
||||
let l:i = 0
|
||||
for l:w in a:payload.wikis
|
||||
@@ -28,7 +31,7 @@ endfunction
|
||||
|
||||
" Scenario 1: defaults (no globals set).
|
||||
unlet! g:nuwiki_wiki_root g:nuwiki_file_extension g:nuwiki_syntax
|
||||
unlet! g:nuwiki_log_level g:nuwiki_wikis
|
||||
unlet! g:nuwiki_log_level g:nuwiki_wikis g:nuwiki_link_severity
|
||||
call add(s:lines, '[default]')
|
||||
call s:dump(nuwiki#lsp#settings())
|
||||
|
||||
@@ -37,6 +40,7 @@ let g:nuwiki_wiki_root = '/tmp/base'
|
||||
let g:nuwiki_file_extension = '.md'
|
||||
let g:nuwiki_syntax = 'vimwiki'
|
||||
let g:nuwiki_log_level = 'debug'
|
||||
let g:nuwiki_link_severity = 'error'
|
||||
let g:nuwiki_wikis = [
|
||||
\ { 'name': 'personal', 'root': '/tmp/personal',
|
||||
\ 'file_extension': '.wiki', 'index': 'home',
|
||||
|
||||
@@ -27,6 +27,9 @@ local function dump(payload)
|
||||
emit('file_extension=' .. tostring(payload.file_extension))
|
||||
emit('syntax=' .. tostring(payload.syntax))
|
||||
emit('log_level=' .. tostring(payload.log_level))
|
||||
if payload.diagnostic then
|
||||
emit('diagnostic.link_severity=' .. tostring(payload.diagnostic.link_severity))
|
||||
end
|
||||
if payload.wikis then
|
||||
for i, w in ipairs(payload.wikis) do
|
||||
local keys = {}
|
||||
@@ -53,6 +56,7 @@ config.apply({
|
||||
file_extension = '.md',
|
||||
syntax = 'vimwiki',
|
||||
log_level = 'debug',
|
||||
diagnostic = { link_severity = 'error' },
|
||||
wikis = {
|
||||
{
|
||||
name = 'personal',
|
||||
|
||||
Reference in New Issue
Block a user