@codebolt/codeboltjs 2.0.4 → 2.0.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/dist/core/messageManager.d.ts +47 -0
- package/dist/core/messageManager.js +128 -0
- package/dist/{modules → core}/websocket.d.ts +5 -0
- package/dist/{modules → core}/websocket.js +15 -10
- package/dist/index.d.ts +98 -68
- package/dist/index.js +51 -4
- package/dist/modules/agent.js +26 -58
- package/dist/modules/browser.d.ts +7 -7
- package/dist/modules/browser.js +75 -195
- package/dist/modules/chat.d.ts +8 -20
- package/dist/modules/chat.js +60 -123
- package/dist/modules/codeparsers.d.ts +32 -3
- package/dist/modules/codeparsers.js +295 -3
- package/dist/modules/codeutils.d.ts +24 -7
- package/dist/modules/codeutils.js +113 -126
- package/dist/modules/crawler.d.ts +1 -16
- package/dist/modules/crawler.js +13 -72
- package/dist/modules/dbmemory.js +12 -28
- package/dist/modules/debug.js +17 -33
- package/dist/modules/docutils.d.ts +1 -4
- package/dist/modules/docutils.js +52 -2
- package/dist/modules/fs.d.ts +47 -1
- package/dist/modules/fs.js +151 -162
- package/dist/modules/git.d.ts +7 -14
- package/dist/modules/git.js +54 -163
- package/dist/modules/history.js +11 -27
- package/dist/modules/llm.js +8 -16
- package/dist/modules/outputparsers.d.ts +36 -4
- package/dist/modules/outputparsers.js +56 -5
- package/dist/modules/project.d.ts +4 -5
- package/dist/modules/project.js +23 -45
- package/dist/modules/state.js +29 -69
- package/dist/modules/task.js +19 -43
- package/dist/modules/terminal.d.ts +3 -2
- package/dist/modules/terminal.js +36 -47
- package/dist/modules/tokenizer.js +15 -31
- package/dist/modules/tools.d.ts +0 -6
- package/dist/modules/tools.js +41 -179
- package/dist/modules/utils.js +22 -0
- package/dist/modules/vectordb.js +30 -62
- package/dist/utils/parse-source-code/index.d.ts +9 -0
- package/dist/utils/parse-source-code/index.js +233 -0
- package/dist/utils/parse-source-code/languageParser.d.ts +8 -0
- package/dist/utils/parse-source-code/languageParser.js +137 -0
- package/dist/utils/parse-source-code/queries/c-sharp.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/c-sharp.js +25 -0
- package/dist/utils/parse-source-code/queries/c.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/c.js +17 -0
- package/dist/utils/parse-source-code/queries/cpp.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/cpp.js +25 -0
- package/dist/utils/parse-source-code/queries/go.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/go.js +29 -0
- package/dist/utils/parse-source-code/queries/index.d.ts +12 -0
- package/dist/utils/parse-source-code/queries/index.js +30 -0
- package/dist/utils/parse-source-code/queries/java.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/java.js +17 -0
- package/dist/utils/parse-source-code/queries/javascript.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/javascript.js +67 -0
- package/dist/utils/parse-source-code/queries/php.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/php.js +17 -0
- package/dist/utils/parse-source-code/queries/python.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/python.js +13 -0
- package/dist/utils/parse-source-code/queries/ruby.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/ruby.js +54 -0
- package/dist/utils/parse-source-code/queries/rust.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/rust.js +18 -0
- package/dist/utils/parse-source-code/queries/swift.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/swift.js +47 -0
- package/dist/utils/parse-source-code/queries/typescript.d.ts +2 -0
- package/dist/utils/parse-source-code/queries/typescript.js +34 -0
- package/dist/utils/parse-source-code/tree-sitter-c.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-c_sharp.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-cpp.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-go.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-java.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-javascript.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-php.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-python.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-ruby.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-rust.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-swift.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-tsx.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter-typescript.wasm +0 -0
- package/dist/utils/parse-source-code/tree-sitter.wasm +0 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +6 -2
- package/dist/utils/editFile.js +0 -30
- /package/dist/{utils/editFile.d.ts → modules/utils.d.ts} +0 -0
- /package/dist/{modules → utils}/toolBox.d.ts +0 -0
- /package/dist/{modules → utils}/toolBox.js +0 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.loadRequiredLanguageParsers = void 0;
|
|
30
|
+
const path = __importStar(require("path"));
|
|
31
|
+
const web_tree_sitter_1 = __importDefault(require("web-tree-sitter"));
|
|
32
|
+
const queries_1 = require("./queries");
|
|
33
|
+
async function loadLanguage(langName) {
|
|
34
|
+
return await web_tree_sitter_1.default.Language.load(path.join(__dirname, `tree-sitter-${langName}.wasm`));
|
|
35
|
+
}
|
|
36
|
+
let isParserInitialized = false;
|
|
37
|
+
async function initializeParser() {
|
|
38
|
+
if (!isParserInitialized) {
|
|
39
|
+
await web_tree_sitter_1.default.init();
|
|
40
|
+
isParserInitialized = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/*
|
|
44
|
+
Using node bindings for tree-sitter is problematic in vscode extensions
|
|
45
|
+
because of incompatibility with electron. Going the .wasm route has the
|
|
46
|
+
advantage of not having to build for multiple architectures.
|
|
47
|
+
|
|
48
|
+
We use web-tree-sitter and tree-sitter-wasms which provides auto-updating prebuilt WASM binaries for tree-sitter's language parsers.
|
|
49
|
+
|
|
50
|
+
This function loads WASM modules for relevant language parsers based on input files:
|
|
51
|
+
1. Extracts unique file extensions
|
|
52
|
+
2. Maps extensions to language names
|
|
53
|
+
3. Loads corresponding WASM files (containing grammar rules)
|
|
54
|
+
4. Uses WASM modules to initialize tree-sitter parsers
|
|
55
|
+
|
|
56
|
+
This approach optimizes performance by loading only necessary parsers once for all relevant files.
|
|
57
|
+
|
|
58
|
+
Sources:
|
|
59
|
+
- https://github.com/tree-sitter/node-tree-sitter/issues/169
|
|
60
|
+
- https://github.com/tree-sitter/node-tree-sitter/issues/168
|
|
61
|
+
- https://github.com/Gregoor/tree-sitter-wasms/blob/main/README.md
|
|
62
|
+
- https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/README.md
|
|
63
|
+
- https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/test/query-test.js
|
|
64
|
+
*/
|
|
65
|
+
async function loadRequiredLanguageParsers(filesToParse) {
|
|
66
|
+
await initializeParser();
|
|
67
|
+
const extensionsToLoad = new Set(filesToParse.map((file) => path.extname(file).toLowerCase().slice(1)));
|
|
68
|
+
const parsers = {};
|
|
69
|
+
for (const ext of extensionsToLoad) {
|
|
70
|
+
let language;
|
|
71
|
+
let query;
|
|
72
|
+
switch (ext) {
|
|
73
|
+
case "js":
|
|
74
|
+
case "jsx":
|
|
75
|
+
language = await loadLanguage("javascript");
|
|
76
|
+
query = language.query(queries_1.javascriptQuery);
|
|
77
|
+
break;
|
|
78
|
+
case "ts":
|
|
79
|
+
language = await loadLanguage("typescript");
|
|
80
|
+
query = language.query(queries_1.typescriptQuery);
|
|
81
|
+
break;
|
|
82
|
+
case "tsx":
|
|
83
|
+
language = await loadLanguage("tsx");
|
|
84
|
+
query = language.query(queries_1.typescriptQuery);
|
|
85
|
+
break;
|
|
86
|
+
case "py":
|
|
87
|
+
language = await loadLanguage("python");
|
|
88
|
+
query = language.query(queries_1.pythonQuery);
|
|
89
|
+
break;
|
|
90
|
+
case "rs":
|
|
91
|
+
language = await loadLanguage("rust");
|
|
92
|
+
query = language.query(queries_1.rustQuery);
|
|
93
|
+
break;
|
|
94
|
+
case "go":
|
|
95
|
+
language = await loadLanguage("go");
|
|
96
|
+
query = language.query(queries_1.goQuery);
|
|
97
|
+
break;
|
|
98
|
+
case "cpp":
|
|
99
|
+
case "hpp":
|
|
100
|
+
language = await loadLanguage("cpp");
|
|
101
|
+
query = language.query(queries_1.cppQuery);
|
|
102
|
+
break;
|
|
103
|
+
case "c":
|
|
104
|
+
case "h":
|
|
105
|
+
language = await loadLanguage("c");
|
|
106
|
+
query = language.query(queries_1.cQuery);
|
|
107
|
+
break;
|
|
108
|
+
case "cs":
|
|
109
|
+
language = await loadLanguage("c_sharp");
|
|
110
|
+
query = language.query(queries_1.csharpQuery);
|
|
111
|
+
break;
|
|
112
|
+
case "rb":
|
|
113
|
+
language = await loadLanguage("ruby");
|
|
114
|
+
query = language.query(queries_1.rubyQuery);
|
|
115
|
+
break;
|
|
116
|
+
case "java":
|
|
117
|
+
language = await loadLanguage("java");
|
|
118
|
+
query = language.query(queries_1.javaQuery);
|
|
119
|
+
break;
|
|
120
|
+
case "php":
|
|
121
|
+
language = await loadLanguage("php");
|
|
122
|
+
query = language.query(queries_1.phpQuery);
|
|
123
|
+
break;
|
|
124
|
+
case "swift":
|
|
125
|
+
language = await loadLanguage("swift");
|
|
126
|
+
query = language.query(queries_1.swiftQuery);
|
|
127
|
+
break;
|
|
128
|
+
default:
|
|
129
|
+
throw new Error(`Unsupported language: ${ext}`);
|
|
130
|
+
}
|
|
131
|
+
const parser = new web_tree_sitter_1.default();
|
|
132
|
+
parser.setLanguage(language);
|
|
133
|
+
parsers[ext] = { parser, query };
|
|
134
|
+
}
|
|
135
|
+
return parsers;
|
|
136
|
+
}
|
|
137
|
+
exports.loadRequiredLanguageParsers = loadRequiredLanguageParsers;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(class_declaration\n name: (identifier) @name.definition.class\n) @definition.class\n\n(interface_declaration\n name: (identifier) @name.definition.interface\n) @definition.interface\n\n(method_declaration\n name: (identifier) @name.definition.method\n) @definition.method\n\n(namespace_declaration\n name: (identifier) @name.definition.module\n) @definition.module\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- class declarations
|
|
5
|
+
- interface declarations
|
|
6
|
+
- method declarations
|
|
7
|
+
- namespace declarations
|
|
8
|
+
*/
|
|
9
|
+
exports.default = `
|
|
10
|
+
(class_declaration
|
|
11
|
+
name: (identifier) @name.definition.class
|
|
12
|
+
) @definition.class
|
|
13
|
+
|
|
14
|
+
(interface_declaration
|
|
15
|
+
name: (identifier) @name.definition.interface
|
|
16
|
+
) @definition.interface
|
|
17
|
+
|
|
18
|
+
(method_declaration
|
|
19
|
+
name: (identifier) @name.definition.method
|
|
20
|
+
) @definition.method
|
|
21
|
+
|
|
22
|
+
(namespace_declaration
|
|
23
|
+
name: (identifier) @name.definition.module
|
|
24
|
+
) @definition.module
|
|
25
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(struct_specifier name: (type_identifier) @name.definition.class body:(_)) @definition.class\n\n(declaration type: (union_specifier name: (type_identifier) @name.definition.class)) @definition.class\n\n(function_declarator declarator: (identifier) @name.definition.function) @definition.function\n\n(type_definition declarator: (type_identifier) @name.definition.type) @definition.type\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- struct declarations
|
|
5
|
+
- union declarations
|
|
6
|
+
- function declarations
|
|
7
|
+
- typedef declarations
|
|
8
|
+
*/
|
|
9
|
+
exports.default = `
|
|
10
|
+
(struct_specifier name: (type_identifier) @name.definition.class body:(_)) @definition.class
|
|
11
|
+
|
|
12
|
+
(declaration type: (union_specifier name: (type_identifier) @name.definition.class)) @definition.class
|
|
13
|
+
|
|
14
|
+
(function_declarator declarator: (identifier) @name.definition.function) @definition.function
|
|
15
|
+
|
|
16
|
+
(type_definition declarator: (type_identifier) @name.definition.type) @definition.type
|
|
17
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(struct_specifier name: (type_identifier) @name.definition.class body:(_)) @definition.class\n\n(declaration type: (union_specifier name: (type_identifier) @name.definition.class)) @definition.class\n\n(function_declarator declarator: (identifier) @name.definition.function) @definition.function\n\n(function_declarator declarator: (field_identifier) @name.definition.function) @definition.function\n\n(function_declarator declarator: (qualified_identifier scope: (namespace_identifier) @scope name: (identifier) @name.definition.method)) @definition.method\n\n(type_definition declarator: (type_identifier) @name.definition.type) @definition.type\n\n(class_specifier name: (type_identifier) @name.definition.class) @definition.class\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- struct declarations
|
|
5
|
+
- union declarations
|
|
6
|
+
- function declarations
|
|
7
|
+
- method declarations (with namespace scope)
|
|
8
|
+
- typedef declarations
|
|
9
|
+
- class declarations
|
|
10
|
+
*/
|
|
11
|
+
exports.default = `
|
|
12
|
+
(struct_specifier name: (type_identifier) @name.definition.class body:(_)) @definition.class
|
|
13
|
+
|
|
14
|
+
(declaration type: (union_specifier name: (type_identifier) @name.definition.class)) @definition.class
|
|
15
|
+
|
|
16
|
+
(function_declarator declarator: (identifier) @name.definition.function) @definition.function
|
|
17
|
+
|
|
18
|
+
(function_declarator declarator: (field_identifier) @name.definition.function) @definition.function
|
|
19
|
+
|
|
20
|
+
(function_declarator declarator: (qualified_identifier scope: (namespace_identifier) @scope name: (identifier) @name.definition.method)) @definition.method
|
|
21
|
+
|
|
22
|
+
(type_definition declarator: (type_identifier) @name.definition.type) @definition.type
|
|
23
|
+
|
|
24
|
+
(class_specifier name: (type_identifier) @name.definition.class) @definition.class
|
|
25
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(\n (comment)* @doc\n .\n (function_declaration\n name: (identifier) @name.definition.function) @definition.function\n (#strip! @doc \"^//\\s*\")\n (#set-adjacent! @doc @definition.function)\n)\n\n(\n (comment)* @doc\n .\n (method_declaration\n name: (field_identifier) @name.definition.method) @definition.method\n (#strip! @doc \"^//\\s*\")\n (#set-adjacent! @doc @definition.method)\n)\n\n(type_spec\n name: (type_identifier) @name.definition.type) @definition.type\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- function declarations (with associated comments)
|
|
5
|
+
- method declarations (with associated comments)
|
|
6
|
+
- type specifications
|
|
7
|
+
*/
|
|
8
|
+
exports.default = `
|
|
9
|
+
(
|
|
10
|
+
(comment)* @doc
|
|
11
|
+
.
|
|
12
|
+
(function_declaration
|
|
13
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
14
|
+
(#strip! @doc "^//\\s*")
|
|
15
|
+
(#set-adjacent! @doc @definition.function)
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
(
|
|
19
|
+
(comment)* @doc
|
|
20
|
+
.
|
|
21
|
+
(method_declaration
|
|
22
|
+
name: (field_identifier) @name.definition.method) @definition.method
|
|
23
|
+
(#strip! @doc "^//\\s*")
|
|
24
|
+
(#set-adjacent! @doc @definition.method)
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
(type_spec
|
|
28
|
+
name: (type_identifier) @name.definition.type) @definition.type
|
|
29
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as phpQuery } from "./php";
|
|
2
|
+
export { default as typescriptQuery } from "./typescript";
|
|
3
|
+
export { default as pythonQuery } from "./python";
|
|
4
|
+
export { default as javascriptQuery } from "./javascript";
|
|
5
|
+
export { default as javaQuery } from "./java";
|
|
6
|
+
export { default as rustQuery } from "./rust";
|
|
7
|
+
export { default as rubyQuery } from "./ruby";
|
|
8
|
+
export { default as cppQuery } from "./cpp";
|
|
9
|
+
export { default as cQuery } from "./c";
|
|
10
|
+
export { default as csharpQuery } from "./c-sharp";
|
|
11
|
+
export { default as goQuery } from "./go";
|
|
12
|
+
export { default as swiftQuery } from "./swift";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.swiftQuery = exports.goQuery = exports.csharpQuery = exports.cQuery = exports.cppQuery = exports.rubyQuery = exports.rustQuery = exports.javaQuery = exports.javascriptQuery = exports.pythonQuery = exports.typescriptQuery = exports.phpQuery = void 0;
|
|
7
|
+
var php_1 = require("./php");
|
|
8
|
+
Object.defineProperty(exports, "phpQuery", { enumerable: true, get: function () { return __importDefault(php_1).default; } });
|
|
9
|
+
var typescript_1 = require("./typescript");
|
|
10
|
+
Object.defineProperty(exports, "typescriptQuery", { enumerable: true, get: function () { return __importDefault(typescript_1).default; } });
|
|
11
|
+
var python_1 = require("./python");
|
|
12
|
+
Object.defineProperty(exports, "pythonQuery", { enumerable: true, get: function () { return __importDefault(python_1).default; } });
|
|
13
|
+
var javascript_1 = require("./javascript");
|
|
14
|
+
Object.defineProperty(exports, "javascriptQuery", { enumerable: true, get: function () { return __importDefault(javascript_1).default; } });
|
|
15
|
+
var java_1 = require("./java");
|
|
16
|
+
Object.defineProperty(exports, "javaQuery", { enumerable: true, get: function () { return __importDefault(java_1).default; } });
|
|
17
|
+
var rust_1 = require("./rust");
|
|
18
|
+
Object.defineProperty(exports, "rustQuery", { enumerable: true, get: function () { return __importDefault(rust_1).default; } });
|
|
19
|
+
var ruby_1 = require("./ruby");
|
|
20
|
+
Object.defineProperty(exports, "rubyQuery", { enumerable: true, get: function () { return __importDefault(ruby_1).default; } });
|
|
21
|
+
var cpp_1 = require("./cpp");
|
|
22
|
+
Object.defineProperty(exports, "cppQuery", { enumerable: true, get: function () { return __importDefault(cpp_1).default; } });
|
|
23
|
+
var c_1 = require("./c");
|
|
24
|
+
Object.defineProperty(exports, "cQuery", { enumerable: true, get: function () { return __importDefault(c_1).default; } });
|
|
25
|
+
var c_sharp_1 = require("./c-sharp");
|
|
26
|
+
Object.defineProperty(exports, "csharpQuery", { enumerable: true, get: function () { return __importDefault(c_sharp_1).default; } });
|
|
27
|
+
var go_1 = require("./go");
|
|
28
|
+
Object.defineProperty(exports, "goQuery", { enumerable: true, get: function () { return __importDefault(go_1).default; } });
|
|
29
|
+
var swift_1 = require("./swift");
|
|
30
|
+
Object.defineProperty(exports, "swiftQuery", { enumerable: true, get: function () { return __importDefault(swift_1).default; } });
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(class_declaration\n name: (identifier) @name.definition.class) @definition.class\n\n(method_declaration\n name: (identifier) @name.definition.method) @definition.method\n\n(interface_declaration\n name: (identifier) @name.definition.interface) @definition.interface\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- class declarations
|
|
5
|
+
- method declarations
|
|
6
|
+
- interface declarations
|
|
7
|
+
*/
|
|
8
|
+
exports.default = `
|
|
9
|
+
(class_declaration
|
|
10
|
+
name: (identifier) @name.definition.class) @definition.class
|
|
11
|
+
|
|
12
|
+
(method_declaration
|
|
13
|
+
name: (identifier) @name.definition.method) @definition.method
|
|
14
|
+
|
|
15
|
+
(interface_declaration
|
|
16
|
+
name: (identifier) @name.definition.interface) @definition.interface
|
|
17
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(\n (comment)* @doc\n .\n (method_definition\n name: (property_identifier) @name) @definition.method\n (#not-eq? @name \"constructor\")\n (#strip! @doc \"^[\\s\\*/]+|^[\\s\\*/]$\")\n (#select-adjacent! @doc @definition.method)\n)\n\n(\n (comment)* @doc\n .\n [\n (class\n name: (_) @name)\n (class_declaration\n name: (_) @name)\n ] @definition.class\n (#strip! @doc \"^[\\s\\*/]+|^[\\s\\*/]$\")\n (#select-adjacent! @doc @definition.class)\n)\n\n(\n (comment)* @doc\n .\n [\n (function_declaration\n name: (identifier) @name)\n (generator_function_declaration\n name: (identifier) @name)\n ] @definition.function\n (#strip! @doc \"^[\\s\\*/]+|^[\\s\\*/]$\")\n (#select-adjacent! @doc @definition.function)\n)\n\n(\n (comment)* @doc\n .\n (lexical_declaration\n (variable_declarator\n name: (identifier) @name\n value: [(arrow_function) (function_expression)]) @definition.function)\n (#strip! @doc \"^[\\s\\*/]+|^[\\s\\*/]$\")\n (#select-adjacent! @doc @definition.function)\n)\n\n(\n (comment)* @doc\n .\n (variable_declaration\n (variable_declarator\n name: (identifier) @name\n value: [(arrow_function) (function_expression)]) @definition.function)\n (#strip! @doc \"^[\\s\\*/]+|^[\\s\\*/]$\")\n (#select-adjacent! @doc @definition.function)\n)\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- class definitions
|
|
5
|
+
- method definitions
|
|
6
|
+
- named function declarations
|
|
7
|
+
- arrow functions and function expressions assigned to variables
|
|
8
|
+
*/
|
|
9
|
+
exports.default = `
|
|
10
|
+
(
|
|
11
|
+
(comment)* @doc
|
|
12
|
+
.
|
|
13
|
+
(method_definition
|
|
14
|
+
name: (property_identifier) @name) @definition.method
|
|
15
|
+
(#not-eq? @name "constructor")
|
|
16
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
17
|
+
(#select-adjacent! @doc @definition.method)
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
(
|
|
21
|
+
(comment)* @doc
|
|
22
|
+
.
|
|
23
|
+
[
|
|
24
|
+
(class
|
|
25
|
+
name: (_) @name)
|
|
26
|
+
(class_declaration
|
|
27
|
+
name: (_) @name)
|
|
28
|
+
] @definition.class
|
|
29
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
30
|
+
(#select-adjacent! @doc @definition.class)
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
(
|
|
34
|
+
(comment)* @doc
|
|
35
|
+
.
|
|
36
|
+
[
|
|
37
|
+
(function_declaration
|
|
38
|
+
name: (identifier) @name)
|
|
39
|
+
(generator_function_declaration
|
|
40
|
+
name: (identifier) @name)
|
|
41
|
+
] @definition.function
|
|
42
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
43
|
+
(#select-adjacent! @doc @definition.function)
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
(
|
|
47
|
+
(comment)* @doc
|
|
48
|
+
.
|
|
49
|
+
(lexical_declaration
|
|
50
|
+
(variable_declarator
|
|
51
|
+
name: (identifier) @name
|
|
52
|
+
value: [(arrow_function) (function_expression)]) @definition.function)
|
|
53
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
54
|
+
(#select-adjacent! @doc @definition.function)
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
(
|
|
58
|
+
(comment)* @doc
|
|
59
|
+
.
|
|
60
|
+
(variable_declaration
|
|
61
|
+
(variable_declarator
|
|
62
|
+
name: (identifier) @name
|
|
63
|
+
value: [(arrow_function) (function_expression)]) @definition.function)
|
|
64
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
65
|
+
(#select-adjacent! @doc @definition.function)
|
|
66
|
+
)
|
|
67
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(class_declaration\n name: (name) @name.definition.class) @definition.class\n\n(function_definition\n name: (name) @name.definition.function) @definition.function\n\n(method_declaration\n name: (name) @name.definition.function) @definition.function\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- class declarations
|
|
5
|
+
- function definitions
|
|
6
|
+
- method declarations
|
|
7
|
+
*/
|
|
8
|
+
exports.default = `
|
|
9
|
+
(class_declaration
|
|
10
|
+
name: (name) @name.definition.class) @definition.class
|
|
11
|
+
|
|
12
|
+
(function_definition
|
|
13
|
+
name: (name) @name.definition.function) @definition.function
|
|
14
|
+
|
|
15
|
+
(method_declaration
|
|
16
|
+
name: (name) @name.definition.function) @definition.function
|
|
17
|
+
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- class definitions
|
|
5
|
+
- function definitions
|
|
6
|
+
*/
|
|
7
|
+
exports.default = `
|
|
8
|
+
(class_definition
|
|
9
|
+
name: (identifier) @name.definition.class) @definition.class
|
|
10
|
+
|
|
11
|
+
(function_definition
|
|
12
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
13
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(\n (comment)* @doc\n .\n [\n (method\n name: (_) @name.definition.method) @definition.method\n (singleton_method\n name: (_) @name.definition.method) @definition.method\n ]\n (#strip! @doc \"^#\\s*\")\n (#select-adjacent! @doc @definition.method)\n)\n\n(alias\n name: (_) @name.definition.method) @definition.method\n\n(\n (comment)* @doc\n .\n [\n (class\n name: [\n (constant) @name.definition.class\n (scope_resolution\n name: (_) @name.definition.class)\n ]) @definition.class\n (singleton_class\n value: [\n (constant) @name.definition.class\n (scope_resolution\n name: (_) @name.definition.class)\n ]) @definition.class\n ]\n (#strip! @doc \"^#\\s*\")\n (#select-adjacent! @doc @definition.class)\n)\n\n(\n (module\n name: [\n (constant) @name.definition.module\n (scope_resolution\n name: (_) @name.definition.module)\n ]) @definition.module\n)\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- method definitions (including singleton methods and aliases, with associated comments)
|
|
5
|
+
- class definitions (including singleton classes, with associated comments)
|
|
6
|
+
- module definitions
|
|
7
|
+
*/
|
|
8
|
+
exports.default = `
|
|
9
|
+
(
|
|
10
|
+
(comment)* @doc
|
|
11
|
+
.
|
|
12
|
+
[
|
|
13
|
+
(method
|
|
14
|
+
name: (_) @name.definition.method) @definition.method
|
|
15
|
+
(singleton_method
|
|
16
|
+
name: (_) @name.definition.method) @definition.method
|
|
17
|
+
]
|
|
18
|
+
(#strip! @doc "^#\\s*")
|
|
19
|
+
(#select-adjacent! @doc @definition.method)
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
(alias
|
|
23
|
+
name: (_) @name.definition.method) @definition.method
|
|
24
|
+
|
|
25
|
+
(
|
|
26
|
+
(comment)* @doc
|
|
27
|
+
.
|
|
28
|
+
[
|
|
29
|
+
(class
|
|
30
|
+
name: [
|
|
31
|
+
(constant) @name.definition.class
|
|
32
|
+
(scope_resolution
|
|
33
|
+
name: (_) @name.definition.class)
|
|
34
|
+
]) @definition.class
|
|
35
|
+
(singleton_class
|
|
36
|
+
value: [
|
|
37
|
+
(constant) @name.definition.class
|
|
38
|
+
(scope_resolution
|
|
39
|
+
name: (_) @name.definition.class)
|
|
40
|
+
]) @definition.class
|
|
41
|
+
]
|
|
42
|
+
(#strip! @doc "^#\\s*")
|
|
43
|
+
(#select-adjacent! @doc @definition.class)
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
(
|
|
47
|
+
(module
|
|
48
|
+
name: [
|
|
49
|
+
(constant) @name.definition.module
|
|
50
|
+
(scope_resolution
|
|
51
|
+
name: (_) @name.definition.module)
|
|
52
|
+
]) @definition.module
|
|
53
|
+
)
|
|
54
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(struct_item\n name: (type_identifier) @name.definition.class) @definition.class\n\n(declaration_list\n (function_item\n name: (identifier) @name.definition.method)) @definition.method\n\n(function_item\n name: (identifier) @name.definition.function) @definition.function\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- struct definitions
|
|
5
|
+
- method definitions
|
|
6
|
+
- function definitions
|
|
7
|
+
*/
|
|
8
|
+
exports.default = `
|
|
9
|
+
(struct_item
|
|
10
|
+
name: (type_identifier) @name.definition.class) @definition.class
|
|
11
|
+
|
|
12
|
+
(declaration_list
|
|
13
|
+
(function_item
|
|
14
|
+
name: (identifier) @name.definition.method)) @definition.method
|
|
15
|
+
|
|
16
|
+
(function_item
|
|
17
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
18
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(class_declaration\n name: (type_identifier) @name) @definition.class\n\n(protocol_declaration\n name: (type_identifier) @name) @definition.interface\n\n(class_declaration\n (class_body\n [\n (function_declaration\n name: (simple_identifier) @name\n )\n (subscript_declaration\n (parameter (simple_identifier) @name)\n )\n (init_declaration \"init\" @name)\n (deinit_declaration \"deinit\" @name)\n ]\n )\n) @definition.method\n\n(class_declaration\n (class_body\n [\n (property_declaration\n (pattern (simple_identifier) @name)\n )\n ]\n )\n) @definition.property\n\n(property_declaration\n (pattern (simple_identifier) @name)\n) @definition.property\n\n(function_declaration\n name: (simple_identifier) @name) @definition.function\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- class declarations
|
|
5
|
+
- method declarations (including initializers and deinitializers)
|
|
6
|
+
- property declarations
|
|
7
|
+
- function declarations
|
|
8
|
+
*/
|
|
9
|
+
exports.default = `
|
|
10
|
+
(class_declaration
|
|
11
|
+
name: (type_identifier) @name) @definition.class
|
|
12
|
+
|
|
13
|
+
(protocol_declaration
|
|
14
|
+
name: (type_identifier) @name) @definition.interface
|
|
15
|
+
|
|
16
|
+
(class_declaration
|
|
17
|
+
(class_body
|
|
18
|
+
[
|
|
19
|
+
(function_declaration
|
|
20
|
+
name: (simple_identifier) @name
|
|
21
|
+
)
|
|
22
|
+
(subscript_declaration
|
|
23
|
+
(parameter (simple_identifier) @name)
|
|
24
|
+
)
|
|
25
|
+
(init_declaration "init" @name)
|
|
26
|
+
(deinit_declaration "deinit" @name)
|
|
27
|
+
]
|
|
28
|
+
)
|
|
29
|
+
) @definition.method
|
|
30
|
+
|
|
31
|
+
(class_declaration
|
|
32
|
+
(class_body
|
|
33
|
+
[
|
|
34
|
+
(property_declaration
|
|
35
|
+
(pattern (simple_identifier) @name)
|
|
36
|
+
)
|
|
37
|
+
]
|
|
38
|
+
)
|
|
39
|
+
) @definition.property
|
|
40
|
+
|
|
41
|
+
(property_declaration
|
|
42
|
+
(pattern (simple_identifier) @name)
|
|
43
|
+
) @definition.property
|
|
44
|
+
|
|
45
|
+
(function_declaration
|
|
46
|
+
name: (simple_identifier) @name) @definition.function
|
|
47
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n(function_signature\n name: (identifier) @name.definition.function) @definition.function\n\n(method_signature\n name: (property_identifier) @name.definition.method) @definition.method\n\n(abstract_method_signature\n name: (property_identifier) @name.definition.method) @definition.method\n\n(abstract_class_declaration\n name: (type_identifier) @name.definition.class) @definition.class\n\n(module\n name: (identifier) @name.definition.module) @definition.module\n\n(function_declaration\n name: (identifier) @name.definition.function) @definition.function\n\n(method_definition\n name: (property_identifier) @name.definition.method) @definition.method\n\n(class_declaration\n name: (type_identifier) @name.definition.class) @definition.class\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
- function signatures and declarations
|
|
5
|
+
- method signatures and definitions
|
|
6
|
+
- abstract method signatures
|
|
7
|
+
- class declarations (including abstract classes)
|
|
8
|
+
- module declarations
|
|
9
|
+
*/
|
|
10
|
+
exports.default = `
|
|
11
|
+
(function_signature
|
|
12
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
13
|
+
|
|
14
|
+
(method_signature
|
|
15
|
+
name: (property_identifier) @name.definition.method) @definition.method
|
|
16
|
+
|
|
17
|
+
(abstract_method_signature
|
|
18
|
+
name: (property_identifier) @name.definition.method) @definition.method
|
|
19
|
+
|
|
20
|
+
(abstract_class_declaration
|
|
21
|
+
name: (type_identifier) @name.definition.class) @definition.class
|
|
22
|
+
|
|
23
|
+
(module
|
|
24
|
+
name: (identifier) @name.definition.module) @definition.module
|
|
25
|
+
|
|
26
|
+
(function_declaration
|
|
27
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
28
|
+
|
|
29
|
+
(method_definition
|
|
30
|
+
name: (property_identifier) @name.definition.method) @definition.method
|
|
31
|
+
|
|
32
|
+
(class_declaration
|
|
33
|
+
name: (type_identifier) @name.definition.class) @definition.class
|
|
34
|
+
`;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|