Skip to main content

Crate code_ranker_plugin_javascript

Crate code_ranker_plugin_javascript 

Source
Expand description

JavaScript language plugin for Code Ranker.

Handles .js, .jsx, .mjs, .cjs files via tree-sitter-javascript. Also exposes shared ECMAScript parsing helpers (ecmascript_level, analyze_ecmascript, detect_with_marker) so the TypeScript plugin can reuse the walker/resolver without any copy-paste.

Structs§

JavascriptPlugin
The JavaScript language plugin (handles .js / .jsx / .mjs / .cjs).

Functions§

analyze_ecmascript
Walk workspace, parse every file whose extension is in exts, and build an [api::Graph] of file + external nodes connected by "uses" edges.
detect_with_marker
Return true when workspace contains the given marker file.
ecmascript_is_test_path
ECMAScript test conventions, shared by the JS and TS plugins: *.test.* / *.spec.* files and anything under __tests__, __mocks__, tests or test directories.
ecmascript_level
Build the single “files” Level that both JS and TS plugins expose.
external_package
Extract the package name for a bare (non-relative, non-alias) import specifier: reactreact, lodash/fplodash, @scope/pkg/sub@scope/pkg. Returns None for relative (./, ../) and @/ alias specifiers.