@lvce-editor/shared-process 0.18.4 → 0.18.6

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.
@@ -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(RE_LINE_COMMENT_START))) {
121
- token = TokenType.Comment
122
- state = State.InsideLineComment
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
- index += next[0].length
171
- tokens.push({
172
- type: token,
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,
@@ -277,6 +277,14 @@
277
277
  {
278
278
  "name": "CssPseudoSelector",
279
279
  "foreground": "#7A8D5C"
280
+ },
281
+ {
282
+ "name": "CssImportant",
283
+ "foreground": "#CD6564"
284
+ },
285
+ {
286
+ "name": "CssAttributeName",
287
+ "foreground": "#AB6767"
280
288
  }
281
289
  ]
282
290
  }
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.18.4",
3
+ "version": "0.18.6",
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.4",
9
- "@lvce-editor/extension-host-helper-process": "0.18.4",
8
+ "@lvce-editor/extension-host": "0.18.6",
9
+ "@lvce-editor/extension-host-helper-process": "0.18.6",
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.4",
12
+ "@lvce-editor/pty-host": "0.18.6",
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
- `return "/${commitHash}";`,
115
- `return "${pathPrefix}/${commitHash}";`,
114
+ `/${commitHash}`,
115
+ `${pathPrefix}/${commitHash}`,
116
116
  )
117
117
  await replace(
118
118
  Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'),
@@ -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.4'
58
+ export const version = '0.18.6'
59
59
 
60
- export const commit = '224d179'
60
+ export const commit = '467f8b8'
61
61
 
62
- export const date = '2023-10-02T10:40:05.000Z'
62
+ export const date = '2023-10-03T09:02:19.000Z'
63
63
 
64
64
  export const getVersion = () => {
65
65
  return version