@noyrax/documentation-system-plugin 1.0.4-beta.3 → 1.0.4-beta.5
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/out/cache/ast-cache.js +69 -0
- package/out/cache/ast-cache.js.map +1 -0
- package/out/cache/dependencies-cache.js +73 -0
- package/out/cache/dependencies-cache.js.map +1 -0
- package/out/cache/output-cache.js +69 -0
- package/out/cache/output-cache.js.map +1 -0
- package/out/cache/signature-cache.js +60 -0
- package/out/cache/signature-cache.js.map +1 -0
- package/out/cli/generate-cli.js +345 -0
- package/out/cli/generate-cli.js.map +1 -0
- package/out/cli/scan-cli.js +157 -0
- package/out/cli/scan-cli.js.map +1 -0
- package/out/cli/validate-cli.js +258 -0
- package/out/cli/validate-cli.js.map +1 -0
- package/out/core/async.js +38 -0
- package/out/core/async.js.map +1 -0
- package/out/core/consolidation.js +230 -0
- package/out/core/consolidation.js.map +1 -0
- package/out/core/git.js +48 -0
- package/out/core/git.js.map +1 -0
- package/out/core/language-detection.js +29 -0
- package/out/core/language-detection.js.map +1 -0
- package/out/core/scanner.js +180 -0
- package/out/core/scanner.js.map +1 -0
- package/out/core/signature-formatter.js +162 -0
- package/out/core/signature-formatter.js.map +1 -0
- package/out/core/symbol-classifier.js +96 -0
- package/out/core/symbol-classifier.js.map +1 -0
- package/out/core/symbols.js +24 -0
- package/out/core/symbols.js.map +1 -0
- package/out/drift/index.js +28 -0
- package/out/drift/index.js.map +1 -0
- package/out/extension.js +984 -0
- package/out/extension.js.map +1 -0
- package/out/generator/adr-linker.js +216 -0
- package/out/generator/adr-linker.js.map +1 -0
- package/out/generator/change-report.js +124 -0
- package/out/generator/change-report.js.map +1 -0
- package/out/generator/dependency-graph.js +98 -0
- package/out/generator/dependency-graph.js.map +1 -0
- package/out/generator/index.js +117 -0
- package/out/generator/index.js.map +1 -0
- package/out/generator/module-doc.js +438 -0
- package/out/generator/module-doc.js.map +1 -0
- package/out/generator/system-metadata.js +202 -0
- package/out/generator/system-metadata.js.map +1 -0
- package/out/index/index.js +161 -0
- package/out/index/index.js.map +1 -0
- package/out/logging/index.js +24 -0
- package/out/logging/index.js.map +1 -0
- package/out/parsers/dependencies.js +126 -0
- package/out/parsers/dependencies.js.map +1 -0
- package/out/parsers/json-yaml.js +121 -0
- package/out/parsers/json-yaml.js.map +1 -0
- package/out/parsers/python.js +160 -0
- package/out/parsers/python.js.map +1 -0
- package/out/parsers/ts-js.js +598 -0
- package/out/parsers/ts-js.js.map +1 -0
- package/out/parsers/types.js +3 -0
- package/out/parsers/types.js.map +1 -0
- package/out/ui/commands-provider.js +91 -0
- package/out/ui/commands-provider.js.map +1 -0
- package/out/ui/status-bar.js +85 -0
- package/out/ui/status-bar.js.map +1 -0
- package/out/validator/index.js +185 -0
- package/out/validator/index.js.map +1 -0
- package/out/validator/signature-matching.js +261 -0
- package/out/validator/signature-matching.js.map +1 -0
- package/out/validator/status.js +38 -0
- package/out/validator/status.js.map +1 -0
- package/package.json +9 -1
- package/.vscodeignore +0 -41
- package/MCP_SERVER_SETUP.md +0 -371
- package/assets/icon.svg +0 -27
- package/docs/LINKEDIN_ANTWORT_SEQUENZDIAGRAMME.md +0 -190
- package/docs/SEQUENZDIAGRAMM_BEWEIS.md +0 -469
- package/docs/SEQUENZDIAGRAMM_VALIDATE_FLOW.md +0 -282
- package/docs/adr/001-signatur-abweichung-fix.md +0 -54
- package/docs/adr/002-file-specific-validation-1.0.1.md +0 -45
- package/docs/adr/003-documentation-generation-bugs.md +0 -134
- package/docs/adr/004-validator-signature-matching-fix.md +0 -121
- package/docs/adr/005-validator-generic-simplification-tightening.md +0 -35
- package/docs/adr/006-parser-variable-type-extraction.md +0 -33
- package/docs/adr/007-ts-parser-load-libs-for-accurate-types.md +0 -31
- package/docs/adr/008-dependencies-cache-phase1.md +0 -133
- package/docs/adr/009-consolidation-union-logic-phase1-2.md +0 -147
- package/docs/adr/010-extension-union-integration-phase1-3-and-phase2.md +0 -179
- package/docs/adr/011-module-doc-change-tracking-phase3.md +0 -190
- package/docs/adr/012-git-deletions-change-report-phase4.md +0 -235
- package/docs/adr/013-system-functionality-fixes.md +0 -279
- package/docs/adr/014-rules-migration-und-mcp-integration.md +0 -113
- package/docs/adr/015-global-agent-package.md +0 -158
- package/docs/adr/016-produktisierung-docguard.md +0 -193
- package/docs/adr/017-signature-matching-optional-fields.md +0 -128
- package/docs/adr/018-rebranding-docguard-to-noyrax.md +0 -109
- package/docs/adr/019-system-schwachstellen-analyse-und-fixes.md +0 -204
- package/docs/adr/020-api-doc-tiefe-und-signatureformatter.md +0 -74
- package/docs/adr/021-semantic-api-docs-and-symbol-classifier.md +0 -125
- package/docs/adr/022-semantic-class-and-constants-rendering.md +0 -82
- package/docs/adr/023-adr-verknuepfung-modul-doku.md +0 -54
- package/docs/adr/024-cursor-rules-mehrdimensionaler-raum.md +0 -230
- package/docs/adr/025-mcp-tools-scan-validate-cli-bridge.md +0 -202
- package/docs/adr/026-reality-driven-development-system.md +0 -173
- package/docs/adr/027-scanner-excludes-and-union-logic-fix.md +0 -189
- package/docs/adr/028-src-coverage-union-resync.md +0 -124
- package/docs/adr/029-parser-flow-kopplung-und-sync-drift-modi.md +0 -102
- package/docs/adr/030-dependency-import-symbol-names-preservation.md +0 -123
- package/docs/adr/031-generate-cli-vollstaendige-dokumentation.md +0 -99
- package/docs/adr/032-windows-optimized-verification-scripts.md +0 -165
- package/docs/adr/036-enhanced-dependency-metadata.md +0 -190
- package/docs/adr/TEMPLATE.md +0 -76
- package/docs/index/symbols.jsonl +0 -78
- package/docs/modules/action__action.yml.md +0 -50
- package/docs/modules/documentation.config.schema.json.md +0 -37
- package/docs/modules/mcp__package.json.md +0 -130
- package/docs/modules/mcp__src__resources__docs.ts.md +0 -94
- package/docs/modules/mcp__src__server.ts.md +0 -15
- package/docs/modules/mcp__src__tools__drift.ts.md +0 -114
- package/docs/modules/mcp__src__tools__impact.ts.md +0 -130
- package/docs/modules/mcp__src__tools__scan.ts.md +0 -75
- package/docs/modules/mcp__src__tools__validate.ts.md +0 -116
- package/docs/modules/mcp__src__tools__verify-adrs.ts.md +0 -106
- package/docs/modules/mcp__tsconfig.json.md +0 -22
- package/docs/modules/package.json.md +0 -130
- package/docs/modules/packages__doc-system-agent__examples__basic-project__package.json.md +0 -43
- package/docs/modules/packages__doc-system-agent__examples__basic-project__src__calculator.ts.md +0 -81
- package/docs/modules/packages__doc-system-agent__package.json.md +0 -154
- package/docs/modules/packages__doc-system-agent__src__cli__index.ts.md +0 -8
- package/docs/modules/packages__doc-system-agent__src__cli__init.ts.md +0 -93
- package/docs/modules/packages__doc-system-agent__src__cli__update.ts.md +0 -113
- package/docs/modules/packages__doc-system-agent__src__constants.ts.md +0 -29
- package/docs/modules/packages__doc-system-agent__src__index.ts.md +0 -234
- package/docs/modules/packages__doc-system-agent__src__mcp__resources__docs.ts.md +0 -94
- package/docs/modules/packages__doc-system-agent__src__mcp__server.ts.md +0 -17
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__drift.ts.md +0 -38
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__impact.ts.md +0 -75
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__scan.ts.md +0 -23
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__validate.ts.md +0 -23
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__verify-adrs.ts.md +0 -106
- package/docs/modules/packages__doc-system-agent__src__mcp__types.ts.md +0 -355
- package/docs/modules/packages__doc-system-agent__tsconfig.json.md +0 -22
- package/docs/modules/scripts__verify-adrs.js.md +0 -97
- package/docs/modules/scripts__verify-architecture.js.md +0 -93
- package/docs/modules/scripts__verify-imports.js.md +0 -114
- package/docs/modules/src____tests____setup.ts.md +0 -8
- package/docs/modules/src____tests____signature-formatter.test.ts.md +0 -16
- package/docs/modules/src____tests____snapshot-doc-generation.test.ts.md +0 -8
- package/docs/modules/src____tests____symbol-classifier.test.ts.md +0 -16
- package/docs/modules/src__cache__ast-cache.ts.md +0 -91
- package/docs/modules/src__cache__dependencies-cache.ts.md +0 -89
- package/docs/modules/src__cache__output-cache.ts.md +0 -91
- package/docs/modules/src__cache__signature-cache.ts.md +0 -76
- package/docs/modules/src__cli__generate-cli.ts.md +0 -130
- package/docs/modules/src__cli__scan-cli.ts.md +0 -99
- package/docs/modules/src__cli__validate-cli.ts.md +0 -144
- package/docs/modules/src__core__async.ts.md +0 -18
- package/docs/modules/src__core__consolidation.ts.md +0 -157
- package/docs/modules/src__core__git.ts.md +0 -35
- package/docs/modules/src__core__language-detection.ts.md +0 -31
- package/docs/modules/src__core__scanner.ts.md +0 -100
- package/docs/modules/src__core__signature-formatter.ts.md +0 -232
- package/docs/modules/src__core__symbol-classifier.ts.md +0 -178
- package/docs/modules/src__core__symbols.ts.md +0 -31
- package/docs/modules/src__drift__index.ts.md +0 -53
- package/docs/modules/src__extension.ts.md +0 -418
- package/docs/modules/src__generator__adr-linker.ts.md +0 -154
- package/docs/modules/src__generator__change-report.ts.md +0 -85
- package/docs/modules/src__generator__dependency-graph.ts.md +0 -63
- package/docs/modules/src__generator__index.ts.md +0 -40
- package/docs/modules/src__generator__module-doc.ts.md +0 -242
- package/docs/modules/src__index__index.ts.md +0 -159
- package/docs/modules/src__logging__index.ts.md +0 -87
- package/docs/modules/src__parsers__dependencies.ts.md +0 -69
- package/docs/modules/src__parsers__json-yaml.ts.md +0 -96
- package/docs/modules/src__parsers__python.ts.md +0 -73
- package/docs/modules/src__parsers__ts-js.ts.md +0 -48
- package/docs/modules/src__parsers__types.ts.md +0 -117
- package/docs/modules/src__ui__commands-provider.ts.md +0 -70
- package/docs/modules/src__ui__status-bar.ts.md +0 -79
- package/docs/modules/src__validator__index.ts.md +0 -211
- package/docs/modules/src__validator__signature-matching.ts.md +0 -209
- package/docs/modules/src__validator__status.ts.md +0 -72
- package/docs/modules/test-mcp-resources.js.md +0 -27
- package/docs/modules/tsconfig.json.md +0 -22
- package/docs/system/CHANGE_REPORT.md +0 -26
- package/docs/system/DEPENDENCIES.md +0 -403
- package/docs/system/DEPENDENCY_GRAPH.md +0 -336
- package/docs/system/NAVIGATION_SPACE_ANALYSIS.md +0 -244
- package/docs/system/NPX_CACHE_FIX.md +0 -85
- package/docs/system/NPX_LOCAL_USAGE.md +0 -66
- package/docs/system/PLUGIN_ECOSYSTEM_STATUS.md +0 -465
- package/docs/system/PLUGIN_UPDATE_GUIDE.md +0 -212
- package/docs/system/RULES_UPDATE_GUIDE.md +0 -182
- package/docs/system/SYSTEM_ANALYSIS.md +0 -947
- package/docs/system/SYSTEM_METADATA.json +0 -37
- package/documentation.config.schema.json +0 -77
- package/publish.ps1 +0 -21
|
@@ -0,0 +1,91 @@
|
|
|
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.CommandItem = exports.CommandsProvider = void 0;
|
|
27
|
+
const vscode = __importStar(require("vscode"));
|
|
28
|
+
class CommandsProvider {
|
|
29
|
+
constructor() {
|
|
30
|
+
this._onDidChangeTreeData = new vscode.EventEmitter();
|
|
31
|
+
this.onDidChangeTreeData = this._onDidChangeTreeData.event;
|
|
32
|
+
}
|
|
33
|
+
refresh() {
|
|
34
|
+
this._onDidChangeTreeData.fire();
|
|
35
|
+
}
|
|
36
|
+
getTreeItem(element) {
|
|
37
|
+
return element;
|
|
38
|
+
}
|
|
39
|
+
getChildren(element) {
|
|
40
|
+
if (!element) {
|
|
41
|
+
return Promise.resolve([
|
|
42
|
+
new CommandItem('🔍 System scannen', 'noyrax.scan', 'Scannt alle Dateien im Workspace'),
|
|
43
|
+
new CommandItem('📝 Dokumentation generieren', 'noyrax.generate', 'Erzeugt Markdown-Dokumentation'),
|
|
44
|
+
new CommandItem('✅ Dokumentation validieren', 'noyrax.validate', 'Prüft Coverage und Qualität'),
|
|
45
|
+
new CommandItem('🔎 In Dokumentation suchen', 'noyrax.search', 'Durchsucht Symbol-Index'),
|
|
46
|
+
new CommandItem('📂 Dokumentation öffnen', 'noyrax.open', 'Öffnet generierte Dateien'),
|
|
47
|
+
new CommandItem('📊 Systemübersicht anzeigen', 'noyrax.overview', 'Zeigt Abhängigkeitsgraphen'),
|
|
48
|
+
new CommandItem('🔄 Vollständiger Lauf', 'noyrax.fullCycle', 'Scan → Generate → Validate'),
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
51
|
+
return Promise.resolve([]);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.CommandsProvider = CommandsProvider;
|
|
55
|
+
class CommandItem extends vscode.TreeItem {
|
|
56
|
+
constructor(label, commandId, description) {
|
|
57
|
+
super(label, vscode.TreeItemCollapsibleState.None);
|
|
58
|
+
this.label = label;
|
|
59
|
+
this.commandId = commandId;
|
|
60
|
+
this.description = description;
|
|
61
|
+
this.tooltip = this.description;
|
|
62
|
+
this.command = {
|
|
63
|
+
command: commandId,
|
|
64
|
+
title: label,
|
|
65
|
+
};
|
|
66
|
+
// Icons basierend auf Command-Typ
|
|
67
|
+
if (commandId.includes('scan')) {
|
|
68
|
+
this.iconPath = new vscode.ThemeIcon('search');
|
|
69
|
+
}
|
|
70
|
+
else if (commandId.includes('generate')) {
|
|
71
|
+
this.iconPath = new vscode.ThemeIcon('file-text');
|
|
72
|
+
}
|
|
73
|
+
else if (commandId.includes('validate')) {
|
|
74
|
+
this.iconPath = new vscode.ThemeIcon('check');
|
|
75
|
+
}
|
|
76
|
+
else if (commandId.includes('search')) {
|
|
77
|
+
this.iconPath = new vscode.ThemeIcon('search-fuzzy');
|
|
78
|
+
}
|
|
79
|
+
else if (commandId.includes('open')) {
|
|
80
|
+
this.iconPath = new vscode.ThemeIcon('folder-opened');
|
|
81
|
+
}
|
|
82
|
+
else if (commandId.includes('overview')) {
|
|
83
|
+
this.iconPath = new vscode.ThemeIcon('graph');
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.iconPath = new vscode.ThemeIcon('play');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.CommandItem = CommandItem;
|
|
91
|
+
//# sourceMappingURL=commands-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands-provider.js","sourceRoot":"","sources":["../../src/ui/commands-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,MAAa,gBAAgB;IAA7B;QACY,yBAAoB,GAA+D,IAAI,MAAM,CAAC,YAAY,EAAyC,CAAC;QACnJ,wBAAmB,GAAwD,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IAwBxH,CAAC;IAtBG,OAAO;QACH,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC;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I,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;SAClD;aAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;SACrD;aAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;SACjD;aAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;SACxD;aAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;SACzD;aAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;SACjD;aAAM;YACH,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SAChD;IACL,CAAC;CACJ;AA/BD,kCA+BC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
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.StatusBarManager = void 0;
|
|
27
|
+
const vscode = __importStar(require("vscode"));
|
|
28
|
+
class StatusBarManager {
|
|
29
|
+
constructor(context) {
|
|
30
|
+
// Scan Button
|
|
31
|
+
this.scanButton = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 100);
|
|
32
|
+
this.scanButton.text = "$(search) Scan";
|
|
33
|
+
this.scanButton.tooltip = "System scannen";
|
|
34
|
+
this.scanButton.command = "noyrax.scan";
|
|
35
|
+
this.scanButton.show();
|
|
36
|
+
context.subscriptions.push(this.scanButton);
|
|
37
|
+
// Generate Button
|
|
38
|
+
this.generateButton = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 99);
|
|
39
|
+
this.generateButton.text = "$(file-text) Generate";
|
|
40
|
+
this.generateButton.tooltip = "Dokumentation generieren";
|
|
41
|
+
this.generateButton.command = "noyrax.generate";
|
|
42
|
+
this.generateButton.show();
|
|
43
|
+
context.subscriptions.push(this.generateButton);
|
|
44
|
+
// Validate Button
|
|
45
|
+
this.validateButton = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 98);
|
|
46
|
+
this.validateButton.text = "$(check) Validate";
|
|
47
|
+
this.validateButton.tooltip = "Dokumentation validieren";
|
|
48
|
+
this.validateButton.command = "noyrax.validate";
|
|
49
|
+
this.validateButton.show();
|
|
50
|
+
context.subscriptions.push(this.validateButton);
|
|
51
|
+
// Status Indicator
|
|
52
|
+
this.statusIndicator = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 97);
|
|
53
|
+
this.statusIndicator.text = "$(circle-outline) Noyrax";
|
|
54
|
+
this.statusIndicator.tooltip = "Dokumentationsstatus";
|
|
55
|
+
this.statusIndicator.command = "noyrax.overview";
|
|
56
|
+
this.statusIndicator.show();
|
|
57
|
+
context.subscriptions.push(this.statusIndicator);
|
|
58
|
+
}
|
|
59
|
+
updateStatus(status, message) {
|
|
60
|
+
const icons = {
|
|
61
|
+
green: '$(check)',
|
|
62
|
+
yellow: '$(warning)',
|
|
63
|
+
red: '$(error)',
|
|
64
|
+
unknown: '$(circle-outline)'
|
|
65
|
+
};
|
|
66
|
+
const colors = {
|
|
67
|
+
green: '#28a745',
|
|
68
|
+
yellow: '#ffc107',
|
|
69
|
+
red: '#dc3545',
|
|
70
|
+
unknown: '#6c757d'
|
|
71
|
+
};
|
|
72
|
+
this.statusIndicator.text = `${icons[status]} Docs`;
|
|
73
|
+
this.statusIndicator.tooltip = message || `Dokumentationsstatus: ${status}`;
|
|
74
|
+
this.statusIndicator.color = colors[status];
|
|
75
|
+
}
|
|
76
|
+
showProgress(operation) {
|
|
77
|
+
this.statusIndicator.text = "$(sync~spin) " + operation;
|
|
78
|
+
this.statusIndicator.tooltip = `Läuft: ${operation}`;
|
|
79
|
+
}
|
|
80
|
+
hideProgress() {
|
|
81
|
+
this.updateStatus('unknown');
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.StatusBarManager = StatusBarManager;
|
|
85
|
+
//# sourceMappingURL=status-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|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AAC,SAAiB;QAC1B,IAAI,CAAC,eAAe,CAAC,IAAI,GAAG,eAAe,GAAG,SAAS,CAAC;QACxD,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,UAAU,SAAS,EAAE,CAAC;IACzD,CAAC;IAED,YAAY;QACR,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;CACJ;AApED,4CAoEC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
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.validateMarkdownDir = exports.computeCoverage = exports.validateMarkdownContent = exports.validateSymbols = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const index_1 = require("../logging/index");
|
|
30
|
+
const signature_matching_1 = require("./signature-matching");
|
|
31
|
+
function validateSymbols(symbols) {
|
|
32
|
+
const errors = [];
|
|
33
|
+
const warnings = [];
|
|
34
|
+
// Minimal: Namen vorhanden, deterministische Sortierung testbar
|
|
35
|
+
for (const s of symbols) {
|
|
36
|
+
if (!s.fullyQualifiedName || !s.signature?.name) {
|
|
37
|
+
errors.push(`Ungültiges Symbol in ${s.filePath}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return { totalSymbols: symbols.length, errors, warnings };
|
|
41
|
+
}
|
|
42
|
+
exports.validateSymbols = validateSymbols;
|
|
43
|
+
function validateMarkdownContent(md) {
|
|
44
|
+
const errors = [];
|
|
45
|
+
const warnings = [];
|
|
46
|
+
// Einfache Fence-Überprüfung: gerade Anzahl von ```
|
|
47
|
+
const fenceCount = (md.match(/```/g) || []).length;
|
|
48
|
+
if (fenceCount % 2 !== 0) {
|
|
49
|
+
errors.push('Ungeschlossene Code-Fences entdeckt');
|
|
50
|
+
}
|
|
51
|
+
// Basale Überschriften-Präsenz
|
|
52
|
+
if (!/^#\s+/m.test(md)) {
|
|
53
|
+
warnings.push('Keine H1-Überschrift gefunden');
|
|
54
|
+
}
|
|
55
|
+
return { errors, warnings };
|
|
56
|
+
}
|
|
57
|
+
exports.validateMarkdownContent = validateMarkdownContent;
|
|
58
|
+
function computeCoverage(symbols, modulesDir, thresholds = { classes: 0.9, interfaces: 0.9, methods: 0.9, functions: 0.8 }) {
|
|
59
|
+
const metrics = {
|
|
60
|
+
totalClasses: 0, documentedClasses: 0,
|
|
61
|
+
totalInterfaces: 0, documentedInterfaces: 0,
|
|
62
|
+
totalMethods: 0, documentedMethods: 0,
|
|
63
|
+
totalFunctions: 0, documentedFunctions: 0,
|
|
64
|
+
};
|
|
65
|
+
const errors = [];
|
|
66
|
+
const warnings = [];
|
|
67
|
+
// Index der MD-Inhalte laden
|
|
68
|
+
const mdIndex = new Map();
|
|
69
|
+
if (fs.existsSync(modulesDir)) {
|
|
70
|
+
for (const entry of fs.readdirSync(modulesDir)) {
|
|
71
|
+
if (entry.endsWith('.md')) {
|
|
72
|
+
const full = path.join(modulesDir, entry);
|
|
73
|
+
try {
|
|
74
|
+
mdIndex.set(entry.replace(/\.md$/, ''), fs.readFileSync(full, 'utf8'));
|
|
75
|
+
}
|
|
76
|
+
catch { }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function isDocumented(symbolName) {
|
|
81
|
+
// Wir suchen eine Überschrift-Zeile "### function/class/interface/method/variable/type: symbolName"
|
|
82
|
+
// oder "### symbolName" (ohne Präfix)
|
|
83
|
+
const patterns = [
|
|
84
|
+
new RegExp(`^###\\s+(function|class|interface|method|variable|type|enum):\\s+${symbolName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*$`, 'm'),
|
|
85
|
+
new RegExp(`^###\\s+${symbolName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*$`, 'm')
|
|
86
|
+
];
|
|
87
|
+
for (const content of mdIndex.values()) {
|
|
88
|
+
for (const pattern of patterns) {
|
|
89
|
+
if (pattern.test(content))
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
for (const s of symbols) {
|
|
96
|
+
if (s.language !== 'ts' && s.language !== 'js')
|
|
97
|
+
continue;
|
|
98
|
+
const vis = s.signature.visibility ?? 'public';
|
|
99
|
+
if (vis !== 'public')
|
|
100
|
+
continue;
|
|
101
|
+
switch (s.kind) {
|
|
102
|
+
case 'class':
|
|
103
|
+
metrics.totalClasses++;
|
|
104
|
+
if (isDocumented(s.fullyQualifiedName))
|
|
105
|
+
metrics.documentedClasses++;
|
|
106
|
+
break;
|
|
107
|
+
case 'interface':
|
|
108
|
+
metrics.totalInterfaces++;
|
|
109
|
+
if (isDocumented(s.fullyQualifiedName))
|
|
110
|
+
metrics.documentedInterfaces++;
|
|
111
|
+
break;
|
|
112
|
+
case 'method':
|
|
113
|
+
metrics.totalMethods++;
|
|
114
|
+
if (isDocumented(s.fullyQualifiedName))
|
|
115
|
+
metrics.documentedMethods++;
|
|
116
|
+
break;
|
|
117
|
+
case 'function':
|
|
118
|
+
metrics.totalFunctions++;
|
|
119
|
+
if (isDocumented(s.fullyQualifiedName))
|
|
120
|
+
metrics.documentedFunctions++;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function ratio(doc, total) {
|
|
125
|
+
return total === 0 ? 1 : doc / total;
|
|
126
|
+
}
|
|
127
|
+
const classesOk = ratio(metrics.documentedClasses, metrics.totalClasses) >= thresholds.classes;
|
|
128
|
+
const interfacesOk = ratio(metrics.documentedInterfaces, metrics.totalInterfaces) >= thresholds.interfaces;
|
|
129
|
+
const methodsOk = ratio(metrics.documentedMethods, metrics.totalMethods) >= thresholds.methods;
|
|
130
|
+
const functionsOk = ratio(metrics.documentedFunctions, metrics.totalFunctions) >= thresholds.functions;
|
|
131
|
+
if (!classesOk)
|
|
132
|
+
errors.push(`Coverage Klassen < ${Math.round(thresholds.classes * 100)}% (${metrics.documentedClasses}/${metrics.totalClasses})`);
|
|
133
|
+
if (!interfacesOk)
|
|
134
|
+
errors.push(`Coverage Interfaces < ${Math.round(thresholds.interfaces * 100)}% (${metrics.documentedInterfaces}/${metrics.totalInterfaces})`);
|
|
135
|
+
if (!methodsOk)
|
|
136
|
+
errors.push(`Coverage Methoden < ${Math.round(thresholds.methods * 100)}% (${metrics.documentedMethods}/${metrics.totalMethods})`);
|
|
137
|
+
if (!functionsOk)
|
|
138
|
+
errors.push(`Coverage Funktionen < ${Math.round(thresholds.functions * 100)}% (${metrics.documentedFunctions}/${metrics.totalFunctions})`);
|
|
139
|
+
return { metrics, errors, warnings };
|
|
140
|
+
}
|
|
141
|
+
exports.computeCoverage = computeCoverage;
|
|
142
|
+
function validateMarkdownDir(modulesDir, symbols) {
|
|
143
|
+
const logger = new index_1.Logger({ component: 'validator' });
|
|
144
|
+
const errors = [];
|
|
145
|
+
const warnings = [];
|
|
146
|
+
const files = [];
|
|
147
|
+
if (!fs.existsSync(modulesDir)) {
|
|
148
|
+
errors.push('modules/ Verzeichnis fehlt');
|
|
149
|
+
return { errors, warnings, files };
|
|
150
|
+
}
|
|
151
|
+
let allMarkdownContent = '';
|
|
152
|
+
for (const entry of fs.readdirSync(modulesDir)) {
|
|
153
|
+
if (!entry.endsWith('.md'))
|
|
154
|
+
continue;
|
|
155
|
+
const full = path.join(modulesDir, entry);
|
|
156
|
+
try {
|
|
157
|
+
const content = fs.readFileSync(full, 'utf8');
|
|
158
|
+
allMarkdownContent += content + '\n';
|
|
159
|
+
const r = validateMarkdownContent(content);
|
|
160
|
+
files.push({ file: full, errors: r.errors, warnings: r.warnings });
|
|
161
|
+
errors.push(...r.errors.map(e => `${entry}: ${e}`));
|
|
162
|
+
warnings.push(...r.warnings.map(w => `${entry}: ${w}`));
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
errors.push(`${entry}: konnte nicht gelesen werden`);
|
|
166
|
+
logger.error('Markdown konnte nicht gelesen werden', e);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Signatur-Abgleich wenn Symbole verfügbar
|
|
170
|
+
let mismatchesCount = 0;
|
|
171
|
+
if (symbols) {
|
|
172
|
+
const mismatches = (0, signature_matching_1.validateSignatureMatching)(symbols, modulesDir);
|
|
173
|
+
mismatchesCount = mismatches.length;
|
|
174
|
+
if (mismatchesCount > 0) {
|
|
175
|
+
logger.info(`Signature mismatches detected: ${mismatchesCount}`);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
logger.info('No signature mismatches detected');
|
|
179
|
+
}
|
|
180
|
+
warnings.push(...mismatches.map(m => `Signatur-Abweichung ${m.symbolId}: erwartet "${m.expected}", dokumentiert "${m.documented}"`));
|
|
181
|
+
}
|
|
182
|
+
return { errors, warnings, files, mismatchesCount };
|
|
183
|
+
}
|
|
184
|
+
exports.validateMarkdownDir = validateMarkdownDir;
|
|
185
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAAyB;AACzB,2CAA6B;AAC7B,4CAA0C;AAC1C,6DAAiE;AAUjE,SAAgB,eAAe,CAAC,OAAuB;IACnD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,gEAAgE;IAChE,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACrB,IAAI,CAAC,CAAC,CAAC,kBAAkB,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE;YAC7C,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;SACrD;KACJ;IAED,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9D,CAAC;AAZD,0CAYC;AAED,SAAgB,uBAAuB,CAAC,EAAU;IAC9C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,oDAAoD;IACpD,MAAM,UAAU,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,UAAU,GAAG,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;KACtD;IACD,+BAA+B;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;QACpB,QAAQ,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC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AzCD,kDAyCC"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSignatureMatching = void 0;
|
|
4
|
+
const signature_formatter_1 = require("../core/signature-formatter");
|
|
5
|
+
const symbol_classifier_1 = require("../core/symbol-classifier");
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
* Validate signature matching between code and documentation
|
|
9
|
+
*/
|
|
10
|
+
function validateSignatureMatching(symbols, modulesDir, options = {}) {
|
|
11
|
+
const rawMismatches = [];
|
|
12
|
+
const depth = options.depth ?? 'full';
|
|
13
|
+
for (const symbol of symbols) {
|
|
14
|
+
const classification = (0, symbol_classifier_1.classifySymbol)(symbol);
|
|
15
|
+
if (!options.validateNonPublic && classification.visibility !== 'public') {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
// Alle Symbol-Typen validieren, auch Interfaces und Types
|
|
19
|
+
// if (symbol.kind === 'variable' || symbol.kind === 'type') continue; // ENTFERNT: Alle Typen validieren
|
|
20
|
+
// DATEI-SPEZIFISCHE SUCHE: Finde die korrekte Markdown-Datei für das Symbol
|
|
21
|
+
const markdownFileName = symbol.filePath.replace(/[\/\\]/g, '__') + '.md';
|
|
22
|
+
const markdownFilePath = require('path').join(modulesDir, markdownFileName);
|
|
23
|
+
if (!require('fs').existsSync(markdownFilePath))
|
|
24
|
+
continue;
|
|
25
|
+
const markdownContent = require('fs').readFileSync(markdownFilePath, 'utf8');
|
|
26
|
+
// Erwartete Signatur konsistent über SignatureFormatter rendern
|
|
27
|
+
const expectedSig = signature_formatter_1.SignatureFormatter.formatForDoc(symbol);
|
|
28
|
+
const docPattern = new RegExp(`###\\s+${symbol.kind}:\\s+${escapeRegex(symbol.fullyQualifiedName)}[\\s\\S]*?\`\`\`[^\\n]*\\n([\\s\\S]*?)\\n\`\`\``, 'i');
|
|
29
|
+
const match = markdownContent.match(docPattern);
|
|
30
|
+
if (match) {
|
|
31
|
+
const documentedSig = match[1].trim();
|
|
32
|
+
// Zentrale Vergleichslogik mit Toleranzen (optionale Felder, Generics)
|
|
33
|
+
const compareResult = signature_formatter_1.SignatureFormatter.compare(expectedSig, documentedSig, {
|
|
34
|
+
tolerateOptionalFields: true,
|
|
35
|
+
tolerateGenericSimplification: true
|
|
36
|
+
});
|
|
37
|
+
if (!compareResult.match && !isArchitecturallyValid(expectedSig, documentedSig, symbol)) {
|
|
38
|
+
// Bewertungslogik abhängig von Rolle und Doku-Tiefe
|
|
39
|
+
const severity = depth === 'full' && (classification.role === 'service-api' || classification.role === 'domain-model')
|
|
40
|
+
? 'error'
|
|
41
|
+
: 'warning';
|
|
42
|
+
rawMismatches.push({
|
|
43
|
+
symbolId: symbol.fullyQualifiedName,
|
|
44
|
+
expected: expectedSig,
|
|
45
|
+
documented: documentedSig,
|
|
46
|
+
severity
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Dedupliziere identische Abweichungen (gleiches Symbol + gleiche Signaturen)
|
|
52
|
+
const deduped = new Map();
|
|
53
|
+
for (const m of rawMismatches) {
|
|
54
|
+
const key = `${m.symbolId}::${m.expected}::${m.documented}`;
|
|
55
|
+
if (!deduped.has(key)) {
|
|
56
|
+
deduped.set(key, m);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return Array.from(deduped.values());
|
|
60
|
+
}
|
|
61
|
+
exports.validateSignatureMatching = validateSignatureMatching;
|
|
62
|
+
/**
|
|
63
|
+
* Prüft ob dokumentierte Signatur architektonisch gültig ist (z.B. Response Wrapper Pattern)
|
|
64
|
+
*/
|
|
65
|
+
function isArchitecturallyValid(expected, documented, symbol) {
|
|
66
|
+
// Normalisiere Whitespaces für Vergleich (gemeinsame Logik aus SignatureFormatter)
|
|
67
|
+
const expectedNorm = signature_formatter_1.SignatureFormatter.normalize(expected);
|
|
68
|
+
const documentedNorm = signature_formatter_1.SignatureFormatter.normalize(documented);
|
|
69
|
+
// Spezielle Behandlung für parser vs parserOptions (beide existieren in .eslintrc.json)
|
|
70
|
+
if ((expectedNorm.includes('parser:') && documentedNorm.includes('parserOptions:')) ||
|
|
71
|
+
(expectedNorm.includes('parserOptions:') && documentedNorm.includes('parser:'))) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
// Spezielle Behandlung für RepositoryFactory.get vs getDatabaseManager (Alias/Method-Name-Variation)
|
|
75
|
+
if ((expectedNorm.includes('get(') && documentedNorm.includes('getDatabaseManager()')) ||
|
|
76
|
+
(expectedNorm.includes('getDatabaseManager()') && documentedNorm.includes('get('))) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
// 1. Response Wrapper Pattern: EntityType() vs EntityTypeApiResponse()
|
|
80
|
+
if (isResponseWrapperPattern(expectedNorm, documentedNorm)) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
// 1a. Direkte Architektur-Toleranz für bekannte Patterns
|
|
84
|
+
if ((expectedNorm === 'Plugin()' && documentedNorm === 'PluginApiResponse()') ||
|
|
85
|
+
(expectedNorm === 'Snapshot()' && documentedNorm === 'SnapshotApiResponse()')) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
// 2. API-Config Pattern: AnalyticsApi vs AnalyticsApiConfig
|
|
89
|
+
// Erwartet: "AnalyticsApi" oder "class AnalyticsApi", Dokumentiert: "AnalyticsApiConfig" oder "interface AnalyticsApiConfig"
|
|
90
|
+
if (isApiConfigPattern(expectedNorm, documentedNorm)) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
// 3. Recommendation vs RecommendationRequest Pattern
|
|
94
|
+
// Erwartet: "Recommendation" oder "interface Recommendation", Dokumentiert: "RecommendationRequest" oder "interface RecommendationRequest"
|
|
95
|
+
if (isRecommendationPattern(expectedNorm, documentedNorm)) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
// 4. Manager-Suffix Pattern: DiagnosticsPublisher vs DiagnosticsPublisherManager
|
|
99
|
+
// Erwartet: "DiagnosticsPublisher" oder "class DiagnosticsPublisher", Dokumentiert: "DiagnosticsPublisherManager" oder "class DiagnosticsPublisherManager"
|
|
100
|
+
if (isManagerPattern(expectedNorm, documentedNorm)) {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
// 5. Config-Suffix Pattern (allgemein): X vs XConfig
|
|
104
|
+
// Erwartet: "X" oder "class X", Dokumentiert: "XConfig" oder "interface XConfig"
|
|
105
|
+
if (isConfigSuffixPattern(expectedNorm, documentedNorm)) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
// 6. Recommendation vs RecommendationApiConfig Pattern (spezialisiert)
|
|
109
|
+
// Erwartet: "Recommendation", Dokumentiert: "RecommendationApiConfig"
|
|
110
|
+
// Das sind zwei verschiedene Interfaces, aber es ist ein bekanntes Pattern
|
|
111
|
+
if (isRecommendationApiConfigPattern(expectedNorm, documentedNorm)) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Erkennt Response Wrapper Pattern: Plugin() → PluginApiResponse()
|
|
118
|
+
*/
|
|
119
|
+
function isResponseWrapperPattern(expected, documented) {
|
|
120
|
+
// Extrahiere Funktionsnamen aus Signaturen
|
|
121
|
+
const extractFunctionName = (sig) => {
|
|
122
|
+
const match = sig.match(/^(\w+)\(/);
|
|
123
|
+
return match ? match[1] : '';
|
|
124
|
+
};
|
|
125
|
+
const expectedName = extractFunctionName(expected);
|
|
126
|
+
const documentedName = extractFunctionName(documented);
|
|
127
|
+
// Prüfe ob documented = expected + "ApiResponse" Pattern
|
|
128
|
+
if (documentedName === expectedName + 'ApiResponse') {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
// Prüfe auch umgekehrte Richtung: PluginApiResponse → Plugin
|
|
132
|
+
if (expectedName === documentedName + 'ApiResponse') {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Erkennt API-Config Pattern: AnalyticsApi vs AnalyticsApiConfig
|
|
139
|
+
*/
|
|
140
|
+
function isApiConfigPattern(expected, documented) {
|
|
141
|
+
const extractName = (sig) => {
|
|
142
|
+
// Normalisierte Signaturen können sein: "AnalyticsApi", "class AnalyticsApi", "interface AnalyticsApiConfig", "AnalyticsApi: AnalyticsApiConfig"
|
|
143
|
+
// Extrahiere den Namen (erstes Wort nach "class"/"interface" oder erstes Wort vor ":" oder "{" oder am Anfang)
|
|
144
|
+
const match = sig.match(/(?:class|interface|type|enum)\s+(\w+)|^(\w+)(?::|\{|$)/);
|
|
145
|
+
return match ? (match[1] || match[2]) : '';
|
|
146
|
+
};
|
|
147
|
+
const expectedName = extractName(expected);
|
|
148
|
+
const documentedName = extractName(documented);
|
|
149
|
+
if (!expectedName || !documentedName)
|
|
150
|
+
return false;
|
|
151
|
+
// Prüfe ob documented = expected + "Config" Pattern (z.B. AnalyticsApi → AnalyticsApiConfig)
|
|
152
|
+
if (documentedName === expectedName + 'Config') {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
// Prüfe auch umgekehrte Richtung: AnalyticsApiConfig → AnalyticsApi
|
|
156
|
+
if (expectedName === documentedName + 'Config') {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Erkennt Recommendation Pattern: Recommendation vs RecommendationRequest
|
|
163
|
+
*/
|
|
164
|
+
function isRecommendationPattern(expected, documented) {
|
|
165
|
+
const extractName = (sig) => {
|
|
166
|
+
// Normalisierte Signaturen können sein: "Recommendation", "interface Recommendation", "interface RecommendationRequest {...}"
|
|
167
|
+
// Extrahiere den Namen (erstes Wort nach "interface"/"class" oder erstes Wort vor ":" oder "{" oder am Anfang)
|
|
168
|
+
const match = sig.match(/(?:interface|class|type|enum)\s+(\w+)|^(\w+)(?::|\{|$)/);
|
|
169
|
+
return match ? (match[1] || match[2]) : '';
|
|
170
|
+
};
|
|
171
|
+
const expectedName = extractName(expected);
|
|
172
|
+
const documentedName = extractName(documented);
|
|
173
|
+
if (!expectedName || !documentedName)
|
|
174
|
+
return false;
|
|
175
|
+
// Prüfe ob documented = expected + "Request" Pattern (z.B. Recommendation → RecommendationRequest)
|
|
176
|
+
if (documentedName === expectedName + 'Request') {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
// Prüfe auch umgekehrte Richtung: RecommendationRequest → Recommendation
|
|
180
|
+
if (expectedName === documentedName + 'Request') {
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Erkennt Manager-Suffix Pattern: DiagnosticsPublisher vs DiagnosticsPublisherManager
|
|
187
|
+
*/
|
|
188
|
+
function isManagerPattern(expected, documented) {
|
|
189
|
+
const extractName = (sig) => {
|
|
190
|
+
// Normalisierte Signaturen können sein: "DiagnosticsPublisher", "class DiagnosticsPublisher", "class DiagnosticsPublisherManager"
|
|
191
|
+
// Extrahiere den Namen (erstes Wort nach "class"/"interface" oder erstes Wort vor ":" oder "{" oder am Anfang)
|
|
192
|
+
const match = sig.match(/(?:class|interface|type|enum)\s+(\w+)|^(\w+)(?::|\{|$)/);
|
|
193
|
+
return match ? (match[1] || match[2]) : '';
|
|
194
|
+
};
|
|
195
|
+
const expectedName = extractName(expected);
|
|
196
|
+
const documentedName = extractName(documented);
|
|
197
|
+
if (!expectedName || !documentedName)
|
|
198
|
+
return false;
|
|
199
|
+
// Prüfe ob documented = expected + "Manager" Pattern (z.B. DiagnosticsPublisher → DiagnosticsPublisherManager)
|
|
200
|
+
if (documentedName === expectedName + 'Manager') {
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
// Prüfe auch umgekehrte Richtung: DiagnosticsPublisherManager → DiagnosticsPublisher
|
|
204
|
+
if (expectedName === documentedName + 'Manager') {
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Erkennt Config-Suffix Pattern (allgemein): X vs XConfig
|
|
211
|
+
*/
|
|
212
|
+
function isConfigSuffixPattern(expected, documented) {
|
|
213
|
+
const extractName = (sig) => {
|
|
214
|
+
// Normalisierte Signaturen können sein: "ComputationCache", "class ComputationCache", "interface ComputationCacheConfig"
|
|
215
|
+
// Extrahiere den Namen (erstes Wort nach "class"/"interface" oder erstes Wort vor ":" oder "{" oder am Anfang)
|
|
216
|
+
const match = sig.match(/(?:class|interface|type|enum)\s+(\w+)|^(\w+)(?::|\{|$)/);
|
|
217
|
+
return match ? (match[1] || match[2]) : '';
|
|
218
|
+
};
|
|
219
|
+
const expectedName = extractName(expected);
|
|
220
|
+
const documentedName = extractName(documented);
|
|
221
|
+
if (!expectedName || !documentedName)
|
|
222
|
+
return false;
|
|
223
|
+
// Prüfe ob documented = expected + "Config" Pattern (z.B. ComputationCache → ComputationCacheConfig)
|
|
224
|
+
if (documentedName === expectedName + 'Config') {
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
// Prüfe auch umgekehrte Richtung: ComputationCacheConfig → ComputationCache
|
|
228
|
+
if (expectedName === documentedName + 'Config') {
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Erkennt Recommendation vs RecommendationApiConfig Pattern
|
|
235
|
+
* Spezieller Fall: Recommendation (Interface) vs RecommendationApiConfig (Interface)
|
|
236
|
+
*/
|
|
237
|
+
function isRecommendationApiConfigPattern(expected, documented) {
|
|
238
|
+
const extractName = (sig) => {
|
|
239
|
+
// Normalisierte Signaturen können sein: "Recommendation", "interface Recommendation", "RecommendationApiConfig"
|
|
240
|
+
// Extrahiere den Namen (erstes Wort nach "class"/"interface" oder erstes Wort vor ":" oder "{" oder am Anfang)
|
|
241
|
+
const match = sig.match(/(?:class|interface|type|enum)\s+(\w+)|^(\w+)(?::|\{|$)/);
|
|
242
|
+
return match ? (match[1] || match[2]) : '';
|
|
243
|
+
};
|
|
244
|
+
const expectedName = extractName(expected);
|
|
245
|
+
const documentedName = extractName(documented);
|
|
246
|
+
if (!expectedName || !documentedName)
|
|
247
|
+
return false;
|
|
248
|
+
// Spezieller Fall: "Recommendation" vs "RecommendationApiConfig"
|
|
249
|
+
if (expectedName === 'Recommendation' && documentedName === 'RecommendationApiConfig') {
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
// Umgekehrte Richtung: "RecommendationApiConfig" vs "Recommendation"
|
|
253
|
+
if (expectedName === 'RecommendationApiConfig' && documentedName === 'Recommendation') {
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
function escapeRegex(str) {
|
|
259
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=signature-matching.js.map
|