@lvce-editor/shared-process 0.122.6 → 0.122.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.122.6",
3
+ "version": "0.122.7",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -3,6 +3,6 @@ import { fileURLToPath } from 'url'
3
3
 
4
4
  export const getBuiltinExtensionsPath = () => {
5
5
  const staticServerPath = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'))
6
- const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', 'fe633ed', 'extensions')
6
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', 'f15462f', 'extensions')
7
7
  return builtinExtensionsPath
8
8
  }
@@ -21,6 +21,7 @@ import { normalizeLanguageServerDocumentUri } from '../NormalizeLanguageServerDo
21
21
 
22
22
 
23
23
 
24
+
24
25
 
25
26
 
26
27
 
@@ -147,6 +148,9 @@ const wait = (duration) => {
147
148
  }
148
149
 
149
150
  const PublishDiagnosticsTimeout = 1_000
151
+ // Push servers can publish several diagnostic stages, including an unchanged
152
+ // intermediate result after didChange. Collect the burst before returning it.
153
+ const PublishDiagnosticsSettleTime = 300
150
154
 
151
155
  export class LanguageServerConnection {
152
156
  child
@@ -267,7 +271,7 @@ export class LanguageServerConnection {
267
271
  const previous = this.documents.get(textDocument.uri)
268
272
  const documentChanged = !previous || previous.languageId !== textDocument.languageId || previous.text !== textDocument.text
269
273
  const cached = this.publishedDiagnostics.get(textDocument.uri)
270
- if (!documentChanged && cached) {
274
+ if (!documentChanged && cached && !this.diagnosticWaiters.has(textDocument.uri)) {
271
275
  return cached
272
276
  }
273
277
  const diagnostics = this.waitForPublishedDiagnostics(textDocument.uri)
@@ -510,9 +514,8 @@ export class LanguageServerConnection {
510
514
  if (!waiters) {
511
515
  return
512
516
  }
513
- this.diagnosticWaiters.delete(normalizedUri)
514
517
  for (const waiter of waiters) {
515
- waiter.resolve(diagnostics)
518
+ waiter.publish(diagnostics)
516
519
  }
517
520
  }
518
521
 
@@ -614,22 +617,31 @@ export class LanguageServerConnection {
614
617
  return new Promise ((resolve, reject) => {
615
618
  const waiters = this.diagnosticWaiters.get(uri) || new Set()
616
619
  let timeout
620
+ let settling
621
+ const removeWaiter = () => {
622
+ clearTimeout(timeout)
623
+ clearTimeout(settling)
624
+ waiters.delete(waiter)
625
+ if (waiters.size === 0) {
626
+ this.diagnosticWaiters.delete(uri)
627
+ }
628
+ }
617
629
  const waiter = {
630
+ publish(value) {
631
+ clearTimeout(settling)
632
+ settling = setTimeout(() => waiter.resolve(value), PublishDiagnosticsSettleTime)
633
+ },
618
634
  reject(error) {
619
- clearTimeout(timeout)
635
+ removeWaiter()
620
636
  reject(error)
621
637
  },
622
638
  resolve(value) {
623
- clearTimeout(timeout)
639
+ removeWaiter()
624
640
  resolve(value)
625
641
  },
626
642
  }
627
643
  timeout = setTimeout(() => {
628
- waiters.delete(waiter)
629
- if (waiters.size === 0) {
630
- this.diagnosticWaiters.delete(uri)
631
- }
632
- resolve(this.publishedDiagnostics.get(uri) || [])
644
+ waiter.resolve(this.publishedDiagnostics.get(uri) || [])
633
645
  }, PublishDiagnosticsTimeout)
634
646
  waiters.add(waiter)
635
647
  this.diagnosticWaiters.set(uri, waiters)
@@ -56,11 +56,11 @@ export const getSetupName = () => {
56
56
  return 'Lvce-Setup'
57
57
  }
58
58
 
59
- export const version = '0.122.6'
59
+ export const version = '0.122.7'
60
60
 
61
- export const commit = 'fe633ed'
61
+ export const commit = 'f15462f'
62
62
 
63
- export const date = '2026-10-12T11:39:04.000Z'
63
+ export const date = '2026-10-12T14:04:27.000Z'
64
64
 
65
65
  export const getVersion = () => {
66
66
  return version
@@ -2,5 +2,5 @@ import { join } from 'node:path'
2
2
  import * as Root from '../Root/Root.js'
3
3
 
4
4
  export const getPreloadUrl = () => {
5
- return join(Root.root, 'static', 'fe633ed', 'packages', 'preload', 'dist', 'index.js')
5
+ return join(Root.root, 'static', 'f15462f', 'packages', 'preload', 'dist', 'index.js')
6
6
  }