@abaplint/core 2.93.24 → 2.93.25
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/build/abaplint.d.ts
CHANGED
|
@@ -3272,6 +3272,12 @@ declare interface IRenameParams {
|
|
|
3272
3272
|
newName: string;
|
|
3273
3273
|
}
|
|
3274
3274
|
|
|
3275
|
+
declare interface IRenameResult {
|
|
3276
|
+
deletedFiles: Set<string>;
|
|
3277
|
+
addedFiles: Set<string>;
|
|
3278
|
+
updatedFiles: Set<string>;
|
|
3279
|
+
}
|
|
3280
|
+
|
|
3275
3281
|
export declare interface IRenameSettings {
|
|
3276
3282
|
/** output folder, if value is empty or undefined the changes are written inline in the input folders */
|
|
3277
3283
|
output?: string;
|
|
@@ -4536,7 +4542,7 @@ export declare class Rename {
|
|
|
4536
4542
|
constructor(reg: IRegistry);
|
|
4537
4543
|
/** Applies the renaming to the objects and files in the registry,
|
|
4538
4544
|
* after renaming the registry is not parsed */
|
|
4539
|
-
rename(type: string, oldName: string, newName: string):
|
|
4545
|
+
rename(type: string, oldName: string, newName: string): IRenameResult;
|
|
4540
4546
|
/** Builds edits, but does not apply to registry, used by LSP */
|
|
4541
4547
|
buildEdits(type: string, oldName: string, newName: string): WorkspaceEdit | undefined;
|
|
4542
4548
|
private factory;
|
|
@@ -23,8 +23,9 @@ class Renamer {
|
|
|
23
23
|
else if (edits.changes) {
|
|
24
24
|
throw new Error("only documentChanges expected");
|
|
25
25
|
}
|
|
26
|
-
this.apply(edits);
|
|
26
|
+
const result = this.apply(edits);
|
|
27
27
|
this.reg.findIssues(); // hmm, this builds the ddic references
|
|
28
|
+
return result;
|
|
28
29
|
}
|
|
29
30
|
/** Builds edits, but does not apply to registry, used by LSP */
|
|
30
31
|
buildEdits(type, oldName, newName) {
|
|
@@ -61,10 +62,16 @@ class Renamer {
|
|
|
61
62
|
}
|
|
62
63
|
apply(edits) {
|
|
63
64
|
const renames = [];
|
|
65
|
+
const result = {
|
|
66
|
+
addedFiles: new Set(),
|
|
67
|
+
deletedFiles: new Set(),
|
|
68
|
+
updatedFiles: new Set(),
|
|
69
|
+
};
|
|
64
70
|
// assumption: only renames or text changes, no deletes or creates
|
|
65
71
|
for (const dc of edits.documentChanges || []) {
|
|
66
72
|
if (vscode_languageserver_types_1.TextDocumentEdit.is(dc)) {
|
|
67
73
|
this.applyEdit(dc);
|
|
74
|
+
result.updatedFiles.add(dc.textDocument.uri);
|
|
68
75
|
}
|
|
69
76
|
else if (vscode_languageserver_types_1.RenameFile.is(dc)) {
|
|
70
77
|
renames.push(dc);
|
|
@@ -73,7 +80,13 @@ class Renamer {
|
|
|
73
80
|
throw new Error("unexpected documentChange type");
|
|
74
81
|
}
|
|
75
82
|
}
|
|
83
|
+
for (const rename of renames) {
|
|
84
|
+
result.updatedFiles.delete(rename.oldUri);
|
|
85
|
+
result.deletedFiles.add(rename.oldUri);
|
|
86
|
+
result.addedFiles.add(rename.newUri);
|
|
87
|
+
}
|
|
76
88
|
this.applyRenames(renames);
|
|
89
|
+
return result;
|
|
77
90
|
}
|
|
78
91
|
applyEdit(dc) {
|
|
79
92
|
const file = this.reg.getFileByName(dc.textDocument.uri);
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.93.
|
|
3
|
+
"version": "2.93.25",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"mocha": "^10.0.0",
|
|
56
56
|
"c8": "^7.12.0",
|
|
57
57
|
"source-map-support": "^0.5.21",
|
|
58
|
-
"ts-json-schema-generator": "^1.
|
|
58
|
+
"ts-json-schema-generator": "^1.1.0",
|
|
59
59
|
"typescript": "^4.8.3"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|