codecane 1.0.265 → 1.0.268
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/background-process-manager.d.ts +1 -1
- package/dist/background-process-manager.js +3 -3
- package/dist/browser-runner.d.ts +1 -1
- package/dist/browser-runner.js +4 -4
- package/dist/chat-storage.d.ts +1 -1
- package/dist/chat-storage.js +1 -1
- package/dist/checkpoints/checkpoint-manager.d.ts +1 -1
- package/dist/checkpoints/checkpoint-manager.js +1 -1
- package/dist/cli-handlers/api-key.d.ts +1 -1
- package/dist/cli-handlers/api-key.js +1 -1
- package/dist/cli-handlers/diff.d.ts +1 -1
- package/dist/cli-handlers/inititalization-flow.js +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +2 -2
- package/dist/client.d.ts +7 -7
- package/dist/client.js +9 -9
- package/dist/credentials.d.ts +1 -1
- package/dist/credentials.js +2 -2
- package/dist/dev-process-manager.d.ts +1 -1
- package/dist/dev-process-manager.js +1 -1
- package/dist/index.js +1 -1
- package/dist/menu.d.ts +1 -1
- package/dist/menu.js +1 -1
- package/dist/project-files.d.ts +2 -2
- package/dist/project-files.js +5 -5
- package/dist/startup-process-handler.d.ts +1 -1
- package/dist/tool-handlers.d.ts +2 -2
- package/dist/tool-handlers.js +4 -4
- package/dist/types.d.ts +1 -1
- package/dist/utils/__tests__/tool-renderers.test.js +1 -1
- package/dist/utils/__tests__/xml-stream-parser.test.js +1 -1
- package/dist/utils/analytics.d.ts +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/terminal.js +9 -14
- package/dist/utils/terminal.js.map +1 -1
- package/dist/utils/tool-renderers.d.ts +1 -1
- package/dist/utils/tool-renderers.js +1 -1
- package/dist/utils/xml-stream-parser.d.ts +1 -1
- package/dist/utils/xml-stream-parser.js +2 -2
- package/dist/web-scraper.js +1 -1
- package/dist/workers/project-context.js +1 -1
- package/package.json +38 -19
- package/dist/code-map/languages.d.ts +0 -13
- package/dist/code-map/languages.d.ts.map +0 -1
- package/dist/code-map/languages.js +0 -129
- package/dist/code-map/languages.js.map +0 -1
- package/dist/code-map/parse.d.ts +0 -12
- package/dist/code-map/parse.d.ts.map +0 -1
- package/dist/code-map/parse.js +0 -127
- package/dist/code-map/parse.js.map +0 -1
- package/dist/code-map/test-langs/test.d.ts +0 -12
- package/dist/code-map/test-langs/test.d.ts.map +0 -1
- package/dist/code-map/test-langs/test.js +0 -23
- package/dist/code-map/test-langs/test.js.map +0 -1
- package/dist/code-map/tree-sitter-queries/readme.md +0 -23
- package/dist/code-map/tree-sitter-queries/tree-sitter-c-tags.scm +0 -11
- package/dist/code-map/tree-sitter-queries/tree-sitter-c_sharp-tags.scm +0 -13
- package/dist/code-map/tree-sitter-queries/tree-sitter-cpp-tags.scm +0 -17
- package/dist/code-map/tree-sitter-queries/tree-sitter-go-tags.scm +0 -26
- package/dist/code-map/tree-sitter-queries/tree-sitter-java-tags.scm +0 -19
- package/dist/code-map/tree-sitter-queries/tree-sitter-javascript-tags.scm +0 -15
- package/dist/code-map/tree-sitter-queries/tree-sitter-php-tags.scm +0 -26
- package/dist/code-map/tree-sitter-queries/tree-sitter-python-tags.scm +0 -9
- package/dist/code-map/tree-sitter-queries/tree-sitter-ruby-tags.scm +0 -58
- package/dist/code-map/tree-sitter-queries/tree-sitter-rust-tags.scm +0 -26
- package/dist/code-map/tree-sitter-queries/tree-sitter-typescript-tags.scm +0 -15
- package/dist/code-map/tsconfig.tsbuildinfo +0 -1
- package/dist/common/actions.d.ts +0 -2589
- package/dist/common/actions.js +0 -143
- package/dist/common/actions.js.map +0 -1
- package/dist/common/analytics.d.ts +0 -4
- package/dist/common/analytics.js +0 -40
- package/dist/common/analytics.js.map +0 -1
- package/dist/common/api-keys/constants.d.ts +0 -8
- package/dist/common/api-keys/constants.js +0 -26
- package/dist/common/api-keys/constants.js.map +0 -1
- package/dist/common/api-keys/crypto.d.ts +0 -24
- package/dist/common/api-keys/crypto.js +0 -186
- package/dist/common/api-keys/crypto.js.map +0 -1
- package/dist/common/browser-actions.d.ts +0 -4415
- package/dist/common/browser-actions.js +0 -343
- package/dist/common/browser-actions.js.map +0 -1
- package/dist/common/constants/analytics-events.d.ts +0 -19
- package/dist/common/constants/analytics-events.js +0 -27
- package/dist/common/constants/analytics-events.js.map +0 -1
- package/dist/common/constants/grant-priorities.d.ts +0 -2
- package/dist/common/constants/grant-priorities.js +0 -10
- package/dist/common/constants/grant-priorities.js.map +0 -1
- package/dist/common/constants/tools.d.ts +0 -16
- package/dist/common/constants/tools.js +0 -44
- package/dist/common/constants/tools.js.map +0 -1
- package/dist/common/constants.d.ts +0 -134
- package/dist/common/constants.js +0 -180
- package/dist/common/constants.js.map +0 -1
- package/dist/common/db/drizzle.config.d.ts +0 -2
- package/dist/common/db/drizzle.config.js +0 -17
- package/dist/common/db/drizzle.config.js.map +0 -1
- package/dist/common/db/env.d.mts +0 -1
- package/dist/common/db/env.mjs +0 -26
- package/dist/common/db/env.mjs.map +0 -1
- package/dist/common/db/index.d.ts +0 -6
- package/dist/common/db/index.js +0 -35
- package/dist/common/db/index.js.map +0 -1
- package/dist/common/db/schema.d.ts +0 -1419
- package/dist/common/db/schema.js +0 -175
- package/dist/common/db/schema.js.map +0 -1
- package/dist/common/db/transaction.d.ts +0 -12
- package/dist/common/db/transaction.js +0 -36
- package/dist/common/db/transaction.js.map +0 -1
- package/dist/common/env.d.mts +0 -1
- package/dist/common/env.mjs +0 -40
- package/dist/common/env.mjs.map +0 -1
- package/dist/common/json-config/__tests__/stringify-schema.test.d.ts +0 -1
- package/dist/common/json-config/__tests__/stringify-schema.test.js +0 -66
- package/dist/common/json-config/__tests__/stringify-schema.test.js.map +0 -1
- package/dist/common/json-config/constants.d.ts +0 -82
- package/dist/common/json-config/constants.js +0 -48
- package/dist/common/json-config/constants.js.map +0 -1
- package/dist/common/json-config/parser.d.ts +0 -7
- package/dist/common/json-config/parser.js +0 -51
- package/dist/common/json-config/parser.js.map +0 -1
- package/dist/common/json-config/stringify-schema.d.ts +0 -9
- package/dist/common/json-config/stringify-schema.js +0 -131
- package/dist/common/json-config/stringify-schema.js.map +0 -1
- package/dist/common/project-file-tree.d.ts +0 -11
- package/dist/common/project-file-tree.js +0 -200
- package/dist/common/project-file-tree.js.map +0 -1
- package/dist/common/types/agent-state.d.ts +0 -464
- package/dist/common/types/agent-state.js +0 -32
- package/dist/common/types/agent-state.js.map +0 -1
- package/dist/common/types/grant.d.ts +0 -2
- package/dist/common/types/grant.js +0 -10
- package/dist/common/types/grant.js.map +0 -1
- package/dist/common/types/message.d.ts +0 -311
- package/dist/common/types/message.js +0 -54
- package/dist/common/types/message.js.map +0 -1
- package/dist/common/types/referral.d.ts +0 -2
- package/dist/common/types/referral.js +0 -5
- package/dist/common/types/referral.js.map +0 -1
- package/dist/common/types/tools.d.ts +0 -5
- package/dist/common/types/tools.js +0 -3
- package/dist/common/types/tools.js.map +0 -1
- package/dist/common/types/usage.d.ts +0 -40
- package/dist/common/types/usage.js +0 -15
- package/dist/common/types/usage.js.map +0 -1
- package/dist/common/util/__tests__/messages.test.d.ts +0 -1
- package/dist/common/util/__tests__/messages.test.js +0 -70
- package/dist/common/util/__tests__/messages.test.js.map +0 -1
- package/dist/common/util/__tests__/saxy.test.d.ts +0 -1
- package/dist/common/util/__tests__/saxy.test.js +0 -262
- package/dist/common/util/__tests__/saxy.test.js.map +0 -1
- package/dist/common/util/__tests__/string.test.d.ts +0 -1
- package/dist/common/util/__tests__/string.test.js +0 -82
- package/dist/common/util/__tests__/string.test.js.map +0 -1
- package/dist/common/util/array.d.ts +0 -6
- package/dist/common/util/array.js +0 -32
- package/dist/common/util/array.js.map +0 -1
- package/dist/common/util/changes.d.ts +0 -7
- package/dist/common/util/changes.js +0 -78
- package/dist/common/util/changes.js.map +0 -1
- package/dist/common/util/credentials.d.ts +0 -25
- package/dist/common/util/credentials.js +0 -24
- package/dist/common/util/credentials.js.map +0 -1
- package/dist/common/util/currency.d.ts +0 -14
- package/dist/common/util/currency.js +0 -23
- package/dist/common/util/currency.js.map +0 -1
- package/dist/common/util/dates.d.ts +0 -10
- package/dist/common/util/dates.js +0 -22
- package/dist/common/util/dates.js.map +0 -1
- package/dist/common/util/file.d.ts +0 -159
- package/dist/common/util/file.js +0 -192
- package/dist/common/util/file.js.map +0 -1
- package/dist/common/util/git.d.ts +0 -6
- package/dist/common/util/git.js +0 -81
- package/dist/common/util/git.js.map +0 -1
- package/dist/common/util/logger.d.ts +0 -8
- package/dist/common/util/logger.js +0 -52
- package/dist/common/util/logger.js.map +0 -1
- package/dist/common/util/lru-cache.d.ts +0 -30
- package/dist/common/util/lru-cache.js +0 -68
- package/dist/common/util/lru-cache.js.map +0 -1
- package/dist/common/util/messages.d.ts +0 -9
- package/dist/common/util/messages.js +0 -69
- package/dist/common/util/messages.js.map +0 -1
- package/dist/common/util/min-heap.d.ts +0 -15
- package/dist/common/util/min-heap.js +0 -73
- package/dist/common/util/min-heap.js.map +0 -1
- package/dist/common/util/object.d.ts +0 -18
- package/dist/common/util/object.js +0 -91
- package/dist/common/util/object.js.map +0 -1
- package/dist/common/util/patch.d.ts +0 -1
- package/dist/common/util/patch.js +0 -215
- package/dist/common/util/patch.js.map +0 -1
- package/dist/common/util/promise.d.ts +0 -17
- package/dist/common/util/promise.js +0 -80
- package/dist/common/util/promise.js.map +0 -1
- package/dist/common/util/referral.d.ts +0 -1
- package/dist/common/util/referral.js +0 -6
- package/dist/common/util/referral.js.map +0 -1
- package/dist/common/util/saxy.d.ts +0 -166
- package/dist/common/util/saxy.js +0 -473
- package/dist/common/util/saxy.js.map +0 -1
- package/dist/common/util/string.d.ts +0 -61
- package/dist/common/util/string.js +0 -220
- package/dist/common/util/string.js.map +0 -1
- package/dist/common/util/stripe.d.ts +0 -3
- package/dist/common/util/stripe.js +0 -22
- package/dist/common/util/stripe.js.map +0 -1
- package/dist/common/util/sync-failure.d.ts +0 -1
- package/dist/common/util/sync-failure.js +0 -57
- package/dist/common/util/sync-failure.js.map +0 -1
- package/dist/common/websockets/websocket-client.d.ts +0 -42
- package/dist/common/websockets/websocket-client.js +0 -216
- package/dist/common/websockets/websocket-client.js.map +0 -1
- package/dist/common/websockets/websocket-schema.d.ts +0 -4866
- package/dist/common/websockets/websocket-schema.js +0 -55
- package/dist/common/websockets/websocket-schema.js.map +0 -1
- package/dist/utils/__tests__/response-example-4-files.txt +0 -621
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codecane",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.268",
|
|
4
4
|
"description": "AI dev assistant",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,28 +9,47 @@
|
|
|
9
9
|
"codecane": "dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
|
-
"
|
|
13
|
-
"build": "tsc && tsc-alias",
|
|
14
|
-
"postbuild": "mkdir -p dist/common && cp -r ../common/dist/* dist/common && mkdir -p dist/code-map && cp -r ../packages/code-map/dist/* dist/code-map && mkdir -p dist/utils/__tests__ && cp -r src/utils/__tests__/*.txt dist/utils/__tests__/ && tsc-alias",
|
|
12
|
+
"build": "nx exec -- bun run quick-build",
|
|
15
13
|
"quick-build": "tsc && tsc-alias",
|
|
16
14
|
"clean": "rm -rf dist && (rm tsconfig.tsbuildinfo || true)",
|
|
17
|
-
"prepublishOnly": "
|
|
15
|
+
"prepublishOnly": "nx build && bun run clean-package.js",
|
|
18
16
|
"postpublish": "echo \"const fs=require('fs');fs.copyFileSync('temp.package.json','package.json');fs.unlinkSync('temp.package.json');\" | bun run -",
|
|
19
|
-
"format": "prettier --write \"**/*.{ts,tsx,json,md}\"",
|
|
20
|
-
"test": "jest",
|
|
21
|
-
"start
|
|
22
|
-
"start": "
|
|
23
|
-
"start-dir": "bun run with-env -- ts-node src/index.ts",
|
|
17
|
+
"format": "nx exec -- prettier --write \"**/*.{ts,tsx,json,md}\"",
|
|
18
|
+
"test": "nx exec -- jest",
|
|
19
|
+
"start": "nx exec -- ts-node src/index.ts ..",
|
|
20
|
+
"start-dir": "nx exec -- ts-node src/index.ts",
|
|
24
21
|
"with-env": "env-cmd -f ./loadEnv.js",
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
"typecheck": "nx exec -- tsc --noEmit && tsc-alias"
|
|
23
|
+
},
|
|
24
|
+
"nx": {
|
|
25
|
+
"targets": {
|
|
26
|
+
"build": {
|
|
27
|
+
"cache": true,
|
|
28
|
+
"inputs": [
|
|
29
|
+
"{projectRoot}/src/**/*.ts",
|
|
30
|
+
"{projectRoot}/tsconfig.json"
|
|
31
|
+
],
|
|
32
|
+
"outputs": [
|
|
33
|
+
"{projectRoot}/dist"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"test": {
|
|
37
|
+
"cache": true,
|
|
38
|
+
"inputs": [
|
|
39
|
+
"default",
|
|
40
|
+
"^default"
|
|
41
|
+
],
|
|
42
|
+
"outputs": []
|
|
43
|
+
},
|
|
44
|
+
"typecheck": {
|
|
45
|
+
"cache": true,
|
|
46
|
+
"inputs": [
|
|
47
|
+
"{projectRoot}/src/**/*.ts",
|
|
48
|
+
"{projectRoot}/tsconfig.json"
|
|
49
|
+
],
|
|
50
|
+
"outputs": []
|
|
51
|
+
}
|
|
52
|
+
}
|
|
34
53
|
},
|
|
35
54
|
"files": [
|
|
36
55
|
"dist",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Parser from 'tree-sitter';
|
|
2
|
-
import { Query } from 'tree-sitter';
|
|
3
|
-
interface LanguageConfig {
|
|
4
|
-
language: any;
|
|
5
|
-
extensions: string[];
|
|
6
|
-
packageName: string;
|
|
7
|
-
queryFile: string;
|
|
8
|
-
parser: Parser;
|
|
9
|
-
query: Query;
|
|
10
|
-
}
|
|
11
|
-
export declare function getLanguageConfig(filePath: string): Promise<LanguageConfig | undefined>;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../languages.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAInC,UAAU,cAAc;IACtB,QAAQ,EAAE,GAAG,CAAA;IACb,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,KAAK,CAAA;CACb;AAkED,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAwCrC"}
|
|
@@ -1,129 +0,0 @@
|
|
|
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.getLanguageConfig = getLanguageConfig;
|
|
30
|
-
const fs = __importStar(require("fs"));
|
|
31
|
-
const path = __importStar(require("path"));
|
|
32
|
-
const tree_sitter_1 = __importDefault(require("tree-sitter"));
|
|
33
|
-
const tree_sitter_2 = require("tree-sitter");
|
|
34
|
-
const parse_1 = require("./parse");
|
|
35
|
-
const languageConfigs = [
|
|
36
|
-
{
|
|
37
|
-
extensions: ['.ts'],
|
|
38
|
-
queryFile: 'tree-sitter-typescript-tags.scm',
|
|
39
|
-
packageName: 'tree-sitter-typescript',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
extensions: ['.tsx'],
|
|
43
|
-
queryFile: 'tree-sitter-typescript-tags.scm',
|
|
44
|
-
packageName: 'tree-sitter-typescript',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
extensions: ['.js', '.jsx'],
|
|
48
|
-
queryFile: 'tree-sitter-javascript-tags.scm',
|
|
49
|
-
packageName: 'tree-sitter-javascript',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
extensions: ['.py'],
|
|
53
|
-
queryFile: 'tree-sitter-python-tags.scm',
|
|
54
|
-
packageName: 'tree-sitter-python',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
extensions: ['.java'],
|
|
58
|
-
queryFile: 'tree-sitter-java-tags.scm',
|
|
59
|
-
packageName: 'tree-sitter-java',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
extensions: ['.cs'],
|
|
63
|
-
queryFile: 'tree-sitter-c_sharp-tags.scm',
|
|
64
|
-
packageName: 'tree-sitter-c-sharp',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
extensions: ['.c', '.h'],
|
|
68
|
-
queryFile: 'tree-sitter-c-tags.scm',
|
|
69
|
-
packageName: 'tree-sitter-c',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
extensions: ['.cpp', '.hpp'],
|
|
73
|
-
queryFile: 'tree-sitter-cpp-tags.scm',
|
|
74
|
-
packageName: 'tree-sitter-cpp',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
extensions: ['.rs'],
|
|
78
|
-
queryFile: 'tree-sitter-rust-tags.scm',
|
|
79
|
-
packageName: 'tree-sitter-rust',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
extensions: ['.rb'],
|
|
83
|
-
queryFile: 'tree-sitter-ruby-tags.scm',
|
|
84
|
-
packageName: 'tree-sitter-ruby',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
extensions: ['.go'],
|
|
88
|
-
queryFile: 'tree-sitter-go-tags.scm',
|
|
89
|
-
packageName: 'tree-sitter-go',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
extensions: ['.php'],
|
|
93
|
-
queryFile: 'tree-sitter-php-tags.scm',
|
|
94
|
-
packageName: 'tree-sitter-php',
|
|
95
|
-
},
|
|
96
|
-
];
|
|
97
|
-
async function getLanguageConfig(filePath) {
|
|
98
|
-
const extension = path.extname(filePath);
|
|
99
|
-
const config = languageConfigs.find((config) => config.extensions.includes(extension));
|
|
100
|
-
if (!config)
|
|
101
|
-
return undefined;
|
|
102
|
-
if (!config.parser) {
|
|
103
|
-
const parser = new tree_sitter_1.default();
|
|
104
|
-
try {
|
|
105
|
-
const languageModule = await Promise.resolve(`${config.packageName}`).then(s => __importStar(require(s)));
|
|
106
|
-
const language = extension === '.ts'
|
|
107
|
-
? languageModule.typescript
|
|
108
|
-
: extension === '.tsx'
|
|
109
|
-
? languageModule.tsx
|
|
110
|
-
: extension === '.php'
|
|
111
|
-
? languageModule.php
|
|
112
|
-
: languageModule;
|
|
113
|
-
parser.setLanguage(language);
|
|
114
|
-
const queryFilePath = path.join(__dirname, 'tree-sitter-queries', config.queryFile);
|
|
115
|
-
const queryString = fs.readFileSync(queryFilePath, 'utf8');
|
|
116
|
-
config.query = new tree_sitter_2.Query(parser.getLanguage(), queryString);
|
|
117
|
-
config.parser = parser;
|
|
118
|
-
config.language = language;
|
|
119
|
-
}
|
|
120
|
-
catch (e) {
|
|
121
|
-
if (parse_1.DEBUG_PARSING) {
|
|
122
|
-
console.log('error', filePath, e);
|
|
123
|
-
}
|
|
124
|
-
return undefined;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return config;
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=languages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../languages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,8CA0CC;AA1HD,uCAAwB;AACxB,2CAA4B;AAC5B,8DAAgC;AAChC,6CAAmC;AAEnC,mCAAuC;AAWvC,MAAM,eAAe,GACnB;IACE;QACE,UAAU,EAAE,CAAC,KAAK,CAAC;QACnB,SAAS,EAAE,iCAAiC;QAC5C,WAAW,EAAE,wBAAwB;KACtC;IACD;QACE,UAAU,EAAE,CAAC,MAAM,CAAC;QACpB,SAAS,EAAE,iCAAiC;QAC5C,WAAW,EAAE,wBAAwB;KACtC;IACD;QACE,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;QAC3B,SAAS,EAAE,iCAAiC;QAC5C,WAAW,EAAE,wBAAwB;KACtC;IACD;QACE,UAAU,EAAE,CAAC,KAAK,CAAC;QACnB,SAAS,EAAE,6BAA6B;QACxC,WAAW,EAAE,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CAAA;QAE3B,IAAI,CAAC;YACH,MAAM,cAAc,GAAG,yBAAa,MAAM,CAAC,WAAW,uCAAC,CAAA;YACvD,MAAM,QAAQ,GACZ,SAAS,KAAK,KAAK;gBACjB,CAAC,CAAC,cAAc,CAAC,UAAU;gBAC3B,CAAC,CAAC,SAAS,KAAK,MAAM;oBACpB,CAAC,CAAC,cAAc,CAAC,GAAG;oBACpB,CAAC,CAAC,SAAS,KAAK,MAAM;wBACpB,CAAC,CAAC,cAAc,CAAC,GAAG;wBACpB,CAAC,CAAC,cAAc,CAAA;YACxB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;YAE5B,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAC7B,SAAS,EACT,qBAAqB,EACrB,MAAM,CAAC,SAAS,CACjB,CAAA;YACD,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;YAC1D,MAAM,CAAC,KAAK,GAAG,IAAI,mBAAK,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,WAAW,CAAC,CAAA;YAC3D,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;YACtB,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;QAC5B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,qBAAa,EAAE,CAAC;gBAClB,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAA;YACnC,CAAC;YACD,OAAO,SAAS,CAAA;QAClB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/dist/code-map/parse.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const DEBUG_PARSING = false;
|
|
2
|
-
export declare function getFileTokenScores(projectRoot: string, filePaths: string[]): Promise<{
|
|
3
|
-
[filePath: string]: {
|
|
4
|
-
[token: string]: number;
|
|
5
|
-
};
|
|
6
|
-
}>;
|
|
7
|
-
export declare function parseTokens(filePath: string): Promise<{
|
|
8
|
-
numLines: number;
|
|
9
|
-
identifiers: string[];
|
|
10
|
-
calls: string[];
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../parse.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,QAAQ,CAAA;AAGlC,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE;;;;GA8DhF;AAED,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM;;;;GA4BjD"}
|
package/dist/code-map/parse.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.DEBUG_PARSING = void 0;
|
|
27
|
-
exports.getFileTokenScores = getFileTokenScores;
|
|
28
|
-
exports.parseTokens = parseTokens;
|
|
29
|
-
const fs = __importStar(require("fs"));
|
|
30
|
-
const path = __importStar(require("path"));
|
|
31
|
-
const languages_1 = require("./languages");
|
|
32
|
-
exports.DEBUG_PARSING = false;
|
|
33
|
-
const IGNORE_TOKENS = ['__init__', '__post_init__', '__call__', 'constructor'];
|
|
34
|
-
async function getFileTokenScores(projectRoot, filePaths) {
|
|
35
|
-
const startTime = Date.now();
|
|
36
|
-
const tokenScores = {};
|
|
37
|
-
const externalCalls = {};
|
|
38
|
-
for (const filePath of filePaths) {
|
|
39
|
-
const fullPath = path.join(projectRoot, filePath);
|
|
40
|
-
if (!!(0, languages_1.getLanguageConfig)(fullPath)) {
|
|
41
|
-
const { identifiers, calls, numLines } = await parseTokens(fullPath);
|
|
42
|
-
const tokenScoresForFile = {};
|
|
43
|
-
tokenScores[filePath] = tokenScoresForFile;
|
|
44
|
-
const dirs = path.dirname(fullPath).split(path.sep);
|
|
45
|
-
const depth = dirs.length;
|
|
46
|
-
const tokenBaseScore = 0.8 ** depth * Math.sqrt(numLines / (identifiers.length + 1));
|
|
47
|
-
for (const identifier of identifiers) {
|
|
48
|
-
if (!IGNORE_TOKENS.includes(identifier)) {
|
|
49
|
-
tokenScoresForFile[identifier] = tokenBaseScore;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
for (const call of calls) {
|
|
53
|
-
if (!tokenScoresForFile[call]) {
|
|
54
|
-
externalCalls[call] = (externalCalls[call] ?? 0) + 1;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
for (const scores of Object.values(tokenScores)) {
|
|
60
|
-
for (const token of Object.keys(scores)) {
|
|
61
|
-
const numCalls = externalCalls[token] ?? 0;
|
|
62
|
-
if (typeof numCalls !== 'number')
|
|
63
|
-
continue;
|
|
64
|
-
scores[token] *= 1 + Math.log(1 + numCalls);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (exports.DEBUG_PARSING) {
|
|
68
|
-
const endTime = Date.now();
|
|
69
|
-
console.log(`Parsed ${filePaths.length} files in ${endTime - startTime}ms`);
|
|
70
|
-
console.log('externalCalls', externalCalls);
|
|
71
|
-
// Save exportedTokens to a file
|
|
72
|
-
const exportedTokensFilePath = path.join(projectRoot, 'exported-tokens.json');
|
|
73
|
-
try {
|
|
74
|
-
fs.writeFileSync(exportedTokensFilePath, JSON.stringify(tokenScores, null, 2));
|
|
75
|
-
console.log(`Exported tokens saved to ${exportedTokensFilePath}`);
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
console.error(`Failed to save exported tokens to file: ${error}`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return tokenScores;
|
|
82
|
-
}
|
|
83
|
-
async function parseTokens(filePath) {
|
|
84
|
-
const languageConfig = await (0, languages_1.getLanguageConfig)(filePath);
|
|
85
|
-
if (languageConfig) {
|
|
86
|
-
const { parser, query } = languageConfig;
|
|
87
|
-
try {
|
|
88
|
-
const sourceCode = fs.readFileSync(filePath, 'utf8');
|
|
89
|
-
const numLines = sourceCode.match(/\n/g)?.length ?? 0 + 1;
|
|
90
|
-
const parseResults = parseFile(parser, query, sourceCode);
|
|
91
|
-
const identifiers = parseResults.identifier;
|
|
92
|
-
const calls = parseResults['call.identifier'];
|
|
93
|
-
return {
|
|
94
|
-
numLines,
|
|
95
|
-
identifiers: identifiers ?? [],
|
|
96
|
-
calls: calls ?? [],
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
100
|
-
if (exports.DEBUG_PARSING) {
|
|
101
|
-
console.error(`Error parsing query: ${e}`);
|
|
102
|
-
console.log(filePath);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
numLines: 0,
|
|
108
|
-
identifiers: [],
|
|
109
|
-
calls: [],
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
function parseFile(parser, query, sourceCode) {
|
|
113
|
-
const tree = parser.parse(sourceCode, undefined, {
|
|
114
|
-
bufferSize: 1024 * 1024,
|
|
115
|
-
});
|
|
116
|
-
const captures = query.captures(tree.rootNode);
|
|
117
|
-
const result = {};
|
|
118
|
-
for (const capture of captures) {
|
|
119
|
-
const { name, node } = capture;
|
|
120
|
-
if (!result[name]) {
|
|
121
|
-
result[name] = [];
|
|
122
|
-
}
|
|
123
|
-
result[name].push(node.text);
|
|
124
|
-
}
|
|
125
|
-
return result;
|
|
126
|
-
}
|
|
127
|
-
//# sourceMappingURL=parse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../parse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AASA,gDA8DC;AAED,kCA4BC;AArGD,uCAAwB;AACxB,2CAA4B;AAG5B,2CAA+C;AAElC,QAAA,aAAa,GAAG,KAAK,CAAA;AAClC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,CAAC,CAAA;AAEvE,KAAK,UAAU,kBAAkB,CAAC,WAAmB,EAAE,SAAmB;IAC/E,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IAC5B,MAAM,WAAW,GAAwD,EAAE,CAAA;IAC3E,MAAM,aAAa,GAAgC,EAAE,CAAA;IAErD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;QACjD,IAAI,CAAC,CAAC,IAAA,6BAAiB,EAAC,QAAQ,CA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IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface Greeter {
|
|
2
|
-
greet(name: string): string;
|
|
3
|
-
}
|
|
4
|
-
declare class Greeting implements Greeter {
|
|
5
|
-
private prefix;
|
|
6
|
-
constructor(prefix: string);
|
|
7
|
-
greet(name: string): string;
|
|
8
|
-
static printGreeting(greeter: Greeter, name: string): void;
|
|
9
|
-
}
|
|
10
|
-
declare function createGreeter(prefix: string): Greeter;
|
|
11
|
-
declare const greeting: Greeter;
|
|
12
|
-
//# sourceMappingURL=test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../test-langs/test.ts"],"names":[],"mappings":"AACA,UAAU,OAAO;IACb,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AAGD,cAAM,QAAS,YAAW,OAAO;IAC7B,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM;IAI1B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAK3B,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;CAG7D;AAGD,iBAAS,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE9C;AAGD,QAAA,MAAM,QAAQ,SAAyB,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Class implementation
|
|
3
|
-
class Greeting {
|
|
4
|
-
prefix;
|
|
5
|
-
constructor(prefix) {
|
|
6
|
-
this.prefix = prefix;
|
|
7
|
-
}
|
|
8
|
-
greet(name) {
|
|
9
|
-
return `${this.prefix}, ${name}!`;
|
|
10
|
-
}
|
|
11
|
-
// Static method
|
|
12
|
-
static printGreeting(greeter, name) {
|
|
13
|
-
console.log(greeter.greet(name));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
// Function
|
|
17
|
-
function createGreeter(prefix) {
|
|
18
|
-
return new Greeting(prefix);
|
|
19
|
-
}
|
|
20
|
-
// Main execution
|
|
21
|
-
const greeting = createGreeter('Hello');
|
|
22
|
-
Greeting.printGreeting(greeting, 'World');
|
|
23
|
-
//# sourceMappingURL=test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test-langs/test.ts"],"names":[],"mappings":";AAKA,uBAAuB;AACvB,MAAM,QAAQ;IACF,MAAM,CAAS;IAEvB,YAAY,MAAc;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,IAAY;QACd,OAAO,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,GAAG,CAAC;IACtC,CAAC;IAED,gBAAgB;IAChB,MAAM,CAAC,aAAa,CAAC,OAAgB,EAAE,IAAY;QAC/C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,CAAC;CACJ;AAED,WAAW;AACX,SAAS,aAAa,CAAC,MAAc;IACjC,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAED,iBAAiB;AACjB,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AACxC,QAAQ,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Credits
|
|
2
|
-
|
|
3
|
-
Codebuff uses modified versions of the tags.scm files from these open source tree-sitter language implementations:
|
|
4
|
-
|
|
5
|
-
* [https://github.com/tree-sitter/tree-sitter-c](https://github.com/tree-sitter/tree-sitter-c) — licensed under the MIT License.
|
|
6
|
-
* [https://github.com/tree-sitter/tree-sitter-c-sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) — licensed under the MIT License.
|
|
7
|
-
* [https://github.com/tree-sitter/tree-sitter-cpp](https://github.com/tree-sitter/tree-sitter-cpp) — licensed under the MIT License.
|
|
8
|
-
* [https://github.com/Wilfred/tree-sitter-elisp](https://github.com/Wilfred/tree-sitter-elisp) — licensed under the MIT License.
|
|
9
|
-
* [https://github.com/elixir-lang/tree-sitter-elixir](https://github.com/elixir-lang/tree-sitter-elixir) — licensed under the Apache License, Version 2.0.
|
|
10
|
-
* [https://github.com/elm-tooling/tree-sitter-elm](https://github.com/elm-tooling/tree-sitter-elm) — licensed under the MIT License.
|
|
11
|
-
* [https://github.com/tree-sitter/tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go) — licensed under the MIT License.
|
|
12
|
-
* [https://github.com/tree-sitter/tree-sitter-java](https://github.com/tree-sitter/tree-sitter-java) — licensed under the MIT License.
|
|
13
|
-
* [https://github.com/tree-sitter/tree-sitter-javascript](https://github.com/tree-sitter/tree-sitter-javascript) — licensed under the MIT License.
|
|
14
|
-
* [https://github.com/tree-sitter/tree-sitter-ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) — licensed under the MIT License.
|
|
15
|
-
* [https://github.com/tree-sitter/tree-sitter-php](https://github.com/tree-sitter/tree-sitter-php) — licensed under the MIT License.
|
|
16
|
-
* [https://github.com/tree-sitter/tree-sitter-python](https://github.com/tree-sitter/tree-sitter-python) — licensed under the MIT License.
|
|
17
|
-
* [https://github.com/tree-sitter/tree-sitter-ql](https://github.com/tree-sitter/tree-sitter-ql) — licensed under the MIT License.
|
|
18
|
-
* [https://github.com/r-lib/tree-sitter-r](https://github.com/r-lib/tree-sitter-r) — licensed under the MIT License.
|
|
19
|
-
* [https://github.com/tree-sitter/tree-sitter-ruby](https://github.com/tree-sitter/tree-sitter-ruby) — licensed under the MIT License.
|
|
20
|
-
* [https://github.com/tree-sitter/tree-sitter-rust](https://github.com/tree-sitter/tree-sitter-rust) — licensed under the MIT License.
|
|
21
|
-
* [https://github.com/tree-sitter/tree-sitter-typescript](https://github.com/tree-sitter/tree-sitter-typescript) — licensed under the MIT License.
|
|
22
|
-
|
|
23
|
-
This collection of queries was originally put together in the project aider: https://github.com/paul-gauthier/aider/tree/main/aider/queries
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
(struct_specifier name: (type_identifier) @identifier body:(_))
|
|
2
|
-
|
|
3
|
-
(declaration type: (union_specifier name: (type_identifier) @identifier))
|
|
4
|
-
|
|
5
|
-
(function_declarator declarator: (identifier) @identifier)
|
|
6
|
-
|
|
7
|
-
(type_definition declarator: (type_identifier) @identifier)
|
|
8
|
-
|
|
9
|
-
(enum_specifier name: (type_identifier) @identifier)
|
|
10
|
-
|
|
11
|
-
; TODO add calls
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
(struct_specifier name: (type_identifier) @identifier)
|
|
2
|
-
|
|
3
|
-
(declaration type: (union_specifier name: (type_identifier) @identifier))
|
|
4
|
-
|
|
5
|
-
(function_declarator declarator: (identifier) @identifier)
|
|
6
|
-
|
|
7
|
-
(function_declarator declarator: (field_identifier) @identifier)
|
|
8
|
-
|
|
9
|
-
(function_declarator declarator: (qualified_identifier scope: (namespace_identifier) name: (identifier) @identifier))
|
|
10
|
-
|
|
11
|
-
(type_definition declarator: (type_identifier) @identifier)
|
|
12
|
-
|
|
13
|
-
(enum_specifier name: (type_identifier) @identifier)
|
|
14
|
-
|
|
15
|
-
(class_specifier name: (type_identifier) @identifier)
|
|
16
|
-
|
|
17
|
-
; TODO add calls
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
(
|
|
2
|
-
(comment)*
|
|
3
|
-
.
|
|
4
|
-
(function_declaration
|
|
5
|
-
name: (identifier) @identifier)
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
(
|
|
9
|
-
(comment)*
|
|
10
|
-
.
|
|
11
|
-
(method_declaration
|
|
12
|
-
name: (field_identifier) @identifier)
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
(type_spec
|
|
16
|
-
name: (type_identifier) @identifier)
|
|
17
|
-
|
|
18
|
-
(type_identifier) @identifier
|
|
19
|
-
|
|
20
|
-
(call_expression
|
|
21
|
-
function: [
|
|
22
|
-
(identifier) @call.identifier
|
|
23
|
-
(parenthesized_expression (identifier) @call.identifier)
|
|
24
|
-
(selector_expression field: (field_identifier) @call.identifier)
|
|
25
|
-
(parenthesized_expression (selector_expression field: (field_identifier) @call.identifier))
|
|
26
|
-
])
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
(class_declaration
|
|
2
|
-
name: (identifier) @identifier)
|
|
3
|
-
|
|
4
|
-
(interface_declaration
|
|
5
|
-
name: (identifier) @identifier) @definition.interface
|
|
6
|
-
|
|
7
|
-
(method_declaration
|
|
8
|
-
name: (identifier) @identifier)
|
|
9
|
-
|
|
10
|
-
(method_invocation
|
|
11
|
-
name: (identifier) @call.identifier)
|
|
12
|
-
|
|
13
|
-
(type_list
|
|
14
|
-
(type_identifier) @call.identifier)
|
|
15
|
-
|
|
16
|
-
(object_creation_expression
|
|
17
|
-
type: (type_identifier) @call.identifier)
|
|
18
|
-
|
|
19
|
-
(superclass (type_identifier) @call.identifier)
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
(function_declaration name: (identifier) @identifier)
|
|
2
|
-
(class_declaration name: (identifier) @identifier)
|
|
3
|
-
(method_definition name: (property_identifier) @identifier)
|
|
4
|
-
|
|
5
|
-
(export_statement
|
|
6
|
-
declaration: (lexical_declaration
|
|
7
|
-
(variable_declarator
|
|
8
|
-
name: (identifier) @identifier)))
|
|
9
|
-
(export_statement
|
|
10
|
-
declaration: (variable_declaration
|
|
11
|
-
(variable_declarator
|
|
12
|
-
name: (identifier) @identifier)))
|
|
13
|
-
|
|
14
|
-
(call_expression function: (identifier) @call.identifier)
|
|
15
|
-
(new_expression constructor: (identifier) @call.identifier)
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
(class_declaration
|
|
2
|
-
name: (name) @identifier)
|
|
3
|
-
|
|
4
|
-
(function_definition
|
|
5
|
-
name: (name) @identifier)
|
|
6
|
-
|
|
7
|
-
(method_declaration
|
|
8
|
-
name: (name) @identifier)
|
|
9
|
-
|
|
10
|
-
(object_creation_expression
|
|
11
|
-
[
|
|
12
|
-
(qualified_name (name) @call.identifier)
|
|
13
|
-
(variable_name (name) @call.identifier)
|
|
14
|
-
])
|
|
15
|
-
|
|
16
|
-
(function_call_expression
|
|
17
|
-
function: [
|
|
18
|
-
(qualified_name (name) @call.identifier)
|
|
19
|
-
(variable_name (name)) @call.identifier
|
|
20
|
-
])
|
|
21
|
-
|
|
22
|
-
(scoped_call_expression
|
|
23
|
-
name: (name) @call.identifier)
|
|
24
|
-
|
|
25
|
-
(member_call_expression
|
|
26
|
-
name: (name) @call.identifier)
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
; Method definitions
|
|
2
|
-
|
|
3
|
-
(
|
|
4
|
-
[
|
|
5
|
-
(method
|
|
6
|
-
name: (_) @identifier)
|
|
7
|
-
(singleton_method
|
|
8
|
-
name: (_) @identifier)
|
|
9
|
-
]
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
(alias
|
|
13
|
-
name: (_) @identifier)
|
|
14
|
-
|
|
15
|
-
; (setter
|
|
16
|
-
; (identifier) @identifier)
|
|
17
|
-
|
|
18
|
-
; Class definitions
|
|
19
|
-
|
|
20
|
-
(
|
|
21
|
-
(comment)*
|
|
22
|
-
.
|
|
23
|
-
[
|
|
24
|
-
(class
|
|
25
|
-
name: [
|
|
26
|
-
(constant) @identifier
|
|
27
|
-
(scope_resolution
|
|
28
|
-
name: (_) @identifier)
|
|
29
|
-
])
|
|
30
|
-
(singleton_class
|
|
31
|
-
value: [
|
|
32
|
-
(constant) @identifier
|
|
33
|
-
(scope_resolution
|
|
34
|
-
name: (_) @identifier)
|
|
35
|
-
])
|
|
36
|
-
]
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
; Module definitions
|
|
40
|
-
|
|
41
|
-
(
|
|
42
|
-
(module
|
|
43
|
-
name: [
|
|
44
|
-
(constant) @identifier
|
|
45
|
-
(scope_resolution
|
|
46
|
-
name: (_) @identifier)
|
|
47
|
-
])
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
; Calls
|
|
51
|
-
|
|
52
|
-
(call method: (identifier) @call.identifier)
|
|
53
|
-
|
|
54
|
-
(
|
|
55
|
-
[(identifier) (constant)] @call.identifier
|
|
56
|
-
(#is-not? local)
|
|
57
|
-
(#not-match? @call.identifier "^(lambda|load|require|require_relative|__FILE__|__LINE__)$")
|
|
58
|
-
)
|