@jbearak/sight 0.14.3 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sight-server.js +109 -80
- package/dist/sight-server.js.sha256 +1 -1
- package/package.json +1 -1
package/dist/sight-server.js
CHANGED
|
@@ -52,7 +52,7 @@ var package_default;
|
|
|
52
52
|
var init_package = __esm(() => {
|
|
53
53
|
package_default = {
|
|
54
54
|
name: "@jbearak/sight",
|
|
55
|
-
version: "0.14.
|
|
55
|
+
version: "0.14.4",
|
|
56
56
|
type: "module",
|
|
57
57
|
workspaces: [
|
|
58
58
|
"client"
|
|
@@ -25022,6 +25022,23 @@ var init_findalias_resolver = __esm(() => {
|
|
|
25022
25022
|
};
|
|
25023
25023
|
});
|
|
25024
25024
|
|
|
25025
|
+
// src/utils/source-discovery-policy.ts
|
|
25026
|
+
import * as path9 from "path";
|
|
25027
|
+
function is_hidden_source_path(file_path, scan_roots) {
|
|
25028
|
+
const root = get_workspace_root_for_path(scan_roots, file_path);
|
|
25029
|
+
if (!root)
|
|
25030
|
+
return false;
|
|
25031
|
+
const relative_path = path9.relative(root, path9.resolve(file_path));
|
|
25032
|
+
if (relative_path === ".." || relative_path.startsWith(`..${path9.sep}`) || path9.isAbsolute(relative_path)) {
|
|
25033
|
+
return false;
|
|
25034
|
+
}
|
|
25035
|
+
const the_directories = relative_path.split(path9.sep).slice(0, -1);
|
|
25036
|
+
return the_directories.some((my_directory) => my_directory.startsWith("."));
|
|
25037
|
+
}
|
|
25038
|
+
var init_source_discovery_policy = __esm(() => {
|
|
25039
|
+
init_workspace_roots();
|
|
25040
|
+
});
|
|
25041
|
+
|
|
25025
25042
|
// node_modules/picomatch/lib/constants.js
|
|
25026
25043
|
var require_constants = __commonJS((exports, module) => {
|
|
25027
25044
|
var WIN_SLASH = "\\\\/";
|
|
@@ -25220,8 +25237,8 @@ var require_utils = __commonJS((exports) => {
|
|
|
25220
25237
|
}
|
|
25221
25238
|
return output;
|
|
25222
25239
|
};
|
|
25223
|
-
exports.basename = (
|
|
25224
|
-
const segs =
|
|
25240
|
+
exports.basename = (path10, { windows } = {}) => {
|
|
25241
|
+
const segs = path10.split(windows ? /[\\/]/ : "/");
|
|
25225
25242
|
const last = segs[segs.length - 1];
|
|
25226
25243
|
if (last === "") {
|
|
25227
25244
|
return segs[segs.length - 2];
|
|
@@ -26702,7 +26719,7 @@ var require_picomatch2 = __commonJS((exports, module) => {
|
|
|
26702
26719
|
});
|
|
26703
26720
|
|
|
26704
26721
|
// src/utils/exclude-matcher.ts
|
|
26705
|
-
import
|
|
26722
|
+
import path10 from "path";
|
|
26706
26723
|
function normalize_pattern(raw) {
|
|
26707
26724
|
const trimmed = raw.trim();
|
|
26708
26725
|
if (trimmed === "")
|
|
@@ -26724,13 +26741,13 @@ function derive_dir_pattern(pattern) {
|
|
|
26724
26741
|
return stripped === "" ? pattern : stripped;
|
|
26725
26742
|
}
|
|
26726
26743
|
function relative_to_containing_root(abs_path, workspace_roots) {
|
|
26727
|
-
const target =
|
|
26744
|
+
const target = path10.resolve(abs_path);
|
|
26728
26745
|
let best = null;
|
|
26729
26746
|
let best_root_length = -1;
|
|
26730
26747
|
for (const my_root of workspace_roots) {
|
|
26731
|
-
const root =
|
|
26732
|
-
const my_relative =
|
|
26733
|
-
const contained = my_relative === "" || my_relative !== ".." && !my_relative.startsWith(`..${
|
|
26748
|
+
const root = path10.resolve(my_root);
|
|
26749
|
+
const my_relative = path10.relative(root, target);
|
|
26750
|
+
const contained = my_relative === "" || my_relative !== ".." && !my_relative.startsWith(`..${path10.sep}`) && !path10.isAbsolute(my_relative);
|
|
26734
26751
|
if (contained && root.length > best_root_length) {
|
|
26735
26752
|
best = my_relative;
|
|
26736
26753
|
best_root_length = root.length;
|
|
@@ -26738,7 +26755,7 @@ function relative_to_containing_root(abs_path, workspace_roots) {
|
|
|
26738
26755
|
}
|
|
26739
26756
|
if (best === null)
|
|
26740
26757
|
return null;
|
|
26741
|
-
return best.split(
|
|
26758
|
+
return best.split(path10.sep).join("/");
|
|
26742
26759
|
}
|
|
26743
26760
|
function create_exclude_matcher(patterns) {
|
|
26744
26761
|
const compiled = [];
|
|
@@ -26778,12 +26795,12 @@ function create_exclude_matcher(patterns) {
|
|
|
26778
26795
|
return {
|
|
26779
26796
|
is_empty: false,
|
|
26780
26797
|
is_excluded_file(abs_path, workspace_roots) {
|
|
26781
|
-
const
|
|
26782
|
-
if (
|
|
26798
|
+
const relative5 = relative_to_containing_root(abs_path, workspace_roots);
|
|
26799
|
+
if (relative5 === null || relative5 === "")
|
|
26783
26800
|
return false;
|
|
26784
26801
|
let excluded = false;
|
|
26785
26802
|
for (const my_rule of compiled) {
|
|
26786
|
-
if (my_rule.match(
|
|
26803
|
+
if (my_rule.match(relative5)) {
|
|
26787
26804
|
excluded = !my_rule.is_negated;
|
|
26788
26805
|
}
|
|
26789
26806
|
}
|
|
@@ -26792,8 +26809,8 @@ function create_exclude_matcher(patterns) {
|
|
|
26792
26809
|
is_excluded_dir(abs_path, workspace_roots) {
|
|
26793
26810
|
if (dir_match === null)
|
|
26794
26811
|
return false;
|
|
26795
|
-
const
|
|
26796
|
-
return
|
|
26812
|
+
const relative5 = relative_to_containing_root(abs_path, workspace_roots);
|
|
26813
|
+
return relative5 !== null && relative5 !== "" && dir_match(relative5);
|
|
26797
26814
|
}
|
|
26798
26815
|
};
|
|
26799
26816
|
}
|
|
@@ -26810,7 +26827,7 @@ var init_exclude_matcher = __esm(() => {
|
|
|
26810
26827
|
|
|
26811
26828
|
// src/indexer/index.ts
|
|
26812
26829
|
import * as fs9 from "fs";
|
|
26813
|
-
import * as
|
|
26830
|
+
import * as path11 from "path";
|
|
26814
26831
|
var MAX_PARALLEL = 4, YIELD_INTERVAL_MS = 100, INDEX_DEBOUNCE_MS = 200, WorkspaceIndexer;
|
|
26815
26832
|
var init_indexer = __esm(() => {
|
|
26816
26833
|
init_esm();
|
|
@@ -26826,6 +26843,7 @@ var init_indexer = __esm(() => {
|
|
|
26826
26843
|
init_stata_install_paths();
|
|
26827
26844
|
init_findalias_resolver();
|
|
26828
26845
|
init_file_path_utils();
|
|
26846
|
+
init_source_discovery_policy();
|
|
26829
26847
|
init_exclude_matcher();
|
|
26830
26848
|
WorkspaceIndexer = class WorkspaceIndexer {
|
|
26831
26849
|
symbol_index = new Map;
|
|
@@ -26861,6 +26879,7 @@ var init_indexer = __esm(() => {
|
|
|
26861
26879
|
is_processing_queue = false;
|
|
26862
26880
|
on_graph_change_callback;
|
|
26863
26881
|
workspace_roots = [];
|
|
26882
|
+
scan_roots = [];
|
|
26864
26883
|
scope_resolver;
|
|
26865
26884
|
scope_resolver_config = {};
|
|
26866
26885
|
set_dependency_graph(graph) {
|
|
@@ -26964,7 +26983,11 @@ var init_indexer = __esm(() => {
|
|
|
26964
26983
|
return;
|
|
26965
26984
|
}
|
|
26966
26985
|
this.ado_paths = ado_paths;
|
|
26967
|
-
this.workspace_roots = workspace_folders.map((f) =>
|
|
26986
|
+
this.workspace_roots = workspace_folders.map((f) => path11.resolve(f));
|
|
26987
|
+
this.scan_roots = [
|
|
26988
|
+
...this.workspace_roots,
|
|
26989
|
+
...ado_paths.map((my_path) => path11.resolve(my_path))
|
|
26990
|
+
];
|
|
26968
26991
|
this.help_search_paths = discover_stata_ado_paths();
|
|
26969
26992
|
const start_time = Date.now();
|
|
26970
26993
|
for (const folder of [...workspace_folders, ...this.ado_paths]) {
|
|
@@ -26996,9 +27019,9 @@ var init_indexer = __esm(() => {
|
|
|
26996
27019
|
for (const entry of entries) {
|
|
26997
27020
|
if (!this.is_active_generation(generation))
|
|
26998
27021
|
break;
|
|
26999
|
-
const entry_path =
|
|
27022
|
+
const entry_path = path11.join(dir_path, entry.name);
|
|
27000
27023
|
if (entry.isDirectory()) {
|
|
27001
|
-
if (
|
|
27024
|
+
if (entry.name.startsWith(".")) {
|
|
27002
27025
|
continue;
|
|
27003
27026
|
}
|
|
27004
27027
|
if (!this.exclude_matcher.is_empty && this.exclude_matcher.is_excluded_dir(entry_path, this.workspace_roots)) {
|
|
@@ -27028,7 +27051,7 @@ var init_indexer = __esm(() => {
|
|
|
27028
27051
|
const now = Date.now();
|
|
27029
27052
|
if (now - last_yield_time.value > YIELD_INTERVAL_MS) {
|
|
27030
27053
|
last_yield_time.value = now;
|
|
27031
|
-
await new Promise((
|
|
27054
|
+
await new Promise((resolve10) => setImmediate(resolve10));
|
|
27032
27055
|
}
|
|
27033
27056
|
}
|
|
27034
27057
|
};
|
|
@@ -27072,6 +27095,8 @@ var init_indexer = __esm(() => {
|
|
|
27072
27095
|
if (!this.is_active_generation(generation) || !this.enabled)
|
|
27073
27096
|
return;
|
|
27074
27097
|
const file_uri = URI.file(file_path).toString();
|
|
27098
|
+
if (is_hidden_source_path(file_path, this.scan_roots))
|
|
27099
|
+
return;
|
|
27075
27100
|
if (!this.exclude_matcher.is_empty && this.exclude_matcher.is_excluded_file(file_path, this.workspace_roots)) {
|
|
27076
27101
|
this.clear_stale_entry(file_uri);
|
|
27077
27102
|
return;
|
|
@@ -27095,7 +27120,7 @@ var init_indexer = __esm(() => {
|
|
|
27095
27120
|
return;
|
|
27096
27121
|
if (!already_indexed && this.should_skip_for_max_indexed_files(file_uri))
|
|
27097
27122
|
return;
|
|
27098
|
-
if (
|
|
27123
|
+
if (path11.extname(file_path).toLowerCase() === ".mata") {
|
|
27099
27124
|
await this.index_mata_file(content, file_uri, generation);
|
|
27100
27125
|
return;
|
|
27101
27126
|
}
|
|
@@ -27109,7 +27134,7 @@ var init_indexer = __esm(() => {
|
|
|
27109
27134
|
if (own_working_directory === undefined && this.scope_resolver) {
|
|
27110
27135
|
effective_working_directory = await this.scope_resolver.resolve_inherited_working_directory(directive_result.directives, file_uri, directive_result.standalone !== undefined, this.scope_resolver_config);
|
|
27111
27136
|
}
|
|
27112
|
-
const my_caller_dir =
|
|
27137
|
+
const my_caller_dir = path11.dirname(file_path);
|
|
27113
27138
|
const { timeline: cd_timeline } = build_cd_timeline({
|
|
27114
27139
|
starting_wd: effective_working_directory,
|
|
27115
27140
|
caller_dir: my_caller_dir,
|
|
@@ -27224,6 +27249,8 @@ var init_indexer = __esm(() => {
|
|
|
27224
27249
|
schedule_update(file_path) {
|
|
27225
27250
|
if (!this.enabled)
|
|
27226
27251
|
return;
|
|
27252
|
+
if (is_hidden_source_path(file_path, this.scan_roots))
|
|
27253
|
+
return;
|
|
27227
27254
|
const existing = this.pending_updates.get(file_path);
|
|
27228
27255
|
if (existing) {
|
|
27229
27256
|
clearTimeout(existing);
|
|
@@ -27248,7 +27275,7 @@ var init_indexer = __esm(() => {
|
|
|
27248
27275
|
break;
|
|
27249
27276
|
this.update_queue.delete(file_path);
|
|
27250
27277
|
await this.index_file(file_path, generation);
|
|
27251
|
-
await new Promise((
|
|
27278
|
+
await new Promise((resolve10) => setImmediate(resolve10));
|
|
27252
27279
|
}
|
|
27253
27280
|
} finally {
|
|
27254
27281
|
this.is_processing_queue = false;
|
|
@@ -27507,17 +27534,17 @@ var init_indexer = __esm(() => {
|
|
|
27507
27534
|
...this.help_search_paths
|
|
27508
27535
|
];
|
|
27509
27536
|
for (const my_dir of the_search_dirs) {
|
|
27510
|
-
const my_subdir_path =
|
|
27537
|
+
const my_subdir_path = path11.join(my_dir, my_first_letter, my_basename);
|
|
27511
27538
|
try {
|
|
27512
27539
|
await fs9.promises.access(my_subdir_path);
|
|
27513
27540
|
return my_subdir_path;
|
|
27514
27541
|
} catch {}
|
|
27515
|
-
const my_direct_path =
|
|
27542
|
+
const my_direct_path = path11.join(my_dir, my_basename);
|
|
27516
27543
|
try {
|
|
27517
27544
|
await fs9.promises.access(my_direct_path);
|
|
27518
27545
|
return my_direct_path;
|
|
27519
27546
|
} catch {}
|
|
27520
|
-
if (!this.workspace_roots.includes(
|
|
27547
|
+
if (!this.workspace_roots.includes(path11.resolve(my_dir))) {
|
|
27521
27548
|
continue;
|
|
27522
27549
|
}
|
|
27523
27550
|
const my_recursive_match = await this.find_sthlp_file_recursive(my_dir, my_basename);
|
|
@@ -27541,12 +27568,12 @@ var init_indexer = __esm(() => {
|
|
|
27541
27568
|
...this.help_search_paths
|
|
27542
27569
|
];
|
|
27543
27570
|
for (const my_dir of the_search_dirs) {
|
|
27544
|
-
const my_subdir_path =
|
|
27571
|
+
const my_subdir_path = path11.join(my_dir, my_first_letter, my_basename);
|
|
27545
27572
|
try {
|
|
27546
27573
|
await fs9.promises.access(my_subdir_path);
|
|
27547
27574
|
return my_subdir_path;
|
|
27548
27575
|
} catch {}
|
|
27549
|
-
const my_direct_path =
|
|
27576
|
+
const my_direct_path = path11.join(my_dir, my_basename);
|
|
27550
27577
|
try {
|
|
27551
27578
|
await fs9.promises.access(my_direct_path);
|
|
27552
27579
|
return my_direct_path;
|
|
@@ -27558,7 +27585,7 @@ var init_indexer = __esm(() => {
|
|
|
27558
27585
|
try {
|
|
27559
27586
|
const the_entries = await fs9.promises.readdir(dir);
|
|
27560
27587
|
const the_matches = the_entries.filter((my_entry) => my_entry.startsWith(prefix) && my_entry.endsWith(".sthlp")).sort();
|
|
27561
|
-
return the_matches.map((my_entry) =>
|
|
27588
|
+
return the_matches.map((my_entry) => path11.join(dir, my_entry));
|
|
27562
27589
|
} catch {
|
|
27563
27590
|
return [];
|
|
27564
27591
|
}
|
|
@@ -27582,7 +27609,7 @@ var init_indexer = __esm(() => {
|
|
|
27582
27609
|
const my_prefix = `${my_variant}_`;
|
|
27583
27610
|
const my_first_letter = my_variant.charAt(0).toLowerCase();
|
|
27584
27611
|
for (const my_dir of the_search_dirs) {
|
|
27585
|
-
const my_subdir =
|
|
27612
|
+
const my_subdir = path11.join(my_dir, my_first_letter);
|
|
27586
27613
|
const the_subdir_matches = await this.list_matching_sthlp(my_subdir, my_prefix);
|
|
27587
27614
|
for (const my_match of the_subdir_matches) {
|
|
27588
27615
|
if (!the_seen.has(my_match)) {
|
|
@@ -27627,7 +27654,7 @@ var init_indexer = __esm(() => {
|
|
|
27627
27654
|
continue;
|
|
27628
27655
|
}
|
|
27629
27656
|
for (const my_dirent of the_entries) {
|
|
27630
|
-
const my_path =
|
|
27657
|
+
const my_path = path11.join(my_entry.path, my_dirent.name);
|
|
27631
27658
|
if (my_dirent.isDirectory()) {
|
|
27632
27659
|
if (!WorkspaceIndexer.EXCLUDED_DIRS.has(my_dirent.name)) {
|
|
27633
27660
|
the_dirs.push({
|
|
@@ -27646,8 +27673,8 @@ var init_indexer = __esm(() => {
|
|
|
27646
27673
|
}
|
|
27647
27674
|
resolve_program(name, referring_uri) {
|
|
27648
27675
|
const referring_path = URI.parse(referring_uri).fsPath;
|
|
27649
|
-
const current_dir =
|
|
27650
|
-
const local_ado =
|
|
27676
|
+
const current_dir = path11.dirname(referring_path);
|
|
27677
|
+
const local_ado = path11.join(current_dir, `${name}.ado`);
|
|
27651
27678
|
if (fs9.existsSync(local_ado)) {
|
|
27652
27679
|
const local_uri = URI.file(local_ado).toString();
|
|
27653
27680
|
const entry = this.symbol_index.get(local_uri);
|
|
@@ -31448,7 +31475,7 @@ function format_help_link(topic, display) {
|
|
|
31448
31475
|
|
|
31449
31476
|
// src/providers/completion.ts
|
|
31450
31477
|
import * as fs10 from "fs";
|
|
31451
|
-
import * as
|
|
31478
|
+
import * as path12 from "path";
|
|
31452
31479
|
function coerce_macro_map(value) {
|
|
31453
31480
|
if (value instanceof Map) {
|
|
31454
31481
|
return value;
|
|
@@ -32214,7 +32241,7 @@ class CompletionProvider {
|
|
|
32214
32241
|
const path_parts = clean_path.split("/");
|
|
32215
32242
|
search_prefix = path_parts.pop() || "";
|
|
32216
32243
|
const dir_path = path_parts.join("/");
|
|
32217
|
-
base_dir =
|
|
32244
|
+
base_dir = path12.resolve(workspace_root, dir_path);
|
|
32218
32245
|
} else {
|
|
32219
32246
|
search_prefix = clean_path;
|
|
32220
32247
|
}
|
|
@@ -32230,7 +32257,7 @@ class CompletionProvider {
|
|
|
32230
32257
|
if (search_prefix && !entry.name.toLowerCase().startsWith(search_prefix.toLowerCase())) {
|
|
32231
32258
|
continue;
|
|
32232
32259
|
}
|
|
32233
|
-
const entry_kind = classify_entry_sync(entry,
|
|
32260
|
+
const entry_kind = classify_entry_sync(entry, path12.join(base_dir, entry.name), fs10);
|
|
32234
32261
|
if (entry_kind === "directory") {
|
|
32235
32262
|
completions.push({
|
|
32236
32263
|
label: entry.name + "/",
|
|
@@ -32258,17 +32285,17 @@ class CompletionProvider {
|
|
|
32258
32285
|
get_workspace_root(document_uri) {
|
|
32259
32286
|
try {
|
|
32260
32287
|
const file_path = document_uri.replace(/^file:\/\//, "");
|
|
32261
|
-
let current_dir =
|
|
32262
|
-
while (current_dir !==
|
|
32288
|
+
let current_dir = path12.dirname(file_path);
|
|
32289
|
+
while (current_dir !== path12.dirname(current_dir)) {
|
|
32263
32290
|
const markers = [".git", "sight.toml", ".sight.json", "package.json", ".vscode"];
|
|
32264
32291
|
for (const marker of markers) {
|
|
32265
|
-
if (fs10.existsSync(
|
|
32292
|
+
if (fs10.existsSync(path12.join(current_dir, marker))) {
|
|
32266
32293
|
return current_dir;
|
|
32267
32294
|
}
|
|
32268
32295
|
}
|
|
32269
|
-
current_dir =
|
|
32296
|
+
current_dir = path12.dirname(current_dir);
|
|
32270
32297
|
}
|
|
32271
|
-
return
|
|
32298
|
+
return path12.dirname(file_path);
|
|
32272
32299
|
} catch {
|
|
32273
32300
|
return null;
|
|
32274
32301
|
}
|
|
@@ -33753,7 +33780,7 @@ function create_shutdown_handler(deps, disposables) {
|
|
|
33753
33780
|
const SHUTDOWN_TIMEOUT_MS = 500;
|
|
33754
33781
|
await Promise.race([
|
|
33755
33782
|
deps.document_store.dispose(),
|
|
33756
|
-
new Promise((
|
|
33783
|
+
new Promise((resolve11) => setTimeout(resolve11, SHUTDOWN_TIMEOUT_MS))
|
|
33757
33784
|
]);
|
|
33758
33785
|
}
|
|
33759
33786
|
deps?.scope_resolver?.dispose();
|
|
@@ -34508,26 +34535,26 @@ var init_shared = __esm(() => {
|
|
|
34508
34535
|
|
|
34509
34536
|
// src/cli/source-files.ts
|
|
34510
34537
|
import * as fs12 from "fs";
|
|
34511
|
-
import * as
|
|
34538
|
+
import * as path13 from "path";
|
|
34512
34539
|
import { TextDecoder } from "util";
|
|
34513
34540
|
function canonicalize_existing_path(file_path) {
|
|
34514
34541
|
return fs12.realpathSync.native(file_path);
|
|
34515
34542
|
}
|
|
34516
34543
|
function workspace_relative(workspace_root, file_path) {
|
|
34517
|
-
const
|
|
34518
|
-
const inside =
|
|
34519
|
-
return { relative:
|
|
34544
|
+
const relative6 = path13.relative(workspace_root, file_path);
|
|
34545
|
+
const inside = relative6 !== ".." && !relative6.startsWith(`..${path13.sep}`) && !path13.isAbsolute(relative6);
|
|
34546
|
+
return { relative: relative6, inside };
|
|
34520
34547
|
}
|
|
34521
34548
|
function relative_path(workspace_root, file_path) {
|
|
34522
|
-
const { relative:
|
|
34523
|
-
if (
|
|
34549
|
+
const { relative: relative6 } = workspace_relative(workspace_root, file_path);
|
|
34550
|
+
if (relative6 === "") {
|
|
34524
34551
|
return ".";
|
|
34525
34552
|
}
|
|
34526
|
-
return
|
|
34553
|
+
return path13.isAbsolute(relative6) ? file_path : relative6.split(path13.sep).join("/");
|
|
34527
34554
|
}
|
|
34528
34555
|
function is_within_workspace(workspace_root, file_path) {
|
|
34529
|
-
const { relative:
|
|
34530
|
-
return
|
|
34556
|
+
const { relative: relative6, inside } = workspace_relative(workspace_root, file_path);
|
|
34557
|
+
return relative6 === "" || relative6.length > 0 && inside;
|
|
34531
34558
|
}
|
|
34532
34559
|
function walk_sources(dir_path, out, operator_errors, workspace_roots, exclude_matcher) {
|
|
34533
34560
|
let entries;
|
|
@@ -34538,9 +34565,9 @@ function walk_sources(dir_path, out, operator_errors, workspace_roots, exclude_m
|
|
|
34538
34565
|
return;
|
|
34539
34566
|
}
|
|
34540
34567
|
for (const entry of entries) {
|
|
34541
|
-
const entry_path =
|
|
34568
|
+
const entry_path = path13.join(dir_path, entry.name);
|
|
34542
34569
|
if (entry.isDirectory()) {
|
|
34543
|
-
if (
|
|
34570
|
+
if (entry.name.startsWith("."))
|
|
34544
34571
|
continue;
|
|
34545
34572
|
if (!exclude_matcher.is_empty && exclude_matcher.is_excluded_dir(entry_path, workspace_roots)) {
|
|
34546
34573
|
continue;
|
|
@@ -34557,7 +34584,7 @@ function walk_sources(dir_path, out, operator_errors, workspace_roots, exclude_m
|
|
|
34557
34584
|
function collect_report_targets(input_paths, workspace_root, cwd, exclude_patterns = []) {
|
|
34558
34585
|
const operator_errors = [];
|
|
34559
34586
|
const source_paths = [];
|
|
34560
|
-
let normalized_root =
|
|
34587
|
+
let normalized_root = path13.resolve(workspace_root);
|
|
34561
34588
|
try {
|
|
34562
34589
|
normalized_root = canonicalize_existing_path(normalized_root);
|
|
34563
34590
|
} catch {}
|
|
@@ -34566,7 +34593,7 @@ function collect_report_targets(input_paths, workspace_root, cwd, exclude_patter
|
|
|
34566
34593
|
const has_explicit_paths = input_paths.length > 0;
|
|
34567
34594
|
const paths_to_collect = input_paths.length > 0 ? input_paths : [normalized_root];
|
|
34568
34595
|
for (const input_path of paths_to_collect) {
|
|
34569
|
-
const resolved_path =
|
|
34596
|
+
const resolved_path = path13.resolve(cwd, input_path);
|
|
34570
34597
|
if (!fs12.existsSync(resolved_path)) {
|
|
34571
34598
|
operator_errors.push(`path does not exist: ${input_path}`);
|
|
34572
34599
|
continue;
|
|
@@ -34714,7 +34741,7 @@ __export(exports_check, {
|
|
|
34714
34741
|
build_check_context: () => build_check_context
|
|
34715
34742
|
});
|
|
34716
34743
|
import * as fs13 from "fs";
|
|
34717
|
-
import * as
|
|
34744
|
+
import * as path14 from "path";
|
|
34718
34745
|
function parse_required_option_value(argv, index, flag, value_kind, inline_value) {
|
|
34719
34746
|
if (inline_value !== undefined) {
|
|
34720
34747
|
if (inline_value.length === 0) {
|
|
@@ -34880,7 +34907,7 @@ function load_check_config(options) {
|
|
|
34880
34907
|
warnings: validation_warnings
|
|
34881
34908
|
};
|
|
34882
34909
|
}
|
|
34883
|
-
const loaded = options.config_path ? load_toml_file(
|
|
34910
|
+
const loaded = options.config_path ? load_toml_file(path14.resolve(options.cwd, options.config_path)) : discover_and_load_project_config(options.workspace_root);
|
|
34884
34911
|
if (loaded.kind === "load-failed") {
|
|
34885
34912
|
return {
|
|
34886
34913
|
kind: "operator-error",
|
|
@@ -34969,6 +34996,7 @@ async function collect_check_diagnostics(context, workspace_root, config, target
|
|
|
34969
34996
|
const workspace_symbols = context.workspace_indexer.get_all_symbols();
|
|
34970
34997
|
const files_indexed = context.workspace_indexer.get_metrics().files_indexed;
|
|
34971
34998
|
const exclude_matcher = create_exclude_matcher(config.exclude);
|
|
34999
|
+
const scan_roots = [workspace_root, ...config.adoPaths];
|
|
34972
35000
|
const the_slots = new Array(targets.length);
|
|
34973
35001
|
async function collect_target_diagnostics(target, document_store) {
|
|
34974
35002
|
const records = [];
|
|
@@ -34986,7 +35014,7 @@ async function collect_check_diagnostics(context, workspace_root, config, target
|
|
|
34986
35014
|
}
|
|
34987
35015
|
return records;
|
|
34988
35016
|
}
|
|
34989
|
-
if (is_within_workspace(workspace_root, target.path) && files_indexed >= config.cross_file.max_indexed_files && !context.workspace_indexer.has_indexed_file(uri) && !exclude_matcher.is_excluded_file(target.path, [workspace_root])) {
|
|
35017
|
+
if (is_within_workspace(workspace_root, target.path) && files_indexed >= config.cross_file.max_indexed_files && !context.workspace_indexer.has_indexed_file(uri) && !is_hidden_source_path(target.path, scan_roots) && !exclude_matcher.is_excluded_file(target.path, [workspace_root])) {
|
|
34990
35018
|
records.push(diagnostic_record(target.relative_path, index_limit_diagnostic()));
|
|
34991
35019
|
return records;
|
|
34992
35020
|
}
|
|
@@ -35070,7 +35098,7 @@ async function run_check_with_cwd(argv, cwd, output = DEFAULT_OUTPUT) {
|
|
|
35070
35098
|
`);
|
|
35071
35099
|
return EXIT_OK;
|
|
35072
35100
|
}
|
|
35073
|
-
const resolved_workspace_root =
|
|
35101
|
+
const resolved_workspace_root = path14.resolve(cwd, result.args.workspace ?? ".");
|
|
35074
35102
|
let is_workspace_directory = false;
|
|
35075
35103
|
try {
|
|
35076
35104
|
is_workspace_directory = fs13.statSync(resolved_workspace_root).isDirectory();
|
|
@@ -35158,6 +35186,7 @@ var init_check = __esm(() => {
|
|
|
35158
35186
|
init_logger();
|
|
35159
35187
|
init_source_files();
|
|
35160
35188
|
init_exclude_matcher();
|
|
35189
|
+
init_source_discovery_policy();
|
|
35161
35190
|
init_shared();
|
|
35162
35191
|
DEFAULT_OUTPUT = {
|
|
35163
35192
|
stdout: (text) => process.stdout.write(text),
|
|
@@ -35433,7 +35462,7 @@ function is_position_in_range3(position, range) {
|
|
|
35433
35462
|
}
|
|
35434
35463
|
|
|
35435
35464
|
// src/providers/hover.ts
|
|
35436
|
-
import * as
|
|
35465
|
+
import * as path15 from "path";
|
|
35437
35466
|
function has_definition_index(hit) {
|
|
35438
35467
|
return typeof hit.definition_index === "number";
|
|
35439
35468
|
}
|
|
@@ -36783,7 +36812,7 @@ ${source_info}${footer}`
|
|
|
36783
36812
|
if (this.looks_like_uri_scheme(uri_or_path)) {
|
|
36784
36813
|
return null;
|
|
36785
36814
|
}
|
|
36786
|
-
return
|
|
36815
|
+
return path15.resolve(uri_or_path);
|
|
36787
36816
|
}
|
|
36788
36817
|
escape_markdown_link_text(text) {
|
|
36789
36818
|
return text.replace(/[\\[\]()]/g, "\\$&");
|
|
@@ -36803,11 +36832,11 @@ ${source_info}${footer}`
|
|
|
36803
36832
|
if (workspace_fs_path === null) {
|
|
36804
36833
|
return fs_path;
|
|
36805
36834
|
}
|
|
36806
|
-
const
|
|
36807
|
-
if (
|
|
36835
|
+
const relative7 = path15.relative(workspace_fs_path, fs_path);
|
|
36836
|
+
if (relative7.startsWith("..") || path15.isAbsolute(relative7)) {
|
|
36808
36837
|
return fs_path;
|
|
36809
36838
|
}
|
|
36810
|
-
return
|
|
36839
|
+
return relative7;
|
|
36811
36840
|
}
|
|
36812
36841
|
format_source_link(source_uri, current_uri, workspace_root) {
|
|
36813
36842
|
const source_path = this.normalize_file_path(source_uri);
|
|
@@ -37158,7 +37187,7 @@ var init_hover = __esm(() => {
|
|
|
37158
37187
|
});
|
|
37159
37188
|
|
|
37160
37189
|
// src/providers/definition.ts
|
|
37161
|
-
import * as
|
|
37190
|
+
import * as path16 from "path";
|
|
37162
37191
|
|
|
37163
37192
|
class DefinitionProvider {
|
|
37164
37193
|
workspace_roots = [];
|
|
@@ -37903,7 +37932,7 @@ class DefinitionProvider {
|
|
|
37903
37932
|
if (!the_call) {
|
|
37904
37933
|
return { matched: false, path: null };
|
|
37905
37934
|
}
|
|
37906
|
-
const current_dir =
|
|
37935
|
+
const current_dir = path16.dirname(URI.parse(document.uri).fsPath);
|
|
37907
37936
|
const my_outcome = resolve_forward_call_rich(file_path, current_dir, the_call.working_directory, { workspace_roots: this.workspace_roots });
|
|
37908
37937
|
if (my_outcome.kind === "exact" || my_outcome.kind === "case_only") {
|
|
37909
37938
|
return { matched: true, path: my_outcome.path };
|
|
@@ -37912,8 +37941,8 @@ class DefinitionProvider {
|
|
|
37912
37941
|
}
|
|
37913
37942
|
resolve_file_path(current_uri, file_path) {
|
|
37914
37943
|
const current_path = URI.parse(current_uri).fsPath;
|
|
37915
|
-
const current_dir =
|
|
37916
|
-
const resolved_path =
|
|
37944
|
+
const current_dir = path16.dirname(current_path);
|
|
37945
|
+
const resolved_path = path16.resolve(current_dir, file_path);
|
|
37917
37946
|
const the_roots_set = new Set(this.workspace_roots);
|
|
37918
37947
|
the_roots_set.add(current_dir);
|
|
37919
37948
|
const the_roots = Array.from(the_roots_set);
|
|
@@ -38487,7 +38516,7 @@ class ReferencesProvider {
|
|
|
38487
38516
|
}
|
|
38488
38517
|
file_count++;
|
|
38489
38518
|
if (file_count % 10 === 0) {
|
|
38490
|
-
await new Promise((
|
|
38519
|
+
await new Promise((resolve15) => setTimeout(resolve15, 0));
|
|
38491
38520
|
if (cancellation_token?.isCancellationRequested) {
|
|
38492
38521
|
break;
|
|
38493
38522
|
}
|
|
@@ -38913,7 +38942,7 @@ var init_section_detector = __esm(() => {
|
|
|
38913
38942
|
});
|
|
38914
38943
|
|
|
38915
38944
|
// src/providers/symbols.ts
|
|
38916
|
-
import * as
|
|
38945
|
+
import * as path17 from "path";
|
|
38917
38946
|
function is_position_in_range4(position, range) {
|
|
38918
38947
|
if (position.line < range.start.line) {
|
|
38919
38948
|
return false;
|
|
@@ -39309,7 +39338,7 @@ class SymbolProvider {
|
|
|
39309
39338
|
}
|
|
39310
39339
|
}
|
|
39311
39340
|
for (const document of all_documents) {
|
|
39312
|
-
const my_basename =
|
|
39341
|
+
const my_basename = path17.basename(document.uri);
|
|
39313
39342
|
for (const my_program of document.symbols.programs.values()) {
|
|
39314
39343
|
if (my_program.name.toLowerCase().includes(lower_query)) {
|
|
39315
39344
|
symbols.push({
|
|
@@ -41754,8 +41783,8 @@ class DocumentDebounceManager {
|
|
|
41754
41783
|
if (prev_resolver) {
|
|
41755
41784
|
prev_resolver();
|
|
41756
41785
|
}
|
|
41757
|
-
const promise = new Promise((
|
|
41758
|
-
this.pending_resolvers.set(uri,
|
|
41786
|
+
const promise = new Promise((resolve15) => {
|
|
41787
|
+
this.pending_resolvers.set(uri, resolve15);
|
|
41759
41788
|
});
|
|
41760
41789
|
this.pending_promises.set(uri, promise);
|
|
41761
41790
|
const timer = setTimeout(() => {
|
|
@@ -41781,9 +41810,9 @@ class DocumentDebounceManager {
|
|
|
41781
41810
|
if (this.parse_queue.length >= this.MAX_QUEUE_LENGTH) {
|
|
41782
41811
|
logger.warn(`Parse queue full, dropping ${uri} v${version}`);
|
|
41783
41812
|
this.metrics.dropped_parses++;
|
|
41784
|
-
const
|
|
41785
|
-
if (
|
|
41786
|
-
|
|
41813
|
+
const resolve15 = this.pending_resolvers.get(uri);
|
|
41814
|
+
if (resolve15) {
|
|
41815
|
+
resolve15();
|
|
41787
41816
|
this.pending_resolvers.delete(uri);
|
|
41788
41817
|
this.pending_promises.delete(uri);
|
|
41789
41818
|
}
|
|
@@ -41806,7 +41835,7 @@ class DocumentDebounceManager {
|
|
|
41806
41835
|
}
|
|
41807
41836
|
this.active_parses++;
|
|
41808
41837
|
try {
|
|
41809
|
-
await new Promise((
|
|
41838
|
+
await new Promise((resolve15) => setImmediate(resolve15));
|
|
41810
41839
|
await callback();
|
|
41811
41840
|
} catch (error) {
|
|
41812
41841
|
logger.error(`Parse error for ${uri}: ${error}`);
|
|
@@ -41838,9 +41867,9 @@ class DocumentDebounceManager {
|
|
|
41838
41867
|
clearTimeout(existing);
|
|
41839
41868
|
this.pending_timers.delete(uri);
|
|
41840
41869
|
}
|
|
41841
|
-
const
|
|
41842
|
-
if (
|
|
41843
|
-
|
|
41870
|
+
const resolve15 = this.pending_resolvers.get(uri);
|
|
41871
|
+
if (resolve15) {
|
|
41872
|
+
resolve15();
|
|
41844
41873
|
this.pending_resolvers.delete(uri);
|
|
41845
41874
|
this.pending_promises.delete(uri);
|
|
41846
41875
|
}
|
|
@@ -73812,4 +73841,4 @@ export {
|
|
|
73812
73841
|
is_cli_entry_point
|
|
73813
73842
|
};
|
|
73814
73843
|
|
|
73815
|
-
//# debugId=
|
|
73844
|
+
//# debugId=7A54D1D3B542825B64756E2164756E21
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4770f4e115de3c4df1dea43547bbf32b3d99fbc135026bedef1e73a691b47a7a sight-server.js
|