pi-lens 4.4.8 → 4.4.9
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/CHANGELOG-USER.md +31 -0
- package/CHANGELOG.md +178 -0
- package/README.md +2 -1
- package/config/dependency-cruiser-eager-allowlist.json +1 -1
- package/dist/{chunk-3O5EII3W.js → chunk-2VZ3VN3N.js} +2 -2
- package/dist/{chunk-SDFKOLSF.js → chunk-3HTZDY3C.js} +8 -6
- package/dist/{chunk-A5GRLYPZ.js → chunk-3NPWO5UO.js} +7 -13
- package/dist/{chunk-AGGUWKRK.js → chunk-47UCC4MM.js} +1 -1
- package/dist/chunk-4ENEJHF4.js +198 -0
- package/dist/{chunk-WXUDRAG6.js → chunk-5GEYJJHG.js} +10 -12
- package/dist/{chunk-HHR7WGCI.js → chunk-5YSEQHJN.js} +3 -3
- package/dist/{chunk-L3CLUGDY.js → chunk-6GPB3JLL.js} +3 -3
- package/dist/{chunk-5F3XF3SX.js → chunk-7R5GZIA6.js} +6 -6
- package/dist/{chunk-CUDD35TW.js → chunk-7UTSNTWM.js} +4 -4
- package/dist/{chunk-DYRZGUMA.js → chunk-7YTRG6YW.js} +2 -2
- package/dist/{chunk-JZRP4DGP.js → chunk-AACN5GNE.js} +2 -2
- package/dist/{chunk-7ANZ7XDD.js → chunk-ACRJ2GZ5.js} +2 -2
- package/dist/{chunk-6FIRFP6A.js → chunk-C3YRO3EU.js} +10 -12
- package/dist/{chunk-GMROJJRN.js → chunk-CB7PEVOJ.js} +9 -1
- package/dist/{chunk-BBET6HD6.js → chunk-CDFJF5YD.js} +1 -1
- package/dist/{chunk-NSPVR3FN.js → chunk-CJS6WE66.js} +17 -19
- package/dist/{chunk-6YUNI7B5.js → chunk-CM6BDY4E.js} +14 -60
- package/dist/{chunk-G5GV2Q7K.js → chunk-CZCAZVTD.js} +16 -2
- package/dist/chunk-DGKFWQK4.js +23 -0
- package/dist/{chunk-VOP4PJKA.js → chunk-E65WJVI5.js} +7 -9
- package/dist/{chunk-TV6RXRYH.js → chunk-EKNYSXFB.js} +8 -10
- package/dist/{chunk-4LL2VRNY.js → chunk-EY6LY2HO.js} +16 -18
- package/dist/{chunk-MC6VB2E5.js → chunk-F6BEQWAK.js} +17 -5
- package/dist/{chunk-R2QQC33W.js → chunk-FGNSESAC.js} +12 -14
- package/dist/{chunk-OC7VWJBZ.js → chunk-FRUBVFXV.js} +35 -37
- package/dist/{chunk-7CGIDRIK.js → chunk-G22UNQID.js} +14 -16
- package/dist/{chunk-L4NEVZ4T.js → chunk-GQTQUNCG.js} +25 -27
- package/dist/{chunk-ZKLTNLAW.js → chunk-H3BVMK47.js} +6 -6
- package/dist/chunk-H6FLQ5NW.js +28 -0
- package/dist/{chunk-2ZE3AUJQ.js → chunk-HEA3EM23.js} +13 -15
- package/dist/{chunk-CZL44WFN.js → chunk-HSOBIN22.js} +2 -2
- package/dist/{chunk-PKSUMEPT.js → chunk-HYSKJMZK.js} +3 -3
- package/dist/{chunk-VN3L2JWZ.js → chunk-IICERRFF.js} +5 -5
- package/dist/{chunk-O4N5BQ3T.js → chunk-IILEH3ZC.js} +8 -10
- package/dist/{chunk-WC6WRNQT.js → chunk-J3Q2NYJR.js} +2 -2
- package/dist/{chunk-SFLHSL5R.js → chunk-JUZ67QZQ.js} +18 -7
- package/dist/chunk-KR5VGMVT.js +25 -0
- package/dist/{chunk-UHHLR2VY.js → chunk-KV6GQOGN.js} +38 -41
- package/dist/{chunk-HUAM7QG3.js → chunk-KXMJLOZF.js} +25 -23
- package/dist/{chunk-BUZIQDFS.js → chunk-L4Y3ROKQ.js} +3 -3
- package/dist/{chunk-JBP7KESM.js → chunk-L6WBJGQS.js} +1 -1
- package/dist/{chunk-35WKJWO5.js → chunk-L7O774U7.js} +14 -14
- package/dist/{chunk-BOPDQ7AZ.js → chunk-LAHHGNAY.js} +19 -21
- package/dist/{chunk-RGGH6M34.js → chunk-LT62P654.js} +1 -1
- package/dist/{chunk-5T5A6YAJ.js → chunk-LWOM6LVS.js} +33 -34
- package/dist/{chunk-JYLOYTZD.js → chunk-MKPDIAZH.js} +5 -1
- package/dist/{chunk-CM73PPGD.js → chunk-MN635QYA.js} +3 -4
- package/dist/{chunk-BQG2QFVO.js → chunk-MQ4PPCJB.js} +21 -29
- package/dist/{chunk-HXFUTMX2.js → chunk-MRLH4MYU.js} +2 -2
- package/dist/{chunk-XOMGO63G.js → chunk-N56BNAA6.js} +19 -21
- package/dist/{chunk-7MAD5ZAY.js → chunk-N5CEGQPG.js} +14 -16
- package/dist/{chunk-ZFORSIED.js → chunk-NCLO6E6N.js} +13 -33
- package/dist/{chunk-SQC7K3SP.js → chunk-NL5LSKVD.js} +2 -2
- package/dist/{chunk-I22THIHI.js → chunk-NMUSOZ2D.js} +10 -12
- package/dist/{chunk-4NBWFYWW.js → chunk-NOWH2VA2.js} +8 -33
- package/dist/{chunk-NM2NWH55.js → chunk-NUSXS6YB.js} +6 -5
- package/dist/{chunk-OZWXLJMX.js → chunk-OSEKJEUU.js} +2 -2
- package/dist/{chunk-2BKUFQKR.js → chunk-OUYAUXAT.js} +405 -181
- package/dist/{chunk-JPRDTY5S.js → chunk-PBZNYHMM.js} +8 -10
- package/dist/{chunk-JE6HKLC7.js → chunk-PIIUNJIT.js} +2 -4
- package/dist/{chunk-ZZDIOAAJ.js → chunk-PRHYIA6X.js} +6 -6
- package/dist/{chunk-4W52ZKZX.js → chunk-PXQ45SGD.js} +2 -2
- package/dist/chunk-Q6JQKWPK.js +25 -0
- package/dist/{chunk-PIQQM32Y.js → chunk-QB7T2PHK.js} +2 -2
- package/dist/{chunk-HKIL6DCL.js → chunk-QGITU23N.js} +1 -1
- package/dist/chunk-QJJKOHLH.js +57 -0
- package/dist/{chunk-6LJOJ6EO.js → chunk-QP33NKYC.js} +14 -16
- package/dist/{chunk-DIWK3LBC.js → chunk-QVBOXT3L.js} +8 -10
- package/dist/{chunk-IYVYZQRL.js → chunk-RNJFRXEN.js} +5 -7
- package/dist/{chunk-G6JKM4O7.js → chunk-RNXOWDM6.js} +10 -10
- package/dist/{chunk-5RNB4HVK.js → chunk-RTFMDIKV.js} +1 -1
- package/dist/{chunk-XWIME22V.js → chunk-SIQHOB6P.js} +11 -13
- package/dist/{chunk-T2S3FNNJ.js → chunk-SLSMJPEF.js} +41 -42
- package/dist/chunk-T5QSLSMM.js +50 -0
- package/dist/chunk-TGQDAG4B.js +88 -0
- package/dist/{chunk-6GMGEKQN.js → chunk-THYHUIDR.js} +39 -12
- package/dist/{chunk-WMDUT4KH.js → chunk-TMNUTMT5.js} +72 -89
- package/dist/{chunk-7TNILKGY.js → chunk-TOE2RRCS.js} +1 -1
- package/dist/chunk-TYHPVE5H.js +25 -0
- package/dist/chunk-UAKO2M6B.js +73 -0
- package/dist/chunk-UC5AXW5Z.js +20 -0
- package/dist/chunk-UTJP6WOS.js +28 -0
- package/dist/{chunk-FRLAUP2B.js → chunk-UXTQ3QPD.js} +4 -4
- package/dist/{chunk-4QG55RRC.js → chunk-V2WDBOLZ.js} +10 -12
- package/dist/{chunk-FHEV6T4L.js → chunk-V67D6TMU.js} +8 -10
- package/dist/{chunk-VLQ7UKZH.js → chunk-VCRVNLE7.js} +135 -2
- package/dist/{chunk-KZ4ALBCH.js → chunk-VO4JFPTV.js} +2 -2
- package/dist/{chunk-GIRBSBGL.js → chunk-VWLSU3XV.js} +3 -3
- package/dist/{chunk-2453RRJ2.js → chunk-W5E72HJA.js} +59 -22
- package/dist/{chunk-VPLBLWFO.js → chunk-W7TY6HYX.js} +1 -1
- package/dist/{chunk-SP4TFY5F.js → chunk-WSSLVMDA.js} +11 -13
- package/dist/{chunk-PPKECBPP.js → chunk-WTB4GKMH.js} +10 -1
- package/dist/{chunk-X35S7HSB.js → chunk-X5BJ3G2P.js} +41 -30
- package/dist/{chunk-X66YJ2SS.js → chunk-XKFO2SZV.js} +33 -34
- package/dist/{chunk-OWTG6UMO.js → chunk-XLAI7UYY.js} +75 -22
- package/dist/{chunk-4B2YFN4U.js → chunk-XO756WE5.js} +45 -33
- package/dist/{chunk-VOXTCULR.js → chunk-XVB3Q2PG.js} +2 -4
- package/dist/{chunk-XYLC35E4.js → chunk-YOXCCJDF.js} +517 -308
- package/dist/{chunk-O2ARHQKF.js → chunk-ZCQBNPRH.js} +2 -2
- package/dist/chunk-ZD4KVFXI.js +234 -0
- package/dist/{chunk-LSFXZLPW.js → chunk-ZDMFGACN.js} +184 -235
- package/dist/{chunk-4BKU7PV3.js → chunk-ZMMHHXSW.js} +1 -1
- package/dist/{chunk-OY7WZI7Q.js → chunk-ZPM7ZIFL.js} +6 -6
- package/dist/{chunk-R4QWJQ2H.js → chunk-ZVCDHYWZ.js} +9 -11
- package/dist/{chunk-RZG472YW.js → chunk-ZZN74OGD.js} +83 -46
- package/dist/{chunk-BHWW6FAX.js → chunk-ZZSJAR76.js} +37 -19
- package/dist/index.js +4910 -4218
- package/dist/mcp/analyze-cli.js +12 -17
- package/dist/mcp/cli.js +41 -42
- package/dist/mcp/server.js +1451 -648
- package/dist/mcp/worker.js +59 -60
- package/dist/probes/installer.js +17 -19
- package/docs/agent-tools.md +40 -8
- package/docs/analysisall.md +1 -1
- package/docs/ci-bot-pr-checks.md +7 -5
- package/docs/configuration.md +51 -9
- package/docs/defect-shapes.md +52 -3
- package/docs/environment-variables.md +18 -1
- package/docs/features.md +12 -5
- package/docs/globalconfig.md +11 -3
- package/docs/invariants/lsp-trust-exec.md +9 -2
- package/docs/invariants/session-telemetry.md +2 -2
- package/docs/language-coverage.md +1 -0
- package/docs/lsp-capability-matrix.md +57 -35
- package/docs/lsp-idle-eviction.md +4 -1
- package/docs/merge-queue-rollout.md +10 -8
- package/docs/module-report-read-symbol.md +34 -23
- package/docs/pi-lens-fixer.md +11 -1
- package/docs/pi-lens-investigator.md +3 -0
- package/docs/pi-lens-merge-policy.md +15 -7
- package/docs/pi-lens-reviewer.md +1 -1
- package/docs/pi-lens-subagent.md +13 -0
- package/docs/public-api-stability.md +39 -5
- package/docs/release-qa-baseline.md +7 -4
- package/docs/schema/pi-lens-config-v1.json +11 -2
- package/docs/servercapabilities.md +3 -1
- package/docs/settings.md +2 -2
- package/docs/word-index.md +3 -2
- package/package.json +8 -3
- package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +1 -2
- package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +1 -2
- package/scripts/download-grammars.js +3 -2
- package/skills/pi-lens-lsp-navigation/SKILL.md +5 -1
- package/dist/chunk-2TS4GLOJ.js +0 -31
- package/dist/chunk-3JAHQBSY.js +0 -27
- package/dist/chunk-447YZL4S.js +0 -25
- package/dist/chunk-565VRUP4.js +0 -136
- package/dist/chunk-57X2CDRX.js +0 -49
- package/dist/chunk-GGYOZWHW.js +0 -27
- package/dist/chunk-IE5D3RA5.js +0 -58
- package/dist/chunk-LPYTPNOJ.js +0 -22
- package/dist/chunk-OFNMHPBT.js +0 -89
- package/dist/chunk-U3AS2FR6.js +0 -106
- package/dist/chunk-W3BGKBBK.js +0 -27
- package/dist/chunk-WQV6BI4Q.js +0 -48
- package/dist/chunk-YHGYAEFH.js +0 -443
- package/dist/chunk-ZONZ6YY3.js +0 -74
- package/dist/chunk-ZSM35JF4.js +0 -30
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
normalizeMessage,
|
|
8
8
|
sanitizeCorrelationId,
|
|
9
9
|
stableFindingId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VWLSU3XV.js";
|
|
11
11
|
import {
|
|
12
12
|
mapWithConcurrency
|
|
13
13
|
} from "./chunk-XIMYZ3JA.js";
|
|
@@ -38,24 +38,24 @@ import {
|
|
|
38
38
|
resolveLspServerCwd,
|
|
39
39
|
serverTraits,
|
|
40
40
|
withLspProjectCodePermission
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-YOXCCJDF.js";
|
|
42
42
|
import {
|
|
43
43
|
findLocalOpengrepConfig
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-7YTRG6YW.js";
|
|
45
45
|
import {
|
|
46
46
|
emitBounded
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-V67D6TMU.js";
|
|
48
48
|
import {
|
|
49
49
|
loadProjectSnapshot,
|
|
50
50
|
readJsonCache
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-PRHYIA6X.js";
|
|
52
52
|
import {
|
|
53
53
|
acquireWorkspaceSweepHold,
|
|
54
54
|
configureLspServiceLifecycle,
|
|
55
55
|
getOwnedLspService,
|
|
56
56
|
peekOwnedLspService,
|
|
57
57
|
resetOwnedLspService
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-XVB3Q2PG.js";
|
|
59
59
|
import {
|
|
60
60
|
collectForwardImportMtimes,
|
|
61
61
|
exceedsLspSyncLimits,
|
|
@@ -69,46 +69,46 @@ import {
|
|
|
69
69
|
lineTextAt,
|
|
70
70
|
pathBirthtimeMs,
|
|
71
71
|
scanDocumentContent
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-L7O774U7.js";
|
|
73
73
|
import {
|
|
74
74
|
js_yaml_default
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-QGITU23N.js";
|
|
76
76
|
import {
|
|
77
77
|
EXTENSION_TO_LSP_ID,
|
|
78
78
|
lspLanguageId,
|
|
79
79
|
resolveFilenameLanguage
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-WTB4GKMH.js";
|
|
81
81
|
import {
|
|
82
82
|
HOOK_WALL_BUDGET_MS
|
|
83
83
|
} from "./chunk-CKEQFGLT.js";
|
|
84
|
-
import {
|
|
85
|
-
bounded,
|
|
86
|
-
untilAborted,
|
|
87
|
-
withDeadline,
|
|
88
|
-
withTimeout
|
|
89
|
-
} from "./chunk-JYLOYTZD.js";
|
|
90
84
|
import {
|
|
91
85
|
diagnosticsIpcPathForCwd,
|
|
92
86
|
requestWarmCodeActions,
|
|
93
87
|
requestWarmDiagnostics
|
|
94
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-HSOBIN22.js";
|
|
95
89
|
import {
|
|
96
90
|
CONTENT_HASH_MAX_BYTES,
|
|
97
91
|
hashContentBytes,
|
|
98
92
|
hashFileBytes,
|
|
99
93
|
stampContentBytes
|
|
100
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-W7TY6HYX.js";
|
|
95
|
+
import {
|
|
96
|
+
bounded,
|
|
97
|
+
untilAborted,
|
|
98
|
+
withDeadline,
|
|
99
|
+
withTimeout
|
|
100
|
+
} from "./chunk-MKPDIAZH.js";
|
|
101
101
|
import {
|
|
102
102
|
findLocalZizmorConfig,
|
|
103
103
|
logSessionStart
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-MQ4PPCJB.js";
|
|
105
105
|
import {
|
|
106
106
|
findLocalBinUpwards,
|
|
107
107
|
isProjectLocalBinPath
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-E65WJVI5.js";
|
|
109
109
|
import {
|
|
110
110
|
getLspCapableKinds
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-3HTZDY3C.js";
|
|
112
112
|
import {
|
|
113
113
|
createGenerationMap,
|
|
114
114
|
createGenerationSource,
|
|
@@ -127,50 +127,47 @@ import {
|
|
|
127
127
|
sampleProcessTreeCpuPercent,
|
|
128
128
|
selectLivePeerInstances,
|
|
129
129
|
windowsExe
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-TMNUTMT5.js";
|
|
131
131
|
import {
|
|
132
132
|
createSingleFlight
|
|
133
133
|
} from "./chunk-AWQWXSW4.js";
|
|
134
134
|
import {
|
|
135
135
|
SPECIAL_FILENAMES,
|
|
136
136
|
getLanguageId
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-CZCAZVTD.js";
|
|
138
138
|
import {
|
|
139
139
|
PathKeyedMap,
|
|
140
140
|
detectFileRole
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-X5BJ3G2P.js";
|
|
142
142
|
import {
|
|
143
143
|
assertInstallAllowed,
|
|
144
144
|
isLspSpawnAllowedByTrust,
|
|
145
145
|
projectTrustDenialReason,
|
|
146
146
|
writeFileAtomic
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-PIIUNJIT.js";
|
|
148
148
|
import {
|
|
149
149
|
compareOrdinal,
|
|
150
150
|
incrementDegradationCount,
|
|
151
|
+
logExtension,
|
|
151
152
|
recordDegradation,
|
|
152
153
|
recordDegradationOnce,
|
|
153
154
|
truncateForLedger
|
|
154
|
-
} from "./chunk-
|
|
155
|
-
import {
|
|
156
|
-
logExtension
|
|
157
|
-
} from "./chunk-WQV6BI4Q.js";
|
|
155
|
+
} from "./chunk-W5E72HJA.js";
|
|
158
156
|
import {
|
|
159
157
|
freshnessFromMtime
|
|
160
158
|
} from "./chunk-S26LC76R.js";
|
|
161
|
-
import {
|
|
162
|
-
logLatency,
|
|
163
|
-
phaseFinished,
|
|
164
|
-
phaseStarted
|
|
165
|
-
} from "./chunk-565VRUP4.js";
|
|
166
159
|
import {
|
|
167
160
|
createNdjsonLogger,
|
|
168
161
|
getGlobalPiLensLogDir,
|
|
169
162
|
getMaxLogSizeMB,
|
|
170
163
|
getProcessSingleton,
|
|
164
|
+
isLspInstallDisabled,
|
|
171
165
|
isTestMode,
|
|
172
|
-
|
|
173
|
-
|
|
166
|
+
logLatency,
|
|
167
|
+
nextModuleEvaluationOrdinal,
|
|
168
|
+
phaseFinished,
|
|
169
|
+
phaseStarted
|
|
170
|
+
} from "./chunk-VCRVNLE7.js";
|
|
174
171
|
import {
|
|
175
172
|
BoundedFifoMap,
|
|
176
173
|
BoundedLruCache,
|
|
@@ -193,7 +190,7 @@ import {
|
|
|
193
190
|
uriToDiskPath,
|
|
194
191
|
uriToPath,
|
|
195
192
|
walkUpDirs
|
|
196
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-CB7PEVOJ.js";
|
|
197
194
|
import {
|
|
198
195
|
__commonJS,
|
|
199
196
|
__require,
|
|
@@ -2408,10 +2405,11 @@ var require_connection = __commonJS({
|
|
|
2408
2405
|
} finally {
|
|
2409
2406
|
if (result instanceof Promise) {
|
|
2410
2407
|
result.then(() => {
|
|
2411
|
-
inFlight--;
|
|
2412
|
-
triggerMessageQueue();
|
|
2413
2408
|
}).catch((error) => {
|
|
2414
2409
|
logger.error(`Processing message queue failed: ${error.toString()}`);
|
|
2410
|
+
}).finally(() => {
|
|
2411
|
+
inFlight--;
|
|
2412
|
+
triggerMessageQueue();
|
|
2415
2413
|
});
|
|
2416
2414
|
} else {
|
|
2417
2415
|
inFlight--;
|
|
@@ -3404,6 +3402,7 @@ var require_ril = __commonJS({
|
|
|
3404
3402
|
"use strict";
|
|
3405
3403
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3406
3404
|
var util_1 = __require("util");
|
|
3405
|
+
var crypto_1 = __require("crypto");
|
|
3407
3406
|
var api_1 = require_api();
|
|
3408
3407
|
var MessageBuffer = class _MessageBuffer extends api_1.AbstractMessageBuffer {
|
|
3409
3408
|
static emptyBuffer = Buffer.allocUnsafe(0);
|
|
@@ -3427,7 +3426,7 @@ var require_ril = __commonJS({
|
|
|
3427
3426
|
if (length === void 0) {
|
|
3428
3427
|
return buffer instanceof Buffer ? buffer : Buffer.from(buffer);
|
|
3429
3428
|
} else {
|
|
3430
|
-
return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer
|
|
3429
|
+
return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer.subarray(0, length));
|
|
3431
3430
|
}
|
|
3432
3431
|
}
|
|
3433
3432
|
allocNative(length) {
|
|
@@ -3494,6 +3493,9 @@ var require_ril = __commonJS({
|
|
|
3494
3493
|
}
|
|
3495
3494
|
};
|
|
3496
3495
|
var _ril = Object.freeze({
|
|
3496
|
+
crypto: Object.freeze({
|
|
3497
|
+
randomUUID: () => (0, crypto_1.randomUUID)()
|
|
3498
|
+
}),
|
|
3497
3499
|
messageBuffer: Object.freeze({
|
|
3498
3500
|
create: (encoding) => new MessageBuffer(encoding)
|
|
3499
3501
|
}),
|
|
@@ -3644,7 +3646,7 @@ var require_main = __commonJS({
|
|
|
3644
3646
|
this.errorCount = 0;
|
|
3645
3647
|
const eventEmitter = this.process;
|
|
3646
3648
|
eventEmitter.on("error", (error) => this.fireError(error));
|
|
3647
|
-
eventEmitter.on("close", () => this.fireClose);
|
|
3649
|
+
eventEmitter.on("close", () => this.fireClose());
|
|
3648
3650
|
}
|
|
3649
3651
|
write(msg) {
|
|
3650
3652
|
try {
|
|
@@ -3677,7 +3679,7 @@ var require_main = __commonJS({
|
|
|
3677
3679
|
constructor(port) {
|
|
3678
3680
|
super();
|
|
3679
3681
|
this.onData = new api_1.Emitter();
|
|
3680
|
-
port.on("close", () => this.fireClose);
|
|
3682
|
+
port.on("close", () => this.fireClose());
|
|
3681
3683
|
port.on("error", (error) => this.fireError(error));
|
|
3682
3684
|
port.on("message", (message) => {
|
|
3683
3685
|
this.onData.fire(message);
|
|
@@ -3786,6 +3788,9 @@ var require_main = __commonJS({
|
|
|
3786
3788
|
resolve7({
|
|
3787
3789
|
onConnected: () => {
|
|
3788
3790
|
return connected;
|
|
3791
|
+
},
|
|
3792
|
+
close: () => {
|
|
3793
|
+
server.close();
|
|
3789
3794
|
}
|
|
3790
3795
|
});
|
|
3791
3796
|
});
|
|
@@ -3824,6 +3829,9 @@ var require_main = __commonJS({
|
|
|
3824
3829
|
port: () => boundPort,
|
|
3825
3830
|
onConnected: () => {
|
|
3826
3831
|
return connected;
|
|
3832
|
+
},
|
|
3833
|
+
close: () => {
|
|
3834
|
+
server.close();
|
|
3827
3835
|
}
|
|
3828
3836
|
});
|
|
3829
3837
|
});
|
|
@@ -4042,7 +4050,7 @@ async function importTargetsToAnnounce(cwd, importers, onScope) {
|
|
|
4042
4050
|
reason: `resolved the imports of ${CREATED_IMPORT_SCAN_MAX_FILES} of ${importers.length} files in one diagnostics call`
|
|
4043
4051
|
});
|
|
4044
4052
|
}
|
|
4045
|
-
const { extractForwardImports } = await import("./chunk-
|
|
4053
|
+
const { extractForwardImports } = await import("./chunk-LAHHGNAY.js");
|
|
4046
4054
|
const targets = /* @__PURE__ */ new Set();
|
|
4047
4055
|
const reexports = /* @__PURE__ */ new Map();
|
|
4048
4056
|
let resolved2 = 0;
|
|
@@ -5310,14 +5318,79 @@ function restoreLineEndings(text, ending) {
|
|
|
5310
5318
|
|
|
5311
5319
|
// dist/clients/partial-edit-apply.js
|
|
5312
5320
|
import { createHash as createHash3 } from "node:crypto";
|
|
5313
|
-
import * as
|
|
5321
|
+
import * as fs3 from "node:fs";
|
|
5322
|
+
var MAX_APPLIED_RECORDS_PER_FILE = 8;
|
|
5323
|
+
var MAX_APPLIED_RECORD_FILES = 64;
|
|
5324
|
+
function editPairDigest(oldText, newText) {
|
|
5325
|
+
return createHash3("sha256").update(JSON.stringify([oldText, newText ?? ""]), "utf8").digest("hex");
|
|
5326
|
+
}
|
|
5327
|
+
var PartialApplyRecordStore = class {
|
|
5328
|
+
// Bounded on the PathKeyedMap itself (#2442): the file axis used to
|
|
5329
|
+
// hand-roll `keys().next().value` here, which also evicted an unrelated
|
|
5330
|
+
// file when a path ALREADY in the map was re-recorded at capacity.
|
|
5331
|
+
files = new PathKeyedMap(normalizeMapKey, MAX_APPLIED_RECORD_FILES);
|
|
5332
|
+
find(filePath, oldText, newText) {
|
|
5333
|
+
if (!oldText)
|
|
5334
|
+
return void 0;
|
|
5335
|
+
const pairDigest = editPairDigest(oldText, newText);
|
|
5336
|
+
const records = this.files.get(filePath) ?? [];
|
|
5337
|
+
return records.find((r) => r.pairDigest === pairDigest);
|
|
5338
|
+
}
|
|
5339
|
+
record(filePath, oldText, newText, contentHash2) {
|
|
5340
|
+
if (!oldText)
|
|
5341
|
+
return;
|
|
5342
|
+
const pairDigest = editPairDigest(oldText, newText);
|
|
5343
|
+
const records = this.files.get(filePath) ?? [];
|
|
5344
|
+
const existing = records.findIndex((r) => r.pairDigest === pairDigest);
|
|
5345
|
+
if (existing >= 0)
|
|
5346
|
+
records.splice(existing, 1);
|
|
5347
|
+
const entry = {
|
|
5348
|
+
pairDigest,
|
|
5349
|
+
contentHash: contentHash2 ?? hashFile(filePath),
|
|
5350
|
+
appliedAtMs: Date.now()
|
|
5351
|
+
};
|
|
5352
|
+
if (records.length >= MAX_APPLIED_RECORDS_PER_FILE)
|
|
5353
|
+
records.shift();
|
|
5354
|
+
records.push(entry);
|
|
5355
|
+
this.files.set(filePath, records);
|
|
5356
|
+
}
|
|
5357
|
+
/**
|
|
5358
|
+
* Stamps the post-afterWrite file hash onto an existing record so a later
|
|
5359
|
+
* identical retry against the formatter-rewritten file is still recognized as
|
|
5360
|
+
* already-applied (#2402). No-op when the pair was never recorded.
|
|
5361
|
+
*/
|
|
5362
|
+
noteAfterWriteHash(filePath, oldText, newText, afterWriteContentHash) {
|
|
5363
|
+
if (!oldText)
|
|
5364
|
+
return;
|
|
5365
|
+
const pairDigest = editPairDigest(oldText, newText);
|
|
5366
|
+
const record2 = this.files.get(filePath)?.find((r) => r.pairDigest === pairDigest);
|
|
5367
|
+
if (record2)
|
|
5368
|
+
record2.afterWriteContentHash = afterWriteContentHash;
|
|
5369
|
+
}
|
|
5370
|
+
clear() {
|
|
5371
|
+
this.files.clear();
|
|
5372
|
+
}
|
|
5373
|
+
get fileCount() {
|
|
5374
|
+
return this.files.size;
|
|
5375
|
+
}
|
|
5376
|
+
};
|
|
5377
|
+
function hashFile(filePath) {
|
|
5378
|
+
try {
|
|
5379
|
+
return createHash3("sha256").update(fs3.readFileSync(filePath)).digest("hex");
|
|
5380
|
+
} catch {
|
|
5381
|
+
return void 0;
|
|
5382
|
+
}
|
|
5383
|
+
}
|
|
5384
|
+
|
|
5385
|
+
// dist/clients/read-guard.js
|
|
5386
|
+
import { constants as bufferConstants } from "node:buffer";
|
|
5387
|
+
import * as fs5 from "node:fs";
|
|
5314
5388
|
|
|
5315
5389
|
// dist/clients/file-time.js
|
|
5316
|
-
import * as
|
|
5390
|
+
import * as fs4 from "node:fs";
|
|
5317
5391
|
import * as path4 from "node:path";
|
|
5318
5392
|
var globalState = {
|
|
5319
|
-
reads: /* @__PURE__ */ new Map()
|
|
5320
|
-
locks: /* @__PURE__ */ new Map()
|
|
5393
|
+
reads: /* @__PURE__ */ new Map()
|
|
5321
5394
|
};
|
|
5322
5395
|
var FileTime = class {
|
|
5323
5396
|
sessionID;
|
|
@@ -5380,25 +5453,6 @@ Please read the file again before modifying it.`, absolutePath, "modified");
|
|
|
5380
5453
|
const current = createStamp(absolutePath);
|
|
5381
5454
|
return current.mtime !== recorded.mtime || current.ctime !== recorded.ctime || current.size !== recorded.size;
|
|
5382
5455
|
}
|
|
5383
|
-
/**
|
|
5384
|
-
* Acquire exclusive lock on file
|
|
5385
|
-
* Prevents concurrent modifications to same file
|
|
5386
|
-
*/
|
|
5387
|
-
async withLock(filePath, fn) {
|
|
5388
|
-
const absolutePath = path4.resolve(filePath);
|
|
5389
|
-
while (globalState.locks.has(absolutePath)) {
|
|
5390
|
-
const existing = globalState.locks.get(absolutePath);
|
|
5391
|
-
if (existing)
|
|
5392
|
-
await existing;
|
|
5393
|
-
}
|
|
5394
|
-
const lockPromise = fn().finally(() => {
|
|
5395
|
-
globalState.locks.delete(absolutePath);
|
|
5396
|
-
});
|
|
5397
|
-
globalState.locks.set(absolutePath, lockPromise.then(() => {
|
|
5398
|
-
}, () => {
|
|
5399
|
-
}));
|
|
5400
|
-
return lockPromise;
|
|
5401
|
-
}
|
|
5402
5456
|
/**
|
|
5403
5457
|
* Clear all tracked files for this session
|
|
5404
5458
|
*/
|
|
@@ -5426,7 +5480,7 @@ var FileTimeError = class extends Error {
|
|
|
5426
5480
|
};
|
|
5427
5481
|
function createStamp(filePath) {
|
|
5428
5482
|
try {
|
|
5429
|
-
const stats =
|
|
5483
|
+
const stats = fs4.statSync(filePath);
|
|
5430
5484
|
return {
|
|
5431
5485
|
readAt: /* @__PURE__ */ new Date(),
|
|
5432
5486
|
mtime: stats.mtime.getTime(),
|
|
@@ -5447,78 +5501,8 @@ function createFileTime(sessionID) {
|
|
|
5447
5501
|
}
|
|
5448
5502
|
function clearAllSessions() {
|
|
5449
5503
|
globalState.reads.clear();
|
|
5450
|
-
globalState.locks.clear();
|
|
5451
|
-
}
|
|
5452
|
-
|
|
5453
|
-
// dist/clients/partial-edit-apply.js
|
|
5454
|
-
var MAX_APPLIED_RECORDS_PER_FILE = 8;
|
|
5455
|
-
var MAX_APPLIED_RECORD_FILES = 64;
|
|
5456
|
-
function editPairDigest(oldText, newText) {
|
|
5457
|
-
return createHash3("sha256").update(JSON.stringify([oldText, newText ?? ""]), "utf8").digest("hex");
|
|
5458
|
-
}
|
|
5459
|
-
var PartialApplyRecordStore = class {
|
|
5460
|
-
// Bounded on the PathKeyedMap itself (#2442): the file axis used to
|
|
5461
|
-
// hand-roll `keys().next().value` here, which also evicted an unrelated
|
|
5462
|
-
// file when a path ALREADY in the map was re-recorded at capacity.
|
|
5463
|
-
files = new PathKeyedMap(normalizeMapKey, MAX_APPLIED_RECORD_FILES);
|
|
5464
|
-
find(filePath, oldText, newText) {
|
|
5465
|
-
if (!oldText)
|
|
5466
|
-
return void 0;
|
|
5467
|
-
const pairDigest = editPairDigest(oldText, newText);
|
|
5468
|
-
const records = this.files.get(filePath) ?? [];
|
|
5469
|
-
return records.find((r) => r.pairDigest === pairDigest);
|
|
5470
|
-
}
|
|
5471
|
-
record(filePath, oldText, newText, contentHash2) {
|
|
5472
|
-
if (!oldText)
|
|
5473
|
-
return;
|
|
5474
|
-
const pairDigest = editPairDigest(oldText, newText);
|
|
5475
|
-
const records = this.files.get(filePath) ?? [];
|
|
5476
|
-
const existing = records.findIndex((r) => r.pairDigest === pairDigest);
|
|
5477
|
-
if (existing >= 0)
|
|
5478
|
-
records.splice(existing, 1);
|
|
5479
|
-
const entry = {
|
|
5480
|
-
pairDigest,
|
|
5481
|
-
contentHash: contentHash2 ?? hashFile(filePath),
|
|
5482
|
-
appliedAtMs: Date.now()
|
|
5483
|
-
};
|
|
5484
|
-
if (records.length >= MAX_APPLIED_RECORDS_PER_FILE)
|
|
5485
|
-
records.shift();
|
|
5486
|
-
records.push(entry);
|
|
5487
|
-
this.files.set(filePath, records);
|
|
5488
|
-
}
|
|
5489
|
-
/**
|
|
5490
|
-
* Stamps the post-afterWrite file hash onto an existing record so a later
|
|
5491
|
-
* identical retry against the formatter-rewritten file is still recognized as
|
|
5492
|
-
* already-applied (#2402). No-op when the pair was never recorded.
|
|
5493
|
-
*/
|
|
5494
|
-
noteAfterWriteHash(filePath, oldText, newText, afterWriteContentHash) {
|
|
5495
|
-
if (!oldText)
|
|
5496
|
-
return;
|
|
5497
|
-
const pairDigest = editPairDigest(oldText, newText);
|
|
5498
|
-
const record2 = this.files.get(filePath)?.find((r) => r.pairDigest === pairDigest);
|
|
5499
|
-
if (record2)
|
|
5500
|
-
record2.afterWriteContentHash = afterWriteContentHash;
|
|
5501
|
-
}
|
|
5502
|
-
clear() {
|
|
5503
|
-
this.files.clear();
|
|
5504
|
-
}
|
|
5505
|
-
get fileCount() {
|
|
5506
|
-
return this.files.size;
|
|
5507
|
-
}
|
|
5508
|
-
};
|
|
5509
|
-
var fileLock = createFileTime("partial-edit-apply");
|
|
5510
|
-
function hashFile(filePath) {
|
|
5511
|
-
try {
|
|
5512
|
-
return createHash3("sha256").update(fs4.readFileSync(filePath)).digest("hex");
|
|
5513
|
-
} catch {
|
|
5514
|
-
return void 0;
|
|
5515
|
-
}
|
|
5516
5504
|
}
|
|
5517
5505
|
|
|
5518
|
-
// dist/clients/read-guard.js
|
|
5519
|
-
import { constants as bufferConstants } from "node:buffer";
|
|
5520
|
-
import * as fs5 from "node:fs";
|
|
5521
|
-
|
|
5522
5506
|
// dist/clients/eval-timestamp.js
|
|
5523
5507
|
import { performance as performance2 } from "node:perf_hooks";
|
|
5524
5508
|
var PI_LENS_EVAL_STARTED_MS = performance2.now();
|
|
@@ -7785,7 +7769,10 @@ function getProcessBridge(key, version) {
|
|
|
7785
7769
|
return candidate;
|
|
7786
7770
|
}
|
|
7787
7771
|
|
|
7788
|
-
// dist/clients/
|
|
7772
|
+
// dist/clients/recent-touches.js
|
|
7773
|
+
var RECENT_TOUCHES_FRESHNESS_MS = 15 * 60 * 1e3;
|
|
7774
|
+
|
|
7775
|
+
// dist/clients/live-bus-emitter.js
|
|
7789
7776
|
import * as path6 from "node:path";
|
|
7790
7777
|
var BUS_EVENTS_LOG_FILE = path6.join(getGlobalPiLensLogDir(), "bus-events.log");
|
|
7791
7778
|
var writer = createNdjsonLogger({
|
|
@@ -7811,11 +7798,6 @@ function logBusEvent(entry) {
|
|
|
7811
7798
|
}
|
|
7812
7799
|
writer.log({ ts: (/* @__PURE__ */ new Date()).toISOString(), ...entry });
|
|
7813
7800
|
}
|
|
7814
|
-
|
|
7815
|
-
// dist/clients/recent-touches.js
|
|
7816
|
-
var RECENT_TOUCHES_FRESHNESS_MS = 15 * 60 * 1e3;
|
|
7817
|
-
|
|
7818
|
-
// dist/clients/live-bus-emitter.js
|
|
7819
7801
|
var STALE_CTX_MESSAGE = "This extension ctx is stale after session replacement";
|
|
7820
7802
|
function recordStaleBusFailure(subject, error) {
|
|
7821
7803
|
const reason = String(error);
|
|
@@ -7866,12 +7848,110 @@ function resolveLiveBusEmitter(liveEmitter4, entry) {
|
|
|
7866
7848
|
}
|
|
7867
7849
|
return resolution;
|
|
7868
7850
|
}
|
|
7851
|
+
function createBusPublisher(liveEmitter4, options) {
|
|
7852
|
+
let failureLogged = false;
|
|
7853
|
+
let unwiredLogged = false;
|
|
7854
|
+
let disabledLogged = false;
|
|
7855
|
+
return {
|
|
7856
|
+
publish(call) {
|
|
7857
|
+
const { event } = call;
|
|
7858
|
+
let normalized;
|
|
7859
|
+
const cwd = () => {
|
|
7860
|
+
normalized ??= normalizeFilePath(call.cwd);
|
|
7861
|
+
return normalized;
|
|
7862
|
+
};
|
|
7863
|
+
const extra = call.extra ?? {};
|
|
7864
|
+
if (call.enabled === false) {
|
|
7865
|
+
if (!disabledLogged) {
|
|
7866
|
+
disabledLogged = true;
|
|
7867
|
+
logBusEvent({
|
|
7868
|
+
event,
|
|
7869
|
+
outcome: "skipped_disabled",
|
|
7870
|
+
cwd: cwd(),
|
|
7871
|
+
...extra
|
|
7872
|
+
});
|
|
7873
|
+
}
|
|
7874
|
+
return;
|
|
7875
|
+
}
|
|
7876
|
+
call.whenEnabled?.();
|
|
7877
|
+
const resolution = resolveLiveBusEmitter(liveEmitter4, () => ({
|
|
7878
|
+
event,
|
|
7879
|
+
cwd: cwd(),
|
|
7880
|
+
...extra
|
|
7881
|
+
}));
|
|
7882
|
+
if (resolution.outcome === "stale-session")
|
|
7883
|
+
return;
|
|
7884
|
+
if (resolution.outcome === "unwired") {
|
|
7885
|
+
if (!unwiredLogged) {
|
|
7886
|
+
unwiredLogged = true;
|
|
7887
|
+
if (options.onUnwired)
|
|
7888
|
+
options.onUnwired(event);
|
|
7889
|
+
else {
|
|
7890
|
+
logBusEvent({
|
|
7891
|
+
event,
|
|
7892
|
+
outcome: "skipped_unwired",
|
|
7893
|
+
cwd: cwd(),
|
|
7894
|
+
...extra
|
|
7895
|
+
});
|
|
7896
|
+
}
|
|
7897
|
+
}
|
|
7898
|
+
return;
|
|
7899
|
+
}
|
|
7900
|
+
try {
|
|
7901
|
+
const payload = call.build(cwd());
|
|
7902
|
+
resolution.emit(event, payload);
|
|
7903
|
+
failureLogged = false;
|
|
7904
|
+
logBusEvent({
|
|
7905
|
+
event,
|
|
7906
|
+
outcome: "emitted",
|
|
7907
|
+
cwd: cwd(),
|
|
7908
|
+
...extra,
|
|
7909
|
+
...call.emittedFields?.(payload)
|
|
7910
|
+
});
|
|
7911
|
+
} catch (err) {
|
|
7912
|
+
logBusEvent({
|
|
7913
|
+
event,
|
|
7914
|
+
outcome: "emit_failed",
|
|
7915
|
+
cwd: cwd(),
|
|
7916
|
+
...extra,
|
|
7917
|
+
error: String(err),
|
|
7918
|
+
ctxSource: resolution.ctxSource
|
|
7919
|
+
});
|
|
7920
|
+
if (!failureLogged) {
|
|
7921
|
+
failureLogged = true;
|
|
7922
|
+
recordStaleBusFailure(event, err);
|
|
7923
|
+
call.dbg?.(`${options.module}: ${event} emit failed (further failures suppressed): ${err}`);
|
|
7924
|
+
}
|
|
7925
|
+
}
|
|
7926
|
+
},
|
|
7927
|
+
reset() {
|
|
7928
|
+
failureLogged = false;
|
|
7929
|
+
unwiredLogged = false;
|
|
7930
|
+
disabledLogged = false;
|
|
7931
|
+
}
|
|
7932
|
+
};
|
|
7933
|
+
}
|
|
7869
7934
|
|
|
7870
7935
|
// dist/clients/bus-publish.js
|
|
7871
7936
|
var liveEmitter = createLiveBusEmitter();
|
|
7937
|
+
var publisher = createBusPublisher(liveEmitter, {
|
|
7938
|
+
module: "bus-publish"
|
|
7939
|
+
});
|
|
7872
7940
|
|
|
7873
7941
|
// dist/clients/format-events-publish.js
|
|
7874
7942
|
var liveEmitter2 = createLiveBusEmitter();
|
|
7943
|
+
var queuedPublisher = createBusPublisher(liveEmitter2, {
|
|
7944
|
+
module: "format-events-publish"
|
|
7945
|
+
});
|
|
7946
|
+
var startPublisher = createBusPublisher(liveEmitter2, {
|
|
7947
|
+
module: "format-events-publish"
|
|
7948
|
+
});
|
|
7949
|
+
var donePublisher = createBusPublisher(liveEmitter2, {
|
|
7950
|
+
module: "format-events-publish"
|
|
7951
|
+
});
|
|
7952
|
+
var autofixStartPublisher = createBusPublisher(liveEmitter2, {
|
|
7953
|
+
module: "format-events-publish"
|
|
7954
|
+
});
|
|
7875
7955
|
|
|
7876
7956
|
// dist/clients/mutation-bridge.js
|
|
7877
7957
|
var MUTATION_BRIDGE_KEY = /* @__PURE__ */ Symbol.for("pi-lens:mutation-bridge");
|
|
@@ -7989,6 +8069,7 @@ function bookkeepLspMutation(context, files2, fileDetails) {
|
|
|
7989
8069
|
context.dbg?.(`lsp mutation not recordable, skipping ${filePath}`);
|
|
7990
8070
|
continue;
|
|
7991
8071
|
}
|
|
8072
|
+
let accepted = true;
|
|
7992
8073
|
if (sessionLive && context.readGuard) {
|
|
7993
8074
|
try {
|
|
7994
8075
|
context.readGuard.recordWritten(filePath, {
|
|
@@ -8010,6 +8091,7 @@ function bookkeepLspMutation(context, files2, fileDetails) {
|
|
|
8010
8091
|
if (useBridgeFallback) {
|
|
8011
8092
|
const bridge = getMutationBridge();
|
|
8012
8093
|
if (!bridge) {
|
|
8094
|
+
accepted = false;
|
|
8013
8095
|
recordDegradationOnce({
|
|
8014
8096
|
kind: "lsp-mutation-bridge-unmounted",
|
|
8015
8097
|
subject: "lsp-mutation:no-bridge",
|
|
@@ -8054,9 +8136,11 @@ function bookkeepLspMutation(context, files2, fileDetails) {
|
|
|
8054
8136
|
}
|
|
8055
8137
|
});
|
|
8056
8138
|
if (!recorded) {
|
|
8139
|
+
accepted = false;
|
|
8057
8140
|
context.dbg?.(`lsp mutation bridge dropped ${filePath} (recordMutation() returned false \u2014 see the mutation_bridge debug output for the reason: malformed entry, out-of-scope path, or a bookkeeping error)`);
|
|
8058
8141
|
}
|
|
8059
8142
|
} catch (err) {
|
|
8143
|
+
accepted = false;
|
|
8060
8144
|
context.dbg?.(`lsp mutation bridge fallback failed for ${filePath}: ${err}`);
|
|
8061
8145
|
}
|
|
8062
8146
|
}
|
|
@@ -8108,6 +8192,8 @@ function bookkeepLspMutation(context, files2, fileDetails) {
|
|
|
8108
8192
|
context.recordAutofix(filePath);
|
|
8109
8193
|
}
|
|
8110
8194
|
}
|
|
8195
|
+
if (accepted && context.acceptedFiles && !context.acceptedFiles.includes(filePath))
|
|
8196
|
+
context.acceptedFiles.push(filePath);
|
|
8111
8197
|
}
|
|
8112
8198
|
if (context.publishFilesTouched && files2.length > 0) {
|
|
8113
8199
|
context.publishFilesTouched(files2);
|
|
@@ -8347,6 +8433,25 @@ function serverIdsForConfigFile(filePath) {
|
|
|
8347
8433
|
return CONFIG_FILE_SERVERS.get(basename(filePath));
|
|
8348
8434
|
}
|
|
8349
8435
|
|
|
8436
|
+
// dist/clients/lsp/request-timeout-error.js
|
|
8437
|
+
var timeoutBrand = /* @__PURE__ */ Symbol.for("pi-lens.LspRequestTimeoutError");
|
|
8438
|
+
var LspRequestTimeoutError = class extends Error {
|
|
8439
|
+
[timeoutBrand] = true;
|
|
8440
|
+
method;
|
|
8441
|
+
timeoutMs;
|
|
8442
|
+
elapsedMs;
|
|
8443
|
+
constructor(method, timeoutMs, elapsedMs) {
|
|
8444
|
+
super(`LSP request timed out: ${method} after ${elapsedMs}ms`);
|
|
8445
|
+
this.name = "LspRequestTimeoutError";
|
|
8446
|
+
this.method = method;
|
|
8447
|
+
this.timeoutMs = timeoutMs;
|
|
8448
|
+
this.elapsedMs = elapsedMs;
|
|
8449
|
+
}
|
|
8450
|
+
};
|
|
8451
|
+
function isLspRequestTimeoutError(err) {
|
|
8452
|
+
return err?.[timeoutBrand] === true;
|
|
8453
|
+
}
|
|
8454
|
+
|
|
8350
8455
|
// dist/clients/lsp/grouping.js
|
|
8351
8456
|
function aggregateServersForFile(filePath) {
|
|
8352
8457
|
return getServersForFileWithConfig(filePath).flatMap((s) => isOptInAuxiliaryServerId(s.id) ? [] : [s]);
|
|
@@ -8523,7 +8628,7 @@ function resyncDocumentOnPastEof(filePath) {
|
|
|
8523
8628
|
void (async () => {
|
|
8524
8629
|
try {
|
|
8525
8630
|
const [{ getOwnedLspService: getOwnedLspService2 }, content] = await Promise.all([
|
|
8526
|
-
import("./chunk-
|
|
8631
|
+
import("./chunk-MN635QYA.js"),
|
|
8527
8632
|
fs7.promises.readFile(filePath, "utf-8")
|
|
8528
8633
|
]);
|
|
8529
8634
|
await getOwnedLspService2().openFile(filePath, content, { preserveDiagnostics: false });
|
|
@@ -8578,6 +8683,48 @@ var WriteOrderingGuard = class {
|
|
|
8578
8683
|
}
|
|
8579
8684
|
};
|
|
8580
8685
|
|
|
8686
|
+
// dist/clients/inline-blocker-fields.js
|
|
8687
|
+
function inlineBlockerSourceOf(diagnostic) {
|
|
8688
|
+
return diagnostic.tool?.trim() || "unknown";
|
|
8689
|
+
}
|
|
8690
|
+
function inlineBlockerSources(blockers) {
|
|
8691
|
+
return [...new Set(blockers.map(inlineBlockerSourceOf))];
|
|
8692
|
+
}
|
|
8693
|
+
function inlineBlockerLines(blockers, filePath) {
|
|
8694
|
+
return inlineBlockerPlaces(blockers, filePath).map((place) => place.line);
|
|
8695
|
+
}
|
|
8696
|
+
function isCrossFileBlocker(d, filePath) {
|
|
8697
|
+
return !!d.filePath && normalizeEphemeralMapKey(d.filePath) !== normalizeEphemeralMapKey(filePath);
|
|
8698
|
+
}
|
|
8699
|
+
function inlineBlockerPlacement(blockers, filePath) {
|
|
8700
|
+
const places = [];
|
|
8701
|
+
let movedLine = 0;
|
|
8702
|
+
for (const d of blockers) {
|
|
8703
|
+
if (isCrossFileBlocker(d, filePath))
|
|
8704
|
+
continue;
|
|
8705
|
+
if (typeof d.line !== "number")
|
|
8706
|
+
continue;
|
|
8707
|
+
if (d.positionStale) {
|
|
8708
|
+
movedLine += 1;
|
|
8709
|
+
continue;
|
|
8710
|
+
}
|
|
8711
|
+
places.push({
|
|
8712
|
+
line: d.line,
|
|
8713
|
+
rule: d.rule?.trim() || inlineBlockerSourceOf(d)
|
|
8714
|
+
});
|
|
8715
|
+
}
|
|
8716
|
+
return {
|
|
8717
|
+
places,
|
|
8718
|
+
unplaced: {
|
|
8719
|
+
movedLine,
|
|
8720
|
+
noLineInThisFile: blockers.length - places.length - movedLine
|
|
8721
|
+
}
|
|
8722
|
+
};
|
|
8723
|
+
}
|
|
8724
|
+
function inlineBlockerPlaces(blockers, filePath) {
|
|
8725
|
+
return inlineBlockerPlacement(blockers, filePath).places;
|
|
8726
|
+
}
|
|
8727
|
+
|
|
8581
8728
|
// dist/clients/diagnostic-dispositions.js
|
|
8582
8729
|
import * as fs8 from "node:fs";
|
|
8583
8730
|
import * as path9 from "node:path";
|
|
@@ -8596,6 +8743,9 @@ var writer2 = createNdjsonLogger({
|
|
|
8596
8743
|
|
|
8597
8744
|
// dist/clients/disposition-publish.js
|
|
8598
8745
|
var liveEmitter3 = createLiveBusEmitter();
|
|
8746
|
+
var publisher2 = createBusPublisher(liveEmitter3, {
|
|
8747
|
+
module: "disposition-publish"
|
|
8748
|
+
});
|
|
8599
8749
|
|
|
8600
8750
|
// dist/clients/diagnostic-dispositions.js
|
|
8601
8751
|
var deferredByCwd = /* @__PURE__ */ new Map();
|
|
@@ -8959,6 +9109,9 @@ function exportWidgetState() {
|
|
|
8959
9109
|
allDiagnostics: rec.allDiagnostics,
|
|
8960
9110
|
diagnosticCounts: rec.diagnosticCounts,
|
|
8961
9111
|
hasFinalDiagnosticsSnapshot: rec.hasFinalDiagnosticsSnapshot,
|
|
9112
|
+
...rec.uncheckedReason !== void 0 && {
|
|
9113
|
+
uncheckedReason: rec.uncheckedReason
|
|
9114
|
+
},
|
|
8962
9115
|
touchedAt: rec.touchedAt
|
|
8963
9116
|
}))
|
|
8964
9117
|
};
|
|
@@ -8992,6 +9145,9 @@ function importWidgetState(state4) {
|
|
|
8992
9145
|
allDiagnostics: migratedAllDiagnostics,
|
|
8993
9146
|
diagnosticCounts: countDiagnostics(migratedAllDiagnostics),
|
|
8994
9147
|
hasFinalDiagnosticsSnapshot: f.hasFinalDiagnosticsSnapshot ?? false,
|
|
9148
|
+
...typeof f.uncheckedReason === "string" && {
|
|
9149
|
+
uncheckedReason: f.uncheckedReason
|
|
9150
|
+
},
|
|
8995
9151
|
touchedAt: recordTouchedAt
|
|
8996
9152
|
});
|
|
8997
9153
|
}
|
|
@@ -9045,7 +9201,7 @@ function widgetDiagnosticUri(filePath, line, column) {
|
|
|
9045
9201
|
const base = pathToFileURL(filePath).href;
|
|
9046
9202
|
return line != null ? `${base}#L${line}${column != null ? `:${column}` : ""}` : base;
|
|
9047
9203
|
}
|
|
9048
|
-
function recordDiagnostics(filePath, diagnostics, writeIndex, observedAt) {
|
|
9204
|
+
function recordDiagnostics(filePath, diagnostics, writeIndex, observedAt, unchecked) {
|
|
9049
9205
|
const key = fileMapKey(filePath);
|
|
9050
9206
|
if (!diagnosticsWriteGuard.shouldWrite(key, writeIndex))
|
|
9051
9207
|
return false;
|
|
@@ -9053,6 +9209,10 @@ function recordDiagnostics(filePath, diagnostics, writeIndex, observedAt) {
|
|
|
9053
9209
|
const observedTs = observedAt ?? Date.now();
|
|
9054
9210
|
const rec = getOrCreate(filePath, key);
|
|
9055
9211
|
commitDiagnostics(rec, filePath, normalizeDiagnostics(filePath, diagnostics, observedTs), observedTs, key);
|
|
9212
|
+
if (unchecked === void 0)
|
|
9213
|
+
delete rec.uncheckedReason;
|
|
9214
|
+
else
|
|
9215
|
+
rec.uncheckedReason = unchecked;
|
|
9056
9216
|
return true;
|
|
9057
9217
|
}
|
|
9058
9218
|
function normalizeDiagnostics(filePath, diagnostics, observedTs) {
|
|
@@ -9067,7 +9227,8 @@ function normalizeDiagnostics(filePath, diagnostics, observedTs) {
|
|
|
9067
9227
|
rule,
|
|
9068
9228
|
tool: d.tool,
|
|
9069
9229
|
uri: widgetDiagnosticUri(filePath, d.line, d.column),
|
|
9070
|
-
observedAt: observedTs
|
|
9230
|
+
observedAt: observedTs,
|
|
9231
|
+
...d.filePath !== void 0 && isCrossFileBlocker(d, filePath) ? { citedFile: d.filePath } : {}
|
|
9071
9232
|
};
|
|
9072
9233
|
});
|
|
9073
9234
|
}
|
|
@@ -9213,7 +9374,8 @@ function reconcileCorrelatedScanDiagnostics(filePath, diagnostics, writeIndex, o
|
|
|
9213
9374
|
...diagnostic,
|
|
9214
9375
|
observedAt: diagnostic.observedAt ?? observedTs
|
|
9215
9376
|
}));
|
|
9216
|
-
|
|
9377
|
+
const rec = getOrCreate(filePath, key);
|
|
9378
|
+
commitDiagnostics(rec, filePath, correlated, observedTs, key);
|
|
9217
9379
|
}
|
|
9218
9380
|
async function reconcileStaleWidgetFiles(onStaleFile) {
|
|
9219
9381
|
const entries = [...files.entries()];
|
|
@@ -9426,6 +9588,28 @@ function getFileDiagnostics(filePath) {
|
|
|
9426
9588
|
applyPastEofGate(rec);
|
|
9427
9589
|
return rec.allDiagnostics.map((d) => ({ ...d }));
|
|
9428
9590
|
}
|
|
9591
|
+
function citedRowKey(row) {
|
|
9592
|
+
return JSON.stringify([
|
|
9593
|
+
normalizeEphemeralMapKey(row.citedFile ?? ""),
|
|
9594
|
+
row.line ?? null,
|
|
9595
|
+
findingIdentity(row)
|
|
9596
|
+
]);
|
|
9597
|
+
}
|
|
9598
|
+
function retireWidgetCitedRows(filePath, retired) {
|
|
9599
|
+
const rec = files.get(fileMapKey(filePath));
|
|
9600
|
+
if (!rec)
|
|
9601
|
+
return 0;
|
|
9602
|
+
const gone = new Set(normalizeDiagnostics(filePath, retired, 0).flatMap((row) => row.citedFile === void 0 ? [] : [citedRowKey(row)]));
|
|
9603
|
+
const kept = rec.allDiagnostics.filter((row) => !gone.has(citedRowKey(row)));
|
|
9604
|
+
const dropped = rec.allDiagnostics.length - kept.length;
|
|
9605
|
+
if (dropped === 0)
|
|
9606
|
+
return 0;
|
|
9607
|
+
rec.allDiagnostics = kept;
|
|
9608
|
+
rec.diagnostics = capStoredDiagnostics(kept);
|
|
9609
|
+
rec.diagnosticCounts = countDiagnostics(kept);
|
|
9610
|
+
requestRender();
|
|
9611
|
+
return dropped;
|
|
9612
|
+
}
|
|
9429
9613
|
function recordLsp(serverId, root, status, durationMs) {
|
|
9430
9614
|
const normalizedRoot = normalizeMapKey(root);
|
|
9431
9615
|
const key = `${serverId}@${normalizedRoot}`;
|
|
@@ -9580,7 +9764,7 @@ async function raceToCompletion(promises3, shouldComplete, options = { timeoutMs
|
|
|
9580
9764
|
|
|
9581
9765
|
// dist/clients/lsp/edits.js
|
|
9582
9766
|
import fs10 from "node:fs/promises";
|
|
9583
|
-
import { readFileSync as readFileSync8, realpathSync, statSync as
|
|
9767
|
+
import { readFileSync as readFileSync8, realpathSync, statSync as statSync7 } from "node:fs";
|
|
9584
9768
|
import path10 from "node:path";
|
|
9585
9769
|
import { URL as URL2 } from "node:url";
|
|
9586
9770
|
|
|
@@ -10011,7 +10195,7 @@ function captureRenameExpectedContent(edit, cwd, requestedAtMs, readTrackedSend,
|
|
|
10011
10195
|
try {
|
|
10012
10196
|
realPath = realpathSync.native(diskPath);
|
|
10013
10197
|
content = readFileSync8(realPath, "utf-8");
|
|
10014
|
-
mtimeMs =
|
|
10198
|
+
mtimeMs = statSync7(realPath).mtimeMs;
|
|
10015
10199
|
} catch {
|
|
10016
10200
|
continue;
|
|
10017
10201
|
}
|
|
@@ -12910,7 +13094,7 @@ async function clientWaitForDiagnostics(state4, filePath, timeoutMs, options = {
|
|
|
12910
13094
|
let outcome = await clientRequestPullDiagnostics(state4, filePath, timeoutMs);
|
|
12911
13095
|
if (outcome.status === "found") {
|
|
12912
13096
|
logTypeScriptPullSettle(state4, normalizedPath, Date.now() - pullSettleStartedAt, pullSettleSource);
|
|
12913
|
-
return;
|
|
13097
|
+
return "answered";
|
|
12914
13098
|
}
|
|
12915
13099
|
let sawClean = outcome.status === "clean";
|
|
12916
13100
|
const strategy = getStrategy(state4.serverId, state4.launchVariant);
|
|
@@ -12923,32 +13107,33 @@ async function clientWaitForDiagnostics(state4, filePath, timeoutMs, options = {
|
|
|
12923
13107
|
sawClean = true;
|
|
12924
13108
|
}
|
|
12925
13109
|
if (options.pullOnly) {
|
|
12926
|
-
|
|
13110
|
+
const answered = outcome.status === "found" || sawClean;
|
|
13111
|
+
if (answered) {
|
|
12927
13112
|
logTypeScriptPullSettle(state4, normalizedPath, Date.now() - pullSettleStartedAt, pullSettleSource);
|
|
12928
13113
|
}
|
|
12929
|
-
return;
|
|
13114
|
+
return answered ? "answered" : "deadline-expired";
|
|
12930
13115
|
}
|
|
12931
13116
|
if (outcome.status === "found" || sawClean) {
|
|
12932
13117
|
logTypeScriptPullSettle(state4, normalizedPath, Date.now() - pullSettleStartedAt, pullSettleSource);
|
|
12933
|
-
return;
|
|
13118
|
+
return "answered";
|
|
12934
13119
|
}
|
|
12935
13120
|
}
|
|
12936
13121
|
const laterReceiptPending = () => state4.pendingDiagnostics.has(normalizedPath);
|
|
12937
13122
|
const storedAnswerSettles = () => hasFreshDiagnostics() && !isVersionStale() && getMergedDiagnosticsForPath(state4, normalizedPath).length > 0;
|
|
12938
13123
|
if (storedAnswerSettles() && !laterReceiptPending()) {
|
|
12939
|
-
return;
|
|
13124
|
+
return "answered";
|
|
12940
13125
|
}
|
|
12941
13126
|
const answerStored = () => hasFreshDiagnostics() && !isVersionStale() && (state4.pushDiagnostics.has(normalizedPath) || state4.documentPullDiagnostics.has(normalizedPath));
|
|
12942
13127
|
return new Promise((resolve7) => {
|
|
12943
13128
|
let debounceTimer;
|
|
12944
13129
|
let settleDeferred = storedAnswerSettles();
|
|
12945
|
-
const finish = () => {
|
|
13130
|
+
const finish = (outcome = "answered") => {
|
|
12946
13131
|
if (debounceTimer)
|
|
12947
13132
|
clearTimeout(debounceTimer);
|
|
12948
13133
|
state4.diagnosticEmitter.off("diagnostics", onDiagnostics);
|
|
12949
13134
|
state4.diagnosticEmitter.off(PENDING_RECEIPT_DROPPED, onReceiptDropped);
|
|
12950
13135
|
clearTimeout(timeout);
|
|
12951
|
-
resolve7();
|
|
13136
|
+
resolve7(outcome);
|
|
12952
13137
|
};
|
|
12953
13138
|
const onDiagnostics = (fp) => {
|
|
12954
13139
|
if (normalizeMapKey(fp) !== normalizedPath)
|
|
@@ -12980,7 +13165,7 @@ async function clientWaitForDiagnostics(state4, filePath, timeoutMs, options = {
|
|
|
12980
13165
|
};
|
|
12981
13166
|
state4.diagnosticEmitter.on("diagnostics", onDiagnostics);
|
|
12982
13167
|
state4.diagnosticEmitter.on(PENDING_RECEIPT_DROPPED, onReceiptDropped);
|
|
12983
|
-
const timeout = setTimeout(finish, timeoutMs);
|
|
13168
|
+
const timeout = setTimeout(() => finish(answerStored() ? "answered" : "deadline-expired"), timeoutMs);
|
|
12984
13169
|
});
|
|
12985
13170
|
}
|
|
12986
13171
|
function handleNotifyExternalChange(state4, filePath, type) {
|
|
@@ -13156,7 +13341,7 @@ async function handleNotifyOpenOnce(state4, filePath, content, languageId, prese
|
|
|
13156
13341
|
});
|
|
13157
13342
|
}
|
|
13158
13343
|
enqueueWatchedChange(state4, normalizedPath, uri, watchedType, onDisk);
|
|
13159
|
-
if (state4.
|
|
13344
|
+
if (state4.holdsOwnNoticeEcho)
|
|
13160
13345
|
noteOwnNoticeQueued(state4, normalizedPath, uri, 0);
|
|
13161
13346
|
}
|
|
13162
13347
|
if (!isClientAlive(state4))
|
|
@@ -13273,9 +13458,19 @@ function handleNotifySave(state4, filePath, onlyIfOwed = false) {
|
|
|
13273
13458
|
const normalizedPath = normalizeMapKey(filePath);
|
|
13274
13459
|
return enqueueDocumentNotify(state4, normalizedPath, (_count, _saved, debtOnly) => sendDidSaveForHeldDocument(state4, normalizedPath, debtOnly), true, void 0, false, true, onlyIfOwed);
|
|
13275
13460
|
}
|
|
13461
|
+
function toWireDocument(state4, content, contentHash2) {
|
|
13462
|
+
if (state4.serverId !== "powershell" || content.charCodeAt(0) !== 65279) {
|
|
13463
|
+
return { text: content, contentHash: contentHash2 };
|
|
13464
|
+
}
|
|
13465
|
+
return {
|
|
13466
|
+
text: ` ${content.slice(1)}`,
|
|
13467
|
+
contentHash: contentHash2 ?? hashDiagnosticContent(content)
|
|
13468
|
+
};
|
|
13469
|
+
}
|
|
13276
13470
|
function handleNotifyOpen(state4, filePath, content, languageId, preserveDiagnostics = false, silent = false, saved = false, readStamp, contentHash2) {
|
|
13277
13471
|
const normalizedPath = normalizeMapKey(filePath);
|
|
13278
|
-
|
|
13472
|
+
const wire = toWireDocument(state4, content, contentHash2);
|
|
13473
|
+
return enqueueDocumentNotify(state4, normalizedPath, (coalescedCount, queuedSaved) => handleNotifyOpenOnce(state4, filePath, wire.text, languageId, preserveDiagnostics, silent, coalescedCount, queuedSaved, wire.contentHash), saved, readStamp);
|
|
13279
13474
|
}
|
|
13280
13475
|
async function handleNotifyChangeOnce(state4, filePath, content, normalizedPath, coalescedCount = 0, saved = false, contentHash2) {
|
|
13281
13476
|
if (!isClientAlive(state4))
|
|
@@ -13319,7 +13514,8 @@ async function handleNotifyChangeOnce(state4, filePath, content, normalizedPath,
|
|
|
13319
13514
|
}
|
|
13320
13515
|
function handleNotifyChange(state4, filePath, content, contentHash2) {
|
|
13321
13516
|
const normalizedPath = normalizeMapKey(filePath);
|
|
13322
|
-
|
|
13517
|
+
const wire = toWireDocument(state4, content, contentHash2);
|
|
13518
|
+
return enqueueDocumentNotify(state4, normalizedPath, (coalescedCount, queuedSaved) => handleNotifyChangeOnce(state4, filePath, wire.text, normalizedPath, coalescedCount, queuedSaved, wire.contentHash));
|
|
13323
13519
|
}
|
|
13324
13520
|
async function closedAndGone(state4, filePath, normalizedPath) {
|
|
13325
13521
|
if (!state4.closedDocuments?.has(normalizedPath))
|
|
@@ -13510,10 +13706,10 @@ async function navRequest(state4, method, params, staleCheckPath, timeoutMs = NA
|
|
|
13510
13706
|
scope: normalizedPath,
|
|
13511
13707
|
requestStartedAt
|
|
13512
13708
|
});
|
|
13513
|
-
|
|
13709
|
+
throw new LspRequestTimeoutError(method, timeoutMs, Date.now() - requestStartedAt);
|
|
13514
13710
|
}
|
|
13515
13711
|
if (err instanceof Error && err.message.startsWith("Timeout after")) {
|
|
13516
|
-
|
|
13712
|
+
throw new LspRequestTimeoutError(method, timeoutMs, Date.now() - requestStartedAt);
|
|
13517
13713
|
}
|
|
13518
13714
|
throw err;
|
|
13519
13715
|
});
|
|
@@ -13783,7 +13979,7 @@ function hasNotifyInFlightFor(state4, filePath) {
|
|
|
13783
13979
|
}
|
|
13784
13980
|
async function createLSPClient(options) {
|
|
13785
13981
|
installCrashGuard();
|
|
13786
|
-
const { serverId, process: lspProcess, root, sessionCwd, initialization, initializeTimeoutMs = INITIALIZE_TIMEOUT_MS, launchVariant, settingsSection, role, custom, onDiagnosticsPublished } = options;
|
|
13982
|
+
const { serverId, process: lspProcess, root, sessionCwd, initialization, initializeTimeoutMs = INITIALIZE_TIMEOUT_MS, launchVariant, settingsSection, role, custom, echoesOwnNotice, onDiagnosticsPublished } = options;
|
|
13787
13983
|
void recordLspChild({
|
|
13788
13984
|
pid: lspProcess.pid,
|
|
13789
13985
|
serverId,
|
|
@@ -13850,7 +14046,9 @@ async function createLSPClient(options) {
|
|
|
13850
14046
|
lspProcess.stdin.on("error", streamErrorHandler("stdin"));
|
|
13851
14047
|
lspProcess.stdout.on("error", streamErrorHandler("stdout"));
|
|
13852
14048
|
lspProcess.stderr.on("error", streamErrorHandler("stderr"));
|
|
13853
|
-
const
|
|
14049
|
+
const reader = new import_node.StreamMessageReader(lspProcess.stdout);
|
|
14050
|
+
reader.partialMessageTimeout = 0;
|
|
14051
|
+
const connection = (0, import_node.createMessageConnection)(reader, new import_node.StreamMessageWriter(lspProcess.stdin));
|
|
13854
14052
|
const diagnosticEmitter = new EventEmitter();
|
|
13855
14053
|
diagnosticEmitter.setMaxListeners(50);
|
|
13856
14054
|
const state4 = {
|
|
@@ -13896,8 +14094,9 @@ async function createLSPClient(options) {
|
|
|
13896
14094
|
// #4764: the declared role, so a config-load failure gates only an
|
|
13897
14095
|
// auxiliary scanner's empty publications.
|
|
13898
14096
|
...role !== void 0 && { serverRole: role },
|
|
13899
|
-
// #5131 round 2: the echo hold reads a config-declared server
|
|
13900
|
-
|
|
14097
|
+
// #5131 round 2: the echo hold reads a config-declared server, or a
|
|
14098
|
+
// built-in row that declares `echoesOwnNotice`.
|
|
14099
|
+
holdsOwnNoticeEcho: custom === true || echoesOwnNotice === true,
|
|
13901
14100
|
// #3310: one-shot, per client session.
|
|
13902
14101
|
emptyFirstPublishHoldSpent: false,
|
|
13903
14102
|
rulesGeneration: 0,
|
|
@@ -15456,7 +15655,7 @@ var ClientRegistry = class {
|
|
|
15456
15655
|
shouldAllowInstall(serverId) {
|
|
15457
15656
|
if (!assertInstallAllowed(`lsp install: ${serverId}`))
|
|
15458
15657
|
return false;
|
|
15459
|
-
return
|
|
15658
|
+
return !isLspInstallDisabled();
|
|
15460
15659
|
}
|
|
15461
15660
|
/**
|
|
15462
15661
|
* Internal: spawn a client for a server/root combination
|
|
@@ -15545,8 +15744,10 @@ var ClientRegistry = class {
|
|
|
15545
15744
|
// #4764: the declared role travels with the client, so a failed server
|
|
15546
15745
|
// config can gate an auxiliary scanner's empty publications only.
|
|
15547
15746
|
role: server.role,
|
|
15548
|
-
// #5131 round 2: the config-declared flag gates the echo hold
|
|
15747
|
+
// #5131 round 2: the config-declared flag gates the echo hold; a
|
|
15748
|
+
// built-in row with the same behaviour declares `echoesOwnNotice`.
|
|
15549
15749
|
custom: server.custom,
|
|
15750
|
+
echoesOwnNotice: server.echoesOwnNotice,
|
|
15550
15751
|
onDiagnosticsPublished: (serverId) => {
|
|
15551
15752
|
this.hooks.noteDiagnosticsPublished(serverId);
|
|
15552
15753
|
}
|
|
@@ -16192,7 +16393,7 @@ function createLazyImport(load) {
|
|
|
16192
16393
|
}
|
|
16193
16394
|
|
|
16194
16395
|
// dist/clients/lsp-lazy.js
|
|
16195
|
-
var lazyLsp = createLazyImport(() => import("./chunk-
|
|
16396
|
+
var lazyLsp = createLazyImport(() => import("./chunk-UAKO2M6B.js"));
|
|
16196
16397
|
function warmLspService() {
|
|
16197
16398
|
return lazyLsp.get();
|
|
16198
16399
|
}
|
|
@@ -16504,11 +16705,11 @@ async function collectWorkspaceDiagnosticFiles(root, maxFiles = getMaxWorkspaceD
|
|
|
16504
16705
|
continue;
|
|
16505
16706
|
await walk(full);
|
|
16506
16707
|
} else if (
|
|
16507
|
-
// #1974: the getServersForFileWithConfig lookup (an
|
|
16508
|
-
//
|
|
16509
|
-
//
|
|
16510
|
-
//
|
|
16511
|
-
// walkers fixed for #1974.
|
|
16708
|
+
// #1974: the getServersForFileWithConfig lookup (an extension match
|
|
16709
|
+
// against the registered LSP servers; Bash's pathFilter also reads up
|
|
16710
|
+
// to 4 KB of the file from disk) still gates first, ahead of
|
|
16711
|
+
// isIgnored's per-call minimatch pattern compile — the same
|
|
16712
|
+
// order-independent shape as the four walkers fixed for #1974.
|
|
16512
16713
|
entry.isFile() && getServersForFileWithConfig(full).length > 0 && !ignoreMatcher.isIgnored(full, false)
|
|
16513
16714
|
) {
|
|
16514
16715
|
files2.push(full);
|
|
@@ -20038,14 +20239,15 @@ var LSPService = class _LSPService {
|
|
|
20038
20239
|
const waitStart = Date.now();
|
|
20039
20240
|
const launchVariant = entry.client.getLaunchVariant?.();
|
|
20040
20241
|
const strategy = getStrategy(entry.info.id, launchVariant);
|
|
20041
|
-
await entry.client.waitForDiagnostics(filePath, strategy.aggregateWaitMs);
|
|
20242
|
+
let outcome = await entry.client.waitForDiagnostics(filePath, strategy.aggregateWaitMs);
|
|
20042
20243
|
let diagnostics = entry.client.getDiagnostics(filePath);
|
|
20043
20244
|
const firstWaitMs = Date.now() - waitStart;
|
|
20044
20245
|
if (strategy.expectSemanticSecondPush && diagnostics.length === 0 && firstWaitMs < DIAGNOSTICS_SEMANTIC_SETTLE_THRESHOLD_MS) {
|
|
20045
|
-
await entry.client.waitForDiagnostics(filePath, DIAGNOSTICS_SEMANTIC_SETTLE_WAIT_MS);
|
|
20246
|
+
outcome = await entry.client.waitForDiagnostics(filePath, DIAGNOSTICS_SEMANTIC_SETTLE_WAIT_MS);
|
|
20046
20247
|
diagnostics = entry.client.getDiagnostics(filePath);
|
|
20047
20248
|
}
|
|
20048
20249
|
return {
|
|
20250
|
+
answered: outcome === "answered" || diagnostics.length > 0,
|
|
20049
20251
|
serverId: entry.info.id,
|
|
20050
20252
|
launchVariant,
|
|
20051
20253
|
waitMs: Date.now() - waitStart,
|
|
@@ -20074,6 +20276,7 @@ var LSPService = class _LSPService {
|
|
|
20074
20276
|
const perServerFull = spawned.map((entry) => {
|
|
20075
20277
|
const found = perServer.find((r) => r.serverId === entry.info.id);
|
|
20076
20278
|
return found ?? {
|
|
20279
|
+
answered: false,
|
|
20077
20280
|
serverId: entry.info.id,
|
|
20078
20281
|
launchVariant: entry.client.getLaunchVariant?.(),
|
|
20079
20282
|
waitMs: getStrategy(entry.info.id, entry.client.getLaunchVariant?.()).aggregateWaitMs,
|
|
@@ -20083,7 +20286,10 @@ var LSPService = class _LSPService {
|
|
|
20083
20286
|
});
|
|
20084
20287
|
const merged = [];
|
|
20085
20288
|
const seen = /* @__PURE__ */ new Set();
|
|
20289
|
+
let answeredCount = 0;
|
|
20086
20290
|
for (const entry of perServerFull) {
|
|
20291
|
+
if (entry.answered)
|
|
20292
|
+
answeredCount++;
|
|
20087
20293
|
for (const diagnostic of entry.diagnostics) {
|
|
20088
20294
|
const key = [
|
|
20089
20295
|
diagnostic.range.start.line,
|
|
@@ -20098,12 +20304,15 @@ var LSPService = class _LSPService {
|
|
|
20098
20304
|
}
|
|
20099
20305
|
const rawCount = perServerFull.reduce((sum, entry) => sum + entry.diagnosticCount, 0);
|
|
20100
20306
|
const serversWithDiagnostics = perServerFull.filter((entry) => entry.diagnosticCount > 0).length;
|
|
20101
|
-
const failureKind = merged.length === 0 ? "ok_empty" : "success";
|
|
20102
20307
|
const unanswered = unansweredPrimaries(spawned, resolvedPrimaryRoots, filePath);
|
|
20103
20308
|
const unavailablePrimaryServerIds = unanswered.serverIds;
|
|
20309
|
+
const timedOut = answeredCount === 0;
|
|
20310
|
+
const partialTimeout = answeredCount > 0 && answeredCount < spawned.length;
|
|
20311
|
+
const failureKind = timedOut ? "timeout" : merged.length === 0 ? "ok_empty" : "success";
|
|
20104
20312
|
this.lastDiagnosticsHealth.set(normalizedPath, {
|
|
20105
20313
|
health: failureKind === "success" ? "ok" : "ok_empty",
|
|
20106
20314
|
failureKind,
|
|
20315
|
+
partialTimeout,
|
|
20107
20316
|
serverCountAttempted,
|
|
20108
20317
|
serverCountReady: perServerFull.length,
|
|
20109
20318
|
candidateServerIds,
|
|
@@ -20132,6 +20341,7 @@ var LSPService = class _LSPService {
|
|
|
20132
20341
|
earlyUnblockedCount,
|
|
20133
20342
|
diagnosticsMode,
|
|
20134
20343
|
failureKind,
|
|
20344
|
+
partialTimeout,
|
|
20135
20345
|
health: failureKind === "success" ? "ok" : "ok_empty",
|
|
20136
20346
|
servers: perServerFull.map((entry) => ({
|
|
20137
20347
|
id: entry.serverId,
|
|
@@ -20146,7 +20356,7 @@ var LSPService = class _LSPService {
|
|
|
20146
20356
|
});
|
|
20147
20357
|
if (merged.length > 0) {
|
|
20148
20358
|
this.lastKnownDiagnostics.set(normalizedPath, merged);
|
|
20149
|
-
} else {
|
|
20359
|
+
} else if (!timedOut && !partialTimeout) {
|
|
20150
20360
|
this.lastKnownDiagnostics.delete(normalizedPath);
|
|
20151
20361
|
}
|
|
20152
20362
|
this.lastKnownContentHash.delete(normalizedPath);
|
|
@@ -20613,6 +20823,8 @@ var LSPService = class _LSPService {
|
|
|
20613
20823
|
const priorityServerIds = getServersForFileWithConfig(oldFilePath).map((server) => server.id);
|
|
20614
20824
|
const activeClients = this.activeClientsForCwd(cwd, priorityServerIds);
|
|
20615
20825
|
const willRenameFailures = [];
|
|
20826
|
+
let firstTimeout;
|
|
20827
|
+
let allWillRenameTimedOut = true;
|
|
20616
20828
|
const didRenameFailures = [];
|
|
20617
20829
|
const willRenameClients = activeClients.filter(({ serverId, client }) => {
|
|
20618
20830
|
if (client.getOperationSupport().willRenameFiles === true)
|
|
@@ -20634,6 +20846,11 @@ var LSPService = class _LSPService {
|
|
|
20634
20846
|
failed: false
|
|
20635
20847
|
};
|
|
20636
20848
|
} catch (err) {
|
|
20849
|
+
const timeout = isLspRequestTimeoutError(err) ? err : void 0;
|
|
20850
|
+
if (timeout && !firstTimeout)
|
|
20851
|
+
firstTimeout = timeout;
|
|
20852
|
+
if (!timeout)
|
|
20853
|
+
allWillRenameTimedOut = false;
|
|
20637
20854
|
willRenameFailures.push({
|
|
20638
20855
|
serverId,
|
|
20639
20856
|
error: err instanceof Error ? err.message : String(err)
|
|
@@ -20643,6 +20860,8 @@ var LSPService = class _LSPService {
|
|
|
20643
20860
|
}));
|
|
20644
20861
|
const successfulWillResults = willResults.filter((result) => !result.failed);
|
|
20645
20862
|
if (willRenameClients.length > 0 && successfulWillResults.length === 0) {
|
|
20863
|
+
if (firstTimeout && allWillRenameTimedOut)
|
|
20864
|
+
throw firstTimeout;
|
|
20646
20865
|
throw new Error(`workspace/willRenameFiles failed for all active LSP servers: ${willRenameFailures.map((failure) => `${failure.serverId}: ${failure.error}`).join("; ")}`);
|
|
20647
20866
|
}
|
|
20648
20867
|
const merged = mergeWorkspaceTextEditsByPriority(successfulWillResults);
|
|
@@ -21971,8 +22190,8 @@ export {
|
|
|
21971
22190
|
drainPendingAuxCapEvictedCount,
|
|
21972
22191
|
recordNapiFallbackCoverage,
|
|
21973
22192
|
resetPendingAuxiliaryCoverage,
|
|
21974
|
-
clearAllSessions,
|
|
21975
22193
|
PartialApplyRecordStore,
|
|
22194
|
+
clearAllSessions,
|
|
21976
22195
|
getActiveSessionId,
|
|
21977
22196
|
beginScope,
|
|
21978
22197
|
retireScope,
|
|
@@ -21983,10 +22202,8 @@ export {
|
|
|
21983
22202
|
ReadGuard,
|
|
21984
22203
|
resetOpaqueMutationState,
|
|
21985
22204
|
resetObservedMutationNet,
|
|
21986
|
-
logBusEvent,
|
|
21987
|
-
recordStaleBusFailure,
|
|
21988
22205
|
createLiveBusEmitter,
|
|
21989
|
-
|
|
22206
|
+
createBusPublisher,
|
|
21990
22207
|
getMutationBridge,
|
|
21991
22208
|
resetLspMutationNoBridgeDbgLatch,
|
|
21992
22209
|
newLspMutationCorrelationId,
|
|
@@ -22000,6 +22217,8 @@ export {
|
|
|
22000
22217
|
warmAnswerBinding,
|
|
22001
22218
|
readBoundToCurrentDisk,
|
|
22002
22219
|
SERVER_CONFIG_FILE_NAMES,
|
|
22220
|
+
LspRequestTimeoutError,
|
|
22221
|
+
isLspRequestTimeoutError,
|
|
22003
22222
|
groupFilesByPrimaryServer,
|
|
22004
22223
|
runPerServerGroups,
|
|
22005
22224
|
STALE_LINE_MARKER,
|
|
@@ -22009,6 +22228,10 @@ export {
|
|
|
22009
22228
|
Text,
|
|
22010
22229
|
writeOrderToken,
|
|
22011
22230
|
WriteOrderingGuard,
|
|
22231
|
+
inlineBlockerSourceOf,
|
|
22232
|
+
inlineBlockerSources,
|
|
22233
|
+
inlineBlockerLines,
|
|
22234
|
+
isCrossFileBlocker,
|
|
22012
22235
|
anchorsForDiagnostic,
|
|
22013
22236
|
hasAnyDispositionMarks,
|
|
22014
22237
|
hasStrictDispositionMarks,
|
|
@@ -22035,6 +22258,7 @@ export {
|
|
|
22035
22258
|
getFileDiagnosticSummaries,
|
|
22036
22259
|
getSuppressedDiagnostics,
|
|
22037
22260
|
countRetainedSuppressedRows,
|
|
22261
|
+
retireWidgetCitedRows,
|
|
22038
22262
|
captureRenameExpectedContent,
|
|
22039
22263
|
summarizeWorkspaceEdit,
|
|
22040
22264
|
applyWorkspaceEdit,
|