@appland/appmap 3.152.0 → 3.154.0
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [@appland/appmap-v3.154.0](https://github.com/getappmap/appmap-js/compare/@appland/appmap-v3.153.0...@appland/appmap-v3.154.0) (2024-07-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* More robust location parsing ([7ae1dd2](https://github.com/getappmap/appmap-js/commit/7ae1dd2e18c21451c0c0da954c93a3e73286b5eb))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Recognize .php files in source lookup ([076273f](https://github.com/getappmap/appmap-js/commit/076273f8a24aabb998032df9f9c7d8372e21cfc2))
|
|
12
|
+
|
|
13
|
+
# [@appland/appmap-v3.153.0](https://github.com/getappmap/appmap-js/compare/@appland/appmap-v3.152.0...@appland/appmap-v3.153.0) (2024-07-17)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* Update @appland/navie to v1.19.0 ([e3a2b87](https://github.com/getappmap/appmap-js/commit/e3a2b87713e5b815c9309a17ab44189e550dc792))
|
|
19
|
+
|
|
1
20
|
# [@appland/appmap-v3.152.0](https://github.com/getappmap/appmap-js/compare/@appland/appmap-v3.151.0...@appland/appmap-v3.152.0) (2024-07-17)
|
|
2
21
|
|
|
3
22
|
|
|
@@ -11,6 +11,7 @@ const glob_1 = require("glob");
|
|
|
11
11
|
const text_splitter_1 = require("langchain/text_splitter");
|
|
12
12
|
const utils_1 = require("../../utils");
|
|
13
13
|
const util_1 = require("util");
|
|
14
|
+
const parseLocation_1 = __importDefault(require("./parseLocation"));
|
|
14
15
|
exports.LANGUAGE_BY_FILE_EXTENSION = {
|
|
15
16
|
'.js': 'js',
|
|
16
17
|
'.ts': 'js',
|
|
@@ -19,6 +20,7 @@ exports.LANGUAGE_BY_FILE_EXTENSION = {
|
|
|
19
20
|
'.java': 'java',
|
|
20
21
|
'.py': 'python',
|
|
21
22
|
'.rb': 'ruby',
|
|
23
|
+
'.php': 'php',
|
|
22
24
|
};
|
|
23
25
|
// TODO: Look up different types of files
|
|
24
26
|
const scannedExtensions = new Set();
|
|
@@ -26,9 +28,12 @@ const FILE_NAMES = new Set();
|
|
|
26
28
|
// TODO: Return source code up to the next location in the class map.
|
|
27
29
|
// TODO: Reverse-strip comment that follow the function.
|
|
28
30
|
async function lookupSourceCode(directory, location) {
|
|
31
|
+
const parsedLocation = (0, parseLocation_1.default)(location);
|
|
32
|
+
if (!parsedLocation)
|
|
33
|
+
return;
|
|
34
|
+
const [requestedFileName, lineNo] = parsedLocation;
|
|
29
35
|
if ((0, utils_1.verbose)())
|
|
30
36
|
(0, console_1.warn)(chalk_1.default.gray(`Looking up source code for ${location}`));
|
|
31
|
-
const [requestedFileName, lineNoStr] = location.split(':');
|
|
32
37
|
const extension = requestedFileName.slice(requestedFileName.lastIndexOf('.'));
|
|
33
38
|
if (!scannedExtensions.has(extension)) {
|
|
34
39
|
scannedExtensions.add(extension);
|
|
@@ -63,9 +68,8 @@ async function lookupSourceCode(directory, location) {
|
|
|
63
68
|
return;
|
|
64
69
|
}
|
|
65
70
|
const fileContent = await (0, promises_1.readFile)(fileName, 'utf-8');
|
|
66
|
-
if (!
|
|
71
|
+
if (!lineNo)
|
|
67
72
|
return [fileContent];
|
|
68
|
-
let lineNo = parseInt(lineNoStr, 10);
|
|
69
73
|
if (lineNo <= 0)
|
|
70
74
|
return [fileContent];
|
|
71
75
|
const fileExtension = fileName.slice(fileName.lastIndexOf('.'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookupSourceCode.js","sourceRoot":"","sources":["../../../src/rpc/explain/lookupSourceCode.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qCAA+B;AA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
|
+
"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
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
7
|
+
const console_1 = require("console");
|
|
8
|
+
function parseLocation(location) {
|
|
9
|
+
if (!location.includes(':'))
|
|
10
|
+
return [location, undefined];
|
|
11
|
+
const locationTest = /([^:]+):(\d+)$/.exec(location);
|
|
12
|
+
if (!locationTest) {
|
|
13
|
+
(0, console_1.warn)(chalk_1.default.gray(`Invalid location format: ${location}. Skipping file lookup.`));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const [requestedFileName, lineNoStr] = locationTest.slice(1);
|
|
17
|
+
const lineNoReturned = lineNoStr ? parseInt(lineNoStr, 10) : undefined;
|
|
18
|
+
return [requestedFileName, lineNoReturned];
|
|
19
|
+
}
|
|
20
|
+
exports.default = parseLocation;
|
|
21
|
+
//# sourceMappingURL=parseLocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseLocation.js","sourceRoot":"","sources":["../../../src/rpc/explain/parseLocation.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,qCAA+B;AAE/B,SAAwB,aAAa,CAAC,QAAgB;IACpD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAE1D,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,CAAC,YAAY,EAAE;QACjB,IAAA,cAAI,EAAC,eAAK,CAAC,IAAI,CAAC,4BAA4B,QAAQ,yBAAyB,CAAC,CAAC,CAAC;QAChF,OAAO;KACR;IAED,MAAM,CAAC,iBAAiB,EAAE,SAAS,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7D,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAC7C,CAAC;AAZD,gCAYC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appland/appmap",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.154.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": "built/cli.js",
|
|
6
6
|
"engines": {
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@appland/components": "^4.12.0",
|
|
90
90
|
"@appland/diagrams": "^1.8.0",
|
|
91
91
|
"@appland/models": "^2.10.2",
|
|
92
|
-
"@appland/navie": "^1.
|
|
92
|
+
"@appland/navie": "^1.19.0",
|
|
93
93
|
"@appland/openapi": "^1.8.0",
|
|
94
94
|
"@appland/rpc": "^1.9.0",
|
|
95
95
|
"@appland/scanner": "^1.86.0",
|