@lvce-editor/shared-process 0.15.26 → 0.15.27

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.
@@ -341,6 +341,10 @@
341
341
  "id": "Editor.format",
342
342
  "label": "Editor: Format Document"
343
343
  },
344
+ {
345
+ "id": "Editor.showHover",
346
+ "label": "Editor: Show Hover"
347
+ },
344
348
  {
345
349
  "id": "Editor.formatForced",
346
350
  "label": "Editor: Format Document (forced)"
@@ -37,6 +37,7 @@ const State = {
37
37
  InsideBacktickString: 34,
38
38
  AfterInterfaceName: 35,
39
39
  AfterKeywordImport: 36,
40
+ AfterKeywordFunction: 37,
40
41
  // AfterKeywordImport: 27,
41
42
  }
42
43
 
@@ -246,6 +247,7 @@ export const tokenizeLine = (line, lineState) => {
246
247
  break
247
248
  case 'let':
248
249
  case 'const':
250
+ case 'var':
249
251
  token = TokenType.Keyword
250
252
  state = State.AfterKeywordDeclaration
251
253
  break
@@ -281,6 +283,10 @@ export const tokenizeLine = (line, lineState) => {
281
283
  token = TokenType.KeywordOperator
282
284
  state = State.TopLevelContent
283
285
  break
286
+ case 'function':
287
+ token = TokenType.Keyword
288
+ state = State.AfterKeywordFunction
289
+ break
284
290
  default:
285
291
  token = TokenType.Keyword
286
292
  state = State.TopLevelContent
@@ -398,6 +404,15 @@ export const tokenizeLine = (line, lineState) => {
398
404
  } else if ((next = part.match(RE_SEMICOLON))) {
399
405
  token = TokenType.Punctuation
400
406
  state = State.TopLevelContent
407
+ } else if ((next = part.match(RE_COMMA))) {
408
+ token = TokenType.Punctuation
409
+ state = State.AfterKeywordDeclaration
410
+ } else if ((next = part.match(RE_PUNCTUATION))) {
411
+ token = TokenType.Punctuation
412
+ state = State.AfterKeywordDeclaration
413
+ } else if ((next = part.match(RE_QUOTE_DOUBLE))) {
414
+ token = TokenType.Punctuation
415
+ state = State.InsideDoubleQuoteString
401
416
  } else {
402
417
  line
403
418
  part
@@ -745,6 +760,9 @@ export const tokenizeLine = (line, lineState) => {
745
760
  } else if ((next = part.match(RE_VARIABLE_NAME))) {
746
761
  token = TokenType.VariableName
747
762
  state = State.InsideObjectDestructuringAfterValue
763
+ } else if ((next = part.match(RE_QUOTE_DOUBLE))) {
764
+ token = TokenType.Punctuation
765
+ state = State.InsideDoubleQuoteString
748
766
  } else {
749
767
  throw new Error('no')
750
768
  }
@@ -756,6 +774,21 @@ export const tokenizeLine = (line, lineState) => {
756
774
  } else if ((next = part.match(RE_CURLY_CLOSE))) {
757
775
  token = TokenType.Punctuation
758
776
  state = State.AfterKeywordDeclaration
777
+ } else if ((next = part.match(RE_COLON))) {
778
+ token = TokenType.Punctuation
779
+ state = State.InsideObjectDestructuringAfterValue
780
+ } else if ((next = part.match(RE_VARIABLE_NAME))) {
781
+ token = TokenType.VariableName
782
+ state = State.InsideObjectDestructuringAfterValue
783
+ } else if ((next = part.match(RE_PUNCTUATION))) {
784
+ token = TokenType.Punctuation
785
+ state = State.TopLevelContent
786
+ } else if ((next = part.match(RE_QUOTE_DOUBLE))) {
787
+ token = TokenType.Punctuation
788
+ state = State.InsideDoubleQuoteString
789
+ } else if ((next = part.match(RE_QUOTE_SINGLE))) {
790
+ token = TokenType.Punctuation
791
+ state = State.InsideSingleQuoteString
759
792
  } else {
760
793
  throw new Error('no')
761
794
  }
@@ -959,6 +992,20 @@ export const tokenizeLine = (line, lineState) => {
959
992
  throw new Error('no')
960
993
  }
961
994
  break
995
+ case State.AfterKeywordFunction:
996
+ if ((next = part.match(RE_WHITESPACE))) {
997
+ token = TokenType.Whitespace
998
+ state = State.AfterKeywordFunction
999
+ } else if ((next = part.match(RE_VARIABLE_NAME))) {
1000
+ token = TokenType.FunctionName
1001
+ state = State.TopLevelContent
1002
+ } else if ((next = part.match(RE_PUNCTUATION))) {
1003
+ token = TokenType.Punctuation
1004
+ state = State.TopLevelContent
1005
+ } else {
1006
+ throw new Error('no')
1007
+ }
1008
+ break
962
1009
  default:
963
1010
  state
964
1011
  throw new Error('no')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.15.26",
3
+ "version": "0.15.27",
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.21.4",
20
- "@lvce-editor/extension-host": "0.15.26",
21
- "@lvce-editor/extension-host-helper-process": "0.15.26",
22
- "@lvce-editor/pty-host": "0.15.26",
20
+ "@lvce-editor/extension-host": "0.15.27",
21
+ "@lvce-editor/extension-host-helper-process": "0.15.27",
22
+ "@lvce-editor/pty-host": "0.15.27",
23
23
  "debug": "^4.3.4",
24
24
  "execa": "^7.1.1",
25
25
  "exit-hook": "^3.2.0",