@lvce-editor/shared-process 0.90.2 → 0.91.1
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 +19 -8
- package/src/parts/LanguageServerConnection/LanguageServerConnection.js +37 -1
- package/src/parts/MarkdownLanguageServerRequest/MarkdownLanguageServerRequest.js +5 -0
- package/src/parts/ModuleMap/ModuleMap.js +1 -0
- package/src/parts/NormalizeLanguageServerDocumentUri/NormalizeLanguageServerDocumentUri.js +10 -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.
|
|
3
|
+
"version": "0.91.1",
|
|
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.
|
|
22
|
+
"@lvce-editor/extension-host-helper-process": "0.91.1",
|
|
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', '
|
|
6
|
+
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '4010ea0', 'extensions')
|
|
7
7
|
return builtinExtensionsPath
|
|
8
8
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { dirname } from 'node:path'
|
|
2
2
|
import { pathToFileURL } from 'node:url'
|
|
3
3
|
import { LanguageServerConnection } from '../LanguageServerConnection/LanguageServerConnection.js'
|
|
4
|
+
import { normalizeLanguageServerDocumentUri } from '../NormalizeLanguageServerDocumentUri/NormalizeLanguageServerDocumentUri.js'
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
|
|
@@ -14,6 +15,13 @@ import { LanguageServerConnection } from '../LanguageServerConnection/LanguageSe
|
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
17
25
|
|
|
18
26
|
|
|
19
27
|
|
|
@@ -24,13 +32,6 @@ import { LanguageServerConnection } from '../LanguageServerConnection/LanguageSe
|
|
|
24
32
|
|
|
25
33
|
const connections = new Map ()
|
|
26
34
|
|
|
27
|
-
const normalizeDocumentUri = (uri) => {
|
|
28
|
-
if (uri.startsWith('/')) {
|
|
29
|
-
return pathToFileURL(uri).href
|
|
30
|
-
}
|
|
31
|
-
return uri
|
|
32
|
-
}
|
|
33
|
-
|
|
34
35
|
const getRootUri = (documentUri) => {
|
|
35
36
|
if (documentUri.startsWith('file:')) {
|
|
36
37
|
return new URL('.', documentUri).href
|
|
@@ -63,13 +64,23 @@ const getConnection = (id, uri, argv, rootUri) => {
|
|
|
63
64
|
export const complete = async ({ argv, id, offset, textDocument, uri } ) => {
|
|
64
65
|
const normalizedDocument = {
|
|
65
66
|
...textDocument,
|
|
66
|
-
uri:
|
|
67
|
+
uri: normalizeLanguageServerDocumentUri(textDocument.uri),
|
|
67
68
|
}
|
|
68
69
|
const rootUri = getRootUri(normalizedDocument.uri)
|
|
69
70
|
const connection = getConnection(`${id}:${rootUri}`, uri, argv, rootUri)
|
|
70
71
|
return connection.complete(normalizedDocument, offset)
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
export const diagnostic = async ({ argv, id, textDocument, uri } ) => {
|
|
75
|
+
const normalizedDocument = {
|
|
76
|
+
...textDocument,
|
|
77
|
+
uri: normalizeLanguageServerDocumentUri(textDocument.uri),
|
|
78
|
+
}
|
|
79
|
+
const rootUri = getRootUri(normalizedDocument.uri)
|
|
80
|
+
const connection = getConnection(`${id}:${rootUri}`, uri, argv, rootUri)
|
|
81
|
+
return connection.diagnostic(normalizedDocument)
|
|
82
|
+
}
|
|
83
|
+
|
|
73
84
|
export const disposeAll = () => {
|
|
74
85
|
for (const state of connections.values()) {
|
|
75
86
|
state.connection.dispose()
|
|
@@ -144,6 +144,21 @@ export class LanguageServerConnection {
|
|
|
144
144
|
return []
|
|
145
145
|
}
|
|
146
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
|
+
|
|
147
162
|
configureMarkdown(languageId) {
|
|
148
163
|
if (languageId !== 'markdown' || this.markdownConfigured) {
|
|
149
164
|
return
|
|
@@ -166,7 +181,24 @@ export class LanguageServerConnection {
|
|
|
166
181
|
},
|
|
167
182
|
},
|
|
168
183
|
validate: {
|
|
169
|
-
|
|
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
|
+
},
|
|
170
202
|
},
|
|
171
203
|
},
|
|
172
204
|
},
|
|
@@ -182,6 +214,10 @@ export class LanguageServerConnection {
|
|
|
182
214
|
snippetSupport: true,
|
|
183
215
|
},
|
|
184
216
|
},
|
|
217
|
+
diagnostic: {
|
|
218
|
+
dynamicRegistration: false,
|
|
219
|
+
relatedDocumentSupport: false,
|
|
220
|
+
},
|
|
185
221
|
synchronization: {
|
|
186
222
|
didSave: true,
|
|
187
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
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { pathToFileURL } from 'node:url'
|
|
2
|
+
|
|
3
|
+
const windowsFileUriRegex = /^file:\/\/\/([a-z])(?::|%3a)(?=\/|$)/i
|
|
4
|
+
|
|
5
|
+
export const normalizeLanguageServerDocumentUri = (uri) => {
|
|
6
|
+
if (uri.startsWith('/')) {
|
|
7
|
+
return pathToFileURL(uri).href
|
|
8
|
+
}
|
|
9
|
+
return uri.replace(windowsFileUriRegex, (_, driveLetter) => `file:///${driveLetter.toLowerCase()}%3A`)
|
|
10
|
+
}
|
|
@@ -61,11 +61,11 @@ export const getSetupName = () => {
|
|
|
61
61
|
return 'Lvce-Setup'
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export const version = '0.
|
|
64
|
+
export const version = '0.91.1'
|
|
65
65
|
|
|
66
|
-
export const commit = '
|
|
66
|
+
export const commit = '4010ea0'
|
|
67
67
|
|
|
68
|
-
export const date = '2026-07-
|
|
68
|
+
export const date = '2026-07-15T10:07:17.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', '4010ea0', 'packages', 'preload', 'dist', 'index.js')
|
|
6
6
|
}
|