@lvce-editor/shared-process 0.90.1 → 0.91.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.90.1",
3
+ "version": "0.91.0",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "@lvce-editor/assert": "1.7.0",
21
21
  "@lvce-editor/auth-process": "1.9.0",
22
- "@lvce-editor/extension-host-helper-process": "0.90.1",
22
+ "@lvce-editor/extension-host-helper-process": "0.91.0",
23
23
  "@lvce-editor/ipc": "16.3.0",
24
24
  "@lvce-editor/json-rpc": "8.2.0",
25
25
  "@lvce-editor/jsonc-parser": "1.5.0",
@@ -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', 'd347596', 'extensions')
6
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', 'c7fb6cd', 'extensions')
7
7
  return builtinExtensionsPath
8
8
  }
@@ -4,4 +4,5 @@ export const name = 'LanguageServer'
4
4
 
5
5
  export const Commands = {
6
6
  complete: LanguageServer.complete,
7
+ diagnostic: LanguageServer.diagnostic,
7
8
  }
@@ -14,6 +14,13 @@ import { LanguageServerConnection } from '../LanguageServerConnection/LanguageSe
14
14
 
15
15
 
16
16
 
17
+
18
+
19
+
20
+
21
+
22
+
23
+
17
24
 
18
25
 
19
26
 
@@ -70,6 +77,16 @@ export const complete = async ({ argv, id, offset, textDocument, uri }
70
77
  return connection.complete(normalizedDocument, offset)
71
78
  }
72
79
 
80
+ export const diagnostic = async ({ argv, id, textDocument, uri } ) => {
81
+ const normalizedDocument = {
82
+ ...textDocument,
83
+ uri: normalizeDocumentUri(textDocument.uri),
84
+ }
85
+ const rootUri = getRootUri(normalizedDocument.uri)
86
+ const connection = getConnection(`${id}:${rootUri}`, uri, argv, rootUri)
87
+ return connection.diagnostic(normalizedDocument)
88
+ }
89
+
73
90
  export const disposeAll = () => {
74
91
  for (const state of connections.values()) {
75
92
  state.connection.dispose()
@@ -1,5 +1,5 @@
1
1
  import { spawn, } from 'node:child_process'
2
- import { basename } from 'node:path'
2
+ import { basename, extname } from 'node:path'
3
3
  import { fileURLToPath } from 'node:url'
4
4
  import { LanguageServerMessageParser } from '../LanguageServerMessageParser/LanguageServerMessageParser.js'
5
5
  import {
@@ -40,6 +40,21 @@ import {
40
40
 
41
41
 
42
42
 
43
+
44
+ const getSpawnOptions = (uri, argv) => {
45
+ const executablePath = fileURLToPath(uri)
46
+ const extension = extname(executablePath).toLowerCase()
47
+ if (extension === '.js' || extension === '.mjs' || extension === '.cjs') {
48
+ return {
49
+ args: [executablePath, ...argv],
50
+ command: process.execPath,
51
+ }
52
+ }
53
+ return {
54
+ args: argv,
55
+ command: executablePath,
56
+ }
57
+ }
43
58
 
44
59
  const getPosition = (text, offset) => {
45
60
  const safeOffset = Math.max(0, Math.min(offset, text.length))
@@ -73,7 +88,8 @@ export class LanguageServerConnection {
73
88
 
74
89
  constructor({ argv, rootUri, uri } ) {
75
90
  this.rootUri = rootUri
76
- this.child = spawn(fileURLToPath(uri), [...argv], {
91
+ const { args, command } = getSpawnOptions(uri, argv)
92
+ this.child = spawn(command, [...args], {
77
93
  stdio: ['pipe', 'pipe', 'pipe'],
78
94
  })
79
95
  this.child.stdout.on('data', (chunk) => {
@@ -128,6 +144,21 @@ export class LanguageServerConnection {
128
144
  return []
129
145
  }
130
146
 
147
+ async diagnostic(textDocument) {
148
+ await this.ready
149
+ this.configureMarkdown(textDocument.languageId)
150
+ this.syncDocument(textDocument)
151
+ const result = await this.sendRequest('textDocument/diagnostic', {
152
+ textDocument: {
153
+ uri: textDocument.uri,
154
+ },
155
+ })
156
+ if (result && typeof result === 'object' && Array.isArray((result).items)) {
157
+ return (result).items
158
+ }
159
+ return []
160
+ }
161
+
131
162
  configureMarkdown(languageId) {
132
163
  if (languageId !== 'markdown' || this.markdownConfigured) {
133
164
  return
@@ -150,7 +181,24 @@ export class LanguageServerConnection {
150
181
  },
151
182
  },
152
183
  validate: {
153
- enabled: false,
184
+ duplicateLinkDefinitions: {
185
+ enabled: 'warning',
186
+ },
187
+ enabled: true,
188
+ fileLinks: {
189
+ enabled: 'warning',
190
+ markdownFragmentLinks: 'inherit',
191
+ },
192
+ fragmentLinks: {
193
+ enabled: 'warning',
194
+ },
195
+ ignoredLinks: [],
196
+ referenceLinks: {
197
+ enabled: 'warning',
198
+ },
199
+ unusedLinkDefinitions: {
200
+ enabled: 'warning',
201
+ },
154
202
  },
155
203
  },
156
204
  },
@@ -166,6 +214,10 @@ export class LanguageServerConnection {
166
214
  snippetSupport: true,
167
215
  },
168
216
  },
217
+ diagnostic: {
218
+ dynamicRegistration: false,
219
+ relatedDocumentSupport: false,
220
+ },
169
221
  synchronization: {
170
222
  didSave: true,
171
223
  dynamicRegistration: false,
@@ -27,6 +27,8 @@ export const isMarkdownLanguageServerRequest = (method) => {
27
27
  method === 'markdown/fs/readFile' ||
28
28
  method === 'markdown/fs/readDirectory' ||
29
29
  method === 'markdown/fs/stat' ||
30
+ method === 'markdown/fs/watcher/create' ||
31
+ method === 'markdown/fs/watcher/delete' ||
30
32
  method === 'markdown/findMarkdownFilesInWorkspace'
31
33
  )
32
34
  }
@@ -93,6 +95,9 @@ export const executeMarkdownLanguageServerRequest = async (
93
95
  if (method === 'markdown/findMarkdownFilesInWorkspace') {
94
96
  return findMarkdownFiles(getWorkspacePath(context.rootUri, context.rootUri))
95
97
  }
98
+ if (method === 'markdown/fs/watcher/create' || method === 'markdown/fs/watcher/delete') {
99
+ return null
100
+ }
96
101
  if (!params.uri) {
97
102
  throw new Error(`Markdown file request is missing a uri`)
98
103
  }
@@ -248,6 +248,7 @@ export const getModuleId = (commandId) => {
248
248
  case 'IsAutoUpdateSupported.isAutoUpdateSupported':
249
249
  return ModuleId.IsAutoUpdateSupported
250
250
  case 'LanguageServer.complete':
251
+ case 'LanguageServer.diagnostic':
251
252
  return ModuleId.LanguageServer
252
253
  case 'ListProcessesWithMemoryUsage.listProcessesWithMemoryUsage':
253
254
  return ModuleId.ListProcessesWithMemoryUsage
@@ -61,11 +61,11 @@ export const getSetupName = () => {
61
61
  return 'Lvce-Setup'
62
62
  }
63
63
 
64
- export const version = '0.90.1'
64
+ export const version = '0.91.0'
65
65
 
66
- export const commit = 'd347596'
66
+ export const commit = 'c7fb6cd'
67
67
 
68
- export const date = '2026-07-14T15:50:53.000Z'
68
+ export const date = '2026-07-15T09:22:07.000Z'
69
69
 
70
70
  export const getVersion = () => {
71
71
  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', 'd347596', 'packages', 'preload', 'dist', 'index.js')
5
+ return join(Root.root, 'static', 'c7fb6cd', 'packages', 'preload', 'dist', 'index.js')
6
6
  }