@codua/codeoutline-win32-x64 0.3.2 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DISTRIBUTION.md +26 -1
- package/README.md +39 -4
- package/README.zh-CN.md +30 -3
- package/bin/xnet.exe +0 -0
- package/build-info.json +1 -1
- package/codeoutline +1 -1
- package/codeoutline.cmd +1 -0
- package/editors/codeoutline.vsix +0 -0
- package/editors/zed/extension.wasm +0 -0
- package/package.json +1 -1
- package/scripts/codeoutline/{automatic_events.lua → analysis/automatic_events.lua} +4 -4
- package/scripts/codeoutline/{cpp_bindings.lua → analysis/cpp/cpp_bindings.lua} +7 -7
- package/scripts/codeoutline/{cpp_implementations.lua → analysis/cpp/cpp_implementations.lua} +3 -3
- package/scripts/codeoutline/{cpp_includes.lua → analysis/cpp/cpp_includes.lua} +3 -3
- package/scripts/codeoutline/{cpp_macros.lua → analysis/cpp/cpp_macros.lua} +3 -3
- package/scripts/codeoutline/{cpp_receivers.lua → analysis/cpp/cpp_receivers.lua} +7 -7
- package/scripts/codeoutline/{cpp_types.lua → analysis/cpp/cpp_types.lua} +5 -5
- package/scripts/codeoutline/{csharp_bindings.lua → analysis/csharp/csharp_bindings.lua} +1 -1
- package/scripts/codeoutline/{dispatch_aliases.lua → analysis/dispatch_aliases.lua} +3 -3
- package/scripts/codeoutline/{foreign.lua → analysis/foreign.lua} +2 -2
- package/scripts/codeoutline/{function_values.lua → analysis/function_values.lua} +2 -2
- package/scripts/codeoutline/analysis/go/go_frameworks.lua +327 -0
- package/scripts/codeoutline/{go_methods.lua → analysis/go/go_methods.lua} +2 -2
- package/scripts/codeoutline/{go_modules.lua → analysis/go/go_modules.lua} +2 -2
- package/scripts/codeoutline/{graph.lua → analysis/graph.lua} +53 -47
- package/scripts/codeoutline/{implementations.lua → analysis/implementations.lua} +16 -9
- package/scripts/codeoutline/{indirect.lua → analysis/indirect.lua} +71 -13
- package/scripts/codeoutline/{js_evidence.lua → analysis/js/js_evidence.lua} +4 -3
- package/scripts/codeoutline/{js_resolution.lua → analysis/js/js_resolution.lua} +2 -2
- package/scripts/codeoutline/{js_workspace.lua → analysis/js/js_workspace.lua} +2 -2
- package/scripts/codeoutline/{ts_implementations.lua → analysis/js/ts_implementations.lua} +3 -3
- package/scripts/codeoutline/{foreign_lua.lua → analysis/lua/foreign_lua.lua} +3 -3
- package/scripts/codeoutline/{lua_bindings.lua → analysis/lua/lua_bindings.lua} +97 -11
- package/scripts/codeoutline/{lua_callback_loops.lua → analysis/lua/lua_callback_loops.lua} +1 -1
- package/scripts/codeoutline/{ordinary_bindings.lua → analysis/ordinary_bindings.lua} +45 -21
- package/scripts/codeoutline/{python_bindings.lua → analysis/python/python_bindings.lua} +2 -2
- package/scripts/codeoutline/analysis/receivers.lua +547 -0
- package/scripts/codeoutline/{rust_packages.lua → analysis/rust/rust_packages.lua} +2 -2
- package/scripts/codeoutline/analysis/rust/rust_resolution.lua +609 -0
- package/scripts/codeoutline/{shared_events.lua → analysis/shared_events.lua} +3 -3
- package/scripts/codeoutline/{static_dispatch.lua → analysis/static_dispatch.lua} +5 -5
- package/scripts/codeoutline/{type_uses.lua → analysis/type_uses.lua} +1 -1
- package/scripts/codeoutline/cli.lua +1 -1
- package/scripts/codeoutline/command.lua +236 -19
- package/scripts/codeoutline/{cpp_fragments.lua → indexing/cpp_fragments.lua} +4 -4
- package/scripts/codeoutline/{index.lua → indexing/index.lua} +12 -12
- package/scripts/codeoutline/{parse_pool.lua → indexing/parse_pool.lua} +1 -1
- package/scripts/codeoutline/{agent_config.lua → install/agent_config.lua} +21 -1
- package/scripts/codeoutline/{agent_install.lua → install/agent_install.lua} +105 -10
- package/scripts/codeoutline/{editor_install.lua → install/editor_install.lua} +36 -6
- package/scripts/codeoutline/lang/c.lua +2 -2
- package/scripts/codeoutline/lang/cpp.lua +2 -2
- package/scripts/codeoutline/lang/csharp.lua +2 -2
- package/scripts/codeoutline/lang/go.lua +2 -2
- package/scripts/codeoutline/lang/java.lua +2 -2
- package/scripts/codeoutline/lang/js.lua +2 -2
- package/scripts/codeoutline/lang/kotlin.lua +4 -2
- package/scripts/codeoutline/lang/lua.lua +3 -3
- package/scripts/codeoutline/lang/python.lua +2 -2
- package/scripts/codeoutline/lang/rust.lua +3 -3
- package/scripts/codeoutline/main.lua +9 -9
- package/scripts/codeoutline/{common.lua → parsing/common.lua} +22 -17
- package/scripts/codeoutline/{language_detect.lua → parsing/language_detect.lua} +1 -1
- package/scripts/codeoutline/{parse.lua → parsing/parse.lua} +4 -4
- package/scripts/codeoutline/{http.lua → protocol/http.lua} +1 -1
- package/scripts/codeoutline/{lsp.lua → protocol/lsp.lua} +4 -4
- package/scripts/codeoutline/{mcp.lua → protocol/mcp.lua} +9 -9
- package/scripts/codeoutline/{affected.lua → query/affected.lua} +6 -6
- package/scripts/codeoutline/{callers.lua → query/callers.lua} +9 -9
- package/scripts/codeoutline/{completion.lua → query/completion.lua} +37 -49
- package/scripts/codeoutline/{definition_candidates.lua → query/definition_candidates.lua} +6 -6
- package/scripts/codeoutline/{documents.lua → query/documents.lua} +4 -4
- package/scripts/codeoutline/{explore.lua → query/explore.lua} +85 -25
- package/scripts/codeoutline/{external_headers.lua → query/external_headers.lua} +6 -6
- package/scripts/codeoutline/{navigation.lua → query/navigation.lua} +53 -54
- package/scripts/codeoutline/{on_demand.lua → query/on_demand.lua} +6 -6
- package/scripts/codeoutline/{query_report.lua → query/query_report.lua} +9 -5
- package/scripts/codeoutline/{search_ranking.lua → query/search_ranking.lua} +10 -7
- package/scripts/codeoutline/{type_hierarchy.lua → query/type_hierarchy.lua} +11 -11
- package/scripts/codeoutline/{type_references.lua → query/type_references.lua} +17 -17
- package/scripts/codeoutline/{index_worker.lua → runtime/index_worker.lua} +10 -10
- package/scripts/codeoutline/{parse_worker.lua → runtime/parse_worker.lua} +2 -2
- package/scripts/codeoutline/{update_worker.lua → runtime/update_worker.lua} +1 -1
- package/scripts/codeoutline/service.lua +11 -11
- package/scripts/codeoutline/update_sequence.lua +1 -1
- package/scripts/codeoutline/version.lua +1 -1
- package/scripts/codeoutline/rust_resolution.lua +0 -301
- /package/scripts/codeoutline/{lua_literal.lua → analysis/lua/lua_literal.lua} +0 -0
- /package/scripts/codeoutline/{resolution.lua → analysis/resolution.lua} +0 -0
- /package/scripts/codeoutline/{cargo_toml.lua → analysis/rust/cargo_toml.lua} +0 -0
- /package/scripts/codeoutline/{type_bases.lua → analysis/type_bases.lua} +0 -0
- /package/scripts/codeoutline/{cache_repairs.lua → indexing/cache_repairs.lua} +0 -0
- /package/scripts/codeoutline/{daemon.lua → install/daemon.lua} +0 -0
- /package/scripts/codeoutline/{install_prompt.lua → install/install_prompt.lua} +0 -0
- /package/scripts/codeoutline/{xscan.lua → parsing/xscan.lua} +0 -0
- /package/scripts/codeoutline/{lsp_trace.lua → protocol/lsp_trace.lua} +0 -0
- /package/scripts/codeoutline/{coverage.lua → query/coverage.lua} +0 -0
- /package/scripts/codeoutline/{query_filters.lua → query/query_filters.lua} +0 -0
- /package/scripts/codeoutline/{idle_gc.lua → runtime/idle_gc.lua} +0 -0
- /package/scripts/codeoutline/{control.lua → shared/control.lua} +0 -0
- /package/scripts/codeoutline/{path.lua → shared/path.lua} +0 -0
- /package/scripts/codeoutline/{rules.lua → shared/rules.lua} +0 -0
- /package/scripts/codeoutline/{text.lua → shared/text.lua} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
-- Ordinary binding evidence belongs to one query, never to the resident index.
|
|
2
2
|
local M = {}
|
|
3
|
-
local control = require('codeoutline.control')
|
|
3
|
+
local control = require('codeoutline.shared.control')
|
|
4
4
|
local function js(rec) return rec.language == 'javascript' or rec.language == 'typescript' or rec.language == 'arkts' end
|
|
5
5
|
local function evidence(rec, i)
|
|
6
6
|
local refs = rec.refs
|
|
7
|
+
if refs.receiver and refs.receiver[i] ~= '' then return refs.receiver[i] end
|
|
7
8
|
return refs.binding and refs.binding[i] or refs.lua_binding and refs.lua_binding[i]
|
|
8
9
|
or refs.js_receiver and refs.js_receiver[i]
|
|
9
10
|
end
|
|
@@ -108,7 +109,7 @@ function M.context(G, ctx, source, options)
|
|
|
108
109
|
local raw = read_source(f)
|
|
109
110
|
cached = cached_data(rec, raw)
|
|
110
111
|
if cached then return alias_list(rec, cached.cpp_aliases) end
|
|
111
|
-
local parsed = assert(require('codeoutline.parse').parse(rec.path, raw,
|
|
112
|
+
local parsed = assert(require('codeoutline.parsing.parse').parse(rec.path, raw,
|
|
112
113
|
{ ranges = false, omit_signatures = true, cpp_aliases_only = true, language = rec.language }))
|
|
113
114
|
assert(#parsed.nodes == #rec.nodes, 'source changed; refresh index before alias query: ' .. rec.path)
|
|
114
115
|
for i, n in ipairs(parsed.nodes) do
|
|
@@ -130,7 +131,7 @@ function M.context(G, ctx, source, options)
|
|
|
130
131
|
if cached and not cached.cpp_aliases_only then return cached.cpp_macros end
|
|
131
132
|
-- Macro visibility needs directive events, not a second syntax tree,
|
|
132
133
|
-- receiver bindings or implementation evidence for the whole header.
|
|
133
|
-
return require('codeoutline.cpp_macros').summary(rec, raw)
|
|
134
|
+
return require('codeoutline.analysis.cpp.cpp_macros').summary(rec, raw)
|
|
134
135
|
end
|
|
135
136
|
-- Inheritance queries need class headers and aliases, not every call,
|
|
136
137
|
-- receiver, type-use site and method signature in the file.
|
|
@@ -142,7 +143,7 @@ function M.context(G, ctx, source, options)
|
|
|
142
143
|
local raw = read_source(f)
|
|
143
144
|
cached = cached_data(rec, raw)
|
|
144
145
|
if cached and (not cached.cpp_aliases_only or cached.implementation_evidence) then return cached end
|
|
145
|
-
local parsed, T = require('codeoutline.parse').parse_tokens(rec.path, raw,
|
|
146
|
+
local parsed, T = require('codeoutline.parsing.parse').parse_tokens(rec.path, raw,
|
|
146
147
|
{ ranges = false, cpp_aliases_only = true, language = rec.language })
|
|
147
148
|
local function check(ok) assert(ok, 'source changed; refresh index before hierarchy query: ' .. rec.path) end
|
|
148
149
|
check(parsed and #parsed.nodes == #rec.nodes)
|
|
@@ -152,7 +153,7 @@ function M.context(G, ctx, source, options)
|
|
|
152
153
|
check(n.qualified == rec.nodes[i].qualified and n.line == rec.nodes[i].line)
|
|
153
154
|
if n.kind == 'class' or n.kind == 'struct' then
|
|
154
155
|
evidence[i] = { at = T.s[n.ti] - 1,
|
|
155
|
-
hierarchy_bases = require('codeoutline.type_bases').collect(T, n, rec.language) }
|
|
156
|
+
hierarchy_bases = require('codeoutline.analysis.type_bases').collect(T, n, rec.language) }
|
|
156
157
|
count = count + 1
|
|
157
158
|
end
|
|
158
159
|
end
|
|
@@ -169,7 +170,7 @@ function M.context(G, ctx, source, options)
|
|
|
169
170
|
cached = cached_data(rec, raw)
|
|
170
171
|
if cached and not cached.cpp_aliases_only then return cached end
|
|
171
172
|
local parsed = options.parsed and options.parsed(f)
|
|
172
|
-
parsed = parsed or assert(require('codeoutline.parse').parse(rec.path, raw,
|
|
173
|
+
parsed = parsed or assert(require('codeoutline.parsing.parse').parse(rec.path, raw,
|
|
173
174
|
{ ranges = false, ordinary_bindings = true, language = rec.language }))
|
|
174
175
|
local function check(ok) assert(ok, 'source changed; refresh index before binding query: ' .. rec.path) end
|
|
175
176
|
check(#parsed.nodes == #rec.nodes and #parsed.refs.name == #rec.refs.name)
|
|
@@ -181,28 +182,49 @@ function M.context(G, ctx, source, options)
|
|
|
181
182
|
and parsed.refs.line[i] == rec.refs.line[i] and parsed.refs.kind[i] == rec.refs.kind[i])
|
|
182
183
|
end
|
|
183
184
|
-- Keep only compact query evidence; source, tokens, and duplicate symbols die here.
|
|
184
|
-
local data = { refs = { binding = parsed.refs.binding, js_receiver = parsed.refs.js_receiver, lua_binding = parsed.refs.lua_binding
|
|
185
|
+
local data = { refs = { binding = parsed.refs.binding, js_receiver = parsed.refs.js_receiver, lua_binding = parsed.refs.lua_binding,
|
|
186
|
+
receiver = parsed.refs.receiver },
|
|
185
187
|
js_exports = parsed.js_exports, python_imports = parsed.python_imports, cpp_aliases = parsed.cpp_aliases,
|
|
186
188
|
csharp_usings = parsed.csharp_usings, csharp_statics = parsed.csharp_statics,
|
|
187
189
|
csharp_scopes = parsed.csharp_scopes, csharp_parameters = parsed.csharp_parameters, csharp_access = parsed.csharp_access }
|
|
188
190
|
data.implementation_evidence = parsed.implementation_evidence
|
|
189
191
|
data.lua_locals = parsed.lua_locals
|
|
192
|
+
data.lua_self = parsed.lua_self
|
|
190
193
|
data.static_dispatch = parsed.static_dispatch
|
|
191
194
|
data.type_sites, data.type_parameters = parsed.type_sites, parsed.type_parameters
|
|
192
195
|
data.type_exclusions = parsed.type_exclusions
|
|
193
196
|
data.go_methods = parsed.go_methods
|
|
197
|
+
data.go_frameworks = parsed.go_frameworks
|
|
194
198
|
data.cpp_receivers = parsed.cpp_receivers
|
|
195
199
|
data.cpp_macros = parsed.cpp_macros
|
|
196
200
|
data.automatic_events = parsed.automatic_events
|
|
197
201
|
data.shared_events = parsed.shared_events
|
|
198
202
|
data.lua_callback_loops = parsed.lua_callback_loops
|
|
199
203
|
data.rust_imports, data.rust_public = parsed.rust_imports, parsed.rust_public
|
|
204
|
+
data.rust_impls = parsed.rust_impls
|
|
205
|
+
data.rust_instance = parsed.rust_instance
|
|
206
|
+
data.receivers = parsed.receivers
|
|
200
207
|
local type_count = 0; for _ in pairs(parsed.type_sites or {}) do type_count = type_count + 1 end
|
|
201
208
|
local static_count = 0
|
|
202
209
|
for _, site in ipairs(parsed.static_dispatch and parsed.static_dispatch.sites or {}) do
|
|
203
210
|
static_count = static_count + 1 + #site.registrations
|
|
204
211
|
end
|
|
205
|
-
local
|
|
212
|
+
local self_weight, self_seen = 0, {}
|
|
213
|
+
for _ in pairs(parsed.rust_instance or {}) do self_weight = self_weight + 32 end
|
|
214
|
+
for _, header in pairs(parsed.rust_impls or {}) do
|
|
215
|
+
self_weight = self_weight + 128 + #(header.path or '') + #(header.args or '') + #(header.trait or '')
|
|
216
|
+
for name in pairs(header.generics or {}) do self_weight = self_weight + #name + 32 end
|
|
217
|
+
end
|
|
218
|
+
for _, info in pairs(parsed.lua_self or {}) do
|
|
219
|
+
if not self_seen[info] then
|
|
220
|
+
self_seen[info] = true; self_weight = self_weight + 128
|
|
221
|
+
for name in pairs(info.members) do self_weight = self_weight + #name + 64 end
|
|
222
|
+
for name in pairs(info.fields) do self_weight = self_weight + #name + 64 end
|
|
223
|
+
end
|
|
224
|
+
self_weight = self_weight + 32
|
|
225
|
+
end
|
|
226
|
+
local weight = #raw + #parsed.refs.name * 128 + #(parsed.js_exports or {}) * 256 + self_weight
|
|
227
|
+
+ (parsed.receivers and parsed.receivers.weight or 0)
|
|
206
228
|
+ type_count * 256 + #(parsed.type_parameters or {}) * 96
|
|
207
229
|
+ static_count * 256
|
|
208
230
|
+ #(parsed.lua_locals or {}) * 256
|
|
@@ -214,6 +236,7 @@ function M.context(G, ctx, source, options)
|
|
|
214
236
|
+ (parsed.go_methods and (#parsed.nodes * 384 + #parsed.go_methods.bindings * 256
|
|
215
237
|
+ (parsed.go_methods.receiver_weight or 0)) or 0)
|
|
216
238
|
+ (parsed.cpp_receivers and parsed.cpp_receivers.weight or 0)
|
|
239
|
+
+ (parsed.go_frameworks and parsed.go_frameworks.weight or 0)
|
|
217
240
|
+ #(parsed.automatic_events or {}) * 512
|
|
218
241
|
+ (parsed.shared_events and parsed.shared_events.weight or 0)
|
|
219
242
|
+ (parsed.lua_callback_loops and parsed.lua_callback_loops.weight or 0)
|
|
@@ -224,7 +247,7 @@ function M.context(G, ctx, source, options)
|
|
|
224
247
|
local value = evidence(rec, i)
|
|
225
248
|
if rec.language == 'go' and not C.available(f) then return value end
|
|
226
249
|
if rec.language == 'go' then
|
|
227
|
-
local data = require('codeoutline.go_methods').context(G, ctx).data(f)
|
|
250
|
+
local data = require('codeoutline.analysis.go.go_methods').context(G, ctx).data(f)
|
|
228
251
|
if not data then return 'go:?' end
|
|
229
252
|
return data.evidence[i] or value
|
|
230
253
|
end
|
|
@@ -234,6 +257,7 @@ function M.context(G, ctx, source, options)
|
|
|
234
257
|
if rec.language == 'lua' then
|
|
235
258
|
if rec.refs.lua_binding then return value end
|
|
236
259
|
local wanted = rec.refs.recv[i] or rec.refs.name[i]
|
|
260
|
+
if wanted == 'self' and C.available(f) then return evidence(C.data(f), i) or value end
|
|
237
261
|
for _, imp in ipairs(rec.lua_imports or {}) do
|
|
238
262
|
if imp.member == rec.refs.name[i] then return evidence(C.data(f), i) or value end
|
|
239
263
|
end
|
|
@@ -250,15 +274,15 @@ function M.context(G, ctx, source, options)
|
|
|
250
274
|
end
|
|
251
275
|
local recv = rec.refs.recv[i]
|
|
252
276
|
if (rec.language == 'c' or rec.language == 'cpp') and kind == 'member_call' and not recv then
|
|
253
|
-
local data = require('codeoutline.cpp_receivers').context(G, ctx).data(f)
|
|
277
|
+
local data = require('codeoutline.analysis.cpp.cpp_receivers').context(G, ctx).data(f)
|
|
254
278
|
if not data then return value end
|
|
255
279
|
return data.evidence[i] or value
|
|
256
280
|
end
|
|
257
281
|
if rec.language == 'c' and kind == 'member_call' then return evidence(C.data(f), i) or value end
|
|
258
|
-
if rec.language == 'python' and
|
|
282
|
+
if rec.language == 'python' and recv then return evidence(C.data(f), i) or value end
|
|
259
283
|
if rec.language == 'cpp' and recv == 'this' then return value end
|
|
260
|
-
if rec.language == 'rust' and require('codeoutline.rust_packages').owner(G, f, ctx) then
|
|
261
|
-
return require('codeoutline.rust_packages').guard(ctx, function() return evidence(C.data(f), i) or value end) or value
|
|
284
|
+
if rec.language == 'rust' and require('codeoutline.analysis.rust.rust_packages').owner(G, f, ctx) then
|
|
285
|
+
return require('codeoutline.analysis.rust.rust_packages').guard(ctx, function() return evidence(C.data(f), i) or value end) or value
|
|
262
286
|
end
|
|
263
287
|
if js(rec) or rec.language == 'python' or rec.language == 'csharp' or rec.language == 'cpp'
|
|
264
288
|
or (rec.language == 'java' or rec.language == 'kotlin') and (kind == 'member_call' or kind == 'ref') then
|
|
@@ -292,9 +316,9 @@ function M.context(G, ctx, source, options)
|
|
|
292
316
|
local rec = G.files[f]
|
|
293
317
|
control.check()
|
|
294
318
|
if js(rec) then
|
|
295
|
-
for _, imp in ipairs(rec.imports) do add(f, require('codeoutline.js_resolution').module(G, f, imp.path, ctx, imp.kind)) end
|
|
319
|
+
for _, imp in ipairs(rec.imports) do add(f, require('codeoutline.analysis.js.js_resolution').module(G, f, imp.path, ctx, imp.kind)) end
|
|
296
320
|
elseif rec.language == 'python' then
|
|
297
|
-
local module = require('codeoutline.python_bindings').module
|
|
321
|
+
local module = require('codeoutline.analysis.python.python_bindings').module
|
|
298
322
|
for _, imp in ipairs(rec.imports) do
|
|
299
323
|
add(f, module(G, f, imp.path))
|
|
300
324
|
for _, name in ipairs(imp.names or {}) do
|
|
@@ -318,7 +342,7 @@ function M.context(G, ctx, source, options)
|
|
|
318
342
|
end
|
|
319
343
|
function C.aliases(f, wanted, candidates)
|
|
320
344
|
if G.files[f].language == 'csharp' then
|
|
321
|
-
return require('codeoutline.csharp_bindings').incoming_aliases(G, f, wanted, ctx)
|
|
345
|
+
return require('codeoutline.analysis.csharp.csharp_bindings').incoming_aliases(G, f, wanted, ctx)
|
|
322
346
|
end
|
|
323
347
|
if not candidates[f] then return {} end
|
|
324
348
|
local rec, hits, resolved = G.files[f], {}, {}
|
|
@@ -330,7 +354,7 @@ function M.context(G, ctx, source, options)
|
|
|
330
354
|
return false
|
|
331
355
|
end
|
|
332
356
|
if js(rec) then
|
|
333
|
-
local resolver = require('codeoutline.js_resolution')
|
|
357
|
+
local resolver = require('codeoutline.analysis.js.js_resolution')
|
|
334
358
|
for _, imp in ipairs(rec.js_imports or {}) do
|
|
335
359
|
local target = resolver.module(G, f, imp.path, ctx)
|
|
336
360
|
if target and candidates[target] and (imp.imported == '*'
|
|
@@ -339,7 +363,7 @@ function M.context(G, ctx, source, options)
|
|
|
339
363
|
end
|
|
340
364
|
end
|
|
341
365
|
elseif not relevant and rec.language == 'python' then
|
|
342
|
-
local resolver = require('codeoutline.python_bindings')
|
|
366
|
+
local resolver = require('codeoutline.analysis.python.python_bindings')
|
|
343
367
|
for _, imp in ipairs(rec.imports) do
|
|
344
368
|
local target = resolver.module(G, f, imp.path)
|
|
345
369
|
if target and candidates[target] then
|
|
@@ -368,7 +392,7 @@ function M.context(G, ctx, source, options)
|
|
|
368
392
|
local value = (analyze or kind == 'ref') and C.evidence(f, i) or evidence(rec, i)
|
|
369
393
|
local path = value and (value:match('^import:(.-)%z') or value:match('^py:import:(.-)%z'))
|
|
370
394
|
if path then
|
|
371
|
-
local resolver = js(rec) and require('codeoutline.js_resolution') or require('codeoutline.python_bindings')
|
|
395
|
+
local resolver = js(rec) and require('codeoutline.analysis.js.js_resolution') or require('codeoutline.analysis.python.python_bindings')
|
|
372
396
|
local target = resolver.module(G, f, path, ctx)
|
|
373
397
|
if not target or not candidates[target] then goto next_ref end
|
|
374
398
|
end
|
|
@@ -378,9 +402,9 @@ function M.context(G, ctx, source, options)
|
|
|
378
402
|
local key = value or rec.refs.name[i] .. '\0' .. (rec.refs.recv[i] or '')
|
|
379
403
|
local targets = resolved[key]
|
|
380
404
|
if not targets then
|
|
381
|
-
if js(rec) then targets = require('codeoutline.js_resolution').resolve(G, f,
|
|
405
|
+
if js(rec) then targets = require('codeoutline.analysis.js.js_resolution').resolve(G, f,
|
|
382
406
|
rec.refs.name[i], kind, rec.refs.recv[i], value, ctx)
|
|
383
|
-
else targets = require('codeoutline.python_bindings').resolve(G, f, value, ctx) end
|
|
407
|
+
else targets = require('codeoutline.analysis.python.python_bindings').resolve(G, f, value, ctx) end
|
|
384
408
|
targets = targets or {}; resolved[key] = targets
|
|
385
409
|
end
|
|
386
410
|
for _, id in ipairs(targets) do if wanted[id] then hits[i] = true; break end end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
-- Explicit Python imports and lexical barriers, shared by graph and navigation.
|
|
2
2
|
-- No sys.path execution or project-wide suffix guesses.
|
|
3
3
|
local M = {}
|
|
4
|
-
local aliases = require('codeoutline.dispatch_aliases')
|
|
5
|
-
local control = require('codeoutline.control')
|
|
4
|
+
local aliases = require('codeoutline.analysis.dispatch_aliases')
|
|
5
|
+
local control = require('codeoutline.shared.control')
|
|
6
6
|
|
|
7
7
|
function M.collect(r, T)
|
|
8
8
|
if r.language ~= 'python' then return end
|