@lvce-editor/shared-process 0.100.11 → 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 +1 -0
- package/src/parts/LanguageServer/LanguageServer.js +18 -0
- package/src/parts/LanguageServerConnection/LanguageServerConnection.js +21 -0
- package/src/parts/ModuleMap/ModuleMap.js +1 -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
|
}
|
|
@@ -27,6 +27,14 @@ import { normalizeLanguageServerDocumentUri } from '../NormalizeLanguageServerDo
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
30
38
|
|
|
31
39
|
|
|
32
40
|
|
|
@@ -95,6 +103,16 @@ export const definition = async ({ argv, id, offset, rootUri, textDocument, uri
|
|
|
95
103
|
return connection.definition(normalizedDocument, offset)
|
|
96
104
|
}
|
|
97
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
|
+
|
|
98
116
|
export const disposeAll = () => {
|
|
99
117
|
for (const state of connections.values()) {
|
|
100
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 } ) {
|
|
@@ -232,6 +234,24 @@ export class LanguageServerConnection {
|
|
|
232
234
|
})
|
|
233
235
|
}
|
|
234
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
|
+
|
|
235
255
|
configureMarkdown(languageId) {
|
|
236
256
|
if (languageId !== 'markdown' || this.markdownConfigured) {
|
|
237
257
|
return
|
|
@@ -319,6 +339,7 @@ export class LanguageServerConnection {
|
|
|
319
339
|
},
|
|
320
340
|
],
|
|
321
341
|
}))
|
|
342
|
+
this.supportsDocumentFormatting = Boolean(result?.capabilities?.documentFormattingProvider)
|
|
322
343
|
this.supportsPullDiagnostics = Boolean(result?.capabilities?.diagnosticProvider)
|
|
323
344
|
this.sendNotification('initialized', {})
|
|
324
345
|
await Promise.race([this.initializationProgressStarted.promise, wait(100)])
|
|
@@ -214,6 +214,7 @@ export const getModuleId = (commandId) => {
|
|
|
214
214
|
case 'LanguageServer.complete':
|
|
215
215
|
case 'LanguageServer.definition':
|
|
216
216
|
case 'LanguageServer.diagnostic':
|
|
217
|
+
case 'LanguageServer.format':
|
|
217
218
|
return ModuleId.LanguageServer
|
|
218
219
|
case 'ListProcessesWithMemoryUsage.listProcessesWithMemoryUsage':
|
|
219
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
|
}
|