@lvce-editor/shared-process 0.10.4 → 0.10.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.
@@ -30,7 +30,7 @@
30
30
  "workbench.activityBar.visible": true,
31
31
  "workbench.sideBar.visible": true,
32
32
  "workbench.sideBarLocation": "right",
33
- "workbench.saveStateOnVisibilityChange": false,
33
+ "workbench.saveStateOnVisibilityChange": true,
34
34
 
35
35
  "workspace.defaultWorkspace": "fetch:///playground",
36
36
 
@@ -48,6 +48,7 @@ export const TokenType = {
48
48
  KeywordModifier: 882,
49
49
  KeywordReturn: 883,
50
50
  KeywordNew: 884,
51
+ FunctionName: 885,
51
52
  }
52
53
 
53
54
  export const TokenMap = {
@@ -73,6 +74,7 @@ export const TokenMap = {
73
74
  [TokenType.KeywordModifier]: 'KeywordModifier',
74
75
  [TokenType.KeywordReturn]: 'KeywordReturn',
75
76
  [TokenType.KeywordNew]: 'KeywordNew',
77
+ [TokenType.FunctionName]: 'Function',
76
78
  }
77
79
 
78
80
  const RE_KEYWORD =
@@ -114,6 +116,7 @@ const RE_STRING_DOUBLE_QUOTE_CONTENT = /^[^"\\]+/
114
116
  const RE_STRING_BACKTICK_QUOTE_CONTENT = /^[^`]+/
115
117
  const RE_STRING_ESCAPE = /^\\./
116
118
  const RE_SHEBANG = /^#!.*/
119
+ const RE_FUNCTION_CALL_NAME = /^[\w]+(?=\s*(\(|\=\s*function|\=\s*\())/
117
120
 
118
121
  // copied from https://github.com/PrismJS/prism/blob/master/components/prism-javascript.js#L57
119
122
  const RE_REGEX =
@@ -181,6 +184,9 @@ export const tokenizeLine = (line, lineState) => {
181
184
  break
182
185
  }
183
186
  state = State.TopLevelContent
187
+ } else if ((next = part.match(RE_FUNCTION_CALL_NAME))) {
188
+ token = TokenType.FunctionName
189
+ state = State.TopLevelContent
184
190
  } else if ((next = part.match(RE_VARIABLE_NAME))) {
185
191
  token = TokenType.VariableName
186
192
  state = State.TopLevelContent
@@ -310,5 +316,3 @@ export const tokenizeLine = (line, lineState) => {
310
316
  tokens,
311
317
  }
312
318
  }
313
-
314
- tokenizeLine(`#!/usr/bin/env node`, initialLineState) //?
@@ -91,7 +91,7 @@ const RE_SQUARE_CLOSE = /^\]/
91
91
  const RE_LINE_COMMENT = /^\/\/.*/
92
92
  const RE_ANYTHING = /^.+/s
93
93
  const RE_NUMERIC =
94
- /^((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b/
94
+ /^((0(x|X)[0-9a-fA-F]*)|(\-?([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b/
95
95
  const RE_TEXT = /^[^\s\{\}\[\]]+/
96
96
  // const RE_ESCAPED_QUOTE = /^\\"/
97
97
  // const RE_BACK_SLASH = /^\\/
@@ -160,6 +160,18 @@
160
160
  {
161
161
  "name": "YamlPropertyValueString",
162
162
  "foreground": "#98C379"
163
+ },
164
+ {
165
+ "name": "Function",
166
+ "foreground": "#61AFEF"
167
+ },
168
+ {
169
+ "name": "KeywordControl",
170
+ "foreground": "#C678DD"
171
+ },
172
+ {
173
+ "name": "KeywordThis",
174
+ "foreground": "#E06C75"
163
175
  }
164
176
  ]
165
177
  }
@@ -177,6 +177,10 @@
177
177
  {
178
178
  "name": "YamlPropertyValueString",
179
179
  "foreground": "#86B300"
180
+ },
181
+ {
182
+ "name": "KeywordThis",
183
+ "foreground": "#55B4D4"
180
184
  }
181
185
  ]
182
186
  }
@@ -143,6 +143,14 @@
143
143
  {
144
144
  "name": "YamlPropertyValueString",
145
145
  "foreground": "#A5FF90"
146
+ },
147
+ {
148
+ "name": "KeywordThis",
149
+ "foreground": "#FB94FF"
150
+ },
151
+ {
152
+ "name": "KeywordReturn",
153
+ "foreground": "#FF9D00"
146
154
  }
147
155
  ]
148
156
  }
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "id": "builtin.theme-cobalt2",
3
3
  "name": "Cobalt 2 Theme",
4
- "description": "🔥 Official theme by Wes Bos.",
4
+ "description": "Theme based on the the Official Cobalt2 theme by Wes Bos.",
5
+ "icon": "images/logo.png",
5
6
  "colorThemes": [
6
7
  {
7
8
  "id": "cobalt2",
@@ -180,6 +180,14 @@
180
180
  {
181
181
  "name": "YamlPropertyValueString",
182
182
  "foreground": "#A9B665"
183
+ },
184
+ {
185
+ "name": "Function",
186
+ "foreground": "#A9B665"
187
+ },
188
+ {
189
+ "name": "KeywordThis",
190
+ "foreground": "#D3869B"
183
191
  }
184
192
  ]
185
193
  }
@@ -17,7 +17,7 @@
17
17
  "ContextMenuForeground": "rgb(238, 255, 255)",
18
18
 
19
19
  "EditorBackGround": "",
20
- "EditorScrollBarBackground": "",
20
+ "EditorScrollBarBackground": "rgba(238, 255, 255, 0.13)",
21
21
  "EditorCursorBackground": "#ffcc00",
22
22
  "EditorSelectionBackground": "rgba(128, 203, 196, 0.13)",
23
23
 
@@ -117,7 +117,7 @@
117
117
  },
118
118
  {
119
119
  "name": "VariableName",
120
- "foreground": "#f07178"
120
+ "foreground": "#EEFFFF"
121
121
  },
122
122
  {
123
123
  "name": "Macro",
@@ -157,7 +157,7 @@
157
157
  },
158
158
  {
159
159
  "name": "LanguageConstant",
160
- "foreground": "#F78C6C"
160
+ "foreground": "#89DDFF"
161
161
  },
162
162
  {
163
163
  "name": "Heading",
@@ -170,6 +170,14 @@
170
170
  {
171
171
  "name": "YamlPropertyValueString",
172
172
  "foreground": "#C3E88D"
173
+ },
174
+ {
175
+ "name": "KeywordThis",
176
+ "foreground": "#89DDFF"
177
+ },
178
+ {
179
+ "name": "KeywordReturn",
180
+ "foreground": "#89DDFF"
173
181
  }
174
182
  ]
175
183
  }
@@ -17,7 +17,7 @@
17
17
  "MenuBackground": "rgb(30, 31, 28)",
18
18
 
19
19
  "EditorBackGround": "",
20
- "EditorScrollBarBackground": "",
20
+ "EditorScrollBarBackground": "rgba(121, 121, 121, 0.4)",
21
21
  "EditorCursorBackground": "white",
22
22
  "EditorSelectionBackground": "rgba(135, 139, 145, 0.25)",
23
23
 
@@ -130,6 +130,22 @@
130
130
  {
131
131
  "name": "YamlPropertyValueString",
132
132
  "foreground": "#E6DB74"
133
+ },
134
+ {
135
+ "name": "Function",
136
+ "foreground": "#A6E22E"
137
+ },
138
+ {
139
+ "name": "Keyword",
140
+ "foreground": "#66D9EF"
141
+ },
142
+ {
143
+ "name": "KeywordThis",
144
+ "foreground": "#FD971F"
145
+ },
146
+ {
147
+ "name": "KeywordControl",
148
+ "foreground": "#F92672"
133
149
  }
134
150
  ]
135
151
  }
@@ -118,7 +118,7 @@
118
118
  },
119
119
  {
120
120
  "name": "VariableName",
121
- "foreground": "#16a3b6"
121
+ "foreground": "#E4B781"
122
122
  },
123
123
  {
124
124
  "name": "JsonPropertyName",
@@ -163,6 +163,22 @@
163
163
  {
164
164
  "name": "YamlPropertyValueString",
165
165
  "foreground": "#49E9A6"
166
+ },
167
+ {
168
+ "name": "Function",
169
+ "foreground": "#16A3B6"
170
+ },
171
+ {
172
+ "name": "KeywordNew",
173
+ "foreground": "#DF769B"
174
+ },
175
+ {
176
+ "name": "KeywordControl",
177
+ "foreground": "#DF769B"
178
+ },
179
+ {
180
+ "name": "KeywordThis",
181
+ "foreground": "#E66533"
166
182
  }
167
183
  ]
168
184
  }
@@ -172,6 +172,26 @@
172
172
  {
173
173
  "name": "YamlPropertyValueString",
174
174
  "foreground": "#BFC7D5"
175
+ },
176
+ {
177
+ "name": "Function",
178
+ "foreground": "#82AAFF"
179
+ },
180
+ {
181
+ "name": "KeywordThis",
182
+ "foreground": "#FF5370"
183
+ },
184
+ {
185
+ "name": "KeywordNew",
186
+ "foreground": "#C792EA"
187
+ },
188
+ {
189
+ "name": "KeywordControl",
190
+ "foreground": "#89DDFF"
191
+ },
192
+ {
193
+ "name": "KeywordReturn",
194
+ "foreground": "#89DDFF"
175
195
  }
176
196
  ]
177
197
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
4
4
  "description": "Utility package for @lvce-editor/server",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -20,8 +20,8 @@
20
20
  "node": ">=16"
21
21
  },
22
22
  "dependencies": {
23
- "@lvce-editor/extension-host": "0.10.4",
24
- "@lvce-editor/pty-host": "0.10.4",
23
+ "@lvce-editor/extension-host": "0.10.6",
24
+ "@lvce-editor/pty-host": "0.10.6",
25
25
  "debug": "^4.3.4",
26
26
  "execa": "^6.1.0",
27
27
  "exit-hook": "^3.1.1",
@@ -225,13 +225,6 @@ const applyOverrides = async ({ root, commitHash, pathPrefix }) => {
225
225
  `export {}
226
226
  //# sourceMappingURL`
227
227
  )
228
-
229
- await replace(
230
- Path.join(root, 'dist', commitHash, 'config', 'defaultSettings.json'),
231
- `"workbench.saveStateOnVisibilityChange": false`,
232
- `"workbench.saveStateOnVisibilityChange": true`
233
- )
234
-
235
228
  const extensionDirents = await FileSystem.readDir(
236
229
  Path.join(
237
230
  root,
@@ -551,8 +544,8 @@ const addExtensionLanguages = async ({
551
544
  Path.join(root, 'dist', commitHash, 'config', 'languages.json'),
552
545
  mergedLanguages
553
546
  )
554
- await FileSystem.remove(Path.join(root, 'dist', commitHash, 'playground'))
555
547
  if (await FileSystem.exists(Path.join(extensionPath, 'test', 'cases'))) {
548
+ await FileSystem.remove(Path.join(root, 'dist', commitHash, 'playground'))
556
549
  await FileSystem.copy(
557
550
  Path.join(extensionPath, 'test', 'cases'),
558
551
  Path.join(root, 'dist', commitHash, 'playground')
@@ -70,6 +70,9 @@ const handleMessage = async (event) => {
70
70
  code: /* UnexpectedError */ -32001,
71
71
  // @ts-ignore
72
72
  message: error.toString(),
73
+ data: {
74
+ code: error.code,
75
+ },
73
76
  },
74
77
  })
75
78
  }