@codua/codeoutline-win32-x64 0.2.6 → 0.2.9
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/README.md +205 -3
- package/README.zh-CN.md +40 -2
- package/bin/xnet.exe +0 -0
- package/build-info.json +1 -1
- package/package.json +1 -1
- package/scripts/codeoutline/affected.lua +145 -0
- package/scripts/codeoutline/automatic_events.lua +202 -0
- package/scripts/codeoutline/cache_repairs.lua +47 -0
- package/scripts/codeoutline/callers.lua +56 -16
- package/scripts/codeoutline/cargo_toml.lua +125 -0
- package/scripts/codeoutline/command.lua +26 -4
- package/scripts/codeoutline/common.lua +48 -7
- package/scripts/codeoutline/completion.lua +126 -22
- package/scripts/codeoutline/coverage.lua +63 -0
- package/scripts/codeoutline/cpp_bindings.lua +46 -11
- package/scripts/codeoutline/cpp_fragments.lua +143 -0
- package/scripts/codeoutline/cpp_implementations.lua +340 -0
- package/scripts/codeoutline/cpp_includes.lua +156 -0
- package/scripts/codeoutline/cpp_macros.lua +279 -0
- package/scripts/codeoutline/cpp_receivers.lua +342 -0
- package/scripts/codeoutline/cpp_types.lua +275 -28
- package/scripts/codeoutline/definition_candidates.lua +180 -0
- package/scripts/codeoutline/dispatch_aliases.lua +10 -5
- package/scripts/codeoutline/documents.lua +22 -9
- package/scripts/codeoutline/explore.lua +243 -122
- package/scripts/codeoutline/external_headers.lua +171 -0
- package/scripts/codeoutline/function_values.lua +69 -0
- package/scripts/codeoutline/go_methods.lua +931 -0
- package/scripts/codeoutline/go_modules.lua +329 -0
- package/scripts/codeoutline/graph.lua +322 -67
- package/scripts/codeoutline/implementations.lua +403 -0
- package/scripts/codeoutline/index.lua +161 -28
- package/scripts/codeoutline/index_worker.lua +11 -4
- package/scripts/codeoutline/indirect.lua +4 -2
- package/scripts/codeoutline/js_evidence.lua +2 -1
- package/scripts/codeoutline/js_resolution.lua +40 -12
- package/scripts/codeoutline/js_workspace.lua +325 -0
- package/scripts/codeoutline/lang/c.lua +15 -2
- package/scripts/codeoutline/lang/cpp.lua +7 -4
- package/scripts/codeoutline/lang/csharp.lua +1 -1
- package/scripts/codeoutline/lang/js.lua +56 -20
- package/scripts/codeoutline/lang/rust.lua +9 -1
- package/scripts/codeoutline/language_detect.lua +100 -0
- package/scripts/codeoutline/lsp.lua +173 -23
- package/scripts/codeoutline/lua_bindings.lua +151 -47
- package/scripts/codeoutline/lua_callback_loops.lua +210 -0
- package/scripts/codeoutline/main.lua +32 -7
- package/scripts/codeoutline/mcp.lua +52 -9
- package/scripts/codeoutline/navigation.lua +284 -64
- package/scripts/codeoutline/on_demand.lua +93 -0
- package/scripts/codeoutline/ordinary_bindings.lua +210 -34
- package/scripts/codeoutline/parse.lua +18 -2
- package/scripts/codeoutline/parse_pool.lua +1 -1
- package/scripts/codeoutline/parse_worker.lua +1 -1
- package/scripts/codeoutline/python_bindings.lua +2 -2
- package/scripts/codeoutline/query_filters.lua +65 -0
- package/scripts/codeoutline/query_report.lua +56 -19
- package/scripts/codeoutline/resolution.lua +23 -0
- package/scripts/codeoutline/rust_packages.lua +203 -0
- package/scripts/codeoutline/rust_resolution.lua +301 -0
- package/scripts/codeoutline/search_ranking.lua +70 -0
- package/scripts/codeoutline/service.lua +47 -7
- package/scripts/codeoutline/shared_events.lua +369 -0
- package/scripts/codeoutline/static_dispatch.lua +46 -11
- package/scripts/codeoutline/text.lua +3 -2
- package/scripts/codeoutline/ts_implementations.lua +81 -0
- package/scripts/codeoutline/type_bases.lua +61 -0
- package/scripts/codeoutline/type_hierarchy.lua +324 -0
- package/scripts/codeoutline/type_references.lua +290 -0
- package/scripts/codeoutline/type_uses.lua +260 -0
- package/scripts/codeoutline/update_sequence.lua +1 -1
- package/scripts/codeoutline/version.lua +1 -1
package/README.md
CHANGED
|
@@ -51,12 +51,15 @@ On Windows, Claude Code cannot start the `codeoutline.cmd` shim directly; use `-
|
|
|
51
51
|
|
|
52
52
|
When no project is specified, the service uses, in order: the `projectPath` argument of the call, the `--project` option, the client's roots (the first directory returned by `roots/list`), and the directory the service was started in. Clients usually start a stdio service in the project directory, so a global configuration needs no project path. Access defaults to `--project` or the start directory; repeat `--allow-root` to allow more.
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Seven tools are provided:
|
|
55
55
|
|
|
56
56
|
| Tool | Purpose |
|
|
57
57
|
| --- | --- |
|
|
58
58
|
| `codeoutline_explore` | Query source, call paths, and callers/callees by symbol or file name (`query`; optional `projectPath`, `budget`) |
|
|
59
59
|
| `codeoutline_callers` | [Find recursive callers and affected files](docs/CALLERS.md) for an exact symbol/qualified name (`query`; optional `projectPath`, `depth` default 3, `max_nodes` default 200, `budget`) |
|
|
60
|
+
| `codeoutline_affected` | [Analyze changed files](docs/AFFECTED.md) with shared reverse traversal, shortest paths and test candidates (`files`; optional `projectPath`, `depth`, `max_nodes`, `budget`) |
|
|
61
|
+
| `codeoutline_type_hierarchy` | [Find declared ancestors and descendants](docs/TYPE-HIERARCHY.md) of a C#/Java/Kotlin/TS/C++ type (`query`; optional `projectPath`, `direction`, `depth` default 8, `max_nodes` default 200, `budget`) |
|
|
62
|
+
| `codeoutline_type_references` | [Find explicit type uses](docs/TYPE-REFERENCES.md) with identity resolution in C/C++, C#, Java, Kotlin, TS/ArkTS, Go and Rust (`query`; optional `projectPath`, `max_nodes` default 200, `budget`) |
|
|
60
63
|
| `codeoutline_status` | Refresh and report index, cache, scanner, and parser statistics |
|
|
61
64
|
| `codeoutline_rebuild` | Rebuild fully, bypassing the cache |
|
|
62
65
|
|
|
@@ -70,7 +73,9 @@ Without Node, download the native archive for your platform from [GitHub Release
|
|
|
70
73
|
| --- | --- |
|
|
71
74
|
| Document and workspace symbols | Workspace symbols match substrings, case-insensitively |
|
|
72
75
|
| Definition, hover, signature help | Definition also goes from import lines (`require`, `#include`, module imports) to the files they load |
|
|
73
|
-
| References
|
|
76
|
+
| References | Functions, methods, constructors, macros and [supported explicit type positions](docs/TYPE-REFERENCES.md) |
|
|
77
|
+
| Call hierarchy | Functions, methods, constructors and macros; incoming and outgoing calls |
|
|
78
|
+
| Method implementations | C#, Java, Kotlin and TypeScript interface/abstract methods and C++ virtual overrides; `textDocument/implementation` |
|
|
74
79
|
| Completion | Locals, the file's definitions and imports, declarations from included C/C++ headers, and members after `.`, `->`, `::`, `?.`, or Lua `:` |
|
|
75
80
|
|
|
76
81
|
Resolution is name-based, the same as `codeoutline_explore`; it is not a type checker. Rename, diagnostics, and formatting are not provided, so CodeOutline works best beside a language's own server or where none is available. Unsaved edits are included in every request. A `.codeoutline.json` file in the workspace root can map Lua call arguments to registration sites for Go to Definition. Behavior, limits, and options are described in [LSP.md](docs/LSP.md).
|
|
@@ -96,15 +101,212 @@ On Linux, decoding GBK sources needs the GBK module of the system iconv. Minimal
|
|
|
96
101
|
|
|
97
102
|
## Supported languages
|
|
98
103
|
|
|
99
|
-
C, C++, C#, Go, Java, JavaScript / TypeScript (including JSX/TSX), Kotlin (`.kt` / `.kts`), Lua, Python, and Rust.
|
|
104
|
+
C, C++, C#, Go, Java, JavaScript / TypeScript (including JSX/TSX), ArkTS (`.ets`), Kotlin (`.kt` / `.kts`), Lua, Python, and Rust.
|
|
105
|
+
|
|
106
|
+
ArkTS reuses the JS/TS parser: component `struct` declarations are indexed as classes,
|
|
107
|
+
with decorated fields, methods, local module imports and ArkUI calls. Declarative UI
|
|
108
|
+
blocks remain calls rather than method declarations. This is heuristic indexing, not
|
|
109
|
+
ArkTS type checking; SDK `@kit.*`/`@ohos.*` resolution, resource references and generated
|
|
110
|
+
UI lifecycle/state behavior are not modeled. Zed requires a separate ArkTS language extension.
|
|
100
111
|
|
|
101
112
|
Kotlin includes declarations, constructor properties, extension functions, expression bodies,
|
|
102
113
|
package imports (including aliases), and ordinary, generic and trailing-lambda calls.
|
|
103
114
|
Resolution is heuristic: compiler-generated members, implicit lambda receivers, string-template
|
|
104
115
|
expressions, Java interop and coroutine/framework dispatch are not modeled.
|
|
105
116
|
|
|
117
|
+
C/C++ bare calls check [project macro visibility](docs/CPP-MACROS.md) on demand: define/undef,
|
|
118
|
+
indexed include order and finite conditions distinguish visible macros from ordinary
|
|
119
|
+
functions. Unknown expansions remain unresolved; this does not run a preprocessor.
|
|
120
|
+
|
|
121
|
+
Unknown filename suffixes are handled on demand. LSP uses a supported editor language
|
|
122
|
+
ID first, then bounded, conservative syntax detection. Explicit project-relative file
|
|
123
|
+
paths in explore queries receive the same temporary parsing; `lang:` can supply a
|
|
124
|
+
language hint. Detection ignores comments, strings, binary data and ambiguous syntax.
|
|
125
|
+
Each explore query admits at most four such files of 1 MiB each and 2 MiB in total.
|
|
126
|
+
No suffix association is learned. Except for the C/C++ include-driven admission below,
|
|
127
|
+
these files are not added to the persistent index. Supply a full relative path for files
|
|
128
|
+
outside the root directory; file discovery by basename uses the regular index.
|
|
129
|
+
|
|
130
|
+
C/C++ literal `#include` directives can admit project-local unknown-suffix source
|
|
131
|
+
fragments such as `.inl` or `.inc`. The normal file listing supplies candidates and
|
|
132
|
+
honors ignore rules; relative paths and project include-path configuration take
|
|
133
|
+
precedence. Without configured search paths, only a unique suffix match is admitted.
|
|
134
|
+
Fragments inherit a C/C++ parser hint, with C++ syntax detection, and are parsed once
|
|
135
|
+
per language hint into compact cached records. Unreferenced unknown files, ignored
|
|
136
|
+
files, external SDKs, binary data and clearly foreign-language sources are not admitted.
|
|
137
|
+
Changes rediscover reachable fragments and remove orphaned include cycles; cache
|
|
138
|
+
reloads preserve parser hints. Limits are 4,096 fragments, 64 MiB combined source and
|
|
139
|
+
32 discovery rounds, plus the normal per-file size limit; refresh statistics expose
|
|
140
|
+
`fragment_limited` when a discovery limit is reached. Detailed bindings and macro
|
|
141
|
+
environments remain query-time data. Inclusion alone does not restore a surrounding
|
|
142
|
+
class, namespace or the compiler configuration of every translation unit.
|
|
143
|
+
|
|
144
|
+
Explore can suggest exact-name definitions for unresolved calls, including possible
|
|
145
|
+
macro declarations. The separate **Unconfirmed definition candidates** section gives
|
|
146
|
+
locations, matching reasons and bounded source snippets. These suggestions never add
|
|
147
|
+
call edges, seeds, callers or impact paths; inspect them before inferring a relationship.
|
|
148
|
+
Known import, local, receiver, qualification and include-policy barriers still apply.
|
|
149
|
+
Lookup inspects at most four encountered sites and 256 same-name entries per ordinary site,
|
|
150
|
+
with eight results per site and snippets from four source files totaling 2 MiB. Macro
|
|
151
|
+
suggestions use a separate bounded pass with the existing macro limits. Output limits
|
|
152
|
+
are reported; suggestions and their evidence are query-owned and are not stored in the index.
|
|
153
|
+
|
|
154
|
+
C++ lookup covers named type aliases, namespace aliases, `using ns::Type`, `using ns::function`,
|
|
155
|
+
and bounded `using namespace` chains across included headers. Calls, navigation and completion
|
|
156
|
+
share this lookup; local imports respect their declaration position and block scope, and
|
|
157
|
+
ambiguous imported names remain unresolved. Import evidence is generated on demand rather
|
|
158
|
+
than stored in the index. This is heuristic lookup: preprocessing/include order, compiler
|
|
159
|
+
include-search configuration, dependent templates, ADL and full overload resolution are not modeled.
|
|
160
|
+
|
|
161
|
+
JS/TS package imports resolve local npm/Yarn workspaces (`workspaces` arrays or `packages` lists)
|
|
162
|
+
and pnpm `packages` lists. Package discovery reuses indexed directories; manifests and resolution
|
|
163
|
+
maps exist only during a query. The nearest workspace owns an import, pnpm configuration takes
|
|
164
|
+
precedence, and relative imports and existing tsconfig paths retain their priority. Supported globs
|
|
165
|
+
are `*`, `**`, `?` and `!` exclusions; pnpm accepts block string lists or JSON flow lists.
|
|
166
|
+
Lookup covers scoped names, subpaths, exact/wildcard exports, ordered `types`/`import`/`require`/
|
|
167
|
+
`node`/`default` conditions, and legacy `types`/`typings`/`module`/`main` entries. An unavailable
|
|
168
|
+
declared export stays unresolved rather than guessing a source directory. Duplicate package names
|
|
169
|
+
also stay unresolved. Configuration changes apply on the next query without reindexing sources.
|
|
170
|
+
Discovery is bounded to 4,096 directories, 512 packages, 1,024 configuration probes and 8 MiB of
|
|
171
|
+
configuration per query (1 MiB per file); exceeded limits report incomplete results. This is source
|
|
172
|
+
navigation, not full Node/TypeScript module resolution: dependency installation, lockfiles, package
|
|
173
|
+
`imports`, custom conditions, arbitrary YAML, and CommonJS export analysis are not provided.
|
|
174
|
+
|
|
175
|
+
Go method queries share bounded, query-time method sets across agent exploration,
|
|
176
|
+
callers, LSP definition/implementation lookup and completion. Ordinary interfaces
|
|
177
|
+
match only when every required method has an identical resolved parameter/result
|
|
178
|
+
signature, including variadic form. Value and pointer receivers, non-generic
|
|
179
|
+
embeddings, shallower declarations, field shadowing and ambiguous promotions are
|
|
180
|
+
handled separately. Implementation edges are possible structural matches, not proof
|
|
181
|
+
of a runtime receiver. Empty interfaces do not expand to every type. Generic bodies,
|
|
182
|
+
type-set constraints and unresolved signatures remain unknown. Detailed evidence
|
|
183
|
+
is not stored in the index; see [Go method queries](docs/GO-METHODS.md) for limits.
|
|
184
|
+
|
|
185
|
+
Go imports use the nearest in-project `go.mod` and `go.work`: declared module paths,
|
|
186
|
+
workspace `use` lists, and relative local `replace` targets locate indexed packages.
|
|
187
|
+
Workspace replacements override module replacements; version-specific replacements
|
|
188
|
+
require an agreed direct requirement across workspace modules. Module boundaries,
|
|
189
|
+
duplicate names and conflicting replacements prevent speculative matches. Package calls,
|
|
190
|
+
navigation and completion share explicit aliases and declared package names (including
|
|
191
|
+
imports ending in `/v2`). Imported packages exclude test files and non-Go files;
|
|
192
|
+
unqualified function lookup stays within the current package. With no module metadata,
|
|
193
|
+
directory-suffix lookup remains available only when it finds a unique package.
|
|
194
|
+
Configuration is query-owned and reloaded on the next request. Limits are 1,024 config
|
|
195
|
+
probes, 1 MiB per config, 8 MiB total, 256 workspace modules, 512 files, 8,192 scanned
|
|
196
|
+
nodes and 64 matching declarations per package lookup (4,096 legacy directory candidates);
|
|
197
|
+
exceeded limits report incomplete results. Lookup stays inside
|
|
198
|
+
the indexed project and does not invoke Go or download dependencies. The full module
|
|
199
|
+
version graph, host `GOWORK`/`GOPATH`, vendor/module caches, build tags, dot imports,
|
|
200
|
+
lexical shadowing and full receiver/type inference are not modeled. Configuration accepts
|
|
201
|
+
standard line/block directives and JSON-compatible quoted paths; absolute local paths
|
|
202
|
+
and other Go string escape forms are outside this supported subset.
|
|
203
|
+
|
|
204
|
+
Rust Cargo lookup reads local path dependencies and inherited `workspace.dependencies`
|
|
205
|
+
on demand, including renamed packages, hyphenated crate names and custom `[lib]` names/paths.
|
|
206
|
+
Workspace dependency paths are relative to their defining workspace manifest; sibling packages
|
|
207
|
+
are not inferred as dependencies. `crate`/`self`/`super`, declared file/inline modules, grouped
|
|
208
|
+
`use` aliases and bounded named public re-exports share resolution across calls, navigation
|
|
209
|
+
and module completion. Detailed import, path and visibility evidence reuses the bounded query
|
|
210
|
+
source cache and is excluded from serialized indexes. External lookups require public items.
|
|
211
|
+
Manifest edits apply on the next request. Limits include 1,024 manifest probes, 1 MiB per
|
|
212
|
+
manifest, 8 MiB total, 512 dependencies per package, 8,192 nodes per module and 64 alias-source
|
|
213
|
+
files per caller query; exceeded limits report incomplete results. Supported TOML includes
|
|
214
|
+
basic/literal strings, arrays, inline dependency tables, dotted dependency properties and
|
|
215
|
+
dependency subtables. Lookup stays within the indexed root and never invokes Cargo. Registry/
|
|
216
|
+
Git downloads, dev/build/target-specific dependencies, lockfile/feature/target selection,
|
|
217
|
+
patch/replace overrides, glob re-exports,
|
|
218
|
+
`#[path]`/generated modules, custom binary targets, block-local imports and full Rust type,
|
|
219
|
+
privacy or macro analysis are not modeled. Without Cargo metadata, legacy Rust lookup remains.
|
|
220
|
+
|
|
221
|
+
Function values in supported JS/TS/ArkTS, Python and Java/Kotlin forms retain
|
|
222
|
+
[`ref` dependencies](docs/FUNCTION-VALUES.md), including explicit imports and typed method
|
|
223
|
+
references. A reference is not proof of callback execution; anonymous scopes and complex
|
|
224
|
+
expressions have conservative limits.
|
|
225
|
+
|
|
226
|
+
C#, Java and Kotlin implementation relationships use declared inheritance and matching named
|
|
227
|
+
parameter types. Explore and callers label these edges `implementation`: they describe possible
|
|
228
|
+
implementations, not calls made by the method or a proven runtime receiver. Go to Implementation
|
|
229
|
+
uses the same lookup; Go to Definition continues to return the declaration. Detailed method
|
|
230
|
+
evidence is generated per query and excluded from the index. Candidate, result and hierarchy
|
|
231
|
+
limits report incomplete results. Generic substitution, inherited-only interface implementations,
|
|
232
|
+
and default-interface conflict resolution are not modeled.
|
|
233
|
+
|
|
234
|
+
Lua also follows local callback arrays populated by named local functions and `table.insert`,
|
|
235
|
+
then directly invoked through the value variable of a builtin `pairs`/`ipairs` loop. These
|
|
236
|
+
query-owned `automatic:callback-loop` edges reuse static registry bindings and preserve
|
|
237
|
+
collection identity. See [Indirect calls](docs/INDIRECT-CALLS.md#automatic-lua-callback-collection-traversal)
|
|
238
|
+
for mutation, scope and size limits.
|
|
239
|
+
|
|
240
|
+
JS/TS also infer limited Node EventEmitter deliveries from literal registrations and emissions
|
|
241
|
+
on the same local object. These query-owned `automatic:event` edges feed explore/callers without
|
|
242
|
+
configuration; see [Indirect calls](docs/INDIRECT-CALLS.md#automatic-node-eventemitter-deliveries)
|
|
243
|
+
for import, scope, mutation and candidate limits.
|
|
244
|
+
|
|
245
|
+
TypeScript interface and explicitly abstract methods use the same bounded query path. Only
|
|
246
|
+
explicit `implements`/`extends` relationships between ordinary top-level named types are linked;
|
|
247
|
+
named/default/namespace imports, re-exports, workspace packages and tsconfig paths reuse module
|
|
248
|
+
resolution. Parameter and return annotations must match exactly after resolving primitive or
|
|
249
|
+
named types (including simple arrays); named type identity includes its declaring module.
|
|
250
|
+
Both signatures must have explicit annotations. Generic heritage/methods, aliases, unions,
|
|
251
|
+
optional/rest/default parameters, accessors, arrow fields, declaration merging, nested types,
|
|
252
|
+
inferred returns and structural implementations are excluded. Class overload signatures are
|
|
253
|
+
not treated as abstract contracts. These links do not perform TypeScript assignability checks.
|
|
254
|
+
|
|
255
|
+
C++ uses the same query path for non-template, single, non-virtual inheritance. It matches
|
|
256
|
+
ordinary named/builtin parameter and return types, pointer/reference and cv decoration, and
|
|
257
|
+
member `const`/`volatile`/reference qualifiers. Overrides can omit `virtual`/`override`; private
|
|
258
|
+
virtual methods participate, while `final` blocks further overrides. Namespace imports, aliases
|
|
259
|
+
and indirect includes use the existing bounded C++ lookup. Matching out-of-line definitions are
|
|
260
|
+
preferred over class declarations; an unmatched body cannot stand in for an edited declaration.
|
|
261
|
+
Pure virtual overrides remain contracts. Multiple/virtual inheritance, templates, covariant
|
|
262
|
+
returns, function-pointer/array parameters and decorated type aliases in signatures are excluded.
|
|
263
|
+
These links describe possible implementations, without proving virtual dispatch at a call site.
|
|
264
|
+
Each query retains at most 128 alias-file arrays and 1 MiB of alias evidence from the shared
|
|
265
|
+
source loader. Reaching either limit reports incomplete relationships and suppresses uncertain
|
|
266
|
+
C++ links; alias data is never persisted.
|
|
267
|
+
|
|
268
|
+
C/C++ include lookup can use ordered project search paths in `.codeoutline.json`:
|
|
269
|
+
|
|
270
|
+
```json
|
|
271
|
+
{
|
|
272
|
+
"includePaths": ["shared/include"],
|
|
273
|
+
"includePathRules": [
|
|
274
|
+
{ "directory": "apps/client", "paths": ["apps/client/include"] },
|
|
275
|
+
{ "directory": "apps/server", "paths": ["apps/server/include"] }
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Quoted includes first search the including file's directory. Other searches use the longest
|
|
281
|
+
matching directory rule, then project `includePaths`, then LSP `initializationOptions.includePaths`,
|
|
282
|
+
in array order, stopping at the first existing header. Rule directories match whole path
|
|
283
|
+
components; `apps/client` does not match `apps/client-tools`. Paths are relative to the workspace root or absolute;
|
|
284
|
+
rule directories must stay inside the workspace (`.` matches the root). Each including file
|
|
285
|
+
selects its own rule. Configuration is reloaded per query and shared by explore, callers,
|
|
286
|
+
definition, implementation navigation and completion. Existing same-directory source files take
|
|
287
|
+
priority when pairing a header with its implementation; C++ class-outside members must belong to
|
|
288
|
+
the selected class, rather than another same-named class.
|
|
289
|
+
With configured paths, a paired source must directly include the selected header; unsupported
|
|
290
|
+
build/forced-include relationships remain declarations instead of guessed definitions.
|
|
291
|
+
|
|
292
|
+
An explicit `includePaths` (including `[]`), a matching directory rule, or nonempty LSP search
|
|
293
|
+
paths disables whole-project suffix guesses for that file. Without configuration, legacy suffix
|
|
294
|
+
lookup remains. External or excluded headers can be opened from include lines but do not contribute
|
|
295
|
+
indexed symbols or fall through to indexed duplicates. There are at most 128 rules and 128
|
|
296
|
+
effective directories per file; paths are literal, without globs. These are per-file lookup rules,
|
|
297
|
+
not compiler build configurations, forced includes or full preprocessor/translation-unit analysis.
|
|
298
|
+
Only query-owned configuration and bounded path caches are added; no include maps are persisted.
|
|
299
|
+
|
|
106
300
|
## Command line
|
|
107
301
|
|
|
302
|
+
Explore, callers, type-hierarchy and type-references accept [explicit query filters](docs/QUERY-FILTERS.md)
|
|
303
|
+
such as `lang:lua path:service/ connect`. They select starting symbols; dependency
|
|
304
|
+
expansion still crosses files and languages, including Lua-to-C calls.
|
|
305
|
+
|
|
306
|
+
[Project search ranking](docs/SEARCH-RANKING.md) lets `.codeoutline.json`
|
|
307
|
+
deprioritize directory prefixes when explore chooses starting symbols. Files
|
|
308
|
+
remain indexed, and dependency expansion keeps the same visibility.
|
|
309
|
+
|
|
108
310
|
```sh
|
|
109
311
|
codeoutline serve --stdio [--project PATH] [--allow-root PATH ...]
|
|
110
312
|
codeoutline serve --http [--host HOST] [--port PORT] [--project PATH] [--allow-root PATH ...]
|
package/README.zh-CN.md
CHANGED
|
@@ -51,11 +51,13 @@ Windows 上 Claude Code 无法直接启动 `codeoutline.cmd`,请改用 `-- cmd
|
|
|
51
51
|
|
|
52
52
|
未指定项目时,服务依次使用:调用参数 `projectPath`、启动参数 `--project`、客户端 roots(`roots/list` 返回的第一个目录)、服务启动目录。客户端通常在项目目录中启动 stdio 服务,因此全局配置无需写项目路径。访问范围默认为 `--project` 或启动目录,可用可重复的 `--allow-root` 扩大。
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
提供五个工具:
|
|
55
55
|
|
|
56
56
|
| 工具 | 用途 |
|
|
57
57
|
| --- | --- |
|
|
58
58
|
| `codeoutline_explore` | 按符号或文件名查询源码、调用路径与上下游(参数 `query`,可选 `projectPath`、`budget`) |
|
|
59
|
+
| `codeoutline_callers` | [递归查询潜在调用者与涉及文件](docs/CALLERS.md)(参数 `query`,可选 `projectPath`、`depth` 默认 3、`max_nodes` 默认 200、`budget`) |
|
|
60
|
+
| `codeoutline_type_hierarchy` | [查询类型的祖先与派生/实现类型](docs/TYPE-HIERARCHY.md),覆盖 C#、Java、Kotlin、TS、C++(参数 `query`,可选 `projectPath`、`direction`、`depth` 默认 8、`max_nodes` 默认 200、`budget`) |
|
|
59
61
|
| `codeoutline_status` | 刷新并报告索引、缓存、扫描器与解析统计 |
|
|
60
62
|
| `codeoutline_rebuild` | 绕过缓存完整重建 |
|
|
61
63
|
|
|
@@ -71,6 +73,7 @@ Windows 上 Claude Code 无法直接启动 `codeoutline.cmd`,请改用 `-- cmd
|
|
|
71
73
|
| 定义跳转、悬停、签名帮助 | 在导入行(`require`、`#include`、模块导入)上跳转定义会打开被加载的文件 |
|
|
72
74
|
| 引用、调用层级 | 函数、方法、构造函数和宏;支持调入与调出 |
|
|
73
75
|
| 补全 | 局部变量、本文件的定义与导入、C/C++ 所包含头文件中的声明,以及 `.`、`->`、`::`、`?.`、Lua `:` 之后的成员 |
|
|
76
|
+
| 方法实现 | C#、Java、Kotlin、TypeScript 的接口与抽象方法,C++ 虚方法;支持 `textDocument/implementation` |
|
|
74
77
|
|
|
75
78
|
解析基于名称,与 `codeoutline_explore` 相同,不做类型检查;不提供重命名、诊断和格式化,适合与语言自身的服务器并用,或用于没有语言服务器的场景。每次请求都会带上未保存的修改。工作区根目录的 `.codeoutline.json` 可以把 Lua 调用参数映射到注册位置,用于跳转定义。具体行为、限制和选项见 [LSP.md](docs/LSP.md)。
|
|
76
79
|
|
|
@@ -95,11 +98,46 @@ Linux 上解码 GBK 源码需要系统 iconv 的 GBK 模块;EL8/EL9 最小安
|
|
|
95
98
|
|
|
96
99
|
## 支持的语言
|
|
97
100
|
|
|
98
|
-
C、C++、C#、Go、Java、JavaScript / TypeScript(含 JSX/TSX)、Kotlin(`.kt` / `.kts`)、Lua、Python、Rust。
|
|
101
|
+
C、C++、C#、Go、Java、JavaScript / TypeScript(含 JSX/TSX)、ArkTS(`.ets`)、Kotlin(`.kt` / `.kts`)、Lua、Python、Rust。
|
|
102
|
+
|
|
103
|
+
ArkTS 复用 JS/TS 解析器,将组件 `struct` 按类索引,支持带装饰器的字段、方法、
|
|
104
|
+
本地模块导入和 ArkUI 调用;声明式 UI 块不会被当作方法声明。
|
|
105
|
+
这是启发式索引,不执行 ArkTS 类型检查;尚不解析 SDK `@kit.*`/`@ohos.*`、资源引用,
|
|
106
|
+
也不模拟生成的 UI 生命周期或状态行为。Zed 需要另外安装 ArkTS 语言扩展。
|
|
99
107
|
|
|
100
108
|
Kotlin 支持声明、主构造器属性、扩展函数、表达式函数体、包导入与别名,以及普通、泛型和尾随 lambda 调用。
|
|
101
109
|
关系解析仍是启发式的;不建模编译器生成成员、lambda 隐式接收者、字符串模板内的表达式、Java 互操作或协程/框架分派。
|
|
102
110
|
|
|
111
|
+
C++ 支持具名类型别名、命名空间别名、`using ns::Type`、`using ns::function`,以及所包含头文件中有界的
|
|
112
|
+
`using namespace` 导入链。调用关系、导航和补全共用解析;局部导入遵循声明位置和块作用域,
|
|
113
|
+
有歧义的导入名称保留为未解析。详细导入证据按需生成,不写入索引。
|
|
114
|
+
这仍是启发式解析,不建模预处理与 include 顺序、编译器头文件搜索配置、依赖模板、ADL 或完整重载决议。
|
|
115
|
+
|
|
116
|
+
C#、Java、Kotlin 的实现关系依据显式继承和匹配的具名参数类型生成。Explore 与 callers 将这类边标为
|
|
117
|
+
`implementation`,表示可能的实现,不表示该方法调用了实现方法,也不证明运行时接收者的类型。
|
|
118
|
+
“转到实现”共用这套解析,“转到定义”仍返回声明。详细方法证据按查询生成,不写入索引;
|
|
119
|
+
候选、结果或继承层次达到限制时会报告结果不完整。暂不处理泛型替换、仅由继承成员满足的接口实现、
|
|
120
|
+
默认接口实现冲突。C++ 虚方法的支持范围见英文 README。
|
|
121
|
+
|
|
122
|
+
TypeScript 接口和显式抽象方法复用同一套有界查询,只关联顶层具名类型之间显式的
|
|
123
|
+
`implements` / `extends`。导入别名、默认导入、命名空间导入、重导出、workspace 包和
|
|
124
|
+
tsconfig 路径复用现有模块定位;参数及返回类型须显式标注,解析后完全一致,支持简单数组,
|
|
125
|
+
具名类型按声明模块区分。暂不处理泛型继承或方法、类型别名、联合类型、可选/剩余/默认参数、
|
|
126
|
+
访问器、箭头函数字段、声明合并、嵌套类型、返回类型推断和结构化实现。类的普通重载声明不作为
|
|
127
|
+
抽象契约;这不是 TypeScript 可赋值性检查。证据按查询生成,索引不保存额外实现关系。
|
|
128
|
+
|
|
129
|
+
JS/TS 还可无需配置地识别有限的 Node EventEmitter 模式:显式导入内置构造器、当前文件的
|
|
130
|
+
未导出 const 实例、字面量事件名和具名处理器。Explore/callers 用 `automatic:event` 标注可能的
|
|
131
|
+
事件投递,按实例隔离;遇到对象转交、重赋值、移除监听器、未知作用域或动态事件名时保守跳过。
|
|
132
|
+
详细证据只在查询时生成,不写入索引。支持范围、数量限制及排除情况见
|
|
133
|
+
[间接调用文档](docs/INDIRECT-CALLS.md#automatic-node-eventemitter-deliveries)。
|
|
134
|
+
|
|
135
|
+
Lua 还可自动关联本文件 local 回调数组:由具名局部函数、字面量数组或 `table.insert` 注册,
|
|
136
|
+
再在内置 `pairs` / `ipairs` 循环中直接调用值变量。Explore/callers 用
|
|
137
|
+
`automatic:callback-loop` 标注可能调用,复用静态注册表的作用域和别名解析;遇到集合转交、
|
|
138
|
+
修改、未知来源或作用域不确定时保守跳过。详细证据按查询生成,不新增持久化索引字段。
|
|
139
|
+
支持范围和限制见[间接调用文档](docs/INDIRECT-CALLS.md#automatic-lua-callback-collection-traversal)。
|
|
140
|
+
|
|
103
141
|
## 命令行
|
|
104
142
|
|
|
105
143
|
```sh
|
package/bin/xnet.exe
CHANGED
|
Binary file
|
package/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.2.6","runtimeCommit":"d33491598d199b1a2f5fd3d9840c5b17d49b1e13","runtimeBuild":"b9b847244c68283df56e7858fe3daaafd35b756f0ff67cfa379f998133ddf29d","lua":"LuaJIT 2.1.1774896198","sourceCommit":"e738eb2dff955027fda8ecbe0b397d32d6911e03","sourceDirty":false,"releaseReady":true,"note":"Release build from a clean checkout","sha256":{"scripts/codeoutline/query_report.lua":"5e6052483514c1d3497fe90c2eb70235caed334b4a89411453a2a812f50c6246","scripts/codeoutline/command.lua":"e4bd7698e03dbca3728084454a2e9a4b1a9902e76c3d69b85107ffac80981716","scripts/codeoutline/rules.lua":"b01402863062435a6d31a4a5a90208319876fdb444a76c75fd0c45ea8ee6fee5","scripts/codeoutline/common.lua":"dc76e72f4c8de20f120962bb19bffaa0beafbeddad217fc95b028e4e7d94374a","scripts/codeoutline/service.lua":"91ac502048f8e5be4521284ca77f45af1a8f6421aff59c41361c88015a531b03","licenses/lua-cmsgpack.txt":"8edfdc5282278a1268d8a6ee52f9245f1a5fe3d1c8065be00330196b1de49873","scripts/codeoutline/completion.lua":"aa59fed11e6bcecb4e80a5df42911e05541c4b65bb9aefdd0e7f70b0e8fcfd22","scripts/codeoutline/static_dispatch.lua":"19a4f20ecc85e0e6d49d571fe4f5cc339b6ee6a9968d52d072c62ff4121bcaba","scripts/codeoutline/js_resolution.lua":"b921411cceae30190a0d637605d8f54105a9da907c57c9c361513720feba6dcc","scripts/codeoutline/control.lua":"b67a2e382e021f0793ef313aa4e71faab76f6cb77ca127f499d01ae96f36a8db","keys/update-public.pem":"7ff853339e19631b20ed3fa2cf221daa31c581e2e84d161b344b8f06de6562a8","keys/update-ca.crt":"d9b5ec3d4628de9c5559871f39841a5f84d47c53ded4d58d6e3bba2b4c669a02","lib/xhttp_codec.lua":"a5b0f127105ba6dbd4a518a214ca55e22c7510e6b2fc8c25c325898d8346ef8c","scripts/codeoutline/updater.lua":"267c4b6e9704fce710f44d1bfceac69c1857e34e064d8444d7890f0e10d921c7","licenses/libdeflate.txt":"41b60f2caab6bffdd5ba360687bd23ca653c0a1235c00380ecffc939b4cd8d75","scripts/codeoutline/cpp_types.lua":"b0904638c40bf621f965f9839d4c103dec96cadc98ec7c1b0fa689e379f41804","scripts/codeoutline/update_sequence.lua":"640a1b156e8ce2e54d9e63fd95d179eb07f551e6eeb752d5d36114a7b5867196","scripts/codeoutline/lang/c.lua":"9cd8abbdfda6cae5d6c04a9ae68bbd9f7589b217e88b7682917106e80df9b0c5","scripts/codeoutline/csharp_bindings.lua":"3a237f9a04c4cc2277ebfcbe902bdefecff125ef4a7c8d2d55e8284e916db0ab","scripts/codeoutline/update_worker.lua":"7e2ec28e4b911d7b90fd97d0a4c0e2f5b295d1a9200c5c7250e47a99139ca550","scripts/codeoutline/lang/cpp.lua":"47e3dc18cbc8b9a93567897e9ff69a026434a1971fe1dcc3e07d3af03c54a4f2","scripts/codeoutline/daemon.lua":"06863991135cc9a85f07bca8310296f0df9e415b3e2de97ae006393e777b009b","scripts/codeoutline/version.lua":"098b03a424dd1b59a945f4042470355ca854e3063108e89debca0070dc9145b0","scripts/codeoutline/lang/csharp.lua":"eac54f1664946e2d8278de8530878c14c91b432b62f9d0044e991164df3d0666","scripts/codeoutline/dispatch_aliases.lua":"40c85d2c76efd797cb9cf7355cd18bbac270aaa0fe724c3760695fe97187f83d","scripts/codeoutline/xscan.lua":"bd95a1b0b7022d029a41aab615897502478b5834612505e8d299343cb5ca8ef9","scripts/codeoutline/lang/go.lua":"3a62d4dc451b0d2f7f2aefd5e77d11449a5d725f59379728eba8dda0aacc13f3","scripts/codeoutline/documents.lua":"7e59a60085c68d756f57424925732e205e2559efbf1213716afa620acf0c6c43","scripts/codeoutline/indirect.lua":"ead34f11f48fdb11478f613dd69c83c00fdb4c2840e635da2d5315125395baf9","scripts/codeoutline/lang/java.lua":"0ea34298770cb3431f4bc3521c4d2ecf363d55e768d6cd30b3f11ad05d7e8f0d","scripts/codeoutline/explore.lua":"f9294a11c3155daa41f7a994886e4004fed940468c95d03c1b33859530186236","bin/xnet.exe":"1fa95f25f32f44e49250cda6642a8e6a975e42b3ee8922cbc591ec75ed530848","scripts/xupgate/client.lua":"967c29c1eeebd8596458025ab3237816a91591cca64236ea0e7ba1762814e6ba","scripts/codeoutline/lang/js.lua":"62570ddc38c974991763e11770059880b87ec87f14578891df9d935af6cb4786","scripts/codeoutline/foreign.lua":"a3eab94b652b94dfe2a11c2c33f0744201decdbb84fcbb6d2ef244f2826e9b6e","scripts/codeoutline/lang/kotlin.lua":"cefaad1c412cb42ea6b2027ad9f81ad38d8d821f05c1cfde7f89c600d745a708","scripts/codeoutline/foreign_lua.lua":"03640aa84ba2ba628a5b0d8a7f66285fe308107fdd196862164d29d7e4129660","scripts/codeoutline/mcp.lua":"d68f3648a31befeabb846faae3e13efe4f8c7406f6d9b14a1fab6c77014c6b50","scripts/xupgate/http_client.lua":"a189506c3d0fcc454f5e001fdeecdd6349a1019ea0970d11ce2fbfdf035166d6","scripts/codeoutline/graph.lua":"76350b773fc8366102acf471d8ef70bfebc5898eaeba6ded018041c4ecabd69e","DISTRIBUTION.md":"da4a1048fc9b44670fd6fcef97e7d92ac3f50d3523da1773930c49f7e2c38dc3","scripts/xupgate/http_codec.lua":"a5b0f127105ba6dbd4a518a214ca55e22c7510e6b2fc8c25c325898d8346ef8c","scripts/codeoutline/lang/python.lua":"1ae8f1658e25220ec4d952c17ed817bfc92d0c45d4585d3dd4716d5585b60cc6","scripts/codeoutline/http.lua":"3d957628ecc9592d57cc68a61e5d4229a71da501eb8fb3aa0bbb5e1cd772adf0","scripts/xupgate/proxy.lua":"5bf532e7005f44555d6a5277336e5ad395af060585c13a1cdc2441de50e0dcff","scripts/codeoutline/ordinary_bindings.lua":"63bb8d660a74d67c370641793ab983e9b203c344253535ee32b5530d2365a700","scripts/codeoutline/lang/rust.lua":"294cee85786caaa5f29dedd5058877c7a4786349431faf33b36357ef69406a9e","scripts/codeoutline/index.lua":"f258c8085c5a93ac57c9ae9d21ee92c2be4850e21672b8af650dfee8ecbbc48e","scripts/xupgate/signature.lua":"f07de8a4093d08cc69d3c1d8296d23318c5d81344ece788d4453a9b3b700f000","scripts/codeoutline/parse.lua":"52eadb0b4b5bb5db2f6064170414377c5a23e2b24b3409ae00b9969273076435","scripts/codeoutline/lsp.lua":"5403311a9fd5cdc85bcbe158c35d5f1515d279f8374fc41d1f0c694a629ba824","codeoutline":"3d3970e488e077e8acd67d174b506a361d43578b3360c7b29f2ec3f0103ba899","scripts/codeoutline/parse_pool.lua":"acaafe74a568ec450e428f4a1a2ff704834588bba0f8b808e4c7a1d552861941","scripts/codeoutline/lua_bindings.lua":"e8c8a44dffd7e263dcfb321682c382d3d9d691495dbcb143a049532859d4ed53","codeoutline.cmd":"607b60c6d107becdb6793df8f41aaf2cff944baf69f5ece59dba990d0f24c13b","THIRD_PARTY.md":"a0d596a8600c5244b27c1426a81b4ec7046d213d733ec6b4287a4b1e8db501b5","README.zh-CN.md":"fea0ffb9835e1b78925b1aa0a6a3019591e376d23e94da5b4f58773601e2d7da","README.md":"b58cd12615dd7b796c3a3e8ce86ec0adb36a92f7d32025eed1fb78a843616fcf","scripts/codeoutline/parse_worker.lua":"c5f1745d15332c5040b1e97f6da08f2f456d9afe7c2491275cc97d7113b75e45","scripts/codeoutline/lua_literal.lua":"5fdd90a872988622337410c7e516d41b789ce4326c4aa6dddcd61998fe5aef90","licenses/mbedtls.txt":"9b405ef4c89342f5eae1dd828882f931747f71001cfba7d114801039b52ad09b","licenses/luajit.txt":"1b10a02c9474cb908da2d87bc908edd8798f9ad28d9a8c53fbd05c13227f7394","LICENSE":"1b63179362acd482b4a9a07ca526b3fce6d9103dcded361de2159ade174568b6","licenses/xnet2lua.txt":"1aa8af3df70f60f1ebf2d23e14c27af1606057ad9c32a9a0d15fd76cff257532","scripts/codeoutline/path.lua":"407bd960c1ad04e5006b321ce33263393bb40eee5dee5c123be9b36d3ad10937","scripts/codeoutline/main.lua":"0e1731a4e931ed8cc3ec42c537bb61c22094c3462fe7c20ed49ed7831ce71bd4","scripts/codeoutline/callers.lua":"d5b11e92bd32a823f1d198a6e7b4dca73e15daa4713762cf29d1062f26ec20d6","scripts/codeoutline/lang/lua.lua":"f50a169549475d5d71f8af920feeb82797e8f24ccfe0c3f416abc5a32e942713","scripts/codeoutline/js_evidence.lua":"494f6f90c3da2eee0e8f6b21f8ce364802ed1ee710e74c443f1cfbbd575859f6","scripts/codeoutline/navigation.lua":"69001bab3763fb974a66cdeab5fe88c8b52f7e9229f8243ad6a30a26932c3418","scripts/codeoutline/python_bindings.lua":"e33a0ff223cf3b3292cbe9ed728aa32f6c5cab47d1843d6797ae670b74a3c580","scripts/codeoutline/index_worker.lua":"ad6b300fcca6f2eadb0373179d1c5c3321319a3ab0cae3d9a8996ce760e55671","scripts/codeoutline/cpp_bindings.lua":"b302b0a0e99846853ec75532a5a10e5da2f6738f512ca7b6f57fa98aaed17018","scripts/xupgate/common.lua":"86267648c0dbbd3a05f90de4d6e1dbee53ba57bf4801783c2ae636224b1f228c","scripts/codeoutline/cli.lua":"f7ac4addd32ced58069954cb81edd4836c6043bb5d143683b80bd7b11554c733","scripts/codeoutline/text.lua":"75f9af87ff5ce62def74f69d8972a6b11ff660723fc5cf515369ee3012ff0675"},"target":"win32-x64","updateSequence":15}
|
|
1
|
+
{"runtimeCommit":"be18042e9091379bf45624771a4e8819d2709f84","runtimeBuild":"b9b847244c68283df56e7858fe3daaafd35b756f0ff67cfa379f998133ddf29d","lua":"LuaJIT 2.1.1774896198","sourceCommit":"f7ae0ff2a99fa2402c9c5671e217082348e81ae5","version":"0.2.9","sourceDirty":false,"releaseReady":true,"note":"Release build from a clean checkout","target":"win32-x64","sha256":{"scripts/codeoutline/go_modules.lua":"5aafa1c8607edfa12a79ad3c49db677f79e790582cb51d1e796da7783c656c0f","scripts/codeoutline/completion.lua":"39d0de57b50b8e521b2cb41e16c102e618408648cd6a097bae43e36309bb4d14","scripts/codeoutline/search_ranking.lua":"2ea52d55e55f7de757cfb998f77eaa713ca19c5318b8d8470772c914fad9cb10","codeoutline.cmd":"607b60c6d107becdb6793df8f41aaf2cff944baf69f5ece59dba990d0f24c13b","scripts/codeoutline/graph.lua":"80fe8ec1d9aaaf1858a2590337ddba9f2a4209781c4a9b44967a6055ee6b6b9e","scripts/codeoutline/control.lua":"b67a2e382e021f0793ef313aa4e71faab76f6cb77ca127f499d01ae96f36a8db","keys/update-ca.crt":"d9b5ec3d4628de9c5559871f39841a5f84d47c53ded4d58d6e3bba2b4c669a02","scripts/codeoutline/lua_literal.lua":"5fdd90a872988622337410c7e516d41b789ce4326c4aa6dddcd61998fe5aef90","scripts/codeoutline/shared_events.lua":"46a3f5780d12daed660138aa0cb769d727ceff9156916ca3c703928f036e5255","scripts/codeoutline/coverage.lua":"3a4a0e5f5ea8b7ea4a0be62c7c1a202153cf0c5c3423f78b100aecbb39513d5e","licenses/libdeflate.txt":"41b60f2caab6bffdd5ba360687bd23ca653c0a1235c00380ecffc939b4cd8d75","scripts/codeoutline/main.lua":"3ac12632697d9e7559f5a7f754d0d101b6515fbde93f2c67787359b9e802d1d0","scripts/codeoutline/cpp_bindings.lua":"7b359807322fca1d6769bd34c58ae914404dc1bcf67decad9ec6519fde25432b","scripts/codeoutline/text.lua":"56ee63c7b4cc63fe12d8ecd5b99410281463cdba8ca112f484e402ca6dfc5b90","scripts/codeoutline/js_evidence.lua":"abb87a3b3ccfc1bb4fcaf771ae91aed5636fec1d73cabeebdec8c7af3227e6b5","scripts/codeoutline/mcp.lua":"397476810877b39297ea476c555a3c80353a7122e766ca5adc7af5d81cf8a8b6","scripts/codeoutline/cpp_fragments.lua":"025bc03f9d48eec3d310366d3c58f77871a989a55ba3538a3f0664b3b4c62d7b","scripts/xupgate/proxy.lua":"5bf532e7005f44555d6a5277336e5ad395af060585c13a1cdc2441de50e0dcff","scripts/codeoutline/ts_implementations.lua":"b908020c17b68a2ef5a8b41732ce39e487105e90ade366b9d1f708b75257d06e","scripts/codeoutline/js_resolution.lua":"770326d43d87369ba2ea06300d23bf45a073707aa91d81fff316f010ce1057b2","scripts/codeoutline/navigation.lua":"16f10a108cbb76ff938e556ec4cb5fab2b1a8e0b7c7afc6422962787aff4f908","scripts/codeoutline/cpp_implementations.lua":"c3f59e25512816cf52aad69333f6b3ae882ba8747f6ce74b083f928301316572","scripts/codeoutline/type_bases.lua":"470fdcfffc3ded8bd3c9608db6128539757c91692bc714173dbb1bcdf8344e36","README.md":"48292c6c12d40512128f30173b4bbf8dae7a20071c69e577e7372bd067ee8710","scripts/codeoutline/js_workspace.lua":"fe59bfde1d22357432079dfef33f88c63da8e435e13c5ca97d4dc8c3e5638278","scripts/codeoutline/cpp_includes.lua":"f8bd2016ff040b7f8bd8a3f844baa4fbf0fcc850eb3b1c33b106696c4be92a5d","THIRD_PARTY.md":"a0d596a8600c5244b27c1426a81b4ec7046d213d733ec6b4287a4b1e8db501b5","scripts/codeoutline/type_references.lua":"e9a42c462e1d7b8b5e975c6862903ef993799bd363e560d2227e272a4ab0a95f","scripts/codeoutline/cpp_macros.lua":"41dbcc249d184c2f36be3c3b009a6c6347f7fafd4197e45ceafd3ad7a06af55c","scripts/codeoutline/type_uses.lua":"5c6e2b3279cc4345b6ab33986b38d3717fd56fe82c1d36c9da495bcb22183695","scripts/codeoutline/cpp_receivers.lua":"6bafebc87579d8514a0d36492dbbe65e9346688f228062c86d87053dacaa37e3","codeoutline":"3d3970e488e077e8acd67d174b506a361d43578b3360c7b29f2ec3f0103ba899","DISTRIBUTION.md":"da4a1048fc9b44670fd6fcef97e7d92ac3f50d3523da1773930c49f7e2c38dc3","scripts/codeoutline/updater.lua":"267c4b6e9704fce710f44d1bfceac69c1857e34e064d8444d7890f0e10d921c7","README.zh-CN.md":"b3a203e2356e0bf1e164cfbc9b112a796f61dd3e451ccc11a63255a5a455c583","scripts/codeoutline/lang/c.lua":"2b0efa1ab8a162cdafa293b1f51ded5c528705cea2e2d6c93647498ba0e250b1","scripts/codeoutline/cpp_types.lua":"7e8f53b9eab7600501c9884076f9026850d30155063b88e56dd366c6d4d2f888","licenses/mbedtls.txt":"9b405ef4c89342f5eae1dd828882f931747f71001cfba7d114801039b52ad09b","scripts/codeoutline/update_sequence.lua":"6bf7759e55d008da910886102771e7b2d0fadcfc87dcb4e499bb8e685622d2e3","scripts/xupgate/common.lua":"86267648c0dbbd3a05f90de4d6e1dbee53ba57bf4801783c2ae636224b1f228c","licenses/luajit.txt":"1b10a02c9474cb908da2d87bc908edd8798f9ad28d9a8c53fbd05c13227f7394","LICENSE":"1b63179362acd482b4a9a07ca526b3fce6d9103dcded361de2159ade174568b6","scripts/codeoutline/lang/cpp.lua":"569bd76a5db69d003fe3df9e999e01da106101de362e30cd092acf3075b81f99","scripts/codeoutline/update_worker.lua":"7e2ec28e4b911d7b90fd97d0a4c0e2f5b295d1a9200c5c7250e47a99139ca550","licenses/xnet2lua.txt":"1aa8af3df70f60f1ebf2d23e14c27af1606057ad9c32a9a0d15fd76cff257532","lib/xhttp_codec.lua":"a5b0f127105ba6dbd4a518a214ca55e22c7510e6b2fc8c25c325898d8346ef8c","scripts/codeoutline/on_demand.lua":"c8ce74ef29f7fb1fc4973a40e22b994c43310308d7f446dfe42428a96f7b8b9d","keys/update-public.pem":"7ff853339e19631b20ed3fa2cf221daa31c581e2e84d161b344b8f06de6562a8","scripts/codeoutline/daemon.lua":"06863991135cc9a85f07bca8310296f0df9e415b3e2de97ae006393e777b009b","scripts/xupgate/signature.lua":"f07de8a4093d08cc69d3c1d8296d23318c5d81344ece788d4453a9b3b700f000","scripts/xupgate/http_codec.lua":"a5b0f127105ba6dbd4a518a214ca55e22c7510e6b2fc8c25c325898d8346ef8c","scripts/codeoutline/ordinary_bindings.lua":"9c0d05619262882b448abe7fb0ad4da652a287cbfbac220d5ec152278b9acced","scripts/xupgate/http_client.lua":"a189506c3d0fcc454f5e001fdeecdd6349a1019ea0970d11ce2fbfdf035166d6","scripts/codeoutline/xscan.lua":"bd95a1b0b7022d029a41aab615897502478b5834612505e8d299343cb5ca8ef9","scripts/codeoutline/definition_candidates.lua":"449cbcf85f67a82a90bb2461346c3656518417b27ff66440bf7298ca0bf8c964","licenses/lua-cmsgpack.txt":"8edfdc5282278a1268d8a6ee52f9245f1a5fe3d1c8065be00330196b1de49873","scripts/codeoutline/parse.lua":"490e8c4a208c6eaacb0f1db80e7d0b95cc5f54c9c00fcbfd90934e466a598fe9","scripts/codeoutline/documents.lua":"618a8d150341442d0c37f3966ea6a856c78bf91ccaedd507ff563b26c7059c4f","scripts/codeoutline/version.lua":"143a2906936177e0a7b3cef3de192ec6ca4141650be50540ae005efd79b38fbb","scripts/codeoutline/type_hierarchy.lua":"ba6c62d162e10a5b251492568a2bbab8cef46cf70a96deacb3e0893ff0e44851","scripts/codeoutline/dispatch_aliases.lua":"0383f3de71ed1774c73c08fdc57e408afbd6b146b9beff96a4c2cf6aefda7000","scripts/codeoutline/parse_pool.lua":"4dd16132fa0ac96bd1abda33d1be237d8139095b31addfb81094df8c5e69b92f","scripts/codeoutline/static_dispatch.lua":"0c34302427c36cdb15249c047ae238722752040ac3d5e074fd433f278d75062e","scripts/codeoutline/service.lua":"17703f945472d905a9aa1a4071ecf362ec18872d7c61c933ec2ecdab5ed41f41","scripts/codeoutline/http.lua":"3d957628ecc9592d57cc68a61e5d4229a71da501eb8fb3aa0bbb5e1cd772adf0","scripts/xupgate/client.lua":"967c29c1eeebd8596458025ab3237816a91591cca64236ea0e7ba1762814e6ba","scripts/codeoutline/parse_worker.lua":"c8099bca90f0ce5069257d72065f2c61089526bedfe89e341f610e5c3f5320c0","scripts/codeoutline/rules.lua":"b01402863062435a6d31a4a5a90208319876fdb444a76c75fd0c45ea8ee6fee5","scripts/codeoutline/automatic_events.lua":"d23e61985bc4ddbfd1d4b6b9c46e9ed815b68476415866390cc59b2dd048c912","scripts/codeoutline/index_worker.lua":"7a2746e97bbb13f0fdf1731bc2aeecb3de1113266b6aadef91e61da312a4d618","scripts/codeoutline/query_report.lua":"49c92aa2a1b3410e02dba8fd7ba2a11c8b7d02979895faf766501fd5039a57d1","scripts/codeoutline/path.lua":"407bd960c1ad04e5006b321ce33263393bb40eee5dee5c123be9b36d3ad10937","scripts/codeoutline/explore.lua":"ef25b9085b73a7db34e2d09f6a3669d3a1ecb9ca51e63ed84aa1ec8162d7af23","scripts/codeoutline/implementations.lua":"cc5ce71c13fdbfd12c03257bd8ca799f981147e5594a5e1f0ed90721e9a09e2b","scripts/codeoutline/cache_repairs.lua":"7e31a6118c3e991382ae2751a8b1d4913bcbf4e24d35f56253f46e156e8420a5","scripts/codeoutline/csharp_bindings.lua":"3a237f9a04c4cc2277ebfcbe902bdefecff125ef4a7c8d2d55e8284e916db0ab","scripts/codeoutline/python_bindings.lua":"d54cb346d1814af0e8b85b98d6f92faf8a6c2eadf02127764b2554f74c03c940","scripts/codeoutline/affected.lua":"4fafc905d93c6006519f230bfb874c0477a68c32357a75ae36c8a80c2e48f172","scripts/codeoutline/lang/lua.lua":"f50a169549475d5d71f8af920feeb82797e8f24ccfe0c3f416abc5a32e942713","scripts/codeoutline/lua_callback_loops.lua":"b499abed79b482c577684e537ad9583914a94863fc886302a2baa2213e89481a","scripts/codeoutline/callers.lua":"a822bc0dcad44b5fdf263d5a988a68259a1db6159eaf4c2152236e5670c27b4f","scripts/codeoutline/query_filters.lua":"dfaac210f8ebf53d0e4515866b0128a77ff77cb0c8d7d558b71a4eaf9f2b32ef","scripts/codeoutline/go_methods.lua":"b59746ee5e28170f790f44226bbc1b732d513b72278b994c96d65966c01126db","scripts/codeoutline/index.lua":"eb83b16432cf70bad5491a30ea4aa8adbaefdd84247cc1aa569c6e4e0ed3dd6a","scripts/codeoutline/lang/python.lua":"1ae8f1658e25220ec4d952c17ed817bfc92d0c45d4585d3dd4716d5585b60cc6","bin/xnet.exe":"012f715f6085a38d4896f498cb079befa0b746361bd7dbe98c8495d4a037540b","scripts/codeoutline/cargo_toml.lua":"78f4f8bcf14f8db80bdac9fc2568988372d3cca222f82b34708f5330c00c8771","scripts/codeoutline/lang/js.lua":"6bb90ca153fd43ac8ed0777fe6f62a9ab36c740dc19caa8654d7541e0c14b1cf","scripts/codeoutline/function_values.lua":"63dec69e905545217afdcfd4a073b92e0956b39fd34b8d2808db1043256eb8e1","scripts/codeoutline/foreign_lua.lua":"03640aa84ba2ba628a5b0d8a7f66285fe308107fdd196862164d29d7e4129660","scripts/codeoutline/lang/rust.lua":"c7c3ae20ef9b4e1ce1466c6f36c3507f760995e58bede2c9b06f0f68e33d7308","scripts/codeoutline/resolution.lua":"ec137a38abfdcb7f366861a123480a3b3125a76acf7399a784f8fb207e833d0b","scripts/codeoutline/cli.lua":"f7ac4addd32ced58069954cb81edd4836c6043bb5d143683b80bd7b11554c733","scripts/codeoutline/lang/csharp.lua":"5adffb1d563323d6aeae5339b1f3b8d33b07bc99a66e24c710aaa6b5983825f6","scripts/codeoutline/foreign.lua":"a3eab94b652b94dfe2a11c2c33f0744201decdbb84fcbb6d2ef244f2826e9b6e","scripts/codeoutline/lang/go.lua":"3a62d4dc451b0d2f7f2aefd5e77d11449a5d725f59379728eba8dda0aacc13f3","scripts/codeoutline/language_detect.lua":"87fb472a0a4c29ce6e838354480f59646af33c6d21771e9d3650a4a3d8cf9e0f","scripts/codeoutline/lang/java.lua":"0ea34298770cb3431f4bc3521c4d2ecf363d55e768d6cd30b3f11ad05d7e8f0d","scripts/codeoutline/command.lua":"17a39679944eac004f546b953ec0fd4890e769817d3a6eee50d8c212bb2d6b7f","scripts/codeoutline/external_headers.lua":"0a24c81611847c3370b80bc027c2f86e5c670a8a5d8d0dda51893e89ffe84592","scripts/codeoutline/lang/kotlin.lua":"cefaad1c412cb42ea6b2027ad9f81ad38d8d821f05c1cfde7f89c600d745a708","scripts/codeoutline/rust_packages.lua":"a0cca64e8f3fe37364655158c0f7f5e40ada2a1d1864e3e9f4b1e9d91b88eeef","scripts/codeoutline/lsp.lua":"24fed84201eaa3c5dc45adfef8f515398ca3ec0534d9740251f1da8ce8177b14","scripts/codeoutline/lua_bindings.lua":"4d3dedd9ad664bbaa516e99119bc8bcc557f918995f83679f0408b2e4b42df9c","scripts/codeoutline/common.lua":"7647faecf2d37b7836d9fc6b1f75146d29f1d63ba9182685c19c1f19e33373d9","scripts/codeoutline/indirect.lua":"3bd5086427d0adb22b53f89a24031bfbfe3a18b0f2b4d41b4e1e03279695b7f7","scripts/codeoutline/rust_resolution.lua":"90be2ef14a7c1de357baae026d819f0053cae8eb475947d779ba519461e3c265"},"updateSequence":18}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@codua/codeoutline-win32-x64","version":"0.2.
|
|
1
|
+
{"repository":{"url":"git+https://github.com/1dao/codeoutline.git","type":"git"},"name":"@codua/codeoutline-win32-x64","version":"0.2.9","files":["bin/","lib/","keys/","scripts/","licenses/","LICENSE","codeoutline","codeoutline.cmd","build-info.json","*.md"],"publishConfig":{"access":"public"},"description":"CodeOutline native runtime and Lua implementation for win32-x64","os":["win32"],"cpu":["x64","arm64"],"license":"BSD-2-Clause"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
-- File changes seed one shared reverse traversal; no persistent impact graph.
|
|
2
|
+
local paths = require('codeoutline.path')
|
|
3
|
+
local control = require('codeoutline.control')
|
|
4
|
+
local callers = require('codeoutline.callers')
|
|
5
|
+
local text = require('codeoutline.text')
|
|
6
|
+
local M = { MAX_FILES = 128, TIME_LIMIT_MS = 700 }
|
|
7
|
+
|
|
8
|
+
local function checked(path)
|
|
9
|
+
assert(type(path) == 'string' and #path > 0 and #path <= 4096
|
|
10
|
+
and not path:find('[%z\r\n]'), 'files must contain non-empty paths without NUL or newlines (up to 4096 bytes)')
|
|
11
|
+
return paths.normalize(path)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
local function relative(path, root)
|
|
15
|
+
path = checked(path)
|
|
16
|
+
if path:match('^%a:') or path:sub(1, 1) == '/' then
|
|
17
|
+
assert(root and paths.contains(root, path), 'file must be inside the project: ' .. path)
|
|
18
|
+
path = path:sub(#paths.normalize(root) + (root:sub(-1) == '/' and 1 or 2))
|
|
19
|
+
end
|
|
20
|
+
local parts = {}
|
|
21
|
+
for part in path:gmatch('[^/]+') do
|
|
22
|
+
if part == '..' then
|
|
23
|
+
assert(#parts > 0, 'file must be inside the project: ' .. path)
|
|
24
|
+
parts[#parts] = nil
|
|
25
|
+
elseif part ~= '.' then parts[#parts + 1] = part end
|
|
26
|
+
end
|
|
27
|
+
assert(#parts > 0, 'file must name a project file')
|
|
28
|
+
return table.concat(parts, '/')
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
function M.validate(files, opts)
|
|
32
|
+
assert(type(files) == 'table' and #files >= 1 and #files <= M.MAX_FILES,
|
|
33
|
+
'files must be an array of 1 to ' .. M.MAX_FILES .. ' paths')
|
|
34
|
+
local count = 0
|
|
35
|
+
for k, path in pairs(files) do
|
|
36
|
+
count = count + 1
|
|
37
|
+
assert(type(k) == 'number' and k % 1 == 0 and k >= 1 and k <= #files, 'files must be an array')
|
|
38
|
+
-- Absolute paths are checked against the canonical root during execution.
|
|
39
|
+
local normalized = checked(path)
|
|
40
|
+
if not normalized:match('^%a:') and normalized:sub(1, 1) ~= '/' then relative(normalized) end
|
|
41
|
+
end
|
|
42
|
+
assert(count == #files, 'files must be an array')
|
|
43
|
+
callers.validate('affected', opts)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
local function test_file(path)
|
|
47
|
+
local lower = path:lower()
|
|
48
|
+
local base = lower:match('[^/]+$') or lower
|
|
49
|
+
return ('/' .. lower):find('/tests?[/]') or ('/' .. lower):find('/spec[/]')
|
|
50
|
+
or base:match('^test[_%.]') or base:match('[_%.]test%.')
|
|
51
|
+
or base:match('[_%.]spec%.') or base:match('tests?%.cs$')
|
|
52
|
+
or base:match('tests?%.java$') or base:match('tests?%.kt$')
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
function M.run(symbols, idx, files, opts)
|
|
56
|
+
M.validate(files, opts)
|
|
57
|
+
opts = opts or {}
|
|
58
|
+
local normalized, seen, ordered, matched, unresolved, empty = {}, {}, {}, {}, {}, {}
|
|
59
|
+
for _, path in ipairs(files) do
|
|
60
|
+
local rel = relative(path, idx.root)
|
|
61
|
+
local key = paths.key(rel)
|
|
62
|
+
if not seen[key] then normalized[#normalized + 1] = rel; seen[key] = true end
|
|
63
|
+
end
|
|
64
|
+
table.sort(normalized)
|
|
65
|
+
local lookup = {}
|
|
66
|
+
-- Case folding is only needed on Windows; preserve actual indexed spelling.
|
|
67
|
+
if paths.windows then
|
|
68
|
+
local need_lookup = false
|
|
69
|
+
for _, rel in ipairs(normalized) do if not symbols.file_index[rel] then need_lookup = true; break end end
|
|
70
|
+
if need_lookup then
|
|
71
|
+
for rel, f in pairs(symbols.file_index) do lookup[paths.key(rel)] = f end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
local cap, limited = opts.max_nodes or 200, false
|
|
75
|
+
for _, rel in ipairs(normalized) do
|
|
76
|
+
control.check()
|
|
77
|
+
local f = symbols.file_index[rel] or lookup[paths.key(rel)]
|
|
78
|
+
if not f then unresolved[#unresolved + 1] = rel
|
|
79
|
+
else
|
|
80
|
+
local rec = symbols.files[f]
|
|
81
|
+
matched[#matched + 1] = rec.path
|
|
82
|
+
if #rec.nodes == 0 then empty[#empty + 1] = rec.path end
|
|
83
|
+
for _, id in ipairs(symbols.id_of[f]) do
|
|
84
|
+
if #ordered < cap then ordered[#ordered + 1] = id else limited = true; break end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
local run_opts = {}
|
|
89
|
+
for k, v in pairs(opts) do run_opts[k] = v end
|
|
90
|
+
run_opts.time_limit_ms = M.TIME_LIMIT_MS
|
|
91
|
+
local result = callers.from_targets(symbols, idx, ordered, run_opts)
|
|
92
|
+
if result.encoding_retry then return nil, result end
|
|
93
|
+
result.changed_files, result.unresolved_files, result.files_without_symbols = matched, unresolved, empty
|
|
94
|
+
result.seed_limit_reached = limited
|
|
95
|
+
result.incomplete = limited or result.node_limit_reached or result.depth_limit_reached
|
|
96
|
+
or result.relationships_incomplete or result.time_limit_reached or #unresolved > 0 or #empty > 0
|
|
97
|
+
local affected, tests = {}, {}
|
|
98
|
+
for _, path in ipairs(matched) do affected[path] = true end
|
|
99
|
+
for _, path in ipairs(result.files) do affected[path] = true end
|
|
100
|
+
result.files = {}
|
|
101
|
+
for path in pairs(affected) do
|
|
102
|
+
result.files[#result.files + 1] = path
|
|
103
|
+
if test_file(path) then tests[#tests + 1] = path end
|
|
104
|
+
end
|
|
105
|
+
table.sort(result.files); table.sort(tests); result.tests = tests
|
|
106
|
+
local lines = { string.format('Changed %d indexed file(s); %d starting symbols; %d potential affected symbols in %d files.',
|
|
107
|
+
#matched, #result.targets, #result.callers, #result.files),
|
|
108
|
+
'Static potential impact from indexed symbol relationships; not complete import, type, build or runtime coverage.',
|
|
109
|
+
'Each affected symbol has one shortest path to one changed starting symbol. Test candidates use file naming only; unlisted tests are not safe to skip.' }
|
|
110
|
+
if result.incomplete then
|
|
111
|
+
local reasons = {}
|
|
112
|
+
for _, item in ipairs({ { limited, 'seeds' }, { result.node_limit_reached, 'nodes' },
|
|
113
|
+
{ result.depth_limit_reached, 'depth' }, { result.time_limit_reached, 'time' },
|
|
114
|
+
{ result.relationships_incomplete, 'relationships' }, { #unresolved > 0, 'unresolved files' },
|
|
115
|
+
{ #empty > 0, 'files without symbols' } }) do
|
|
116
|
+
if item[1] then reasons[#reasons + 1] = item[2] end
|
|
117
|
+
end
|
|
118
|
+
table.insert(lines, 2, 'Coverage incomplete: ' .. table.concat(reasons, ', ') .. '.')
|
|
119
|
+
end
|
|
120
|
+
for _, path in ipairs(matched) do lines[#lines + 1] = 'Changed: ' .. path end
|
|
121
|
+
for _, path in ipairs(unresolved) do lines[#lines + 1] = 'Unresolved file (deleted, renamed, ignored, unsupported or not indexed): ' .. path end
|
|
122
|
+
for _, path in ipairs(empty) do lines[#lines + 1] = 'No indexed symbols: ' .. path end
|
|
123
|
+
if limited then lines[#lines + 1] = 'Seed limit reached; starting symbols were omitted.' end
|
|
124
|
+
if result.node_limit_reached then lines[#lines + 1] = 'Node limit reached; affected symbols were omitted.' end
|
|
125
|
+
if result.depth_limit_reached then lines[#lines + 1] = 'Depth limit reached; deeper relationships were not checked.' end
|
|
126
|
+
if result.time_limit_reached then lines[#lines + 1] = 'Time limit reached; verified paths from the scanned portion are returned.' end
|
|
127
|
+
if result.relationships_incomplete then lines[#lines + 1] = 'Relationships incomplete: '
|
|
128
|
+
.. table.concat(require('codeoutline.coverage').relations(result), ', ') .. '.' end
|
|
129
|
+
for _, entry in ipairs(result.callers) do
|
|
130
|
+
local chain = {}
|
|
131
|
+
for _, hop in ipairs(entry.path) do
|
|
132
|
+
chain[#chain + 1] = string.format('%s (%s:%d)%s', hop.name, hop.file, hop.call_line or hop.line,
|
|
133
|
+
hop.kind and ' [' .. hop.kind .. ']' or '')
|
|
134
|
+
end
|
|
135
|
+
lines[#lines + 1] = string.format('Depth %d: %s', entry.depth, table.concat(chain, ' -> '))
|
|
136
|
+
end
|
|
137
|
+
lines[#lines + 1] = 'Affected files:\n' .. table.concat(result.files, '\n')
|
|
138
|
+
lines[#lines + 1] = 'Test candidates (naming heuristic):\n' .. (#tests > 0 and table.concat(tests, '\n') or '(none identified)')
|
|
139
|
+
local output, cut = text.limit(table.concat(lines, '\n'), require('codeoutline.explore').validate('affected', opts),
|
|
140
|
+
limited or result.node_limit_reached)
|
|
141
|
+
result.truncated = cut
|
|
142
|
+
return output, result
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
return M
|