@lvce-editor/shared-process 0.100.10 → 0.100.12
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 +2 -2
- package/src/parts/BuiltinExtensionsPath/BuiltinExtensionsPath.js +1 -1
- package/src/parts/LanguageServer/LanguageServer.ipc.js +2 -0
- package/src/parts/LanguageServer/LanguageServer.js +30 -0
- package/src/parts/LanguageServerConnection/LanguageServerConnection.js +33 -0
- package/src/parts/ModuleMap/ModuleMap.js +2 -0
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/PreloadUrl/PreloadUrl.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.100.
|
|
3
|
+
"version": "0.100.12",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "1.9.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.100.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.100.12",
|
|
22
22
|
"@lvce-editor/ipc": "16.10.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "8.6.0",
|
|
24
24
|
"@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', '
|
|
6
|
+
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '0410e4c', 'extensions')
|
|
7
7
|
return builtinExtensionsPath
|
|
8
8
|
}
|
|
@@ -21,6 +21,16 @@ import { normalizeLanguageServerDocumentUri } from '../NormalizeLanguageServerDo
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
24
34
|
|
|
25
35
|
|
|
26
36
|
|
|
@@ -83,6 +93,26 @@ export const diagnostic = async ({ argv, id, rootUri, textDocument, uri }
|
|
|
83
93
|
return connection.diagnostic(normalizedDocument)
|
|
84
94
|
}
|
|
85
95
|
|
|
96
|
+
export const definition = async ({ argv, id, offset, rootUri, textDocument, uri } ) => {
|
|
97
|
+
const normalizedDocument = {
|
|
98
|
+
...textDocument,
|
|
99
|
+
uri: normalizeLanguageServerDocumentUri(textDocument.uri),
|
|
100
|
+
}
|
|
101
|
+
const normalizedRootUri = rootUri ? normalizeLanguageServerDocumentUri(rootUri) : getRootUri(normalizedDocument.uri)
|
|
102
|
+
const connection = getConnection(`${id}:${normalizedRootUri}`, uri, argv, normalizedRootUri)
|
|
103
|
+
return connection.definition(normalizedDocument, offset)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export const format = async ({ argv, id, rootUri, textDocument, uri } ) => {
|
|
107
|
+
const normalizedDocument = {
|
|
108
|
+
...textDocument,
|
|
109
|
+
uri: normalizeLanguageServerDocumentUri(textDocument.uri),
|
|
110
|
+
}
|
|
111
|
+
const normalizedRootUri = rootUri ? normalizeLanguageServerDocumentUri(rootUri) : getRootUri(normalizedDocument.uri)
|
|
112
|
+
const connection = getConnection(`${id}:${normalizedRootUri}`, uri, argv, normalizedRootUri)
|
|
113
|
+
return connection.format(normalizedDocument)
|
|
114
|
+
}
|
|
115
|
+
|
|
86
116
|
export const disposeAll = () => {
|
|
87
117
|
for (const state of connections.values()) {
|
|
88
118
|
state.connection.dispose()
|
|
@@ -32,6 +32,7 @@ import { normalizeLanguageServerDocumentUri } from '../NormalizeLanguageServerDo
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
@@ -131,6 +132,7 @@ export class LanguageServerConnection {
|
|
|
131
132
|
nextRequestId = 1
|
|
132
133
|
running = true
|
|
133
134
|
stderr = ''
|
|
135
|
+
supportsDocumentFormatting = false
|
|
134
136
|
supportsPullDiagnostics = false
|
|
135
137
|
|
|
136
138
|
constructor({ argv, rootUri, uri } ) {
|
|
@@ -220,6 +222,36 @@ export class LanguageServerConnection {
|
|
|
220
222
|
return diagnostics
|
|
221
223
|
}
|
|
222
224
|
|
|
225
|
+
async definition(textDocument, offset) {
|
|
226
|
+
await this.ready
|
|
227
|
+
this.configureMarkdown(textDocument.languageId)
|
|
228
|
+
this.syncDocument(textDocument)
|
|
229
|
+
return this.sendRequest('textDocument/definition', {
|
|
230
|
+
position: getPosition(textDocument.text, offset),
|
|
231
|
+
textDocument: {
|
|
232
|
+
uri: textDocument.uri,
|
|
233
|
+
},
|
|
234
|
+
})
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async format(textDocument) {
|
|
238
|
+
await this.ready
|
|
239
|
+
if (!this.supportsDocumentFormatting) {
|
|
240
|
+
return []
|
|
241
|
+
}
|
|
242
|
+
this.syncDocument(textDocument)
|
|
243
|
+
const result = await this.sendRequest('textDocument/formatting', {
|
|
244
|
+
options: {
|
|
245
|
+
insertSpaces: true,
|
|
246
|
+
tabSize: 2,
|
|
247
|
+
},
|
|
248
|
+
textDocument: {
|
|
249
|
+
uri: textDocument.uri,
|
|
250
|
+
},
|
|
251
|
+
})
|
|
252
|
+
return Array.isArray(result) ? result : []
|
|
253
|
+
}
|
|
254
|
+
|
|
223
255
|
configureMarkdown(languageId) {
|
|
224
256
|
if (languageId !== 'markdown' || this.markdownConfigured) {
|
|
225
257
|
return
|
|
@@ -307,6 +339,7 @@ export class LanguageServerConnection {
|
|
|
307
339
|
},
|
|
308
340
|
],
|
|
309
341
|
}))
|
|
342
|
+
this.supportsDocumentFormatting = Boolean(result?.capabilities?.documentFormattingProvider)
|
|
310
343
|
this.supportsPullDiagnostics = Boolean(result?.capabilities?.diagnosticProvider)
|
|
311
344
|
this.sendNotification('initialized', {})
|
|
312
345
|
await Promise.race([this.initializationProgressStarted.promise, wait(100)])
|
|
@@ -212,7 +212,9 @@ export const getModuleId = (commandId) => {
|
|
|
212
212
|
case 'IsAutoUpdateSupported.isAutoUpdateSupported':
|
|
213
213
|
return ModuleId.IsAutoUpdateSupported
|
|
214
214
|
case 'LanguageServer.complete':
|
|
215
|
+
case 'LanguageServer.definition':
|
|
215
216
|
case 'LanguageServer.diagnostic':
|
|
217
|
+
case 'LanguageServer.format':
|
|
216
218
|
return ModuleId.LanguageServer
|
|
217
219
|
case 'ListProcessesWithMemoryUsage.listProcessesWithMemoryUsage':
|
|
218
220
|
return ModuleId.ListProcessesWithMemoryUsage
|
|
@@ -61,11 +61,11 @@ export const getSetupName = () => {
|
|
|
61
61
|
return 'Lvce-Setup'
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export const version = '0.100.
|
|
64
|
+
export const version = '0.100.12'
|
|
65
65
|
|
|
66
|
-
export const commit = '
|
|
66
|
+
export const commit = '0410e4c'
|
|
67
67
|
|
|
68
|
-
export const date = '2026-08-
|
|
68
|
+
export const date = '2026-08-10T23:15:31.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', '
|
|
5
|
+
return join(Root.root, 'static', '0410e4c', 'packages', 'preload', 'dist', 'index.js')
|
|
6
6
|
}
|