@reqlan/analytical 0.9.1 → 0.10.1
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/README.md +19 -2
- package/README.template.md +1 -1
- package/out/core/barrel-page.d.ts +2 -1
- package/out/core/barrel-page.js +18 -83
- package/out/core/barrel-page.js.map +1 -1
- package/out/core/base-discovery.d.ts +6 -0
- package/out/core/base-discovery.js +47 -2
- package/out/core/base-discovery.js.map +1 -1
- package/out/core/create-base.js +10 -14
- package/out/core/create-base.js.map +1 -1
- package/out/core/file-reference-resolve.js +3 -1
- package/out/core/file-reference-resolve.js.map +1 -1
- package/out/core/index-error.d.ts +3 -3
- package/out/core/index-error.js.map +1 -1
- package/out/core/index-state-types.d.ts +47 -0
- package/out/core/index-state-types.js +11 -0
- package/out/core/index-state-types.js.map +1 -0
- package/out/core/path-relative.d.ts +15 -0
- package/out/core/path-relative.js +84 -0
- package/out/core/path-relative.js.map +1 -0
- package/out/core/rqignore.js +62 -62
- package/out/core/rqignore.js.map +1 -1
- package/out/core/types.d.ts +4 -3
- package/out/core/types.js +4 -1
- package/out/core/types.js.map +1 -1
- package/out/core/workspace-paths.d.ts +1 -2
- package/out/core/workspace-paths.js +6 -46
- package/out/core/workspace-paths.js.map +1 -1
- package/out/export/build-export-snapshot.js +1 -1
- package/out/export/build-export-snapshot.js.map +1 -1
- package/out/export/export-utils.d.ts +5 -0
- package/out/export/export-utils.js +38 -0
- package/out/export/export-utils.js.map +1 -0
- package/out/export/write-csv-export.js +1 -1
- package/out/export/write-csv-export.js.map +1 -1
- package/out/export/write-markdown-export.js +1 -1
- package/out/export/write-markdown-export.js.map +1 -1
- package/out/index-store/base-registry.d.ts +2 -3
- package/out/index-store/base-registry.js +8 -4
- package/out/index-store/base-registry.js.map +1 -1
- package/out/index-store/fuzzy-search-hit.d.ts +10 -0
- package/out/index-store/fuzzy-search-hit.js +2 -0
- package/out/index-store/fuzzy-search-hit.js.map +1 -0
- package/out/index-store/index-diagnostics-store.d.ts +4 -0
- package/out/index-store/index-diagnostics-store.js +44 -88
- package/out/index-store/index-diagnostics-store.js.map +1 -1
- package/out/index-store/index-file-error.d.ts +1 -1
- package/out/index-store/index-parse-issues.d.ts +4 -3
- package/out/index-store/index-parse-issues.js +0 -38
- package/out/index-store/index-parse-issues.js.map +1 -1
- package/out/index-store/index-status.d.ts +1 -1
- package/out/index-store/sqlite-store.d.ts +6 -2
- package/out/index-store/sqlite-store.js +70 -613
- package/out/index-store/sqlite-store.js.map +1 -1
- package/out/index-store/webview-graph-queries.d.ts +5 -0
- package/out/index-store/webview-graph-queries.js.map +1 -1
- package/out/index-store/workspace-index-file.d.ts +3 -14
- package/out/index-store/workspace-index-file.js +1 -114
- package/out/index-store/workspace-index-file.js.map +1 -1
- package/out/index-store/workspace-index-sync.d.ts +4 -17
- package/out/index-store/workspace-index-sync.js +29 -11
- package/out/index-store/workspace-index-sync.js.map +1 -1
- package/out/index-store/workspace-index.d.ts +36 -9
- package/out/index-store/workspace-index.js +223 -120
- package/out/index-store/workspace-index.js.map +1 -1
- package/out/index.d.ts +16 -43
- package/out/index.js +9 -25
- package/out/index.js.map +1 -1
- package/out/native/generated.d.ts +102 -0
- package/out/native/generated.js +4 -0
- package/out/native/generated.js.map +1 -0
- package/out/native/index.d.ts +17 -0
- package/out/native/index.js +12 -0
- package/out/native/index.js.map +1 -0
- package/out/native/load-native.d.ts +50 -0
- package/out/native/load-native.js +186 -0
- package/out/native/load-native.js.map +1 -0
- package/out/{analysis-api.d.ts → native/native-analysis-api.d.ts} +19 -19
- package/out/native/native-analysis-api.js +212 -0
- package/out/native/native-analysis-api.js.map +1 -0
- package/out/native/native-index-store.d.ts +5 -0
- package/out/native/native-index-store.js +6 -0
- package/out/native/native-index-store.js.map +1 -0
- package/out/native/native-sql-db.d.ts +135 -0
- package/out/native/native-sql-db.js +217 -0
- package/out/native/native-sql-db.js.map +1 -0
- package/out/native/native-workspace-index.d.ts +164 -0
- package/out/native/native-workspace-index.js +283 -0
- package/out/native/native-workspace-index.js.map +1 -0
- package/out/native/open-analysis-api.d.ts +16 -0
- package/out/native/open-analysis-api.js +21 -0
- package/out/native/open-analysis-api.js.map +1 -0
- package/out/native/parse-source.d.ts +24 -0
- package/out/native/parse-source.js +26 -0
- package/out/native/parse-source.js.map +1 -0
- package/package.json +18 -30
- package/out/analysis/analyser-registry.d.ts +0 -21
- package/out/analysis/analyser-registry.js +0 -33
- package/out/analysis/analyser-registry.js.map +0 -1
- package/out/analysis/completion-tracking-analyser.d.ts +0 -3
- package/out/analysis/completion-tracking-analyser.js +0 -37
- package/out/analysis/completion-tracking-analyser.js.map +0 -1
- package/out/analysis/contextual-search.d.ts +0 -26
- package/out/analysis/contextual-search.js +0 -94
- package/out/analysis/contextual-search.js.map +0 -1
- package/out/analysis/deprecation-impact-analyser.d.ts +0 -3
- package/out/analysis/deprecation-impact-analyser.js +0 -21
- package/out/analysis/deprecation-impact-analyser.js.map +0 -1
- package/out/analysis/file-related-analyser.d.ts +0 -5
- package/out/analysis/file-related-analyser.js +0 -41
- package/out/analysis/file-related-analyser.js.map +0 -1
- package/out/analysis/fuzzy-search-analyser.d.ts +0 -17
- package/out/analysis/fuzzy-search-analyser.js +0 -25
- package/out/analysis/fuzzy-search-analyser.js.map +0 -1
- package/out/analysis/fuzzy-search-worker-client.d.ts +0 -39
- package/out/analysis/fuzzy-search-worker-client.js +0 -178
- package/out/analysis/fuzzy-search-worker-client.js.map +0 -1
- package/out/analysis/fuzzy-search-worker.d.ts +0 -32
- package/out/analysis/fuzzy-search-worker.js +0 -81
- package/out/analysis/fuzzy-search-worker.js.map +0 -1
- package/out/analysis/fuzzy-search.d.ts +0 -62
- package/out/analysis/fuzzy-search.js +0 -471
- package/out/analysis/fuzzy-search.js.map +0 -1
- package/out/analysis/git-dates-analyser.d.ts +0 -12
- package/out/analysis/git-dates-analyser.js +0 -96
- package/out/analysis/git-dates-analyser.js.map +0 -1
- package/out/analysis/list-ideas-analyser.d.ts +0 -3
- package/out/analysis/list-ideas-analyser.js +0 -7
- package/out/analysis/list-ideas-analyser.js.map +0 -1
- package/out/analysis/local-graph-analyser.d.ts +0 -6
- package/out/analysis/local-graph-analyser.js +0 -42
- package/out/analysis/local-graph-analyser.js.map +0 -1
- package/out/analysis/semantic-search-analyser.d.ts +0 -8
- package/out/analysis/semantic-search-analyser.js +0 -51
- package/out/analysis/semantic-search-analyser.js.map +0 -1
- package/out/analysis-api.js +0 -199
- package/out/analysis-api.js.map +0 -1
- package/out/core/analytical-store.d.ts +0 -85
- package/out/core/analytical-store.js +0 -143
- package/out/core/analytical-store.js.map +0 -1
- package/out/core/context-model.d.ts +0 -204
- package/out/core/context-model.js +0 -36
- package/out/core/context-model.js.map +0 -1
- package/out/core/context-signals.d.ts +0 -154
- package/out/core/context-signals.js +0 -406
- package/out/core/context-signals.js.map +0 -1
- package/out/create-runtime.d.ts +0 -47
- package/out/create-runtime.js +0 -79
- package/out/create-runtime.js.map +0 -1
- package/out/export/export-html.d.ts +0 -4
- package/out/export/export-html.js +0 -12
- package/out/export/export-html.js.map +0 -1
- package/out/export/html-export-assets.d.ts +0 -3
- package/out/export/html-export-assets.js +0 -2294
- package/out/export/html-export-assets.js.map +0 -1
- package/out/export/html-export-template.d.ts +0 -18
- package/out/export/html-export-template.js +0 -1154
- package/out/export/html-export-template.js.map +0 -1
- package/out/export/html-export-utils.d.ts +0 -86
- package/out/export/html-export-utils.js +0 -485
- package/out/export/html-export-utils.js.map +0 -1
- package/out/export/write-html-export.d.ts +0 -2
- package/out/export/write-html-export.js +0 -181
- package/out/export/write-html-export.js.map +0 -1
- package/out/graph/physics-core-source.d.ts +0 -5
- package/out/graph/physics-core-source.js +0 -8
- package/out/graph/physics-core-source.js.map +0 -1
- package/out/graph/physics-core.d.ts +0 -141
- package/out/graph/physics-core.js +0 -237
- package/out/graph/physics-core.js.map +0 -1
- package/out/index-store/file-treatment.d.ts +0 -40
- package/out/index-store/file-treatment.js +0 -144
- package/out/index-store/file-treatment.js.map +0 -1
- package/out/index-store/idea-extractor.d.ts +0 -11
- package/out/index-store/idea-extractor.js +0 -351
- package/out/index-store/idea-extractor.js.map +0 -1
- package/out/index-store/overview-coverage.d.ts +0 -23
- package/out/index-store/overview-coverage.js +0 -254
- package/out/index-store/overview-coverage.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
# @reqlan/analytical
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Native requirement graph index and analysis API for reqlan
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
- Headless requirement graph index (
|
|
11
|
+
- Headless requirement graph index (rusqlite via napi) over parsed `.rq` workspaces
|
|
12
12
|
- Shared application memory under `<workspace>/.reqlan` (ideas-index.sqlite) for extension, CLI, and MCP
|
|
13
13
|
- Analysers for semantic search, file context, local graphs, and completion status
|
|
14
14
|
- `AnalysisApi` façade shared by the CLI and MCP server
|
|
@@ -30,6 +30,23 @@ npm install @reqlan/analytical
|
|
|
30
30
|
|
|
31
31
|
## Changelog
|
|
32
32
|
|
|
33
|
+
### 0.10.1
|
|
34
|
+
|
|
35
|
+
#### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 06e9150: fix build and deps.
|
|
38
|
+
|
|
39
|
+
### 0.10.0
|
|
40
|
+
|
|
41
|
+
#### Minor Changes
|
|
42
|
+
|
|
43
|
+
- e9b7e8a: rust
|
|
44
|
+
|
|
45
|
+
#### Patch Changes
|
|
46
|
+
|
|
47
|
+
- 72246b6: up pnpm
|
|
48
|
+
- 70ccc6f: up pnpm version
|
|
49
|
+
|
|
33
50
|
### 0.9.1
|
|
34
51
|
|
|
35
52
|
#### Patch Changes
|
package/README.template.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
- Headless requirement graph index (
|
|
11
|
+
- Headless requirement graph index (rusqlite via napi) over parsed `.rq` workspaces
|
|
12
12
|
- Shared application memory under `<workspace>/.reqlan` (ideas-index.sqlite) for extension, CLI, and MCP
|
|
13
13
|
- Analysers for semantic search, file context, local graphs, and completion status
|
|
14
14
|
- `AnalysisApi` façade shared by the CLI and MCP server
|
|
@@ -38,7 +38,8 @@ export declare function planBarrelPage(sourceText: string, options?: BarrelPageP
|
|
|
38
38
|
export declare function barrelPage(filePath: string, options?: BarrelPageOptions): Promise<BarrelPageResult>;
|
|
39
39
|
/**
|
|
40
40
|
* Rewrite same-file sibling idea refs `[other]` to `[other.other]` and record needed imports.
|
|
41
|
-
* Leaves wiki links `[[...]]` and already-qualified refs untouched.
|
|
41
|
+
* Leaves wiki links `[[...]]` and already-qualified refs untouched. Pure text helper mirrored
|
|
42
|
+
* in the native barrel engine; kept in TS for webview edits and re-use without a native round-trip.
|
|
42
43
|
*/
|
|
43
44
|
export declare function rewriteSiblingRefs(text: string, selfName: string, siblingNames: ReadonlySet<string>): {
|
|
44
45
|
text: string;
|
package/out/core/barrel-page.js
CHANGED
|
@@ -1,86 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Barrel a large `.rq` page into a container that imports one file per top-level idea.
|
|
3
|
-
*
|
|
3
|
+
* The plan is computed by the native engine (`reqlan-parse`); this module only performs
|
|
4
|
+
* the filesystem writes. Shared by CLI `barrel`, the extension code action, and headless tools.
|
|
4
5
|
*
|
|
5
6
|
* rq:["../../../reqlan rq/extension/features-commands.rq".barrel_page]
|
|
6
7
|
* rq:["../../../reqlan rq/extension/features-commands.rq".file_based_code_actions]
|
|
8
|
+
* rq:["../../../reqlan rq/core_analysis/rust_port.rq".native_bridge]
|
|
7
9
|
*/
|
|
8
10
|
import { existsSync } from 'node:fs';
|
|
9
11
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
10
12
|
import { basename, dirname, join, resolve } from 'node:path';
|
|
11
|
-
import {
|
|
12
|
-
import { createReqlanServices, fileBasenameAlias, ideaDeclarationText, isIdeaSet, isModel, isRefactorIdeaDeclaration } from '@reqlan/language';
|
|
13
|
+
import { loadNativeEngine } from '../native/load-native.js';
|
|
13
14
|
/**
|
|
14
15
|
* Plan a barrel transform from source text (no filesystem writes).
|
|
15
16
|
*/
|
|
16
17
|
export async function planBarrelPage(sourceText, options = {}) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
services.shared.workspace.LangiumDocuments.addDocument(document);
|
|
21
|
-
await services.shared.workspace.DocumentBuilder.build([document], { validation: false });
|
|
22
|
-
const model = document.parseResult.value;
|
|
23
|
-
if (!isModel(model)) {
|
|
24
|
-
throw new Error('Failed to parse reqlan document for barrel page.');
|
|
18
|
+
const engine = loadNativeEngine();
|
|
19
|
+
if (typeof engine.barrelPagePlan !== 'function') {
|
|
20
|
+
throw new Error('Native barrelPagePlan is missing; rebuild crates/reqlan-napi (cargo build -p reqlan-napi).');
|
|
25
21
|
}
|
|
26
|
-
const
|
|
27
|
-
const ideasetTexts = [];
|
|
28
|
-
for (const element of model.elements) {
|
|
29
|
-
if (isRefactorIdeaDeclaration(element)) {
|
|
30
|
-
ideas.push(element);
|
|
31
|
-
}
|
|
32
|
-
else if (isIdeaSet(element)) {
|
|
33
|
-
const text = element.$cstNode
|
|
34
|
-
? document.textDocument.getText(element.$cstNode.range)
|
|
35
|
-
: undefined;
|
|
36
|
-
if (text) {
|
|
37
|
-
ideasetTexts.push(text.trimEnd());
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (ideas.length === 0) {
|
|
42
|
-
throw new Error('Barrel page requires at least one top-level idea.');
|
|
43
|
-
}
|
|
44
|
-
const containerName = options.containerName?.trim()
|
|
45
|
-
|| fileBasenameAlias(sourceFileName);
|
|
46
|
-
if (!containerName) {
|
|
47
|
-
throw new Error('Container idea name must not be empty.');
|
|
48
|
-
}
|
|
49
|
-
if (ideas.some(idea => idea.name === containerName)) {
|
|
50
|
-
throw new Error(`Container name "${containerName}" conflicts with an idea being barreled; choose a different --name.`);
|
|
51
|
-
}
|
|
52
|
-
const siblingNames = new Set(ideas.map(idea => idea.name));
|
|
53
|
-
const importPreamble = extractImportPreamble(document, model);
|
|
54
|
-
const children = ideas.map(idea => {
|
|
55
|
-
const declaration = ideaDeclarationText(document, idea);
|
|
56
|
-
if (!declaration) {
|
|
57
|
-
throw new Error(`Could not read declaration text for idea "${idea.name}".`);
|
|
58
|
-
}
|
|
59
|
-
const { text: rewritten, neededSiblings } = rewriteSiblingRefs(declaration.trimEnd(), idea.name, siblingNames);
|
|
60
|
-
const siblingImports = neededSiblings
|
|
61
|
-
.map(name => `import "./${name}.rq" as ${name}`)
|
|
62
|
-
.join('\n');
|
|
63
|
-
const parts = [importPreamble.trimEnd(), siblingImports, rewritten]
|
|
64
|
-
.filter(part => part && part.length > 0);
|
|
65
|
-
return {
|
|
66
|
-
ideaName: idea.name,
|
|
67
|
-
fileName: `${idea.name}.rq`,
|
|
68
|
-
content: `${parts.join('\n\n')}\n`
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
const importLines = children
|
|
72
|
-
.map(child => `import "./${child.fileName}" as ${child.ideaName}`)
|
|
73
|
-
.join('\n');
|
|
74
|
-
const memberRefs = children
|
|
75
|
-
.map(child => ` [${child.ideaName}.${child.ideaName}]`)
|
|
76
|
-
.join('\n');
|
|
77
|
-
const preservedBlock = ideasetTexts.length > 0 ? `\n\n${ideasetTexts.join('\n\n')}` : '';
|
|
78
|
-
const containerContent = `${importLines}\n\n${containerName} {\n${memberRefs}\n}${preservedBlock}\n`;
|
|
22
|
+
const plan = engine.barrelPagePlan(sourceText, options.containerName, options.sourceFileName ?? 'page.rq');
|
|
79
23
|
return {
|
|
80
|
-
containerName,
|
|
81
|
-
containerContent,
|
|
82
|
-
children
|
|
83
|
-
|
|
24
|
+
containerName: plan.containerName,
|
|
25
|
+
containerContent: plan.containerContent,
|
|
26
|
+
children: plan.children.map(child => ({
|
|
27
|
+
ideaName: child.ideaName,
|
|
28
|
+
fileName: child.fileName,
|
|
29
|
+
content: child.content
|
|
30
|
+
})),
|
|
31
|
+
preservedIdeasets: plan.preservedIdeasets
|
|
84
32
|
};
|
|
85
33
|
}
|
|
86
34
|
/**
|
|
@@ -124,23 +72,10 @@ export async function barrelPage(filePath, options = {}) {
|
|
|
124
72
|
dryRun
|
|
125
73
|
};
|
|
126
74
|
}
|
|
127
|
-
function extractImportPreamble(document, model) {
|
|
128
|
-
if (model.imports.length === 0) {
|
|
129
|
-
return '';
|
|
130
|
-
}
|
|
131
|
-
const first = model.imports[0]?.$cstNode?.range.start;
|
|
132
|
-
const last = model.imports[model.imports.length - 1]?.$cstNode?.range.end;
|
|
133
|
-
if (!first || !last) {
|
|
134
|
-
return '';
|
|
135
|
-
}
|
|
136
|
-
return document.textDocument.getText({
|
|
137
|
-
start: { line: first.line, character: 0 },
|
|
138
|
-
end: last
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
75
|
/**
|
|
142
76
|
* Rewrite same-file sibling idea refs `[other]` to `[other.other]` and record needed imports.
|
|
143
|
-
* Leaves wiki links `[[...]]` and already-qualified refs untouched.
|
|
77
|
+
* Leaves wiki links `[[...]]` and already-qualified refs untouched. Pure text helper mirrored
|
|
78
|
+
* in the native barrel engine; kept in TS for webview edits and re-use without a native round-trip.
|
|
144
79
|
*/
|
|
145
80
|
export function rewriteSiblingRefs(text, selfName, siblingNames) {
|
|
146
81
|
const needed = new Set();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"barrel-page.js","sourceRoot":"","sources":["../../src/core/barrel-page.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"barrel-page.js","sourceRoot":"","sources":["../../src/core/barrel-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,QAA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CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO;QACH,GAAG,IAAI;QACP,UAAU;QACV,YAAY;QACZ,MAAM;KACT,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAC9B,IAAY,EACZ,QAAgB,EAChB,YAAiC;IAEjC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,yCAAyC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAC9F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,IAAI,KAAK,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACjD,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC;IACjC,CAAC,CAAC,CAAC;IACH,OAAO;QACH,IAAI,EAAE,SAAS;QACf,cAAc,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE;KACrC,CAAC;AACN,CAAC"}
|
|
@@ -19,6 +19,12 @@ export declare function discoverBasesUnder(root: string): BaseDescriptor[];
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function discoverBases(roots: string[]): BaseDescriptor[];
|
|
21
21
|
export declare function toBaseDescriptor(baseRoot: string, labelRoot?: string): BaseDescriptor;
|
|
22
|
+
/**
|
|
23
|
+
* Nearest ancestor directory that owns `.reqlan` (O(depth) `existsSync`).
|
|
24
|
+
* Use this on click / selection / open paths — never `discoverBases`, which walks the tree.
|
|
25
|
+
* When `stopAt` is set, do not walk above those roots (typically workspace folders).
|
|
26
|
+
*/
|
|
27
|
+
export declare function nearestBaseRoot(absPath: string, stopAt?: readonly string[]): string | undefined;
|
|
22
28
|
/** Longest-matching base root that contains `absPath`, or undefined. */
|
|
23
29
|
export declare function baseForPath(bases: readonly BaseDescriptor[], absPath: string): BaseDescriptor | undefined;
|
|
24
30
|
/** True if `filePath` is under `dir` (or equal). */
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
* Walk pruning uses built-in `.rqignore` defaults (and the search root's `.reqlan/.rqignore`
|
|
6
6
|
* when that root is already a base).
|
|
7
7
|
*
|
|
8
|
+
* rq:["../../../reqlan rq/ontology.rq".base]
|
|
8
9
|
* rq:["../../../reqlan rq/extension/configuration.rq".configuration_rqignore]
|
|
9
10
|
* rq:["../../../reqlan rq/extension/module/index.rq".rqignore]
|
|
10
11
|
*/
|
|
11
12
|
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
12
|
-
import { basename, join, relative, resolve, sep } from 'node:path';
|
|
13
|
+
import { basename, dirname, join, relative, resolve, sep } from 'node:path';
|
|
13
14
|
import { APPLICATION_MEMORY_DIR } from './application-memory.js';
|
|
14
15
|
import { isIgnoredPath, loadRqIgnore } from './rqignore.js';
|
|
15
|
-
import { relativeWindowsDrivePath } from './
|
|
16
|
+
import { relativeWindowsDrivePath } from './path-relative.js';
|
|
16
17
|
function normalizeRoot(path) {
|
|
17
18
|
return resolve(path).replace(/\\/g, '/');
|
|
18
19
|
}
|
|
@@ -94,6 +95,50 @@ export function toBaseDescriptor(baseRoot, labelRoot) {
|
|
|
94
95
|
}
|
|
95
96
|
return { id, root, memoryPath, label };
|
|
96
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Nearest ancestor directory that owns `.reqlan` (O(depth) `existsSync`).
|
|
100
|
+
* Use this on click / selection / open paths — never `discoverBases`, which walks the tree.
|
|
101
|
+
* When `stopAt` is set, do not walk above those roots (typically workspace folders).
|
|
102
|
+
*/
|
|
103
|
+
export function nearestBaseRoot(absPath, stopAt) {
|
|
104
|
+
const target = resolve(absPath);
|
|
105
|
+
let dir = target;
|
|
106
|
+
try {
|
|
107
|
+
if (statSync(dir).isFile()) {
|
|
108
|
+
dir = dirname(dir);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
dir = dirname(dir);
|
|
113
|
+
}
|
|
114
|
+
const stops = (stopAt ?? []).map(root => resolve(root));
|
|
115
|
+
const insideStop = (path) => stops.length === 0 || stops.some(stop => isPathInsideOrEqual(path, stop));
|
|
116
|
+
while (insideStop(dir)) {
|
|
117
|
+
const marker = join(dir, APPLICATION_MEMORY_DIR);
|
|
118
|
+
try {
|
|
119
|
+
if (existsSync(marker) && statSync(marker).isDirectory()) {
|
|
120
|
+
return dir;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
// unreadable marker — keep walking
|
|
125
|
+
}
|
|
126
|
+
if (stops.some(stop => pathsEqual(dir, stop))) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
const parent = dirname(dir);
|
|
130
|
+
if (parent === dir) {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
dir = parent;
|
|
134
|
+
}
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
function pathsEqual(left, right) {
|
|
138
|
+
const leftCmp = process.platform === 'win32' ? resolve(left).toLowerCase() : resolve(left);
|
|
139
|
+
const rightCmp = process.platform === 'win32' ? resolve(right).toLowerCase() : resolve(right);
|
|
140
|
+
return leftCmp === rightCmp;
|
|
141
|
+
}
|
|
97
142
|
/** Longest-matching base root that contains `absPath`, or undefined. */
|
|
98
143
|
export function baseForPath(bases, absPath) {
|
|
99
144
|
const target = resolve(absPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-discovery.js","sourceRoot":"","sources":["../../src/core/base-discovery.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"base-discovery.js","sourceRoot":"","sources":["../../src/core/base-discovery.ts"],"names":[],"mappings":"AAAA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G;AACH,MAAM,UAAU,iBAAiB,CAC7B,KAAgC,EAChC,GAAY;IAEZ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,GAAG,EAAE,CAAC;QACN,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACtC,IAAI,KAAK,EAAE,CAAC;YACR,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,YAAY,CAAC,IAAY;IACrC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
|
package/out/core/create-base.js
CHANGED
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Create a reqlan base by writing the `.reqlan` application-memory marker.
|
|
3
|
-
*
|
|
3
|
+
* The native engine seeds `config.json` + `.rqignore` (single source of truth for
|
|
4
|
+
* the default ignore patterns); this wrapper returns the base descriptor.
|
|
4
5
|
*
|
|
5
6
|
* rq:["../../../reqlan rq/extension/module/index.rq".rqignore]
|
|
6
7
|
* rq:["../../../reqlan rq/extension/configuration.rq".configuration_rqignore]
|
|
8
|
+
* rq:["../../../reqlan rq/core_analysis/rust_port.rq".native_bridge]
|
|
7
9
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { join, resolve } from 'node:path';
|
|
11
|
-
import { CONFIG_FILENAME, RQIGNORE_FILENAME, resolveApplicationMemoryPath } from './application-memory.js';
|
|
10
|
+
import { resolve } from 'node:path';
|
|
11
|
+
import { loadNativeEngine } from '../native/load-native.js';
|
|
12
12
|
import { toBaseDescriptor } from './base-discovery.js';
|
|
13
|
-
import { defaultRqIgnoreFileContents } from './rqignore.js';
|
|
14
|
-
const DEFAULT_CONFIG_JSON = `${JSON.stringify({}, null, 2)}\n`;
|
|
15
13
|
/**
|
|
16
14
|
* Ensure `<baseRoot>/.reqlan/` exists and seed `config.json` + `.rqignore` when creating a new base.
|
|
17
15
|
* Idempotent: existing markers are left alone and reported as `created: false`.
|
|
18
16
|
*/
|
|
19
17
|
export async function createBase(baseRoot) {
|
|
20
18
|
const root = resolve(baseRoot);
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (created) {
|
|
25
|
-
await writeFile(join(memoryPath, CONFIG_FILENAME), DEFAULT_CONFIG_JSON, 'utf8');
|
|
26
|
-
await writeFile(join(memoryPath, RQIGNORE_FILENAME), defaultRqIgnoreFileContents(), 'utf8');
|
|
19
|
+
const engine = loadNativeEngine();
|
|
20
|
+
if (typeof engine.createBase !== 'function') {
|
|
21
|
+
throw new Error('Native createBase is missing; rebuild crates/reqlan-napi (cargo build -p reqlan-napi).');
|
|
27
22
|
}
|
|
23
|
+
const result = engine.createBase(root);
|
|
28
24
|
return {
|
|
29
25
|
base: toBaseDescriptor(root),
|
|
30
|
-
created
|
|
26
|
+
created: result.created
|
|
31
27
|
};
|
|
32
28
|
}
|
|
33
29
|
//# sourceMappingURL=create-base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-base.js","sourceRoot":"","sources":["../../src/core/create-base.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-base.js","sourceRoot":"","sources":["../../src/core/create-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAuB,MAAM,qBAAqB,CAAC;AAa5E;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CACX,wFAAwF,CAC3F,CAAC;IACN,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAA2B,CAAC;IACjE,OAAO;QACH,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;QAC5B,OAAO,EAAE,MAAM,CAAC,OAAO;KAC1B,CAAC;AACN,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Resolve authored file-reference paths against the defining idea's file.
|
|
3
3
|
* Shared by graph slices and reference-list rows so open actions match the editor.
|
|
4
|
+
* rq:["../../../reqlan rq/ontology.rq".referenced_files]
|
|
5
|
+
* rq:["../../../reqlan rq/ontology.rq".reference_types]
|
|
4
6
|
*/
|
|
5
|
-
import { isWindowsAbsolutePath } from '
|
|
7
|
+
import { isWindowsAbsolutePath } from './path-relative.js';
|
|
6
8
|
import { posix } from 'node:path';
|
|
7
9
|
function definingFilePath(sourceId) {
|
|
8
10
|
const separator = sourceId.lastIndexOf('#');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-reference-resolve.js","sourceRoot":"","sources":["../../src/core/file-reference-resolve.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"file-reference-resolve.js","sourceRoot":"","sources":["../../src/core/file-reference-resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,SAAS,gBAAgB,CAAC,QAAgB;IACtC,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACpE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,UAAkB,EAAE,QAAgB;IAC1E,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9C,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,qBAAqB,CAAC,UAAU,CAAC,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3H,OAAO,UAAU,CAAC;IACtB,CAAC;IACD,MAAM,YAAY,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpE,IACI,CAAC,YAAY;WACV,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC;WAC5B,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC;WAC9B,qBAAqB,CAAC,YAAY,CAAC,EACxC,CAAC;QACC,OAAO,UAAU,CAAC;IACtB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IndexError } from './
|
|
2
|
-
export type { IndexErrorPhase } from './
|
|
1
|
+
import type { IndexError } from './index-state-types.js';
|
|
2
|
+
export type { IndexErrorPhase } from './index-state-types.js';
|
|
3
3
|
export interface IndexErrorDetail {
|
|
4
4
|
summary: string;
|
|
5
5
|
file?: string;
|
|
@@ -19,5 +19,5 @@ export interface FileIndexIssueView {
|
|
|
19
19
|
ideaNames?: string[];
|
|
20
20
|
cause?: string;
|
|
21
21
|
}
|
|
22
|
-
export declare function toFileIndexIssueView(issue: import('./
|
|
22
|
+
export declare function toFileIndexIssueView(issue: import('./index-state-types.js').FileIndexIssue, relativePath?: (fileUri: string) => string): FileIndexIssueView;
|
|
23
23
|
export declare function toIndexErrorDetail(error: IndexError, relativePath?: (fileUri: string) => string): IndexErrorDetail;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-error.js","sourceRoot":"","sources":["../../src/core/index-error.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC5C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,OAAO,CAAC;IACzB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,EAAE,CAAC;QACrC,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAcD,MAAM,UAAU,oBAAoB,CAChC,
|
|
1
|
+
{"version":3,"file":"index-error.js","sourceRoot":"","sources":["../../src/core/index-error.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC5C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,OAAO,CAAC;IACzB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,EAAE,CAAC;QACrC,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAcD,MAAM,UAAU,oBAAoB,CAChC,KAAsD,EACtD,eAA4C,GAAG,CAAC,EAAE,CAAC,GAAG;IAEtD,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzC,OAAO;QACH,IAAI;QACJ,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,QAAQ,EAAE,GAAG,IAAI,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACzD,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAChE,KAAK,EAAE,KAAK,CAAC,KAAK;KACrB,CAAC;AACN,CAAC;AAED,MAAM,UAAU,kBAAkB,CAC9B,KAAiB,EACjB,eAA4C,GAAG,CAAC,EAAE,CAAC,GAAG;IAEtD,OAAO;QACH,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;QAC7D,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC5D,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC;KACxC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Index lifecycle state types shared by the TS facade and the native runtime.
|
|
3
|
+
*
|
|
4
|
+
* The lifecycle FSM, counts, problem list, and activity rings now live in the
|
|
5
|
+
* Rust `WorkspaceIndexRuntime` (surfaced via `NativeWorkspaceIndex.statusSnapshot`).
|
|
6
|
+
* These are the plain shapes the TS side reads back from that snapshot.
|
|
7
|
+
* rq:["../../../reqlan rq/core_analysis/rust_port.rq".native_bridge]
|
|
8
|
+
* rq:["../../../reqlan rq/codestyle/typescript.rq".zustand_boundary]
|
|
9
|
+
*/
|
|
10
|
+
export type IndexState = 'uninitialized' | 'opening' | 'idle' | 'syncing' | 'ready' | 'error' | 'closing';
|
|
11
|
+
export type IndexEvent = 'activate' | 'opened' | 'sync' | 'synced' | 'fail' | 'deactivate' | 'closed';
|
|
12
|
+
export type WorkspaceChange = 'created' | 'changed' | 'deleted';
|
|
13
|
+
export type IndexErrorPhase = 'open' | 'parse' | 'extract' | 'persist' | 'sync' | 'transition';
|
|
14
|
+
export interface IndexError {
|
|
15
|
+
message: string;
|
|
16
|
+
fileUri?: string;
|
|
17
|
+
ideaNames?: string[];
|
|
18
|
+
phase?: IndexErrorPhase;
|
|
19
|
+
cause?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface FileIndexIssue {
|
|
22
|
+
fileUri: string;
|
|
23
|
+
line: number;
|
|
24
|
+
column: number;
|
|
25
|
+
message: string;
|
|
26
|
+
phase: IndexErrorPhase;
|
|
27
|
+
ideaNames?: string[];
|
|
28
|
+
cause?: string;
|
|
29
|
+
at: number;
|
|
30
|
+
}
|
|
31
|
+
export interface DocumentUpdateIdea {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
lineStart: number;
|
|
35
|
+
}
|
|
36
|
+
export interface DocumentUpdate {
|
|
37
|
+
fileUri: string;
|
|
38
|
+
ideaCount: number;
|
|
39
|
+
/** Ideas persisted in this update — used for idea-centric Timeline events. */
|
|
40
|
+
ideas?: DocumentUpdateIdea[];
|
|
41
|
+
at: number;
|
|
42
|
+
}
|
|
43
|
+
export interface WorkspaceFileChange {
|
|
44
|
+
fileUri: string;
|
|
45
|
+
change: WorkspaceChange;
|
|
46
|
+
at: number;
|
|
47
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Index lifecycle state types shared by the TS facade and the native runtime.
|
|
3
|
+
*
|
|
4
|
+
* The lifecycle FSM, counts, problem list, and activity rings now live in the
|
|
5
|
+
* Rust `WorkspaceIndexRuntime` (surfaced via `NativeWorkspaceIndex.statusSnapshot`).
|
|
6
|
+
* These are the plain shapes the TS side reads back from that snapshot.
|
|
7
|
+
* rq:["../../../reqlan rq/core_analysis/rust_port.rq".native_bridge]
|
|
8
|
+
* rq:["../../../reqlan rq/codestyle/typescript.rq".zustand_boundary]
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=index-state-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-state-types.js","sourceRoot":"","sources":["../../src/core/index-state-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Drive-letter or UNC filesystem path (not a URI). Pure port of the former Langium helper. */
|
|
2
|
+
export declare function isWindowsAbsolutePath(value: string): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Build a `file:` URI string from a filesystem path — pure Node port of the
|
|
5
|
+
* former Langium `fileUriFromFsPath(...).toString()`.
|
|
6
|
+
* Windows drive paths must not go through URL parsing (scheme would be `c:`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function fileUriFromFsPath(fsPath: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Convert a `file://` URI to an fsPath that still understands Windows drive
|
|
11
|
+
* URIs when running on POSIX (Langium `URI.fsPath` behaviour).
|
|
12
|
+
*/
|
|
13
|
+
export declare function fsPathFromFileUri(fileUri: string): string;
|
|
14
|
+
export declare function relativeWindowsDrivePath(filePath: string, workspaceRoot: string): string | undefined;
|
|
15
|
+
export declare function toWorkspaceRelativePath(fileUri: string, workspaceRoot: string): string;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace-relative path helpers with no Langium / @reqlan/language imports.
|
|
3
|
+
* Used by the `@reqlan/analytical/core` entry so headless commands do not load the LSP parser.
|
|
4
|
+
* rq:["../../../reqlan rq/core_analysis/rust_port.rq".native_bridge]
|
|
5
|
+
* rq:["../../../reqlan rq/core_analysis/rust_port.rq".cutover]
|
|
6
|
+
*/
|
|
7
|
+
import { isAbsolute, relative } from 'node:path';
|
|
8
|
+
import { pathToFileURL } from 'node:url';
|
|
9
|
+
const WINDOWS_DRIVE_ABS = /^[A-Za-z]:[\\/]/;
|
|
10
|
+
function normalizeSlashes(filePath) {
|
|
11
|
+
return filePath.replace(/\\/g, '/');
|
|
12
|
+
}
|
|
13
|
+
/** Drive-letter or UNC filesystem path (not a URI). Pure port of the former Langium helper. */
|
|
14
|
+
export function isWindowsAbsolutePath(value) {
|
|
15
|
+
return WINDOWS_DRIVE_ABS.test(value) || value.startsWith('\\\\');
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Build a `file:` URI string from a filesystem path — pure Node port of the
|
|
19
|
+
* former Langium `fileUriFromFsPath(...).toString()`.
|
|
20
|
+
* Windows drive paths must not go through URL parsing (scheme would be `c:`).
|
|
21
|
+
*/
|
|
22
|
+
export function fileUriFromFsPath(fsPath) {
|
|
23
|
+
if (WINDOWS_DRIVE_ABS.test(fsPath)) {
|
|
24
|
+
return `file:///${fsPath.replace(/\\/g, '/')}`;
|
|
25
|
+
}
|
|
26
|
+
if (fsPath.startsWith('\\\\')) {
|
|
27
|
+
return `file:${fsPath.replace(/\\/g, '/')}`;
|
|
28
|
+
}
|
|
29
|
+
return pathToFileURL(fsPath).toString();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Convert a `file://` URI to an fsPath that still understands Windows drive
|
|
33
|
+
* URIs when running on POSIX (Langium `URI.fsPath` behaviour).
|
|
34
|
+
*/
|
|
35
|
+
export function fsPathFromFileUri(fileUri) {
|
|
36
|
+
const url = new URL(fileUri);
|
|
37
|
+
let pathname = decodeURIComponent(url.pathname);
|
|
38
|
+
if (url.protocol === 'file:' && /^\/[A-Za-z]:/.test(pathname)) {
|
|
39
|
+
return pathname.slice(1).replace(/\//g, '\\');
|
|
40
|
+
}
|
|
41
|
+
if (url.protocol === 'file:' && url.hostname) {
|
|
42
|
+
const hostPath = pathname.replace(/\//g, '\\');
|
|
43
|
+
return `\\\\${url.hostname}${hostPath}`;
|
|
44
|
+
}
|
|
45
|
+
return pathname;
|
|
46
|
+
}
|
|
47
|
+
export function relativeWindowsDrivePath(filePath, workspaceRoot) {
|
|
48
|
+
const normalizedFile = normalizeSlashes(filePath);
|
|
49
|
+
const normalizedRoot = normalizeSlashes(workspaceRoot).replace(/\/+$/, '');
|
|
50
|
+
const fileMatch = normalizedFile.match(/^([A-Za-z]:)(\/.*)?$/);
|
|
51
|
+
const rootMatch = normalizedRoot.match(/^([A-Za-z]:)(\/.*)?$/);
|
|
52
|
+
if (!fileMatch || !rootMatch || fileMatch[1].toLowerCase() !== rootMatch[1].toLowerCase()) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
const fileRest = (fileMatch[2] ?? '').replace(/^\/+/, '');
|
|
56
|
+
const rootRest = (rootMatch[2] ?? '').replace(/^\/+/, '');
|
|
57
|
+
if (fileRest.toLowerCase() === rootRest.toLowerCase()) {
|
|
58
|
+
return '';
|
|
59
|
+
}
|
|
60
|
+
const rootPrefix = rootRest ? `${rootRest}/` : '';
|
|
61
|
+
if (!rootRest || fileRest.toLowerCase().startsWith(rootPrefix.toLowerCase())) {
|
|
62
|
+
return rootRest ? fileRest.slice(rootPrefix.length) : fileRest;
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
export function toWorkspaceRelativePath(fileUri, workspaceRoot) {
|
|
67
|
+
if (!workspaceRoot) {
|
|
68
|
+
return normalizeSlashes(fileUri);
|
|
69
|
+
}
|
|
70
|
+
const filePath = fileUri.startsWith('file://') ? fsPathFromFileUri(fileUri) : fileUri;
|
|
71
|
+
const driveRelative = relativeWindowsDrivePath(filePath, workspaceRoot);
|
|
72
|
+
if (driveRelative !== undefined) {
|
|
73
|
+
return driveRelative;
|
|
74
|
+
}
|
|
75
|
+
if (!isAbsolute(filePath)) {
|
|
76
|
+
return normalizeSlashes(filePath);
|
|
77
|
+
}
|
|
78
|
+
const rel = relative(workspaceRoot, filePath);
|
|
79
|
+
if (rel.startsWith('..')) {
|
|
80
|
+
return normalizeSlashes(fileUri);
|
|
81
|
+
}
|
|
82
|
+
return normalizeSlashes(rel);
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=path-relative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-relative.js","sourceRoot":"","sources":["../../src/core/path-relative.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAE5C,SAAS,gBAAgB,CAAC,QAAgB;IACtC,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACxC,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,qBAAqB,CAAC,KAAa;IAC/C,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC5C,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,WAAW,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;IACnD,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,QAAQ,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;IAChD,CAAC;IACD,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC7C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,IAAI,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC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