@lvce-editor/shared-process 0.18.3 → 0.18.5
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/extensions/builtin.language-basics-c/src/tokenizeC.js +39 -8
- package/extensions/builtin.theme-slime/color-theme.json +8 -0
- package/package.json +4 -4
- package/src/parts/CreateCpuProfile/CreateCpuProfile.js +3 -3
- package/src/parts/ExportStatic/ExportStatic.js +2 -2
- package/src/parts/ListProcessGetName/ListProcessGetName.js +4 -4
- package/src/parts/LoadWindowsProcessTree/LoadWindowsProcessTree.js +1 -2
- package/src/parts/Platform/Platform.js +3 -3
|
@@ -6,6 +6,7 @@ export const State = {
|
|
|
6
6
|
AfterInclude: 2,
|
|
7
7
|
InsideLineComment: 3,
|
|
8
8
|
InsideDoubleQuoteString: 4,
|
|
9
|
+
InsideBlockComment: 5,
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const StateMap = {
|
|
@@ -79,12 +80,18 @@ const RE_VARIABLE_NAME = /^[a-zA-Z][a-zA-Z\d\_]*/
|
|
|
79
80
|
const RE_PUNCTUATION = /^[\(\)=\+\-><\.:\/\{\};,\[\]\*]/
|
|
80
81
|
const RE_DOUBLE_QUOTE = /^"/
|
|
81
82
|
const RE_STRING_DOUBLE_QUOTE_CONTENT = /^[^"]+/
|
|
83
|
+
const RE_BLOCK_COMMENT_START = /^\/\*/
|
|
84
|
+
const RE_BLOCK_COMMENT_CONTENT = /^.+?(?=\*\/)/
|
|
85
|
+
const RE_BLOCK_COMMENT_END = /^\*\//
|
|
86
|
+
const RE_SLASH = /^\//
|
|
82
87
|
|
|
83
88
|
export const initialLineState = {
|
|
84
89
|
state: State.TopLevelContent,
|
|
85
90
|
tokens: [],
|
|
86
91
|
}
|
|
87
92
|
|
|
93
|
+
export const hasArrayReturn = true
|
|
94
|
+
|
|
88
95
|
export const isEqualLineState = (lineStateA, lineStateB) => {
|
|
89
96
|
return lineStateA.state === lineStateB.state
|
|
90
97
|
}
|
|
@@ -117,9 +124,18 @@ export const tokenizeLine = (line, lineState) => {
|
|
|
117
124
|
} else if ((next = part.match(RE_INCLUDE))) {
|
|
118
125
|
token = TokenType.Include
|
|
119
126
|
state = State.AfterInclude
|
|
120
|
-
} else if ((next = part.match(
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
} else if ((next = part.match(RE_SLASH))) {
|
|
128
|
+
if ((next = part.match(RE_BLOCK_COMMENT_START))) {
|
|
129
|
+
token = TokenType.Comment
|
|
130
|
+
state = State.InsideBlockComment
|
|
131
|
+
} else if ((next = part.match(RE_LINE_COMMENT_START))) {
|
|
132
|
+
token = TokenType.Comment
|
|
133
|
+
state = State.InsideLineComment
|
|
134
|
+
} else {
|
|
135
|
+
next = part.match(RE_SLASH)
|
|
136
|
+
token = TokenType.Punctuation
|
|
137
|
+
state = State.TopLevelContent
|
|
138
|
+
}
|
|
123
139
|
} else if ((next = part.match(RE_PUNCTUATION))) {
|
|
124
140
|
token = TokenType.Punctuation
|
|
125
141
|
state = State.TopLevelContent
|
|
@@ -138,6 +154,9 @@ export const tokenizeLine = (line, lineState) => {
|
|
|
138
154
|
if ((next = part.match(RE_WHITESPACE))) {
|
|
139
155
|
token = TokenType.Whitespace
|
|
140
156
|
state = State.AfterInclude
|
|
157
|
+
} else if ((next = part.match(RE_DOUBLE_QUOTE))) {
|
|
158
|
+
token = TokenType.PunctuationString
|
|
159
|
+
state = State.InsideDoubleQuoteString
|
|
141
160
|
} else if ((next = part.match(RE_IMPORT))) {
|
|
142
161
|
token = TokenType.Import
|
|
143
162
|
state = State.TopLevelContent
|
|
@@ -164,14 +183,26 @@ export const tokenizeLine = (line, lineState) => {
|
|
|
164
183
|
throw new Error('no')
|
|
165
184
|
}
|
|
166
185
|
break
|
|
186
|
+
case State.InsideBlockComment:
|
|
187
|
+
if ((next = part.match(RE_BLOCK_COMMENT_END))) {
|
|
188
|
+
token = TokenType.Comment
|
|
189
|
+
state = State.TopLevelContent
|
|
190
|
+
} else if ((next = part.match(RE_BLOCK_COMMENT_CONTENT))) {
|
|
191
|
+
token = TokenType.Comment
|
|
192
|
+
state = State.InsideBlockComment
|
|
193
|
+
} else if ((next = part.match(RE_ANYTHING_UNTIL_END))) {
|
|
194
|
+
token = TokenType.Comment
|
|
195
|
+
state = State.InsideBlockComment
|
|
196
|
+
} else {
|
|
197
|
+
throw new Error('no')
|
|
198
|
+
}
|
|
199
|
+
break
|
|
167
200
|
default:
|
|
168
201
|
throw new Error('no')
|
|
169
202
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
length: next[0].length,
|
|
174
|
-
})
|
|
203
|
+
const tokenLength = next[0].length
|
|
204
|
+
index += tokenLength
|
|
205
|
+
tokens.push(token, tokenLength)
|
|
175
206
|
}
|
|
176
207
|
return {
|
|
177
208
|
state,
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.5",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@babel/code-frame": "^7.22.13",
|
|
8
|
-
"@lvce-editor/extension-host": "0.18.
|
|
9
|
-
"@lvce-editor/extension-host-helper-process": "0.18.
|
|
8
|
+
"@lvce-editor/extension-host": "0.18.5",
|
|
9
|
+
"@lvce-editor/extension-host-helper-process": "0.18.5",
|
|
10
10
|
"@lvce-editor/jsonc-parser": "^1.1.0",
|
|
11
11
|
"@lvce-editor/pretty-error": "^1.2.0",
|
|
12
|
-
"@lvce-editor/pty-host": "0.18.
|
|
12
|
+
"@lvce-editor/pty-host": "0.18.5",
|
|
13
13
|
"@lvce-editor/verror": "^1.1.1",
|
|
14
14
|
"debug": "^4.3.4",
|
|
15
15
|
"execa": "^8.0.1",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { writeFile } from 'fs/promises'
|
|
1
|
+
import { writeFile } from 'node:fs/promises'
|
|
2
2
|
import got from 'got'
|
|
3
|
-
import { tmpdir } from 'os'
|
|
4
|
-
import { join } from 'path'
|
|
3
|
+
import { tmpdir } from 'node:os'
|
|
4
|
+
import { join } from 'node:path'
|
|
5
5
|
import { WebSocket } from 'ws'
|
|
6
6
|
import * as DevtoolsProtocolRpc from '../DevtoolsProtocolRpc/DevtoolsProtocolRpc.js'
|
|
7
7
|
|
|
@@ -111,8 +111,8 @@ const applyOverrides = async ({ root, commitHash, pathPrefix }) => {
|
|
|
111
111
|
)
|
|
112
112
|
await replace(
|
|
113
113
|
Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'),
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
`/${commitHash}`,
|
|
115
|
+
`${pathPrefix}/${commitHash}`,
|
|
116
116
|
)
|
|
117
117
|
await replace(
|
|
118
118
|
Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'),
|
|
@@ -32,16 +32,16 @@ export const getName = (pid, cmd, rootPid, pidMap) => {
|
|
|
32
32
|
if (cmd.includes('--type=utility')) {
|
|
33
33
|
return 'utility'
|
|
34
34
|
}
|
|
35
|
-
if (cmd.includes('
|
|
35
|
+
if (cmd.includes('tsserver.js')) {
|
|
36
36
|
return 'tsserver.js'
|
|
37
37
|
}
|
|
38
|
-
if (cmd.includes('
|
|
38
|
+
if (cmd.includes('typingsInstaller.js')) {
|
|
39
39
|
return 'typingsInstaller.js'
|
|
40
40
|
}
|
|
41
41
|
if (cmd.includes('extensionHostHelperProcessMain.js')) {
|
|
42
42
|
return 'extension-host-helper-process'
|
|
43
43
|
}
|
|
44
|
-
if (cmd.includes('/bin/rg')) {
|
|
44
|
+
if (cmd.includes('/bin/rg') || cmd.includes('rg.exe')) {
|
|
45
45
|
return 'ripgrep'
|
|
46
46
|
}
|
|
47
47
|
if (cmd.startsWith('bash')) {
|
|
@@ -50,7 +50,7 @@ export const getName = (pid, cmd, rootPid, pidMap) => {
|
|
|
50
50
|
if (cmd.startsWith(`/opt/sublime_text/sublime_text `)) {
|
|
51
51
|
return 'sublime-text'
|
|
52
52
|
}
|
|
53
|
-
if(cmd.includes('\\conhost.exe')){
|
|
53
|
+
if (cmd.includes('\\conhost.exe')) {
|
|
54
54
|
return 'conhost.exe'
|
|
55
55
|
}
|
|
56
56
|
return `${cmd}`
|
|
@@ -3,12 +3,11 @@ import { VError } from '../VError/VError.js'
|
|
|
3
3
|
|
|
4
4
|
export const loadWindowProcessTree = async () => {
|
|
5
5
|
try {
|
|
6
|
-
// @ts-ignore
|
|
7
6
|
return await import('@vscode/windows-process-tree')
|
|
8
7
|
} catch (error) {
|
|
9
8
|
if (IsDlOpenError.isDlOpenError(error)) {
|
|
10
9
|
throw new VError(
|
|
11
|
-
`Failed to load windows process tree: The native module "@vscode/windows-process-tree" is not compatible with this node version and must be compiled against a matching electron version using electron-rebuild
|
|
10
|
+
`Failed to load windows process tree: The native module "@vscode/windows-process-tree" is not compatible with this node version and must be compiled against a matching electron version using electron-rebuild`,
|
|
12
11
|
)
|
|
13
12
|
}
|
|
14
13
|
throw new VError(error, `Failed to load windows process tree`)
|
|
@@ -55,11 +55,11 @@ export const getSetupName = () => {
|
|
|
55
55
|
return 'Lvce-Setup'
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export const version = '0.18.
|
|
58
|
+
export const version = '0.18.5'
|
|
59
59
|
|
|
60
|
-
export const commit = '
|
|
60
|
+
export const commit = '49f5d02'
|
|
61
61
|
|
|
62
|
-
export const date = '2023-10-
|
|
62
|
+
export const date = '2023-10-03T07:22:07.000Z'
|
|
63
63
|
|
|
64
64
|
export const getVersion = () => {
|
|
65
65
|
return version
|