A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/6160973f36b532b6f9ff2cd7c20958fd791f2e2a below:

fix lookup of boolean values in workspace/configuration (#1… · neovim/neovim@6160973 · GitHub

File tree Expand file treeCollapse file tree 4 files changed

+9

-4

lines changed

Filter options

Expand file treeCollapse file tree 4 files changed

+9

-4

lines changed Original file line number Diff line number Diff line change

@@ -141,7 +141,7 @@ M['workspace/configuration'] = function(_, result, ctx)

141 141

local response = {}

142 142

for _, item in ipairs(result.items) do

143 143

if item.section then

144 -

local value = util.lookup_section(client.config.settings, item.section) or vim.NIL

144 +

local value = util.lookup_section(client.config.settings, item.section)

145 145

-- For empty sections with no explicit '' key, return settings as is

146 146

if value == vim.NIL and item.section == '' then

147 147

value = client.config.settings or vim.NIL

Original file line number Diff line number Diff line change

@@ -1950,8 +1950,8 @@ end

1950 1950

function M.lookup_section(settings, section)

1951 1951

for part in vim.gsplit(section, '.', true) do

1952 1952

settings = settings[part]

1953 -

if not settings then

1954 -

return

1953 +

if settings == nil then

1954 +

return vim.NIL

1955 1955

end

1956 1956

end

1957 1957

return settings

Original file line number Diff line number Diff line change

@@ -119,8 +119,10 @@ function tests.check_workspace_configuration()

119 119

notify('workspace/configuration', { items = {

120 120

{ section = "testSetting1" };

121 121

{ section = "testSetting2" };

122 +

{ section = "test.Setting3" };

123 +

{ section = "test.Setting4" };

122 124

} })

123 -

expect_notification('workspace/configuration', { true; vim.NIL})

125 +

expect_notification('workspace/configuration', { true; false; 'nested'; vim.NIL})

124 126

notify('shutdown')

125 127

end;

126 128

}

Original file line number Diff line number Diff line change

@@ -347,6 +347,8 @@ describe('LSP', function()

347 347

{NIL, { items = {

348 348

{ section = "testSetting1" };

349 349

{ section = "testSetting2" };

350 +

{ section = "test.Setting3" };

351 +

{ section = "test.Setting4" };

350 352

}}, { method="workspace/configuration", client_id=1}};

351 353

{NIL, {}, {method="start", client_id=1}};

352 354

}

@@ -368,6 +370,7 @@ describe('LSP', function()

368 370

client.config.settings = {

369 371

testSetting1 = true;

370 372

testSetting2 = false;

373 +

test = {Setting3 = 'nested' };

371 374

}]=])

372 375

end

373 376

if ctx.method == 'workspace/configuration' then

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4