@mrclrchtr/supi-code-intelligence 11.0.1 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -6
- package/gradle-helper/README.md +48 -0
- package/gradle-helper/build.sh +73 -0
- package/gradle-helper/lib/gradle-tooling-api-9.4.0.jar +0 -0
- package/gradle-helper/lib/slf4j-api-2.0.17.jar +0 -0
- package/gradle-helper/lib/slf4j-simple-2.0.17.jar +0 -0
- package/gradle-helper/lib/supi-gradle-observation.jar +0 -0
- package/gradle-helper/licenses/DEPENDENCIES.md +11 -0
- package/gradle-helper/licenses/LICENSE-gradle-tooling-api.txt +422 -0
- package/gradle-helper/licenses/LICENSE-slf4j.txt +21 -0
- package/gradle-helper/licenses/NOTICE-gradle.txt +21 -0
- package/gradle-helper/src/GradleObservation.java +597 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +41 -1
- package/node_modules/@mrclrchtr/supi-lsp/README.md +43 -6
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +41 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/LICENSE +15 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/README.md +680 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/bin/semver.js +195 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/index.js +7 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/range.js +577 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/semver.js +350 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/major.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/index.js +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/re.js +223 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/package.json +78 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/preload.js +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/range.bnf +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/README.md +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/browser/ril.js +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/common/connection.js +7 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/common/ral.d.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/main.d.ts +14 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/main.js +6 -4
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/ril.js +5 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/package.json +4 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/package.json +4 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/lib/esm/main.js +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/lib/umd/main.js +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/package.json +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -6
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +44 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/config/config.ts +53 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/config/operation-support.ts +19 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +22 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-launch.ts +276 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +22 -10
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +53 -20
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +4 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/session/scanner.ts +27 -15
- package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +41 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/LICENSE +21 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +19 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/LICENSE +21 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +19 -2
- package/node_modules/ignore/README.md +36 -10
- package/node_modules/ignore/index.d.ts +3 -2
- package/node_modules/ignore/index.js +57 -53
- package/node_modules/ignore/legacy.js +50 -46
- package/node_modules/ignore/package.json +1 -1
- package/package.json +11 -6
- package/src/analysis/capability/capability-warnings.ts +18 -12
- package/src/analysis/gradle/query.ts +273 -0
- package/src/analysis/gradle/runtime.ts +173 -0
- package/src/analysis/gradle/types.ts +65 -0
- package/src/analysis/health/check.ts +115 -0
- package/src/analysis/health/diagnostics.ts +3 -0
- package/src/analysis/health/file-scope.ts +2 -3
- package/src/analysis/health/semantic-state.ts +38 -0
- package/src/analysis/health/server-status.ts +8 -0
- package/src/analysis/health/signals.ts +2 -0
- package/src/analysis/health/status.ts +82 -0
- package/src/analysis/read-next.ts +1 -4
- package/src/analysis/refactor/apply.ts +19 -10
- package/src/analysis/refactor/mutation-authority.ts +4 -1
- package/src/analysis/search/ast-scan.ts +143 -18
- package/src/analysis/workspace/safe-path.ts +14 -2
- package/src/analysis/workspace/types.ts +2 -0
- package/src/extension.ts +10 -1
- package/src/gradle/consent.ts +279 -0
- package/src/headless.ts +3 -0
- package/src/overview/collect.ts +11 -3
- package/src/session/health-types.ts +7 -0
- package/src/session/health-workflow.ts +8 -43
- package/src/session/orientation/collect.ts +138 -12
- package/src/session/orientation/context-facts.ts +27 -2
- package/src/session/orientation/context-sections.ts +47 -0
- package/src/session/orientation/facts.ts +124 -0
- package/src/session/orientation/gather.ts +98 -11
- package/src/session/orientation/workspace-context.ts +59 -28
- package/src/session/orientation-types.ts +16 -1
- package/src/session/orientation-workflow.ts +5 -2
- package/src/session/refactor-plans.ts +5 -2
- package/src/session/refactor-workflow.ts +4 -3
- package/src/session/session.ts +8 -0
- package/src/tool/code_find/execute.ts +1 -1
- package/src/tool/code_find/guidance.ts +1 -1
- package/src/tool/code_find/markdown.ts +24 -17
- package/src/tool/code_find/result.ts +18 -5
- package/src/tool/code_find/spec.ts +2 -0
- package/src/tool/code_find/structured.ts +161 -0
- package/src/tool/code_graph/result.ts +32 -15
- package/src/tool/code_graph/spec.ts +2 -0
- package/src/tool/code_graph/structured.ts +142 -0
- package/src/tool/code_health/markdown.ts +17 -17
- package/src/tool/code_health/result.ts +15 -2
- package/src/tool/code_health/spec.ts +2 -0
- package/src/tool/code_health/structured-schema.ts +250 -0
- package/src/tool/code_health/structured.ts +256 -0
- package/src/tool/code_inspect/markdown.ts +19 -11
- package/src/tool/code_inspect/result.ts +12 -5
- package/src/tool/code_inspect/spec.ts +2 -0
- package/src/tool/code_inspect/structured.ts +232 -0
- package/src/tool/code_orientation/directory-navigation.ts +66 -0
- package/src/tool/code_orientation/gradle-sections.ts +68 -0
- package/src/tool/code_orientation/markdown.ts +19 -8
- package/src/tool/code_orientation/result.ts +95 -11
- package/src/tool/code_orientation/spec.ts +2 -0
- package/src/tool/code_orientation/structured-schema.ts +607 -0
- package/src/tool/code_orientation/structured-workspace.ts +193 -0
- package/src/tool/code_orientation/structured.ts +195 -0
- package/src/tool/code_orientation/workspace-format.ts +2 -1
- package/src/tool/code_orientation/workspace-observations.ts +81 -0
- package/src/tool/code_orientation/workspace-output.ts +45 -13
- package/src/tool/code_orientation/workspace-projects.ts +180 -75
- package/src/tool/code_orientation/workspace-sections.ts +46 -31
- package/src/tool/code_refactor_apply/execute.ts +1 -1
- package/src/tool/code_refactor_apply/result.ts +13 -5
- package/src/tool/code_refactor_apply/spec.ts +2 -0
- package/src/tool/code_refactor_apply/structured.ts +49 -0
- package/src/tool/code_refactor_plan/result.ts +16 -8
- package/src/tool/code_refactor_plan/spec.ts +2 -0
- package/src/tool/code_refactor_plan/structured.ts +128 -0
- package/src/tool/code_resolve/markdown.ts +4 -10
- package/src/tool/code_resolve/result.ts +2 -0
- package/src/tool/code_resolve/spec.ts +2 -0
- package/src/tool/code_resolve/structured.ts +103 -0
- package/src/tool/infra/truncate.ts +12 -4
- package/src/tool/register.ts +10 -6
- package/src/tool/result/display.ts +17 -0
- package/src/tool/result/model-budget.ts +195 -0
- package/src/tool/result/structured.ts +62 -0
- package/src/tool/result/types.ts +10 -2
- package/src/tool/schemas.ts +7 -1
- package/src/tool/specs.ts +2 -0
- package/src/types/execution.ts +5 -1
- package/src/ui/status-command.ts +110 -321
- package/src/ui/status-overlay.ts +564 -420
- package/src/ui/tui/display.ts +10 -4
|
@@ -26,6 +26,8 @@ var ESCAPE = '\\';
|
|
|
26
26
|
var REGEX_LITERAL_SPECIAL = /[.*+?()[\]{}^$|\\/]/;
|
|
27
27
|
var BOM = "\uFEFF";
|
|
28
28
|
var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
|
|
29
|
+
// A run of two or more asterisks is a globstar (#175)
|
|
30
|
+
var REGEX_ANCHORED_GLOBSTAR = /^\/\*{2,}$/;
|
|
29
31
|
var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
|
|
30
32
|
var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
|
|
31
33
|
var REGEX_SPLITALL_CRLF = /\r?\n/g;
|
|
@@ -386,6 +388,18 @@ var REPLACERS = [
|
|
|
386
388
|
/(\\+)( ?)/g, function (_, run, space) {
|
|
387
389
|
return space ? run.slice(0, run.length - run.length % 2) + SPACE : run;
|
|
388
390
|
}, ESCAPE + SPACE],
|
|
391
|
+
// git's wildmatch() reads a run of two or more asterisks as one globstar
|
|
392
|
+
// whenever the run fills a path segment: it starts the pattern or follows
|
|
393
|
+
// a `/`, and it ends the pattern or comes before a `/`. A run of two is
|
|
394
|
+
// already `**`; a longer one is folded into `**` here, so the steps
|
|
395
|
+
// below only ever have to know `**`.
|
|
396
|
+
// `***/foo` -> `**/foo`, `a/***/b` -> `a/**/b`, `a/***` -> `a/**`
|
|
397
|
+
// git also takes a run beside a literal prefix (`a***/b`) or beside an
|
|
398
|
+
// escaped slash (`***\/b`) as a globstar, and this does not; the README
|
|
399
|
+
// lists both, under "A run of asterisks".
|
|
400
|
+
[/(^|\/)\*{3,}(?=\/|$)/g, function (_, start) {
|
|
401
|
+
return "".concat(start, "**");
|
|
402
|
+
}, '*'],
|
|
389
403
|
// Escape metacharacters
|
|
390
404
|
// which is written down by users but means special for regular expressions.
|
|
391
405
|
|
|
@@ -754,6 +768,14 @@ var pinWildcards = function pinWildcards(source) {
|
|
|
754
768
|
|
|
755
769
|
// @param {pattern}
|
|
756
770
|
var makeRegexPrefix = function makeRegexPrefix(pattern) {
|
|
771
|
+
// `/**` matches every path, as `**` does. The translation below only finds
|
|
772
|
+
// a globstar beside a slash it keeps, and the leading one is turned into
|
|
773
|
+
// an anchor, so `/**` would come out as `/*` and match one level only.
|
|
774
|
+
// Here rather than in `createRule`, so that `checkSourceOf`, which
|
|
775
|
+
// compiles `/**/` again without its trailing slash, gets it too.
|
|
776
|
+
if (REGEX_ANCHORED_GLOBSTAR.test(pattern)) {
|
|
777
|
+
pattern = '**';
|
|
778
|
+
}
|
|
757
779
|
var _extractBrackets = extractBrackets(pattern),
|
|
758
780
|
source = _extractBrackets.source,
|
|
759
781
|
sources = _extractBrackets.sources;
|
|
@@ -1081,19 +1103,12 @@ var RuleManager = /*#__PURE__*/function () {
|
|
|
1081
1103
|
|
|
1082
1104
|
// Test one single path without recursively checking parent directories
|
|
1083
1105
|
//
|
|
1084
|
-
// -
|
|
1085
|
-
// setting `checkUnignored` to `false` could reduce additional
|
|
1086
|
-
// path matching.
|
|
1087
|
-
// - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
|
|
1106
|
+
// - mode `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
|
|
1088
1107
|
|
|
1089
|
-
// @returns {TestResult}
|
|
1108
|
+
// @returns {TestResult}
|
|
1090
1109
|
}, {
|
|
1091
1110
|
key: "test",
|
|
1092
|
-
value: function test(path,
|
|
1093
|
-
var ignored = false;
|
|
1094
|
-
var unignored = false;
|
|
1095
|
-
var matchedRule;
|
|
1096
|
-
|
|
1111
|
+
value: function test(path, mode) {
|
|
1097
1112
|
// Most of a .gitignore is patterns with no slash in them, and running
|
|
1098
1113
|
// those against the whole path makes the regular expression engine walk
|
|
1099
1114
|
// every directory name on the way to the only segment that could match.
|
|
@@ -1104,40 +1119,31 @@ var RuleManager = /*#__PURE__*/function () {
|
|
|
1104
1119
|
var shortcut = this._basenameCount * 2 >= length;
|
|
1105
1120
|
var basename = shortcut ? basenameOf(path) : path;
|
|
1106
1121
|
|
|
1122
|
+
// The last rule to match decides, as in git, and it is the rule
|
|
1123
|
+
// `git check-ignore -v` reports, so the scan runs from the end and stops
|
|
1124
|
+
// at the first match.
|
|
1107
1125
|
// A plain loop rather than `forEach`, so that `path`, `basename` and
|
|
1108
1126
|
// `shortcut` are locals. As a callback they became closure variables,
|
|
1109
1127
|
// and reaching for one of those once per rule cost 10% of a scan over a
|
|
1110
1128
|
// large rule set -- more than the shortcut they were there to serve.
|
|
1111
|
-
for (var index =
|
|
1129
|
+
for (var index = length - 1; index >= 0; index--) {
|
|
1112
1130
|
var rule = rules[index];
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
// - TEST: always test
|
|
1124
|
-
// - TESTIF: only test if checkUnignored
|
|
1125
|
-
// - X: that never happen
|
|
1126
|
-
var skip = unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored;
|
|
1127
|
-
if (!skip && rule[mode].test(shortcut && rule._basenameOnly ? basename : path)) {
|
|
1128
|
-
ignored = !negative;
|
|
1129
|
-
unignored = negative;
|
|
1130
|
-
matchedRule = negative ? UNDEFINED : rule;
|
|
1131
|
+
if (rule[mode].test(shortcut && rule._basenameOnly ? basename : path)) {
|
|
1132
|
+
var negative = rule.negative;
|
|
1133
|
+
var ret = {
|
|
1134
|
+
ignored: !negative,
|
|
1135
|
+
unignored: negative
|
|
1136
|
+
};
|
|
1137
|
+
if (!negative) {
|
|
1138
|
+
ret.rule = rule;
|
|
1139
|
+
}
|
|
1140
|
+
return ret;
|
|
1131
1141
|
}
|
|
1132
1142
|
}
|
|
1133
|
-
|
|
1134
|
-
ignored:
|
|
1135
|
-
unignored:
|
|
1143
|
+
return {
|
|
1144
|
+
ignored: false,
|
|
1145
|
+
unignored: false
|
|
1136
1146
|
};
|
|
1137
|
-
if (matchedRule) {
|
|
1138
|
-
ret.rule = matchedRule;
|
|
1139
|
-
}
|
|
1140
|
-
return ret;
|
|
1141
1147
|
}
|
|
1142
1148
|
}]);
|
|
1143
1149
|
return RuleManager;
|
|
@@ -1249,12 +1255,12 @@ var Ignore = /*#__PURE__*/function () {
|
|
|
1249
1255
|
// @returns {TestResult}
|
|
1250
1256
|
}, {
|
|
1251
1257
|
key: "_test",
|
|
1252
|
-
value: function _test(originalPath, cache
|
|
1258
|
+
value: function _test(originalPath, cache) {
|
|
1253
1259
|
var path = originalPath
|
|
1254
1260
|
// Supports nullable path
|
|
1255
1261
|
&& checkPath.convert(originalPath);
|
|
1256
1262
|
checkPath(path, originalPath, this._strictPathCheck ? throwError : RETURN_FALSE);
|
|
1257
|
-
return this._t(path, cache
|
|
1263
|
+
return this._t(path, cache);
|
|
1258
1264
|
}
|
|
1259
1265
|
}, {
|
|
1260
1266
|
key: "checkIgnore",
|
|
@@ -1268,7 +1274,7 @@ var Ignore = /*#__PURE__*/function () {
|
|
|
1268
1274
|
// Like `git check-ignore`: a directory excluded by itself or by an
|
|
1269
1275
|
// ancestor settles it, and only then is the literal 'abc/' matched
|
|
1270
1276
|
// against the rules (see `checkSourceOf`).
|
|
1271
|
-
var dir = this._t(path, this._testCache
|
|
1277
|
+
var dir = this._t(path, this._testCache);
|
|
1272
1278
|
if (dir.ignored) {
|
|
1273
1279
|
return dir;
|
|
1274
1280
|
}
|
|
@@ -1281,25 +1287,23 @@ var Ignore = /*#__PURE__*/function () {
|
|
|
1281
1287
|
// The path to be tested
|
|
1282
1288
|
path,
|
|
1283
1289
|
// The cache for the result of a certain checking
|
|
1284
|
-
cache
|
|
1285
|
-
// Whether should check if the path is unignored
|
|
1286
|
-
checkUnignored) {
|
|
1290
|
+
cache) {
|
|
1287
1291
|
if (path in cache) {
|
|
1288
1292
|
return cache[path];
|
|
1289
1293
|
}
|
|
1290
1294
|
var parentPath = parentOf(path);
|
|
1291
1295
|
|
|
1292
1296
|
// If the path contains a parent directory, check the parent first
|
|
1293
|
-
var parent = parentPath ? this._t(parentPath, cache
|
|
1297
|
+
var parent = parentPath ? this._t(parentPath, cache) : UNDEFINED;
|
|
1294
1298
|
return cache[path] = parent && parent.ignored
|
|
1295
1299
|
// > It is not possible to re-include a file if a parent directory of
|
|
1296
1300
|
// > that file is excluded.
|
|
1297
|
-
? parent : this._rules.test(path,
|
|
1301
|
+
? parent : this._rules.test(path, MODE_IGNORE);
|
|
1298
1302
|
}
|
|
1299
1303
|
}, {
|
|
1300
1304
|
key: "ignores",
|
|
1301
1305
|
value: function ignores(path) {
|
|
1302
|
-
return this._test(path, this._ignoreCache
|
|
1306
|
+
return this._test(path, this._ignoreCache).ignored;
|
|
1303
1307
|
}
|
|
1304
1308
|
}, {
|
|
1305
1309
|
key: "createFilter",
|
|
@@ -1319,7 +1323,7 @@ var Ignore = /*#__PURE__*/function () {
|
|
|
1319
1323
|
}, {
|
|
1320
1324
|
key: "test",
|
|
1321
1325
|
value: function test(path) {
|
|
1322
|
-
return this._test(path, this._testCache
|
|
1326
|
+
return this._test(path, this._testCache);
|
|
1323
1327
|
}
|
|
1324
1328
|
}]);
|
|
1325
1329
|
return Ignore;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-code-intelligence",
|
|
3
|
-
"version": "11.0
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"description": "LSP and AST navigation, search, diagnostics, and refactoring",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -31,16 +31,21 @@
|
|
|
31
31
|
],
|
|
32
32
|
"type": "module",
|
|
33
33
|
"files": [
|
|
34
|
-
"src/**/*.ts"
|
|
34
|
+
"src/**/*.ts",
|
|
35
|
+
"gradle-helper/lib/*.jar",
|
|
36
|
+
"gradle-helper/licenses/**",
|
|
37
|
+
"gradle-helper/src/*.java",
|
|
38
|
+
"gradle-helper/build.sh",
|
|
39
|
+
"gradle-helper/README.md"
|
|
35
40
|
],
|
|
36
41
|
"dependencies": {
|
|
37
42
|
"ignore": "^7.0.12",
|
|
38
43
|
"smol-toml": "^1.9.1",
|
|
39
44
|
"yaml": "^2.9.0",
|
|
40
|
-
"@mrclrchtr/supi-code-runtime": "11.0
|
|
41
|
-
"@mrclrchtr/supi-
|
|
42
|
-
"@mrclrchtr/supi-
|
|
43
|
-
"@mrclrchtr/supi-
|
|
45
|
+
"@mrclrchtr/supi-code-runtime": "11.2.0",
|
|
46
|
+
"@mrclrchtr/supi-core": "11.2.0",
|
|
47
|
+
"@mrclrchtr/supi-lsp": "11.2.0",
|
|
48
|
+
"@mrclrchtr/supi-tree-sitter": "11.2.0"
|
|
44
49
|
},
|
|
45
50
|
"bundledDependencies": [
|
|
46
51
|
"@mrclrchtr/supi-code-runtime",
|
|
@@ -29,9 +29,18 @@ export interface CapabilityWarningReport {
|
|
|
29
29
|
warnings: CapabilityWarning[];
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
/** Narrow launch-failure evidence accepted from a controller, before extension normalization. */
|
|
33
|
+
interface MissingServerEvidence {
|
|
34
|
+
name: string;
|
|
35
|
+
command: string;
|
|
36
|
+
foundExtensions?: string[];
|
|
37
|
+
failureMessage?: string;
|
|
38
|
+
}
|
|
39
|
+
type NormalizedMissingServerEvidence = MissingServerEvidence & { foundExtensions: string[] };
|
|
40
|
+
|
|
32
41
|
/** Minimal LSP-controller surface needed to discover missing servers. */
|
|
33
42
|
export interface CapabilityWarningMissingServerSource {
|
|
34
|
-
getMissingServers():
|
|
43
|
+
getMissingServers(): MissingServerEvidence[];
|
|
35
44
|
/** Explicit disablement captured with the active LSP configuration snapshot. */
|
|
36
45
|
getExplicitlyDisabledLanguages?(): readonly string[];
|
|
37
46
|
/** Configuration validation failure that prevented automatic startup. */
|
|
@@ -41,7 +50,7 @@ export interface CapabilityWarningMissingServerSource {
|
|
|
41
50
|
/** Current runtime/config facts needed to evaluate Capability Warnings. */
|
|
42
51
|
export interface CapabilityWarningInput {
|
|
43
52
|
explicitlyDisabledLanguages: string[];
|
|
44
|
-
missingServers:
|
|
53
|
+
missingServers: NormalizedMissingServerEvidence[];
|
|
45
54
|
structuralState: { kind: string; reason?: string };
|
|
46
55
|
/** Configuration could not be validated for automatic capability work. */
|
|
47
56
|
configurationError?: string;
|
|
@@ -68,9 +77,11 @@ export function evaluateCapabilityWarnings(input: CapabilityWarningInput): Capab
|
|
|
68
77
|
|
|
69
78
|
for (const server of input.missingServers) {
|
|
70
79
|
warnings.push({
|
|
71
|
-
type: "missing-server",
|
|
80
|
+
type: server.failureMessage ? "configuration-error" : "missing-server",
|
|
72
81
|
language: server.name,
|
|
73
|
-
message:
|
|
82
|
+
message:
|
|
83
|
+
server.failureMessage ??
|
|
84
|
+
`Cannot start "${server.name}" server — "${server.command}" not found on PATH`,
|
|
74
85
|
detail:
|
|
75
86
|
server.foundExtensions.length > 0
|
|
76
87
|
? `Affected file types: ${server.foundExtensions.join(", ")}`
|
|
@@ -157,11 +168,7 @@ export function gatherCapabilityWarningInput(
|
|
|
157
168
|
const projectTrusted = options.projectTrusted !== false;
|
|
158
169
|
const structuralState = getDefaultWorkspaceRuntime().getWorkspace(cwd).structural.state;
|
|
159
170
|
let explicitlyDisabledLanguages: string[] = [];
|
|
160
|
-
let missingServers:
|
|
161
|
-
name: string;
|
|
162
|
-
command: string;
|
|
163
|
-
foundExtensions: string[];
|
|
164
|
-
}> = [];
|
|
171
|
+
let missingServers: NormalizedMissingServerEvidence[] = [];
|
|
165
172
|
let configurationError: string | undefined;
|
|
166
173
|
|
|
167
174
|
try {
|
|
@@ -197,12 +204,11 @@ export function gatherCapabilityWarningInput(
|
|
|
197
204
|
};
|
|
198
205
|
}
|
|
199
206
|
|
|
200
|
-
function normalizeMissingServers(
|
|
201
|
-
raw: Array<{ name: string; command: string; foundExtensions?: string[] }>,
|
|
202
|
-
): Array<{ name: string; command: string; foundExtensions: string[] }> {
|
|
207
|
+
function normalizeMissingServers(raw: MissingServerEvidence[]): NormalizedMissingServerEvidence[] {
|
|
203
208
|
return raw.map((entry) => ({
|
|
204
209
|
name: entry.name,
|
|
205
210
|
command: entry.command,
|
|
206
211
|
foundExtensions: entry.foundExtensions ?? [],
|
|
212
|
+
...(entry.failureMessage ? { failureMessage: entry.failureMessage } : {}),
|
|
207
213
|
}));
|
|
208
214
|
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { promises as fs } from "node:fs";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import type { CodeRequestControl } from "@mrclrchtr/supi-code-runtime/api";
|
|
6
|
+
import { findExecutable, GradlePrerequisiteError, requireGradle9 } from "./runtime.ts";
|
|
7
|
+
import type {
|
|
8
|
+
GradleFailureStage,
|
|
9
|
+
GradleModelQuery,
|
|
10
|
+
GradleObservation,
|
|
11
|
+
GradleProjectObservation,
|
|
12
|
+
GradleRuntime,
|
|
13
|
+
} from "./types.ts";
|
|
14
|
+
|
|
15
|
+
const helperDirectory = fileURLToPath(new URL("../../../gradle-helper/lib/", import.meta.url));
|
|
16
|
+
const failureStates = new Set([
|
|
17
|
+
"unavailable",
|
|
18
|
+
"unsupported",
|
|
19
|
+
"failed",
|
|
20
|
+
"interrupted",
|
|
21
|
+
"timeout",
|
|
22
|
+
"oversized",
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
/** Launch only the bundled Tooling API helper, with bounded pipes and the caller's deadline. */
|
|
26
|
+
export const queryGradleModel: GradleModelQuery = async (root, runtime, control) => {
|
|
27
|
+
const base = { selectedRoot: root, query: "GradleBuild/BasicGradleProject" as const, runtime };
|
|
28
|
+
const deadline = control?.deadline ?? Date.now() + 30_000;
|
|
29
|
+
let stage: GradleFailureStage = "prerequisites";
|
|
30
|
+
try {
|
|
31
|
+
const java = await selectJava({ ...control, deadline });
|
|
32
|
+
const output = await runProcess(
|
|
33
|
+
java,
|
|
34
|
+
[
|
|
35
|
+
"-cp",
|
|
36
|
+
`${helperDirectory}*`,
|
|
37
|
+
"GradleObservation",
|
|
38
|
+
root,
|
|
39
|
+
runtime.kind,
|
|
40
|
+
runtime.value,
|
|
41
|
+
String(deadline),
|
|
42
|
+
],
|
|
43
|
+
{ ...control, deadline },
|
|
44
|
+
{
|
|
45
|
+
onSpawn: () => {
|
|
46
|
+
stage = "unknown";
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
const result: unknown = JSON.parse(output);
|
|
51
|
+
return validateModel(result, base, await fs.realpath(root));
|
|
52
|
+
} catch (error) {
|
|
53
|
+
return {
|
|
54
|
+
...base,
|
|
55
|
+
stage,
|
|
56
|
+
status:
|
|
57
|
+
error instanceof ProcessFailure || error instanceof GradlePrerequisiteError
|
|
58
|
+
? error.status
|
|
59
|
+
: "failed",
|
|
60
|
+
reason: error instanceof Error ? error.message.slice(0, 500) : "Gradle model query failed.",
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
async function selectJava(control: CodeRequestControl): Promise<string> {
|
|
66
|
+
const candidates = [
|
|
67
|
+
process.env.JAVA_HOME
|
|
68
|
+
? path.join(process.env.JAVA_HOME, "bin", process.platform === "win32" ? "java.exe" : "java")
|
|
69
|
+
: undefined,
|
|
70
|
+
await findExecutable("java"),
|
|
71
|
+
];
|
|
72
|
+
for (const candidate of new Set(candidates)) {
|
|
73
|
+
if (!candidate) continue;
|
|
74
|
+
try {
|
|
75
|
+
const version = await runProcess(candidate, ["-version"], control, { captureError: true });
|
|
76
|
+
const major = Number(version.match(/(?:openjdk|java) version "(\d+)/)?.[1]);
|
|
77
|
+
// This conservative intersection is compatible with the Gradle 9 runtime family.
|
|
78
|
+
if (major >= 17 && major <= 24) return candidate;
|
|
79
|
+
} catch (error) {
|
|
80
|
+
if (error instanceof ProcessFailure && ["timeout", "interrupted"].includes(error.status))
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
throw new GradlePrerequisiteError(
|
|
85
|
+
"unavailable",
|
|
86
|
+
"No compatible installed Java runtime (17–24) found through JAVA_HOME or PATH. No JDK was installed.",
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
class ProcessFailure extends Error {
|
|
91
|
+
constructor(
|
|
92
|
+
readonly status: "failed" | "interrupted" | "timeout" | "oversized",
|
|
93
|
+
message: string,
|
|
94
|
+
) {
|
|
95
|
+
super(message);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function runProcess(
|
|
100
|
+
command: string,
|
|
101
|
+
args: string[],
|
|
102
|
+
control: CodeRequestControl,
|
|
103
|
+
options: { readonly captureError?: boolean; readonly onSpawn?: () => void } = {},
|
|
104
|
+
): Promise<string> {
|
|
105
|
+
return new Promise((resolve, reject) => {
|
|
106
|
+
if (control.signal?.aborted)
|
|
107
|
+
return reject(new ProcessFailure("interrupted", "Gradle observation was cancelled."));
|
|
108
|
+
const remaining = (control.deadline ?? Date.now() + 30_000) - Date.now();
|
|
109
|
+
if (remaining <= 0)
|
|
110
|
+
return reject(new ProcessFailure("timeout", "Gradle observation deadline expired."));
|
|
111
|
+
const child = spawn(command, args, { stdio: ["pipe", "pipe", "pipe"], shell: false });
|
|
112
|
+
child.once("spawn", () => options.onSpawn?.());
|
|
113
|
+
const chunks: Buffer[] = [];
|
|
114
|
+
let bytes = 0;
|
|
115
|
+
let settled = false;
|
|
116
|
+
const finish = (error?: Error) => {
|
|
117
|
+
if (settled) return;
|
|
118
|
+
settled = true;
|
|
119
|
+
clearTimeout(timer);
|
|
120
|
+
control.signal?.removeEventListener("abort", abort);
|
|
121
|
+
if (error) reject(error);
|
|
122
|
+
else resolve(Buffer.concat(chunks).toString("utf8"));
|
|
123
|
+
};
|
|
124
|
+
const stop = (error: ProcessFailure) => {
|
|
125
|
+
child.stdin.end("cancel\n");
|
|
126
|
+
// Only this owned helper is killed; cancellation does not undo build side effects or stop daemons.
|
|
127
|
+
const kill = setTimeout(() => child.kill("SIGKILL"), 250);
|
|
128
|
+
kill.unref();
|
|
129
|
+
child.once("close", () => clearTimeout(kill));
|
|
130
|
+
finish(error);
|
|
131
|
+
};
|
|
132
|
+
const abort = () =>
|
|
133
|
+
stop(
|
|
134
|
+
new ProcessFailure(
|
|
135
|
+
"interrupted",
|
|
136
|
+
"Gradle observation was cancelled; prior side effects may remain.",
|
|
137
|
+
),
|
|
138
|
+
);
|
|
139
|
+
const timer = setTimeout(
|
|
140
|
+
() =>
|
|
141
|
+
stop(
|
|
142
|
+
new ProcessFailure(
|
|
143
|
+
"timeout",
|
|
144
|
+
"Gradle observation deadline expired; cancellation was requested.",
|
|
145
|
+
),
|
|
146
|
+
),
|
|
147
|
+
remaining,
|
|
148
|
+
);
|
|
149
|
+
control.signal?.addEventListener("abort", abort, { once: true });
|
|
150
|
+
if (control.signal?.aborted) abort();
|
|
151
|
+
const collect = (chunk: Buffer) => {
|
|
152
|
+
if (settled) return;
|
|
153
|
+
bytes += chunk.length;
|
|
154
|
+
if (bytes > 1_048_576) {
|
|
155
|
+
stop(
|
|
156
|
+
new ProcessFailure(
|
|
157
|
+
"oversized",
|
|
158
|
+
"Gradle helper output exceeded 1 MiB; no model was retained.",
|
|
159
|
+
),
|
|
160
|
+
);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
chunks.push(chunk);
|
|
164
|
+
};
|
|
165
|
+
child.stdout.on("data", collect);
|
|
166
|
+
child.stderr.on("data", options.captureError ? collect : () => {});
|
|
167
|
+
child.stdin.on("error", () => {});
|
|
168
|
+
child.once("error", (error) => finish(error));
|
|
169
|
+
child.once("close", (code) =>
|
|
170
|
+
finish(
|
|
171
|
+
code === 0
|
|
172
|
+
? undefined
|
|
173
|
+
: new ProcessFailure("failed", `Gradle helper exited with code ${code ?? "unknown"}.`),
|
|
174
|
+
),
|
|
175
|
+
);
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function validateModel(
|
|
180
|
+
value: unknown,
|
|
181
|
+
base: { selectedRoot: string; query: "GradleBuild/BasicGradleProject"; runtime: GradleRuntime },
|
|
182
|
+
canonicalRoot: string,
|
|
183
|
+
): GradleObservation {
|
|
184
|
+
if (!isRecord(value)) throw new Error("Gradle helper returned a non-object result.");
|
|
185
|
+
if (failureStates.has(String(value.status)) && typeof value.reason === "string") {
|
|
186
|
+
if (value.stage !== "prerequisites" && value.stage !== "query")
|
|
187
|
+
throw new Error("Gradle helper returned an invalid failure stage.");
|
|
188
|
+
return {
|
|
189
|
+
...base,
|
|
190
|
+
status: value.status as "failed",
|
|
191
|
+
stage: value.stage,
|
|
192
|
+
reason: value.reason.slice(0, 500),
|
|
193
|
+
gradleVersion: validateFailureVersion(value),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
if (
|
|
197
|
+
value.status !== "complete" ||
|
|
198
|
+
typeof value.gradleVersion !== "string" ||
|
|
199
|
+
value.buildRoot !== canonicalRoot ||
|
|
200
|
+
!Array.isArray(value.projects) ||
|
|
201
|
+
!Array.isArray(value.includedBuilds)
|
|
202
|
+
)
|
|
203
|
+
throw new Error("Gradle helper returned an invalid model envelope.");
|
|
204
|
+
requireGradle9(value.gradleVersion);
|
|
205
|
+
const projects = validateProjects(value.projects, canonicalRoot);
|
|
206
|
+
for (const included of value.includedBuilds)
|
|
207
|
+
if (
|
|
208
|
+
!isRecord(included) ||
|
|
209
|
+
typeof included.buildRoot !== "string" ||
|
|
210
|
+
!path.isAbsolute(included.buildRoot)
|
|
211
|
+
)
|
|
212
|
+
throw new Error("Gradle helper returned an invalid included-build reference.");
|
|
213
|
+
return {
|
|
214
|
+
...base,
|
|
215
|
+
status: "complete",
|
|
216
|
+
gradleVersion: value.gradleVersion,
|
|
217
|
+
buildRoot: canonicalRoot,
|
|
218
|
+
projects,
|
|
219
|
+
includedBuilds: value.includedBuilds as { buildRoot: string }[],
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function validateFailureVersion(value: Record<string, unknown>): string | undefined {
|
|
224
|
+
if (value.gradleVersion === undefined) return undefined;
|
|
225
|
+
if (
|
|
226
|
+
value.stage !== "query" ||
|
|
227
|
+
typeof value.gradleVersion !== "string" ||
|
|
228
|
+
value.gradleVersion.length === 0 ||
|
|
229
|
+
value.gradleVersion.length > 100
|
|
230
|
+
)
|
|
231
|
+
throw new Error("Gradle helper returned an invalid runtime version.");
|
|
232
|
+
return value.gradleVersion;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function validateProjects(projects: unknown[], canonicalRoot: string): GradleProjectObservation[] {
|
|
236
|
+
if (projects.length === 0 || projects.length > 10_000)
|
|
237
|
+
throw new Error("Gradle helper returned an invalid project count.");
|
|
238
|
+
const paths = new Set<string>();
|
|
239
|
+
const validated: GradleProjectObservation[] = [];
|
|
240
|
+
for (const project of projects) {
|
|
241
|
+
assertProject(project, canonicalRoot);
|
|
242
|
+
if (paths.has(project.path))
|
|
243
|
+
throw new Error("Gradle helper returned a duplicate project identity.");
|
|
244
|
+
paths.add(project.path);
|
|
245
|
+
validated.push(project);
|
|
246
|
+
}
|
|
247
|
+
for (const project of validated) {
|
|
248
|
+
const parent =
|
|
249
|
+
project.path === ":" ? null : project.path.slice(0, project.path.lastIndexOf(":")) || ":";
|
|
250
|
+
if (project.parentPath !== parent || (parent !== null && !paths.has(parent)))
|
|
251
|
+
throw new Error("Gradle helper returned an invalid parent hierarchy.");
|
|
252
|
+
}
|
|
253
|
+
if (!paths.has(":")) throw new Error("Gradle helper omitted the root project.");
|
|
254
|
+
return validated;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function assertProject(value: unknown, root: string): asserts value is GradleProjectObservation {
|
|
258
|
+
if (
|
|
259
|
+
!isRecord(value) ||
|
|
260
|
+
value.buildRoot !== root ||
|
|
261
|
+
typeof value.path !== "string" ||
|
|
262
|
+
!/^:(?:[^:]+(?::[^:]+)*)?$/.test(value.path) ||
|
|
263
|
+
typeof value.name !== "string" ||
|
|
264
|
+
typeof value.directory !== "string" ||
|
|
265
|
+
!path.isAbsolute(value.directory) ||
|
|
266
|
+
!(value.parentPath === null || typeof value.parentPath === "string")
|
|
267
|
+
)
|
|
268
|
+
throw new Error("Gradle helper returned an invalid project identity or directory.");
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
272
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
273
|
+
}
|