Skip to content

Commit

Permalink
Only load files in workspace for --check (skip libraries)
Browse files Browse the repository at this point in the history
Also fix handling of URIs with a trailing / in files.getChildFiles()
  • Loading branch information
emmericp committed Feb 26, 2024
1 parent 3723346 commit 6a6b9ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion script/cli/check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local define = require 'proto.define'
local config = require 'config.config'
local fs = require 'bee.filesystem'
local provider = require 'provider'
local scope = require 'workspace.scope'

require 'plugin'
require 'vm'
Expand Down Expand Up @@ -70,7 +71,7 @@ lclient():start(function (client)
end
config.set(rootUri, 'Lua.diagnostics.disable', util.getTableKeys(disables, true))

local uris = files.getAllUris(rootUri)
local uris = files.getChildFiles(rootUri)
local max = #uris
for i, uri in ipairs(uris) do
files.open(uri)
Expand Down
1 change: 1 addition & 0 deletions script/files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ function m.getOriginLines(uri)
end

function m.getChildFiles(uri)
uri = uri:gsub("/$", "")
local results = {}
local uris = m.getAllUris(uri)
for _, curi in ipairs(uris) do
Expand Down

0 comments on commit 6a6b9ee

Please sign in to comment.