@lvce-editor/shared-process 0.16.22 → 0.16.23

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.
@@ -56,6 +56,7 @@ export const TokenType = {
56
56
  String: 891,
57
57
  KeywordImport: 892,
58
58
  CssSelectorClass: 893,
59
+ CssPseudoSelector: 894,
59
60
  }
60
61
 
61
62
  export const TokenMap = {
@@ -83,18 +84,20 @@ export const TokenMap = {
83
84
  [TokenType.String]: 'String',
84
85
  [TokenType.KeywordImport]: 'KeywordImport',
85
86
  [TokenType.CssSelectorClass]: 'CssSelectorClass',
87
+ [TokenType.CssPseudoSelector]: 'CssPseudoSelector',
86
88
  }
87
89
 
88
- const RE_SELECTOR = /^[\.a-zA-Z\d\-\:>\+\~\_%\\]+/
90
+ const RE_SELECTOR = /^[\.a-zA-Z\d\->+~_%\\\p{L}]+/u
89
91
  const RE_SELECTOR_ID = /^#[\w\-\_]+/
90
- const RE_SELECTOR_CLASS = /^\.[\w\-\_]+/
92
+ const RE_PSEUDO_SELECTOR = /^:[\p{L}\-]+/u
93
+ const RE_SELECTOR_CLASS = /^\.[\w\-_\p{L}]+/u
91
94
  const RE_WHITESPACE = /^\s+/
92
95
  const RE_CURLY_OPEN = /^\{/
93
96
  const RE_CURLY_CLOSE = /^\}/
94
97
  const RE_PROPERTY_NAME = /^[a-zA-Z\-\w]+/
95
98
  const RE_COLON = /^:/
96
- const RE_PROPERTY_VALUE = /^[^;\}\/]+/
97
- const RE_PROPERTY_VALUE_SHORT = /^[^;\}\s\)\/]+/
99
+ const RE_PROPERTY_VALUE = /^[^;\}\/\(]+/
100
+ const RE_PROPERTY_VALUE_SHORT = /^[^;\}\s\)\/\*\(]+/
98
101
  const RE_PROPERTY_VALUE_INSIDE_FUNCTION = /^[^\}\s\)]+/
99
102
  const RE_SEMICOLON = /^;/
100
103
  const RE_COMMA = /^,/
@@ -110,7 +113,7 @@ const RE_PSEUDO_SELECTOR_CONTENT = /^[^\)]+/
110
113
  const RE_SQUARE_OPEN = /^\[/
111
114
  const RE_SQUARE_CLOSE = /^\]/
112
115
  const RE_ATTRIBUTE_SELECTOR_CONTENT = /^[^\]]+/
113
- const RE_QUERY = /^@[a-z\-]+/
116
+ const RE_QUERY = /^@[a-zA-Z\w\-\d\_]+/
114
117
  const RE_STAR = /^\*/
115
118
  const RE_QUERY_NAME = /^[a-zA-Z\w\-\d\_]+/
116
119
  const RE_QUERY_CONTENT = /^[^\)]+/
@@ -171,6 +174,9 @@ export const tokenizeLine = (line, lineState) => {
171
174
  } else if ((next = part.match(RE_WHITESPACE))) {
172
175
  token = TokenType.Whitespace
173
176
  state = State.TopLevelContent
177
+ } else if ((next = part.match(RE_PSEUDO_SELECTOR))) {
178
+ token = TokenType.CssPseudoSelector
179
+ state = State.AfterSelector
174
180
  } else if ((next = part.match(RE_CURLY_OPEN))) {
175
181
  token = TokenType.CurlyOpen
176
182
  state = State.InsideSelector
@@ -181,7 +187,7 @@ export const tokenizeLine = (line, lineState) => {
181
187
  token = TokenType.Punctuation
182
188
  state = State.InsideAttributeSelector
183
189
  } else if ((next = part.match(RE_QUERY))) {
184
- switch (next[0]) {
190
+ switch (next[0].toLocaleLowerCase()) {
185
191
  case '@font-face':
186
192
  case '@-ms-viewport':
187
193
  case '@-o-viewport':
@@ -250,6 +256,12 @@ export const tokenizeLine = (line, lineState) => {
250
256
  } else if ((next = part.match(RE_SLASH))) {
251
257
  token = TokenType.Punctuation
252
258
  state = State.AfterSelector
259
+ } else if ((next = part.match(RE_SEMICOLON))) {
260
+ token = TokenType.Punctuation
261
+ state = stack.pop() || State.TopLevelContent
262
+ } else if ((next = part.match(RE_PSEUDO_SELECTOR))) {
263
+ token = TokenType.CssPseudoSelector
264
+ state = State.AfterSelector
253
265
  } else if ((next = part.match(RE_ANYTHING_BUT_CURLY))) {
254
266
  token = TokenType.Unknown
255
267
  state = State.AfterSelector
@@ -293,6 +305,12 @@ export const tokenizeLine = (line, lineState) => {
293
305
  stack.push(state)
294
306
  token = TokenType.Comment
295
307
  state = State.InsideBlockComment
308
+ } else if ((next = part.match(RE_SEMICOLON))) {
309
+ token = TokenType.Punctuation
310
+ state = stack.pop() || State.TopLevelContent
311
+ } else if ((next = part.match(RE_ANYTHING_UNTIL_CLOSE_BRACE))) {
312
+ token = TokenType.Text
313
+ state = stack.pop() || State.TopLevelContent
296
314
  } else {
297
315
  part
298
316
  throw new Error('no')
@@ -305,6 +323,10 @@ export const tokenizeLine = (line, lineState) => {
305
323
  } else if ((next = part.match(RE_CURLY_OPEN))) {
306
324
  token = TokenType.Punctuation
307
325
  state = State.InsideSelector
326
+ } else if ((next = part.match(RE_BLOCK_COMMENT_START))) {
327
+ stack.push(state)
328
+ token = TokenType.Comment
329
+ state = State.InsideBlockComment
308
330
  } else {
309
331
  throw new Error('no')
310
332
  }
@@ -341,6 +363,9 @@ export const tokenizeLine = (line, lineState) => {
341
363
  } else if ((next = part.match(RE_QUERY))) {
342
364
  token = TokenType.Query
343
365
  state = State.AfterQuery
366
+ } else if ((next = part.match(RE_SEMICOLON))) {
367
+ token = TokenType.Punctuation
368
+ state = State.InsideSelector
344
369
  } else if ((next = part.match(RE_ANYTHING_UNTIL_CLOSE_BRACE))) {
345
370
  token = TokenType.Unknown
346
371
  state = State.InsideSelector
@@ -416,6 +441,9 @@ export const tokenizeLine = (line, lineState) => {
416
441
  } else if ((next = part.match(RE_SLASH))) {
417
442
  token = TokenType.Punctuation
418
443
  state = State.AfterPropertyNameAfterColon
444
+ } else if ((next = part.match(RE_ROUND_OPEN))) {
445
+ token = TokenType.Punctuation
446
+ state = State.AfterFunctionNameInsideArguments
419
447
  } else {
420
448
  part
421
449
  throw new Error('no')
@@ -496,9 +524,16 @@ export const tokenizeLine = (line, lineState) => {
496
524
  } else if ((next = part.match(RE_CURLY_CLOSE))) {
497
525
  token = TokenType.Punctuation
498
526
  state = State.TopLevelContent
527
+ } else if ((next = part.match(RE_BLOCK_COMMENT_START))) {
528
+ stack.push(state)
529
+ token = TokenType.Comment
530
+ state = State.InsideBlockComment
499
531
  } else if ((next = part.match(RE_SLASH))) {
500
532
  token = TokenType.Punctuation
501
533
  state = State.AfterFunctionName
534
+ } else if ((next = part.match(RE_STAR))) {
535
+ token = TokenType.Punctuation
536
+ state = State.AfterFunctionName
502
537
  } else {
503
538
  part
504
539
  throw new Error('no')
@@ -572,7 +607,12 @@ export const tokenizeLine = (line, lineState) => {
572
607
  } else if ((next = part.match(RE_DOUBLE_QUOTE))) {
573
608
  token = TokenType.Punctuation
574
609
  state = State.InsideDoubleQuoteString
610
+ } else if ((next = part.match(RE_FUNCTION))) {
611
+ stack.push(state)
612
+ token = TokenType.FuntionName
613
+ state = State.AfterFunctionName
575
614
  } else {
615
+ part
576
616
  throw new Error('no')
577
617
  }
578
618
  break
@@ -598,6 +638,9 @@ export const tokenizeLine = (line, lineState) => {
598
638
  if (state === State.AfterPropertyName) {
599
639
  state = State.InsideSelector
600
640
  }
641
+ if (state === State.AfterKeywordImport) {
642
+ state = State.TopLevelContent
643
+ }
601
644
  return {
602
645
  state,
603
646
  tokens,
@@ -15,7 +15,9 @@
15
15
  ".env.development",
16
16
  ".env.production",
17
17
  ".env.dev",
18
- ".env.sample"
18
+ ".env.sample",
19
+ ".env.dist",
20
+ ".env.test"
19
21
  ],
20
22
  "configuration": "./languageConfiguration.json",
21
23
  "tokenize": "src/tokenizeDotenv.js"
@@ -51,7 +51,8 @@
51
51
  ".nycrc",
52
52
  "manifest.webapp",
53
53
  ".alexrc",
54
- ".yarn-integrity"
54
+ ".yarn-integrity",
55
+ ".tsbuildinfo"
55
56
  ],
56
57
  "tokenize": "src/tokenizeJson.js"
57
58
  }
@@ -6,7 +6,7 @@ const State = {
6
6
  TopLevelContent: 1,
7
7
  InsideSingleQuoteString: 2,
8
8
  InsideDoubleQuoteString: 3,
9
- AfterKeywordDeclaration: 4,
9
+ AfterKeywordVariableDeclaration: 4,
10
10
  BeforeValue: 5,
11
11
  AfterKeywordTypeDeclaration: 8,
12
12
  BeforeType: 9,
@@ -120,7 +120,7 @@ export const initialLineState = {
120
120
 
121
121
  const RE_LINE_COMMENT = /^\/\/[^\n]*/
122
122
  const RE_KEYWORD =
123
- /^(?:yield|with|while|void|var|undefined|typeof|type|true|try|throw|this|static|switch|super|readonly|return|public|protected|private|package|null|new|let|interface|instanceof|in|import|implements|if|function|for|finally|from|false|extends|export|enum|else|do|delete|default|debugger|declare|continue|const|constructor|class|catch|case|break|await|async|abstract)\b/
123
+ /^(?:yield|with|while|void|var|undefined|typeof|type|true|try|throw|this|static|switch|super|readonly|return|public|protected|private|package|null|new|let|interface|instanceof|in|import|implements|if|function|for|finally|from|false|extends|export|enum|else|do|delete|default|debugger|declare|continue|const|constructor|class|catch|case|break|await|async|accessor|abstract)\b/
124
124
 
125
125
  const RE_WHITESPACE = /^\s+/
126
126
  const RE_VARIABLE_NAME = /^[\#\$a-zA-Z\_][\$a-zA-Z\_\d]*/
@@ -155,7 +155,7 @@ const RE_ANYTHING_UNTIL_END = /^.+/s
155
155
  const RE_CURLY_OPEN = /^\{/
156
156
  const RE_CURLY_CLOSE = /^\}/
157
157
  const RE_KEYWORD_CLASS_PROPERTY_MODIFIER =
158
- /^(?:override|public|protected|private|readonly)\b/
158
+ /^(?:override|public|protected|private|readonly|accessor)\b/
159
159
 
160
160
  const RE_VERTICAL_LINE = /^\|/
161
161
  const RE_ROUND_OPEN = /^\(/
@@ -178,6 +178,7 @@ const RE_ANGLE_CLOSE = /^>/
178
178
  const RE_OPERATOR = /^[!\*\?\.\:\|\%\&\^@]/
179
179
  const RE_METHOD_NAME = /^[\w\d]+(?=\s*(\(|\:\s*function|\:\s*\())/
180
180
  const RE_FUNCTION_CALL_NAME = /^[\w]+(?=\s*(\(|\=\s*function|\=\s*\())/
181
+
181
182
  const RE_NUMERIC_2 =
182
183
  /^(?:(?:[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)|(?:[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)|(?:(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)|(?:[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)|(?:[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)|(?:[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)|(?:[0-9][0-9_]*(\.)(n)?\B)|(?:(\.)[0-9][0-9_]*(n)?\b)|(?:[0-9][0-9_]*(n)?\b(?!\.))|(?:0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b)|(?:0(?:b|B)[01][01_]*(n)?\b)|(?:0(?:o|O)?[0-7][0-7_]*(n)?\b))/ // 1.1E+3
183
184
  const RE_NUMERIC_HEX = /0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b/
@@ -195,7 +196,7 @@ const RE_KEYWORD_READONLY = /^readonly\b/
195
196
  const RE_SHEBANG = /^\#\!\/.*/
196
197
  const RE_SPREAD = /^\.\.\./
197
198
  const RE_BUILTIN_CLASS =
198
- /^(?:Array|Object|Promise|ArrayBuffer|URL|URLSearchParams|WebSocket|FileSystemHandle|Function|StorageEvent|MessageEvent|MessageChannel|Int32Array|Boolean|String|Error|Set|RegExp|Map|WeakMap|RangeError|Date|Headers|Response|Request|Buffer|MessagePort|FileHandle|X509Certificate|Blob)\b/
199
+ /^(?:Array|Object|Promise|ArrayBuffer|URL|URLSearchParams|WebSocket|FileSystemHandle|Function|StorageEvent|MessageEvent|MessageChannel|Int32Array|Boolean|String|Error|Set|RegExp|Map|WeakMap|RangeError|Date|Headers|Response|Request|Buffer|MessagePort|FileHandle|X509Certificate|Blob|HTMLElement)\b/
199
200
 
200
201
  const RE_KEYWORD_NEW = /^new\b/
201
202
  const RE_KEYWORD_IMPLEMENTS = /^implements\b/
@@ -279,7 +280,7 @@ export const tokenizeLine = (line, lineState) => {
279
280
  case 'const':
280
281
  case 'var':
281
282
  token = TokenType.Keyword
282
- state = State.AfterKeywordDeclaration
283
+ state = State.AfterKeywordVariableDeclaration
283
284
  break
284
285
  case 'type':
285
286
  token = TokenType.Keyword
@@ -340,6 +341,9 @@ export const tokenizeLine = (line, lineState) => {
340
341
  } else if ((next = part.match(RE_BUILTIN_CLASS))) {
341
342
  token = TokenType.Class
342
343
  state = State.TopLevelContent
344
+ } else if ((next = part.match(RE_FUNCTION_CALL_NAME))) {
345
+ token = TokenType.Function
346
+ state = State.TopLevelContent
343
347
  } else if ((next = part.match(RE_VARIABLE_NAME))) {
344
348
  token = TokenType.VariableName
345
349
  state = State.TopLevelContent
@@ -418,10 +422,10 @@ export const tokenizeLine = (line, lineState) => {
418
422
  throw new Error('no')
419
423
  }
420
424
  break
421
- case State.AfterKeywordDeclaration:
425
+ case State.AfterKeywordVariableDeclaration:
422
426
  if ((next = part.match(RE_WHITESPACE))) {
423
427
  token = TokenType.Whitespace
424
- state = State.AfterKeywordDeclaration
428
+ state = State.AfterKeywordVariableDeclaration
425
429
  } else if ((next = part.match(RE_COLON))) {
426
430
  token = TokenType.Punctuation
427
431
  state = State.BeforeType
@@ -434,9 +438,12 @@ export const tokenizeLine = (line, lineState) => {
434
438
  } else if ((next = part.match(RE_KEYWORD_OF))) {
435
439
  token = TokenType.KeywordOperator
436
440
  state = State.TopLevelContent
441
+ } else if ((next = part.match(RE_FUNCTION_CALL_NAME))) {
442
+ token = TokenType.FunctionName
443
+ state = State.AfterKeywordVariableDeclaration
437
444
  } else if ((next = part.match(RE_VARIABLE_NAME))) {
438
445
  token = TokenType.VariableName
439
- state = State.AfterKeywordDeclaration
446
+ state = State.AfterKeywordVariableDeclaration
440
447
  } else if ((next = part.match(RE_EQUAL))) {
441
448
  token = TokenType.Punctuation
442
449
  state = State.TopLevelContent
@@ -451,10 +458,10 @@ export const tokenizeLine = (line, lineState) => {
451
458
  state = State.TopLevelContent
452
459
  } else if ((next = part.match(RE_COMMA))) {
453
460
  token = TokenType.Punctuation
454
- state = State.AfterKeywordDeclaration
461
+ state = State.AfterKeywordVariableDeclaration
455
462
  } else if ((next = part.match(RE_PUNCTUATION))) {
456
463
  token = TokenType.Punctuation
457
- state = State.AfterKeywordDeclaration
464
+ state = State.AfterKeywordVariableDeclaration
458
465
  } else if ((next = part.match(RE_QUOTE_DOUBLE))) {
459
466
  token = TokenType.Punctuation
460
467
  state = State.InsideDoubleQuoteString
@@ -742,6 +749,10 @@ export const tokenizeLine = (line, lineState) => {
742
749
  } else if ((next = part.match(RE_AMPERSAND))) {
743
750
  token = TokenType.Punctuation
744
751
  state = State.BeforeType
752
+ } else if ((next = part.match(RE_BLOCK_COMMENT_START))) {
753
+ stack.push(state)
754
+ token = TokenType.Comment
755
+ state = State.InsideBlockComment
745
756
  } else if ((next = part.match(RE_ANYTHING_BUT_SEMICOLON_UNTIL_END))) {
746
757
  token = TokenType.Text
747
758
  state = State.AfterType
@@ -811,7 +822,7 @@ export const tokenizeLine = (line, lineState) => {
811
822
  case 'const':
812
823
  case 'var':
813
824
  token = TokenType.Keyword
814
- state = State.AfterKeywordDeclaration
825
+ state = State.AfterKeywordVariableDeclaration
815
826
  break
816
827
  case 'type':
817
828
  token = TokenType.Keyword
@@ -1077,6 +1088,10 @@ export const tokenizeLine = (line, lineState) => {
1077
1088
  } else if ((next = part.match(RE_EQUAL))) {
1078
1089
  token = TokenType.Punctuation
1079
1090
  state = State.TopLevelContent
1091
+ } else if ((next = part.match(RE_BLOCK_COMMENT_START))) {
1092
+ stack.push(state)
1093
+ token = TokenType.Comment
1094
+ state = State.InsideBlockComment
1080
1095
  } else if ((next = part.match(RE_ANYTHING_UNTIL_END))) {
1081
1096
  token = TokenType.Text
1082
1097
  state = State.TopLevelContent
@@ -1174,7 +1189,7 @@ export const tokenizeLine = (line, lineState) => {
1174
1189
  state = State.InsideObjectDestructuringAfterValue
1175
1190
  } else if ((next = part.match(RE_CURLY_CLOSE))) {
1176
1191
  token = TokenType.Punctuation
1177
- state = State.AfterKeywordDeclaration
1192
+ state = State.AfterKeywordVariableDeclaration
1178
1193
  } else if ((next = part.match(RE_COLON))) {
1179
1194
  token = TokenType.Punctuation
1180
1195
  state = State.InsideObjectDestructuringAfterValue
@@ -1201,6 +1216,10 @@ export const tokenizeLine = (line, lineState) => {
1201
1216
  } else if ((next = part.match(RE_VARIABLE_NAME))) {
1202
1217
  token = TokenType.Type
1203
1218
  state = State.AfterInterfaceName
1219
+ } else if ((next = part.match(RE_BLOCK_COMMENT_START))) {
1220
+ stack.push(state)
1221
+ token = TokenType.Comment
1222
+ state = State.InsideBlockComment
1204
1223
  } else {
1205
1224
  throw new Error('no')
1206
1225
  }
@@ -1254,6 +1273,9 @@ export const tokenizeLine = (line, lineState) => {
1254
1273
  token = TokenType.Punctuation
1255
1274
  state = State.InsideSingleQuoteString
1256
1275
  stack.push(State.InsideTypeObject)
1276
+ } else if ((next = part.match(RE_LINE_COMMENT))) {
1277
+ token = TokenType.Comment
1278
+ state = State.InsideTypeObject
1257
1279
  } else if ((next = part.match(RE_ANYTHING_UNTIL_END))) {
1258
1280
  token = TokenType.Text
1259
1281
  state = State.TopLevelContent
@@ -1442,7 +1464,7 @@ export const tokenizeLine = (line, lineState) => {
1442
1464
  } else if ((next = part.match(RE_BLOCK_COMMENT_START))) {
1443
1465
  stack.push(state)
1444
1466
  token = TokenType.Comment
1445
- state = State.AfterInterfaceName
1467
+ state = State.InsideBlockComment
1446
1468
  } else if ((next = part.match(RE_ANYTHING_UNTIL_END))) {
1447
1469
  token = TokenType.Text
1448
1470
  state = stack.pop() || State.TopLevelContent
@@ -1534,6 +1556,10 @@ export const tokenizeLine = (line, lineState) => {
1534
1556
  } else if ((next = part.match(RE_DOT))) {
1535
1557
  token = TokenType.Punctuation
1536
1558
  state = State.AfterPropertyDot
1559
+ } else if ((next = part.match(RE_BLOCK_COMMENT_START))) {
1560
+ stack.push(state)
1561
+ token = TokenType.Comment
1562
+ state = State.InsideBlockComment
1537
1563
  } else {
1538
1564
  throw new Error('no')
1539
1565
  }
@@ -73,7 +73,9 @@
73
73
  ".mm",
74
74
  ".tmDragCommand",
75
75
  ".tmCommand",
76
- ".natvis"
76
+ ".natvis",
77
+ ".xcscheme",
78
+ ".xcsettings"
77
79
  ],
78
80
  "fileNames": [".project", "resources.grd"],
79
81
  "tokenize": "src/tokenizeXml.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.16.22",
3
+ "version": "0.16.23",
4
4
  "description": "Utility package for @lvce-editor/server",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -17,9 +17,9 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@babel/code-frame": "^7.22.5",
20
- "@lvce-editor/extension-host": "0.16.22",
21
- "@lvce-editor/extension-host-helper-process": "0.16.22",
22
- "@lvce-editor/pty-host": "0.16.22",
20
+ "@lvce-editor/extension-host": "0.16.23",
21
+ "@lvce-editor/extension-host-helper-process": "0.16.23",
22
+ "@lvce-editor/pty-host": "0.16.23",
23
23
  "debug": "^4.3.4",
24
24
  "execa": "^7.1.1",
25
25
  "exit-hook": "^3.2.0",
@@ -169,11 +169,11 @@ export const getSetupName = () => {
169
169
  return 'Lvce-Setup'
170
170
  }
171
171
 
172
- export const version = '0.16.22'
172
+ export const version = '0.16.23'
173
173
 
174
- export const commit = '84da26e'
174
+ export const commit = 'd1cdc79'
175
175
 
176
- export const date = '2023-07-30T16:05:29.000Z'
176
+ export const date = '2023-08-04T20:52:23.000Z'
177
177
 
178
178
  export const getVersion = () => {
179
179
  return version