@difizen/libro-cofine-editor 0.1.2

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.
Files changed (122) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/es/editor-contribution.d.ts +10 -0
  4. package/es/editor-contribution.d.ts.map +1 -0
  5. package/es/editor-contribution.js +31 -0
  6. package/es/index.d.ts +7 -0
  7. package/es/index.d.ts.map +1 -0
  8. package/es/index.js +6 -0
  9. package/es/index.less +32 -0
  10. package/es/language/lsp/completion-provider.d.ts +13 -0
  11. package/es/language/lsp/completion-provider.d.ts.map +1 -0
  12. package/es/language/lsp/completion-provider.js +290 -0
  13. package/es/language/lsp/diagnostic-provider.d.ts +22 -0
  14. package/es/language/lsp/diagnostic-provider.d.ts.map +1 -0
  15. package/es/language/lsp/diagnostic-provider.js +161 -0
  16. package/es/language/lsp/format-provider.d.ts +9 -0
  17. package/es/language/lsp/format-provider.d.ts.map +1 -0
  18. package/es/language/lsp/format-provider.js +139 -0
  19. package/es/language/lsp/hover-provider.d.ts +8 -0
  20. package/es/language/lsp/hover-provider.d.ts.map +1 -0
  21. package/es/language/lsp/hover-provider.js +136 -0
  22. package/es/language/lsp/language-feature-provider.d.ts +17 -0
  23. package/es/language/lsp/language-feature-provider.d.ts.map +1 -0
  24. package/es/language/lsp/language-feature-provider.js +89 -0
  25. package/es/language/lsp/lsp-contribution.d.ts +25 -0
  26. package/es/language/lsp/lsp-contribution.d.ts.map +1 -0
  27. package/es/language/lsp/lsp-contribution.js +213 -0
  28. package/es/language/lsp/module.d.ts +2 -0
  29. package/es/language/lsp/module.d.ts.map +1 -0
  30. package/es/language/lsp/module.js +3 -0
  31. package/es/language/lsp/semantic-highlight-provider.d.ts +9 -0
  32. package/es/language/lsp/semantic-highlight-provider.d.ts.map +1 -0
  33. package/es/language/lsp/semantic-highlight-provider.js +41 -0
  34. package/es/language/lsp/signature-help-provider.d.ts +8 -0
  35. package/es/language/lsp/signature-help-provider.d.ts.map +1 -0
  36. package/es/language/lsp/signature-help-provider.js +108 -0
  37. package/es/language/lsp/type-concerters.d.ts +7 -0
  38. package/es/language/lsp/type-concerters.d.ts.map +1 -0
  39. package/es/language/lsp/type-concerters.js +37 -0
  40. package/es/language/python/data/MagicPython.tmLanguage.json +4213 -0
  41. package/es/language/python/data/MagicRegExp.tmLanguage.json +497 -0
  42. package/es/language/python/data/configurations/python.json +135 -0
  43. package/es/language/python/data/snippets/python.snippets.json +223 -0
  44. package/es/language/python/module.d.ts +2 -0
  45. package/es/language/python/module.d.ts.map +1 -0
  46. package/es/language/python/module.js +3 -0
  47. package/es/language/python/python-builtin.d.ts +86 -0
  48. package/es/language/python/python-builtin.d.ts.map +1 -0
  49. package/es/language/python/python-builtin.js +569 -0
  50. package/es/language/python/python-language-feature.d.ts +26 -0
  51. package/es/language/python/python-language-feature.d.ts.map +1 -0
  52. package/es/language/python/python-language-feature.js +174 -0
  53. package/es/language-specs.d.ts +33 -0
  54. package/es/language-specs.d.ts.map +1 -0
  55. package/es/language-specs.js +115 -0
  56. package/es/libro-e2-editor.d.ts +277 -0
  57. package/es/libro-e2-editor.d.ts.map +1 -0
  58. package/es/libro-e2-editor.js +720 -0
  59. package/es/libro-e2-preload.d.ts +5 -0
  60. package/es/libro-e2-preload.d.ts.map +1 -0
  61. package/es/libro-e2-preload.js +57 -0
  62. package/es/libro-sql-api.d.ts +8 -0
  63. package/es/libro-sql-api.d.ts.map +1 -0
  64. package/es/libro-sql-api.js +26 -0
  65. package/es/module.d.ts +3 -0
  66. package/es/module.d.ts.map +1 -0
  67. package/es/module.js +44 -0
  68. package/es/placeholder.d.ts +31 -0
  69. package/es/placeholder.d.ts.map +1 -0
  70. package/es/placeholder.js +101 -0
  71. package/es/theme/data/jupyter_dark.json +406 -0
  72. package/es/theme/data/jupyter_hc_dark.json +385 -0
  73. package/es/theme/data/jupyter_hc_light.json +386 -0
  74. package/es/theme/data/jupyter_light.json +386 -0
  75. package/es/theme/data/libro_dark.json +186 -0
  76. package/es/theme/data/libro_light.json +170 -0
  77. package/es/theme/libro-python-theme-contribution.d.ts +6 -0
  78. package/es/theme/libro-python-theme-contribution.d.ts.map +1 -0
  79. package/es/theme/libro-python-theme-contribution.js +49 -0
  80. package/es/theme/module.d.ts +2 -0
  81. package/es/theme/module.d.ts.map +1 -0
  82. package/es/theme/module.js +3 -0
  83. package/es/types.d.ts +10 -0
  84. package/es/types.d.ts.map +1 -0
  85. package/es/types.js +3 -0
  86. package/package.json +67 -0
  87. package/src/editor-contribution.ts +30 -0
  88. package/src/index.less +32 -0
  89. package/src/index.spec.ts +8 -0
  90. package/src/index.ts +6 -0
  91. package/src/language/lsp/completion-provider.ts +214 -0
  92. package/src/language/lsp/diagnostic-provider.ts +148 -0
  93. package/src/language/lsp/format-provider.ts +87 -0
  94. package/src/language/lsp/hover-provider.ts +98 -0
  95. package/src/language/lsp/language-feature-provider.ts +69 -0
  96. package/src/language/lsp/lsp-contribution.ts +159 -0
  97. package/src/language/lsp/module.ts +5 -0
  98. package/src/language/lsp/semantic-highlight-provider.ts +26 -0
  99. package/src/language/lsp/signature-help-provider.ts +65 -0
  100. package/src/language/lsp/type-concerters.ts +72 -0
  101. package/src/language/python/data/MagicPython.tmLanguage.json +4213 -0
  102. package/src/language/python/data/MagicRegExp.tmLanguage.json +497 -0
  103. package/src/language/python/data/configurations/python.json +135 -0
  104. package/src/language/python/data/snippets/python.snippets.json +223 -0
  105. package/src/language/python/module.ts +5 -0
  106. package/src/language/python/python-builtin.ts +891 -0
  107. package/src/language/python/python-language-feature.ts +163 -0
  108. package/src/language-specs.ts +99 -0
  109. package/src/libro-e2-editor.ts +922 -0
  110. package/src/libro-e2-preload.ts +23 -0
  111. package/src/libro-sql-api.ts +20 -0
  112. package/src/module.ts +44 -0
  113. package/src/placeholder.ts +100 -0
  114. package/src/theme/data/jupyter_dark.json +406 -0
  115. package/src/theme/data/jupyter_hc_dark.json +385 -0
  116. package/src/theme/data/jupyter_hc_light.json +386 -0
  117. package/src/theme/data/jupyter_light.json +386 -0
  118. package/src/theme/data/libro_dark.json +186 -0
  119. package/src/theme/data/libro_light.json +170 -0
  120. package/src/theme/libro-python-theme-contribution.ts +36 -0
  121. package/src/theme/module.ts +5 -0
  122. package/src/types.ts +11 -0
@@ -0,0 +1,170 @@
1
+ {
2
+ "$schema": "vscode://schemas/color-theme",
3
+ "name": "libro light",
4
+ "include": "jupyter-light",
5
+ "colors": {
6
+ "activityBar.background": "#ececec",
7
+ "activityBar.activeBorder": "#000000",
8
+ "activityBar.foreground": "#000000"
9
+ },
10
+ "tokenColors": [
11
+ {
12
+ "scope": "storage.type.function",
13
+ "settings": {
14
+ "foreground": "#098658",
15
+ "fontStyle": "bold"
16
+ }
17
+ },
18
+ {
19
+ "scope": "support.function.builtin.python",
20
+ "settings": {
21
+ "foreground": "#098658"
22
+ }
23
+ },
24
+ {
25
+ "scope": "comment.line.number-sign.python",
26
+ "settings": {
27
+ "foreground": "#6A8B93",
28
+ "fontStyle": "italic"
29
+ }
30
+ },
31
+ {
32
+ "scope": "keyword.control",
33
+ "settings": {
34
+ "foreground": "#098658",
35
+ "fontStyle": "bold"
36
+ }
37
+ },
38
+ {
39
+ "scope": "keyword.operator",
40
+ "settings": {
41
+ "foreground": "#c700c7"
42
+ }
43
+ },
44
+ {
45
+ "scope": "meta.member.access",
46
+ "settings": {
47
+ "foreground": "#2060a0"
48
+ }
49
+ },
50
+ {
51
+ "scope": "constant.language",
52
+ "settings": {
53
+ "foreground": "#098658",
54
+ "fontStyle": "bold"
55
+ }
56
+ },
57
+ {
58
+ "scope": "string.quoted",
59
+ "settings": {
60
+ "foreground": "#c03030"
61
+ }
62
+ },
63
+ {
64
+ "scope": "entity.name.function",
65
+ "settings": {
66
+ "foreground": "#003cff"
67
+ }
68
+ },
69
+
70
+ {
71
+ "name": "SQL Scope",
72
+ "scope": ["keywords", "customKeywords"],
73
+ "settings": {
74
+ "foreground": "#236fd9"
75
+ }
76
+ },
77
+ {
78
+ "name": "SQL Scope",
79
+ "scope": ["comment"],
80
+ "settings": {
81
+ "foreground": "#999999"
82
+ }
83
+ },
84
+ {
85
+ "name": "SQL Scope",
86
+ "scope": ["builtinFunctions", "function"],
87
+ "settings": {
88
+ "foreground": "#CB3BC1"
89
+ }
90
+ },
91
+ {
92
+ "name": "SQL Scope",
93
+ "scope": ["operator"],
94
+ "settings": {
95
+ "foreground": "#232226"
96
+ }
97
+ },
98
+ {
99
+ "name": "SQL Scope",
100
+ "scope": ["string"],
101
+ "settings": {
102
+ "foreground": "#D45E00"
103
+ }
104
+ },
105
+ {
106
+ "name": "SQL Scope",
107
+ "scope": ["number"],
108
+ "settings": {
109
+ "foreground": "#2E7F01"
110
+ }
111
+ },
112
+ {
113
+ "name": "SQL Scope",
114
+ "scope": ["variable"],
115
+ "settings": {
116
+ "foreground": "#B8DBA6"
117
+ }
118
+ },
119
+ {
120
+ "name": "Log Scope",
121
+ "scope": ["log-info"],
122
+ "settings": {
123
+ "foreground": "#008800"
124
+ }
125
+ },
126
+ {
127
+ "name": "Log Scope",
128
+ "scope": ["log-alert"],
129
+ "settings": {
130
+ "foreground": "#DE9504"
131
+ }
132
+ },
133
+ {
134
+ "name": "Log Scope",
135
+ "scope": ["log-date"],
136
+ "settings": {
137
+ "foreground": "#171617"
138
+ }
139
+ },
140
+ {
141
+ "name": "Log Scope",
142
+ "scope": ["log-error"],
143
+ "settings": {
144
+ "foreground": "#FF4B61"
145
+ }
146
+ },
147
+ {
148
+ "name": "Log Scope",
149
+ "scope": ["log-links"],
150
+ "settings": {
151
+ "foreground": "#1292FF"
152
+ }
153
+ },
154
+ {
155
+ "name": "Log Scope",
156
+ "scope": ["log-failed"],
157
+ "settings": {
158
+ "foreground": "#FF4B61"
159
+ }
160
+ },
161
+ {
162
+ "name": "Log Scope",
163
+ "scope": ["log-success"],
164
+ "settings": {
165
+ "foreground": "#171617"
166
+ }
167
+ }
168
+ ],
169
+ "semanticHighlighting": true
170
+ }
@@ -0,0 +1,36 @@
1
+ /* eslint-disable global-require */
2
+ import type { ThemeRegistry } from '@difizen/libro-cofine-editor-core';
3
+ import { ThemeContribution } from '@difizen/libro-cofine-editor-core';
4
+ import { singleton } from '@difizen/mana-app';
5
+
6
+ import jupyterDark from './data/jupyter_dark.json';
7
+ import jupyterHCDark from './data/jupyter_hc_dark.json';
8
+ import jupyterHCLight from './data/jupyter_hc_light.json';
9
+ import jupyterLight from './data/jupyter_light.json';
10
+ import libroDark from './data/libro_dark.json';
11
+ import libroLight from './data/libro_light.json';
12
+
13
+ @singleton({ contrib: ThemeContribution })
14
+ export class LibroPythonThemeContribution implements ThemeContribution {
15
+ registerItem(registry: ThemeRegistry): void {
16
+ if (!registry.mixedThemeEnable) {
17
+ console.warn('cannot register textmate themes');
18
+ return;
19
+ }
20
+
21
+ // theme名称必须满足 ^[a-z0-9\-]+$, 必须提供base theme
22
+ // jupyter theme from https://github.com/sam-the-programmer/vscode-jupyter-theme
23
+ registry.registerMixedTheme(jupyterLight, 'jupyter-light', 'vs');
24
+ registry.registerMixedTheme(jupyterDark, 'jupyter-dark', 'vs-dark');
25
+ registry.registerMixedTheme(jupyterHCLight, 'jupyter-hc-light', 'hc-black');
26
+ registry.registerMixedTheme(jupyterHCDark, 'jupyter-hc-dark', 'hc-black');
27
+
28
+ /**
29
+ * libro theme based on jupyter theme, 支持python;
30
+ * 同时兼容sql和log, 如果有其他语言需要支持,需要在主题中指定对应的token和颜色;
31
+ * monaco不同编辑器实例无法使用不同的主题,所有的编辑器实例共享一个主题,后创建的编辑器会覆盖更新全局的主题,所以libro所有e2编辑器必须使用同一个主题!
32
+ */
33
+ registry.registerMixedTheme(libroLight, 'libro-light', 'vs');
34
+ registry.registerMixedTheme(libroDark, 'libro-dark', 'vs-dark');
35
+ }
36
+ }
@@ -0,0 +1,5 @@
1
+ import { Module } from '@difizen/mana-app';
2
+
3
+ import { LibroPythonThemeContribution } from './libro-python-theme-contribution.js';
4
+
5
+ export const LibroE2ThemeModule = Module().register(LibroPythonThemeContribution);
package/src/types.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { Range, Uri } from '@difizen/monaco-editor-core';
2
+ import type monaco from '@difizen/monaco-editor-core';
3
+
4
+ export type MonacoEditorType = monaco.editor.IStandaloneCodeEditor;
5
+ export type MonacoEditorOptions = monaco.editor.IStandaloneEditorConstructionOptions & {
6
+ uri?: monaco.Uri;
7
+ };
8
+ export type MonacoMatch = monaco.editor.FindMatch;
9
+
10
+ export const MonacoRange = Range;
11
+ export const MonacoUri = Uri;