@datalayer/jupyter-lexical 1.0.7 → 1.0.9
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.
- package/lib/autoindent/AutoIndentEngine.d.ts +111 -0
- package/lib/autoindent/AutoIndentEngine.js +234 -0
- package/lib/autoindent/AutoIndentEngine.js.map +1 -0
- package/lib/autoindent/LanguageIndentRegistry.d.ts +102 -0
- package/lib/autoindent/LanguageIndentRegistry.js +200 -0
- package/lib/autoindent/LanguageIndentRegistry.js.map +1 -0
- package/lib/autoindent/__tests__/AutoIndentEngine.test.d.ts +1 -0
- package/lib/autoindent/__tests__/AutoIndentEngine.test.js +422 -0
- package/lib/autoindent/__tests__/AutoIndentEngine.test.js.map +1 -0
- package/lib/autoindent/index.d.ts +13 -0
- package/lib/autoindent/index.js +20 -0
- package/lib/autoindent/index.js.map +1 -0
- package/lib/autoindent/languages/javascript.d.ts +30 -0
- package/lib/autoindent/languages/javascript.js +150 -0
- package/lib/autoindent/languages/javascript.js.map +1 -0
- package/lib/autoindent/languages/python.d.ts +30 -0
- package/lib/autoindent/languages/python.js +102 -0
- package/lib/autoindent/languages/python.js.map +1 -0
- package/lib/autoindent/types.d.ts +125 -0
- package/lib/autoindent/types.js +7 -0
- package/lib/autoindent/types.js.map +1 -0
- package/lib/components/Button.js +1 -1
- package/lib/components/ColorPicker.d.ts +13 -0
- package/lib/components/ColorPicker.js +219 -0
- package/lib/components/ColorPicker.js.map +1 -0
- package/lib/components/Commenting.d.ts +15 -11
- package/lib/components/Commenting.js +80 -232
- package/lib/components/Commenting.js.map +1 -1
- package/lib/components/CopyButton.js +1 -1
- package/lib/components/ExcalidrawComponent.d.ts +8 -0
- package/lib/components/ExcalidrawComponent.js +111 -0
- package/lib/components/ExcalidrawComponent.js.map +1 -0
- package/lib/components/ExcalidrawImage.d.ts +49 -0
- package/lib/components/ExcalidrawImage.js +118 -0
- package/lib/components/ExcalidrawImage.js.map +1 -0
- package/lib/components/ExcalidrawModal.d.ts +41 -0
- package/lib/components/ExcalidrawModal.js +105 -0
- package/lib/components/ExcalidrawModal.js.map +1 -0
- package/lib/components/InsertEquationDialog.js +2 -2
- package/lib/components/InsertImageDialog.js +4 -4
- package/lib/components/KatexEquationAlterer.js +2 -2
- package/lib/components/TableInsertModal.d.ts +6 -0
- package/lib/components/TableInsertModal.js +34 -0
- package/lib/components/TableInsertModal.js.map +1 -0
- package/lib/components/index.js +16 -16
- package/lib/context/CommentsContext.d.ts +11 -0
- package/lib/context/CommentsContext.js +21 -0
- package/lib/context/CommentsContext.js.map +1 -0
- package/lib/context/EmbedHandlersContext.d.ts +33 -0
- package/lib/context/EmbedHandlersContext.js +33 -0
- package/lib/context/EmbedHandlersContext.js.map +1 -0
- package/lib/context/LexicalConfigContext.d.ts +3 -2
- package/lib/context/LexicalConfigContext.js.map +1 -1
- package/lib/context/SettingsContext.js +2 -2
- package/lib/context/SettingsContext.js.map +1 -1
- package/lib/context/ThemeContext.d.ts +24 -0
- package/lib/context/ThemeContext.js +42 -0
- package/lib/context/ThemeContext.js.map +1 -0
- package/lib/context/index.d.ts +3 -0
- package/lib/context/index.js +7 -4
- package/lib/context/index.js.map +1 -1
- package/lib/convert/LexicalToNbformat.js +6 -6
- package/lib/convert/NbformatToLexical.js +3 -3
- package/lib/convert/index.js +2 -2
- package/lib/convert/markdown/MarkdownExport.js +1 -1
- package/lib/convert/markdown/MarkdownImport.js +2 -2
- package/lib/convert/markdown/MarkdownShortcuts.js +3 -3
- package/lib/convert/markdown/MarkdownTransformers.js +1 -1
- package/lib/convert/markdown/convertToMarkdown.js +1 -1
- package/lib/convert/markdown/index.js +4 -4
- package/lib/convert/markdown/utils.js +1 -1
- package/lib/convert/transformers/MarkdownTransformers.js +5 -4
- package/lib/convert/transformers/MarkdownTransformers.js.map +1 -1
- package/lib/editor/Editor.js +28 -14
- package/lib/editor/Editor.js.map +1 -1
- package/lib/editor/index.js +1 -1
- package/lib/examples/AppNbformat.js +10 -5
- package/lib/examples/AppNbformat.js.map +1 -1
- package/lib/examples/AppSimple.js +18 -9
- package/lib/examples/AppSimple.js.map +1 -1
- package/lib/examples/ManualKernelControl.js +7 -2
- package/lib/examples/ManualKernelControl.js.map +1 -1
- package/lib/examples/content/Example.lexical.json +2042 -101
- package/lib/examples/index.d.ts +1 -0
- package/lib/examples/index.js +5 -3
- package/lib/examples/index.js.map +1 -1
- package/lib/examples/setup-prism.d.ts +14 -0
- package/lib/examples/setup-prism.js +27 -0
- package/lib/examples/setup-prism.js.map +1 -0
- package/lib/hooks/index.js +3 -3
- package/lib/hooks/useLayoutEffect.js +1 -1
- package/lib/hooks/useModal.js +1 -1
- package/lib/images/icons/plus.svg +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +11 -10
- package/lib/index.js.map +1 -1
- package/lib/nodes/CommentThreadNode.d.ts +35 -0
- package/lib/nodes/CommentThreadNode.js +86 -0
- package/lib/nodes/CommentThreadNode.js.map +1 -0
- package/lib/nodes/CounterComponent.js +1 -1
- package/lib/nodes/CounterNode.js +2 -2
- package/lib/nodes/EquationNode.js +2 -2
- package/lib/nodes/ExcalidrawNode.d.ts +32 -0
- package/lib/nodes/ExcalidrawNode.js +118 -0
- package/lib/nodes/ExcalidrawNode.js.map +1 -0
- package/lib/nodes/ImageNode.js +4 -4
- package/lib/nodes/InlineCompletionNode.js +0 -2
- package/lib/nodes/InlineCompletionNode.js.map +1 -1
- package/lib/nodes/JupyterInputHighlightNode.js +15 -0
- package/lib/nodes/JupyterInputHighlightNode.js.map +1 -1
- package/lib/nodes/JupyterInputHighlighter.d.ts +0 -11
- package/lib/nodes/JupyterInputHighlighter.js +8 -15
- package/lib/nodes/JupyterInputHighlighter.js.map +1 -1
- package/lib/nodes/JupyterInputNode.d.ts +0 -11
- package/lib/nodes/JupyterInputNode.js +4 -14
- package/lib/nodes/JupyterInputNode.js.map +1 -1
- package/lib/nodes/JupyterOutputNode.js +18 -12
- package/lib/nodes/JupyterOutputNode.js.map +1 -1
- package/lib/nodes/JupyterOutputNodeUtils.js +1 -1
- package/lib/nodes/YouTubeNode.js +65 -1
- package/lib/nodes/YouTubeNode.js.map +1 -1
- package/lib/nodes/index.d.ts +2 -0
- package/lib/nodes/index.js +12 -10
- package/lib/nodes/index.js.map +1 -1
- package/lib/nodes/jupyterUtils.d.ts +3 -3
- package/lib/nodes/jupyterUtils.js +6 -4
- package/lib/nodes/jupyterUtils.js.map +1 -1
- package/lib/plugins/AutoEmbedPlugin.js +4 -4
- package/lib/plugins/AutoIndentPlugin.d.ts +23 -0
- package/lib/plugins/AutoIndentPlugin.js +385 -0
- package/lib/plugins/AutoIndentPlugin.js.map +1 -0
- package/lib/plugins/AutoLinkPlugin.js +25 -12
- package/lib/plugins/AutoLinkPlugin.js.map +1 -1
- package/lib/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +7 -0
- package/lib/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +48 -0
- package/lib/plugins/CodeActionMenuPlugin/components/CopyButton/index.js.map +1 -0
- package/lib/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +9 -0
- package/lib/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js +116 -0
- package/lib/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js.map +1 -0
- package/lib/plugins/CodeActionMenuPlugin/index.d.ts +4 -0
- package/lib/plugins/CodeActionMenuPlugin/index.js +104 -0
- package/lib/plugins/CodeActionMenuPlugin/index.js.map +1 -0
- package/lib/plugins/CodeActionMenuPlugin/utils.d.ts +1 -0
- package/lib/plugins/CodeActionMenuPlugin/utils.js +24 -0
- package/lib/plugins/CodeActionMenuPlugin/utils.js.map +1 -0
- package/lib/plugins/CodeActionMenuPlugin.js +3 -3
- package/lib/plugins/CodeHighlightPlugin.d.ts +5 -0
- package/lib/plugins/CodeHighlightPlugin.js +97 -0
- package/lib/plugins/CodeHighlightPlugin.js.map +1 -0
- package/lib/plugins/CollapsiblePlugin/Collapsible.css +115 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleContainerNode.d.ts +25 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleContainerNode.js +137 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleContainerNode.js.map +1 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleContentNode.d.ts +16 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleContentNode.js +85 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleContentNode.js.map +1 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleTitleNode.d.ts +16 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleTitleNode.js +87 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleTitleNode.js.map +1 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleUtils.d.ts +2 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleUtils.js +14 -0
- package/lib/plugins/CollapsiblePlugin/CollapsibleUtils.js.map +1 -0
- package/lib/plugins/CollapsiblePlugin/index.d.ts +7 -0
- package/lib/plugins/CollapsiblePlugin/index.js +139 -0
- package/lib/plugins/CollapsiblePlugin/index.js.map +1 -0
- package/lib/plugins/CommentPlugin.d.ts +3 -1
- package/lib/plugins/CommentPlugin.js +16 -20
- package/lib/plugins/CommentPlugin.js.map +1 -1
- package/lib/plugins/ComponentPickerMenuPlugin.js +41 -14
- package/lib/plugins/ComponentPickerMenuPlugin.js.map +1 -1
- package/lib/plugins/DraggableBlockPlugin.js +1 -1
- package/lib/plugins/EquationsPlugin.js +2 -2
- package/lib/plugins/ExcalidrawPlugin.d.ts +3 -0
- package/lib/plugins/ExcalidrawPlugin.js +45 -0
- package/lib/plugins/ExcalidrawPlugin.js.map +1 -0
- package/lib/plugins/FloatingLinkEditorPlugin/index.css +156 -0
- package/lib/plugins/FloatingLinkEditorPlugin/index.d.ts +15 -0
- package/lib/plugins/FloatingLinkEditorPlugin/index.js +317 -0
- package/lib/plugins/FloatingLinkEditorPlugin/index.js.map +1 -0
- package/lib/plugins/FloatingTextFormatToolbarPlugin.d.ts +2 -1
- package/lib/plugins/FloatingTextFormatToolbarPlugin.js +13 -11
- package/lib/plugins/FloatingTextFormatToolbarPlugin.js.map +1 -1
- package/lib/plugins/HorizontalRulePlugin.js.map +1 -1
- package/lib/plugins/ImagesPlugin.js +6 -6
- package/lib/plugins/InlineCompletionConfig.d.ts +135 -0
- package/lib/plugins/InlineCompletionConfig.js +94 -0
- package/lib/plugins/InlineCompletionConfig.js.map +1 -0
- package/lib/plugins/InlineCompletionContextExtractor.d.ts +50 -0
- package/lib/plugins/InlineCompletionContextExtractor.js +171 -0
- package/lib/plugins/InlineCompletionContextExtractor.js.map +1 -0
- package/lib/plugins/JupyterCellPlugin.js +1 -1
- package/lib/plugins/JupyterInputOutputPlugin.js +28 -22
- package/lib/plugins/JupyterInputOutputPlugin.js.map +1 -1
- package/lib/plugins/LSPCompletionMenu.d.ts +24 -0
- package/lib/plugins/LSPCompletionMenu.js +194 -0
- package/lib/plugins/LSPCompletionMenu.js.map +1 -0
- package/lib/plugins/LSPDocumentSyncPlugin.d.ts +37 -0
- package/lib/plugins/LSPDocumentSyncPlugin.js +133 -0
- package/lib/plugins/LSPDocumentSyncPlugin.js.map +1 -0
- package/lib/plugins/LSPTabCompletionPlugin.d.ts +22 -0
- package/lib/plugins/LSPTabCompletionPlugin.js +388 -0
- package/lib/plugins/LSPTabCompletionPlugin.js.map +1 -0
- package/lib/plugins/LSPTabCompletionProvider.d.ts +48 -0
- package/lib/plugins/LSPTabCompletionProvider.js +118 -0
- package/lib/plugins/LSPTabCompletionProvider.js.map +1 -0
- package/lib/plugins/LexicalInlineCompletionPlugin.d.ts +19 -2
- package/lib/plugins/LexicalInlineCompletionPlugin.js +374 -186
- package/lib/plugins/LexicalInlineCompletionPlugin.js.map +1 -1
- package/lib/plugins/LexicalStatePlugin.js +3 -3
- package/lib/plugins/MarkdownPlugin.js +1 -1
- package/lib/plugins/NbformatContentPlugin.js +1 -1
- package/lib/plugins/ShortcutsPlugin/index.js +5 -5
- package/lib/plugins/TableActionMenuPlugin/index.d.ts +5 -0
- package/lib/plugins/TableActionMenuPlugin/index.js +503 -0
- package/lib/plugins/TableActionMenuPlugin/index.js.map +1 -0
- package/lib/plugins/TableCellResizer/index.css +26 -0
- package/lib/plugins/TableCellResizer/index.d.ts +2 -0
- package/lib/plugins/TableCellResizer/index.js +298 -0
- package/lib/plugins/TableCellResizer/index.js.map +1 -0
- package/lib/plugins/TableHoverActionsPlugin/index.d.ts +4 -0
- package/lib/plugins/TableHoverActionsPlugin/index.js +198 -0
- package/lib/plugins/TableHoverActionsPlugin/index.js.map +1 -0
- package/lib/plugins/TableHoverActionsV2Plugin/index.css +83 -0
- package/lib/plugins/TableHoverActionsV2Plugin/index.d.ts +4 -0
- package/lib/plugins/TableHoverActionsV2Plugin/index.js +306 -0
- package/lib/plugins/TableHoverActionsV2Plugin/index.js.map +1 -0
- package/lib/plugins/TablePlugin.d.ts +4 -0
- package/lib/plugins/TablePlugin.js +41 -0
- package/lib/plugins/TablePlugin.js.map +1 -0
- package/lib/plugins/TableScrollShadowPlugin/index.d.ts +1 -0
- package/lib/plugins/TableScrollShadowPlugin/index.js +120 -0
- package/lib/plugins/TableScrollShadowPlugin/index.js.map +1 -0
- package/lib/plugins/ToolbarPlugin/fontSize.js +3 -3
- package/lib/plugins/ToolbarPlugin/index.js +30 -12
- package/lib/plugins/ToolbarPlugin/index.js.map +1 -1
- package/lib/plugins/ToolbarPlugin/utils.js +1 -1
- package/lib/plugins/YouTubePlugin.js +1 -1
- package/lib/plugins/index.d.ts +17 -1
- package/lib/plugins/index.js +38 -22
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/lspTypes.d.ts +138 -0
- package/lib/plugins/lspTypes.js +38 -0
- package/lib/plugins/lspTypes.js.map +1 -0
- package/lib/state/LexicalAdapter.d.ts +73 -4
- package/lib/state/LexicalAdapter.js +883 -20
- package/lib/state/LexicalAdapter.js.map +1 -1
- package/lib/state/LexicalState.d.ts +20 -6
- package/lib/state/LexicalState.js +66 -8
- package/lib/state/LexicalState.js.map +1 -1
- package/lib/state/index.js +2 -2
- package/lib/themes/CommentEditorTheme.js +1 -1
- package/lib/themes/index.js +2 -2
- package/lib/tools/core/executor.js +1 -11
- package/lib/tools/core/executor.js.map +1 -1
- package/lib/tools/core/index.d.ts +2 -2
- package/lib/tools/core/index.js +11 -11
- package/lib/tools/core/index.js.map +1 -1
- package/lib/tools/core/interfaces.d.ts +1 -1
- package/lib/tools/core/types.d.ts +3 -5
- package/lib/tools/definitions/{deleteBlock.d.ts → deleteBlocks.d.ts} +2 -2
- package/lib/tools/definitions/{deleteBlock.js → deleteBlocks.js} +9 -9
- package/lib/tools/definitions/deleteBlocks.js.map +1 -0
- package/lib/tools/definitions/executeCode.js +2 -2
- package/lib/tools/definitions/executeCode.js.map +1 -1
- package/lib/tools/definitions/index.d.ts +1 -1
- package/lib/tools/definitions/index.js +9 -9
- package/lib/tools/definitions/index.js.map +1 -1
- package/lib/tools/definitions/insertBlock.d.ts +2 -2
- package/lib/tools/definitions/insertBlock.js +5 -5
- package/lib/tools/definitions/insertBlock.js.map +1 -1
- package/lib/tools/definitions/listAvailableBlocks.js +7 -7
- package/lib/tools/definitions/listAvailableBlocks.js.map +1 -1
- package/lib/tools/definitions/readAllBlocks.js +3 -3
- package/lib/tools/definitions/readAllBlocks.js.map +1 -1
- package/lib/tools/definitions/readBlock.js +3 -3
- package/lib/tools/definitions/readBlock.js.map +1 -1
- package/lib/tools/definitions/runAllBlocks.js +2 -2
- package/lib/tools/definitions/runAllBlocks.js.map +1 -1
- package/lib/tools/definitions/runBlock.js +2 -2
- package/lib/tools/definitions/runBlock.js.map +1 -1
- package/lib/tools/definitions/updateBlock.d.ts +1 -1
- package/lib/tools/definitions/updateBlock.js +6 -6
- package/lib/tools/definitions/updateBlock.js.map +1 -1
- package/lib/tools/index.d.ts +1 -1
- package/lib/tools/index.js +33 -33
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/operations/deleteBlocks.d.ts +41 -0
- package/lib/tools/operations/deleteBlocks.js +70 -0
- package/lib/tools/operations/deleteBlocks.js.map +1 -0
- package/lib/tools/operations/executeCode.js +2 -13
- package/lib/tools/operations/executeCode.js.map +1 -1
- package/lib/tools/operations/insertBlock.d.ts +4 -2
- package/lib/tools/operations/insertBlock.js +8 -7
- package/lib/tools/operations/insertBlock.js.map +1 -1
- package/lib/tools/operations/listAvailableBlocks.d.ts +4 -8
- package/lib/tools/operations/listAvailableBlocks.js +134 -43
- package/lib/tools/operations/listAvailableBlocks.js.map +1 -1
- package/lib/tools/operations/readAllBlocks.js +3 -2
- package/lib/tools/operations/readAllBlocks.js.map +1 -1
- package/lib/tools/operations/readBlock.js +3 -3
- package/lib/tools/operations/readBlock.js.map +1 -1
- package/lib/tools/operations/runAllBlocks.js +2 -2
- package/lib/tools/operations/runAllBlocks.js.map +1 -1
- package/lib/tools/operations/runBlock.js +3 -3
- package/lib/tools/operations/runBlock.js.map +1 -1
- package/lib/tools/operations/updateBlock.d.ts +2 -2
- package/lib/tools/operations/updateBlock.js +9 -11
- package/lib/tools/operations/updateBlock.js.map +1 -1
- package/lib/tools/schemas/deleteBlocks.d.ts +10 -0
- package/lib/tools/schemas/{deleteBlock.js → deleteBlocks.js} +4 -4
- package/lib/tools/schemas/deleteBlocks.js.map +1 -0
- package/lib/tools/schemas/index.d.ts +1 -1
- package/lib/tools/schemas/index.js +9 -9
- package/lib/tools/schemas/index.js.map +1 -1
- package/lib/tools/schemas/insertBlock.d.ts +1 -1
- package/lib/tools/schemas/insertBlock.js +25 -5
- package/lib/tools/schemas/insertBlock.js.map +1 -1
- package/lib/tools/schemas/listAvailableBlocks.d.ts +1 -19
- package/lib/tools/schemas/listAvailableBlocks.js +6 -12
- package/lib/tools/schemas/listAvailableBlocks.js.map +1 -1
- package/lib/tools/schemas/updateBlock.d.ts +1 -1
- package/lib/tools/schemas/updateBlock.js +24 -4
- package/lib/tools/schemas/updateBlock.js.map +1 -1
- package/lib/tools/utils/blocks.d.ts +11 -0
- package/lib/tools/utils/blocks.js +394 -26
- package/lib/tools/utils/blocks.js.map +1 -1
- package/lib/tools/utils/index.js +1 -1
- package/lib/utils/getThemeSelector.d.ts +2 -0
- package/lib/utils/getThemeSelector.js +16 -0
- package/lib/utils/getThemeSelector.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +12 -10
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/invariant.d.ts +1 -1
- package/lib/utils/invariant.js +1 -1
- package/lib/utils/invariant.js.map +1 -1
- package/lib/utils/rect.js +1 -1
- package/lib/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
- package/lib/utils/setFloatingElemPositionForLinkEditor.js +42 -0
- package/lib/utils/setFloatingElemPositionForLinkEditor.js.map +1 -0
- package/package.json +14 -4
- package/style/lexical/CodeActionMenuPlugin.css +15 -0
- package/style/lexical/ColorPicker.css +87 -0
- package/style/lexical/CommentPlugin.css +44 -61
- package/style/lexical/Editor.css +2 -122
- package/style/lexical/ExcalidrawModal.css +148 -0
- package/style/lexical/ExcalidrawNode.css +137 -0
- package/style/lexical/Rich.css +11 -76
- package/style/lexical/TableInsertModal.css +112 -0
- package/style/lexical/TableNode.css +287 -0
- package/style/lexical/images/icons/pencil-fill.svg +1 -0
- package/style/lexical/index.css +7 -0
- package/lib/tools/definitions/deleteBlock.js.map +0 -1
- package/lib/tools/operations/deleteBlock.d.ts +0 -52
- package/lib/tools/operations/deleteBlock.js +0 -110
- package/lib/tools/operations/deleteBlock.js.map +0 -1
- package/lib/tools/schemas/deleteBlock.d.ts +0 -10
- package/lib/tools/schemas/deleteBlock.js.map +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AutoIndent Engine
|
|
3
|
+
*
|
|
4
|
+
* Core logic for calculating language-aware code indentation.
|
|
5
|
+
* Processes indent/dedent rules and applies them based on line content.
|
|
6
|
+
*
|
|
7
|
+
* @module autoindent/AutoIndentEngine
|
|
8
|
+
*/
|
|
9
|
+
import type { IndentContext, IndentResult } from './types';
|
|
10
|
+
import { LanguageIndentRegistry } from './LanguageIndentRegistry';
|
|
11
|
+
/**
|
|
12
|
+
* Engine for calculating intelligent code indentation
|
|
13
|
+
*
|
|
14
|
+
* Uses language-specific rules to determine appropriate indentation
|
|
15
|
+
* based on line content and context.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const registry = new LanguageIndentRegistry();
|
|
20
|
+
* const engine = new AutoIndentEngine(registry);
|
|
21
|
+
*
|
|
22
|
+
* const result = engine.calculateIndent({
|
|
23
|
+
* currentLine: 'if x > 0:',
|
|
24
|
+
* language: 'python',
|
|
25
|
+
* currentIndent: 0,
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* console.log(result.spaces); // 4
|
|
29
|
+
* console.log(result.shouldIndent); // true
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class AutoIndentEngine {
|
|
33
|
+
private registry;
|
|
34
|
+
private _debug;
|
|
35
|
+
/**
|
|
36
|
+
* Create a new autoindent engine
|
|
37
|
+
*
|
|
38
|
+
* @param registry - Language configuration registry
|
|
39
|
+
* @param debug - Enable debug logging (currently unused - logging disabled)
|
|
40
|
+
*/
|
|
41
|
+
constructor(registry: LanguageIndentRegistry, debug?: boolean);
|
|
42
|
+
/**
|
|
43
|
+
* Calculate indentation for a new line based on current line context
|
|
44
|
+
*
|
|
45
|
+
* @param context - Indentation context
|
|
46
|
+
* @returns Indent result with spaces and indent/dedent flags
|
|
47
|
+
*/
|
|
48
|
+
calculateIndent(context: IndentContext): IndentResult;
|
|
49
|
+
/**
|
|
50
|
+
* Get tab string for a language (either spaces or actual tab character)
|
|
51
|
+
*
|
|
52
|
+
* @param language - Language identifier
|
|
53
|
+
* @returns String to insert for one tab press
|
|
54
|
+
*/
|
|
55
|
+
getTabString(language: string | null | undefined): string;
|
|
56
|
+
/**
|
|
57
|
+
* Get tab size (number of spaces) for a language
|
|
58
|
+
*
|
|
59
|
+
* @param language - Language identifier
|
|
60
|
+
* @returns Number of spaces per indentation level
|
|
61
|
+
*/
|
|
62
|
+
getTabSize(language: string | null | undefined): number;
|
|
63
|
+
/**
|
|
64
|
+
* Calculate indentation for outdenting (Shift+Tab or dedent)
|
|
65
|
+
*
|
|
66
|
+
* @param currentIndent - Current indentation in spaces
|
|
67
|
+
* @param language - Language identifier
|
|
68
|
+
* @returns New indentation level after outdent
|
|
69
|
+
*/
|
|
70
|
+
calculateOutdent(currentIndent: number, language: string | null | undefined): number;
|
|
71
|
+
/**
|
|
72
|
+
* Get leading whitespace count from a line
|
|
73
|
+
*
|
|
74
|
+
* @param line - Line of text
|
|
75
|
+
* @returns Number of leading whitespace characters (spaces and tabs)
|
|
76
|
+
*/
|
|
77
|
+
private getLeadingWhitespaceCount;
|
|
78
|
+
/**
|
|
79
|
+
* Get leading whitespace string from a line
|
|
80
|
+
*
|
|
81
|
+
* @param line - Line of text
|
|
82
|
+
* @returns Leading whitespace characters
|
|
83
|
+
*/
|
|
84
|
+
getLeadingWhitespace(line: string): string;
|
|
85
|
+
/**
|
|
86
|
+
* Check if a line matches an indent rule
|
|
87
|
+
*
|
|
88
|
+
* @param line - Line of text
|
|
89
|
+
* @param rule - Indent rule to check
|
|
90
|
+
* @returns True if line matches the rule
|
|
91
|
+
*/
|
|
92
|
+
private matchesIndentRule;
|
|
93
|
+
/**
|
|
94
|
+
* Check if a line matches a dedent rule
|
|
95
|
+
*
|
|
96
|
+
* @param line - Line of text
|
|
97
|
+
* @param rule - Dedent rule to check
|
|
98
|
+
* @returns True if line matches the rule
|
|
99
|
+
*/
|
|
100
|
+
private matchesDedentRule;
|
|
101
|
+
/**
|
|
102
|
+
* Normalize indentation to use consistent spacing
|
|
103
|
+
* Converts tabs to spaces based on language config
|
|
104
|
+
*
|
|
105
|
+
* @param line - Line of text
|
|
106
|
+
* @param language - Language identifier
|
|
107
|
+
* @returns Line with normalized indentation
|
|
108
|
+
*/
|
|
109
|
+
normalizeIndentation(line: string, language: string | null | undefined): string;
|
|
110
|
+
}
|
|
111
|
+
export default AutoIndentEngine;
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Engine for calculating intelligent code indentation
|
|
8
|
+
*
|
|
9
|
+
* Uses language-specific rules to determine appropriate indentation
|
|
10
|
+
* based on line content and context.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const registry = new LanguageIndentRegistry();
|
|
15
|
+
* const engine = new AutoIndentEngine(registry);
|
|
16
|
+
*
|
|
17
|
+
* const result = engine.calculateIndent({
|
|
18
|
+
* currentLine: 'if x > 0:',
|
|
19
|
+
* language: 'python',
|
|
20
|
+
* currentIndent: 0,
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* console.log(result.spaces); // 4
|
|
24
|
+
* console.log(result.shouldIndent); // true
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export class AutoIndentEngine {
|
|
28
|
+
registry;
|
|
29
|
+
// @ts-expect-error - Debug field preserved for future use, logging currently disabled
|
|
30
|
+
_debug;
|
|
31
|
+
/**
|
|
32
|
+
* Create a new autoindent engine
|
|
33
|
+
*
|
|
34
|
+
* @param registry - Language configuration registry
|
|
35
|
+
* @param debug - Enable debug logging (currently unused - logging disabled)
|
|
36
|
+
*/
|
|
37
|
+
constructor(registry, debug = false) {
|
|
38
|
+
this.registry = registry;
|
|
39
|
+
this._debug = debug;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Calculate indentation for a new line based on current line context
|
|
43
|
+
*
|
|
44
|
+
* @param context - Indentation context
|
|
45
|
+
* @returns Indent result with spaces and indent/dedent flags
|
|
46
|
+
*/
|
|
47
|
+
calculateIndent(context) {
|
|
48
|
+
const config = this.registry.getConfigOrDefault(context.language);
|
|
49
|
+
// Get base indentation from current line
|
|
50
|
+
const currentLineIndent = this.getLeadingWhitespaceCount(context.currentLine);
|
|
51
|
+
// Start with current indentation
|
|
52
|
+
let resultSpaces = currentLineIndent;
|
|
53
|
+
let shouldIndent = false;
|
|
54
|
+
let shouldDedent = false;
|
|
55
|
+
let triggeredRule;
|
|
56
|
+
// Check indent triggers
|
|
57
|
+
for (const rule of config.indentTriggers) {
|
|
58
|
+
if (this.matchesIndentRule(context.currentLine, rule)) {
|
|
59
|
+
resultSpaces = currentLineIndent + rule.indentAmount;
|
|
60
|
+
shouldIndent = true;
|
|
61
|
+
triggeredRule = rule.name;
|
|
62
|
+
break; // Use first matching rule
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Check dedent triggers (only if no indent trigger matched)
|
|
66
|
+
if (!shouldIndent) {
|
|
67
|
+
for (const rule of config.dedentTriggers) {
|
|
68
|
+
if (this.matchesDedentRule(context.currentLine, rule)) {
|
|
69
|
+
// Note: Dedent triggers indicate that the NEXT line after the current
|
|
70
|
+
// line should be dedented. The current line maintains its indent.
|
|
71
|
+
shouldDedent = true;
|
|
72
|
+
triggeredRule = rule.name;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Apply custom rules
|
|
78
|
+
if (config.customRules) {
|
|
79
|
+
for (const customRule of config.customRules) {
|
|
80
|
+
if (customRule.condition(context.currentLine, context)) {
|
|
81
|
+
resultSpaces = customRule.apply(resultSpaces, context);
|
|
82
|
+
break; // Use first matching custom rule
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Ensure we never go negative
|
|
87
|
+
resultSpaces = Math.max(0, resultSpaces);
|
|
88
|
+
const result = {
|
|
89
|
+
spaces: resultSpaces,
|
|
90
|
+
shouldIndent,
|
|
91
|
+
shouldDedent,
|
|
92
|
+
triggeredRule,
|
|
93
|
+
};
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get tab string for a language (either spaces or actual tab character)
|
|
98
|
+
*
|
|
99
|
+
* @param language - Language identifier
|
|
100
|
+
* @returns String to insert for one tab press
|
|
101
|
+
*/
|
|
102
|
+
getTabString(language) {
|
|
103
|
+
const config = this.registry.getConfigOrDefault(language);
|
|
104
|
+
if (config.useTabs) {
|
|
105
|
+
return '\t';
|
|
106
|
+
}
|
|
107
|
+
return ' '.repeat(config.tabSize);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Get tab size (number of spaces) for a language
|
|
111
|
+
*
|
|
112
|
+
* @param language - Language identifier
|
|
113
|
+
* @returns Number of spaces per indentation level
|
|
114
|
+
*/
|
|
115
|
+
getTabSize(language) {
|
|
116
|
+
const config = this.registry.getConfigOrDefault(language);
|
|
117
|
+
return config.tabSize;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Calculate indentation for outdenting (Shift+Tab or dedent)
|
|
121
|
+
*
|
|
122
|
+
* @param currentIndent - Current indentation in spaces
|
|
123
|
+
* @param language - Language identifier
|
|
124
|
+
* @returns New indentation level after outdent
|
|
125
|
+
*/
|
|
126
|
+
calculateOutdent(currentIndent, language) {
|
|
127
|
+
const config = this.registry.getConfigOrDefault(language);
|
|
128
|
+
const newIndent = currentIndent - config.tabSize;
|
|
129
|
+
return Math.max(0, newIndent);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get leading whitespace count from a line
|
|
133
|
+
*
|
|
134
|
+
* @param line - Line of text
|
|
135
|
+
* @returns Number of leading whitespace characters (spaces and tabs)
|
|
136
|
+
*/
|
|
137
|
+
getLeadingWhitespaceCount(line) {
|
|
138
|
+
const match = line.match(/^[\t ]*/);
|
|
139
|
+
if (!match) {
|
|
140
|
+
return 0;
|
|
141
|
+
}
|
|
142
|
+
const whitespace = match[0];
|
|
143
|
+
let count = 0;
|
|
144
|
+
for (const char of whitespace) {
|
|
145
|
+
if (char === '\t') {
|
|
146
|
+
// Count tab as 4 spaces (or configured tab size)
|
|
147
|
+
// Note: This is a simplification; actual tab width depends on config
|
|
148
|
+
count += 4;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
count += 1;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return count;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get leading whitespace string from a line
|
|
158
|
+
*
|
|
159
|
+
* @param line - Line of text
|
|
160
|
+
* @returns Leading whitespace characters
|
|
161
|
+
*/
|
|
162
|
+
getLeadingWhitespace(line) {
|
|
163
|
+
const match = line.match(/^[\t ]*/);
|
|
164
|
+
return match ? match[0] : '';
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Check if a line matches an indent rule
|
|
168
|
+
*
|
|
169
|
+
* @param line - Line of text
|
|
170
|
+
* @param rule - Indent rule to check
|
|
171
|
+
* @returns True if line matches the rule
|
|
172
|
+
*/
|
|
173
|
+
matchesIndentRule(line, rule) {
|
|
174
|
+
switch (rule.context) {
|
|
175
|
+
case 'line-end':
|
|
176
|
+
return rule.pattern.test(line);
|
|
177
|
+
case 'line-start':
|
|
178
|
+
return rule.pattern.test(line);
|
|
179
|
+
case 'anywhere':
|
|
180
|
+
return rule.pattern.test(line);
|
|
181
|
+
default:
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Check if a line matches a dedent rule
|
|
187
|
+
*
|
|
188
|
+
* @param line - Line of text
|
|
189
|
+
* @param rule - Dedent rule to check
|
|
190
|
+
* @returns True if line matches the rule
|
|
191
|
+
*/
|
|
192
|
+
matchesDedentRule(line, rule) {
|
|
193
|
+
switch (rule.context) {
|
|
194
|
+
case 'line-start':
|
|
195
|
+
return rule.pattern.test(line);
|
|
196
|
+
case 'anywhere':
|
|
197
|
+
return rule.pattern.test(line);
|
|
198
|
+
default:
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Normalize indentation to use consistent spacing
|
|
204
|
+
* Converts tabs to spaces based on language config
|
|
205
|
+
*
|
|
206
|
+
* @param line - Line of text
|
|
207
|
+
* @param language - Language identifier
|
|
208
|
+
* @returns Line with normalized indentation
|
|
209
|
+
*/
|
|
210
|
+
normalizeIndentation(line, language) {
|
|
211
|
+
const config = this.registry.getConfigOrDefault(language);
|
|
212
|
+
if (config.useTabs) {
|
|
213
|
+
// Convert spaces to tabs
|
|
214
|
+
const leadingSpaces = this.getLeadingWhitespace(line);
|
|
215
|
+
const spaceCount = leadingSpaces.length;
|
|
216
|
+
const tabCount = Math.floor(spaceCount / config.tabSize);
|
|
217
|
+
const remainingSpaces = spaceCount % config.tabSize;
|
|
218
|
+
const normalized = '\t'.repeat(tabCount) +
|
|
219
|
+
' '.repeat(remainingSpaces) +
|
|
220
|
+
line.substring(leadingSpaces.length);
|
|
221
|
+
return normalized;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
// Convert tabs to spaces
|
|
225
|
+
const leadingWhitespace = this.getLeadingWhitespace(line);
|
|
226
|
+
const normalized = leadingWhitespace
|
|
227
|
+
.replace(/\t/g, ' '.repeat(config.tabSize))
|
|
228
|
+
.concat(line.substring(leadingWhitespace.length));
|
|
229
|
+
return normalized;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
export default AutoIndentEngine;
|
|
234
|
+
//# sourceMappingURL=AutoIndentEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoIndentEngine.js","sourceRoot":"","sources":["../../src/autoindent/AutoIndentEngine.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmBH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,gBAAgB;IACnB,QAAQ,CAAyB;IACzC,sFAAsF;IAC9E,MAAM,CAAU;IAExB;;;;;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BAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;YAEpD,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;CACF;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Indentation Registry
|
|
3
|
+
*
|
|
4
|
+
* Central registry for managing language-specific indentation configurations.
|
|
5
|
+
* Supports registration, retrieval, and updating of language configs.
|
|
6
|
+
*
|
|
7
|
+
* @module autoindent/LanguageIndentRegistry
|
|
8
|
+
*/
|
|
9
|
+
import type { LanguageIndentConfig, AutoIndentOptions } from './types';
|
|
10
|
+
/**
|
|
11
|
+
* Registry for language indentation configurations
|
|
12
|
+
*
|
|
13
|
+
* Manages a collection of language-specific indent rules and provides
|
|
14
|
+
* methods to register, retrieve, and update configurations.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const registry = new LanguageIndentRegistry();
|
|
19
|
+
* const config = registry.getConfig('python');
|
|
20
|
+
* console.log(config.tabSize); // 4
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class LanguageIndentRegistry {
|
|
24
|
+
private configs;
|
|
25
|
+
private options;
|
|
26
|
+
/**
|
|
27
|
+
* Create a new language indent registry
|
|
28
|
+
*
|
|
29
|
+
* @param options - Configuration options
|
|
30
|
+
*/
|
|
31
|
+
constructor(options?: AutoIndentOptions);
|
|
32
|
+
/**
|
|
33
|
+
* Register default language configurations
|
|
34
|
+
* Currently supports: Python, JavaScript, TypeScript
|
|
35
|
+
*/
|
|
36
|
+
private registerDefaultLanguages;
|
|
37
|
+
/**
|
|
38
|
+
* Register a language configuration
|
|
39
|
+
*
|
|
40
|
+
* @param config - Language indent configuration
|
|
41
|
+
* @throws Error if language already registered (use updateConfig to modify)
|
|
42
|
+
*/
|
|
43
|
+
registerLanguage(config: LanguageIndentConfig): void;
|
|
44
|
+
/**
|
|
45
|
+
* Register a language alias
|
|
46
|
+
* Example: 'py' -> 'python', 'js' -> 'javascript'
|
|
47
|
+
*
|
|
48
|
+
* @param alias - Short alias name
|
|
49
|
+
* @param targetLanguage - Full language name
|
|
50
|
+
*/
|
|
51
|
+
registerAlias(alias: string, targetLanguage: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* Get configuration for a language
|
|
54
|
+
*
|
|
55
|
+
* @param language - Language identifier
|
|
56
|
+
* @returns Language config or undefined if not found
|
|
57
|
+
*/
|
|
58
|
+
getConfig(language: string | null | undefined): LanguageIndentConfig | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Get configuration for a language with fallback to default
|
|
61
|
+
*
|
|
62
|
+
* @param language - Language identifier
|
|
63
|
+
* @returns Language config (never undefined - returns default if not found)
|
|
64
|
+
*/
|
|
65
|
+
getConfigOrDefault(language: string | null | undefined): LanguageIndentConfig;
|
|
66
|
+
/**
|
|
67
|
+
* Create a minimal fallback configuration
|
|
68
|
+
*/
|
|
69
|
+
private createFallbackConfig;
|
|
70
|
+
/**
|
|
71
|
+
* Check if a language is registered
|
|
72
|
+
*
|
|
73
|
+
* @param language - Language identifier
|
|
74
|
+
* @returns True if language has a configuration
|
|
75
|
+
*/
|
|
76
|
+
hasLanguage(language: string | null | undefined): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Update an existing language configuration
|
|
79
|
+
*
|
|
80
|
+
* @param language - Language identifier
|
|
81
|
+
* @param updates - Partial configuration to merge
|
|
82
|
+
* @returns True if update successful, false if language not found
|
|
83
|
+
*/
|
|
84
|
+
updateConfig(language: string, updates: Partial<LanguageIndentConfig>): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Get list of all registered languages
|
|
87
|
+
*
|
|
88
|
+
* @returns Array of language identifiers
|
|
89
|
+
*/
|
|
90
|
+
getRegisteredLanguages(): string[];
|
|
91
|
+
/**
|
|
92
|
+
* Clear all registered configurations
|
|
93
|
+
* Useful for testing
|
|
94
|
+
*/
|
|
95
|
+
clear(): void;
|
|
96
|
+
/**
|
|
97
|
+
* Reset to default configurations
|
|
98
|
+
* Removes custom configs but keeps built-in languages
|
|
99
|
+
*/
|
|
100
|
+
reset(): void;
|
|
101
|
+
}
|
|
102
|
+
export default LanguageIndentRegistry;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
import { pythonIndentConfig } from './languages/python.js';
|
|
7
|
+
import { javascriptIndentConfig, typescriptIndentConfig, } from './languages/javascript.js';
|
|
8
|
+
/**
|
|
9
|
+
* Registry for language indentation configurations
|
|
10
|
+
*
|
|
11
|
+
* Manages a collection of language-specific indent rules and provides
|
|
12
|
+
* methods to register, retrieve, and update configurations.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const registry = new LanguageIndentRegistry();
|
|
17
|
+
* const config = registry.getConfig('python');
|
|
18
|
+
* console.log(config.tabSize); // 4
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export class LanguageIndentRegistry {
|
|
22
|
+
configs;
|
|
23
|
+
options;
|
|
24
|
+
/**
|
|
25
|
+
* Create a new language indent registry
|
|
26
|
+
*
|
|
27
|
+
* @param options - Configuration options
|
|
28
|
+
*/
|
|
29
|
+
constructor(options = {}) {
|
|
30
|
+
this.configs = new Map();
|
|
31
|
+
this.options = {
|
|
32
|
+
defaultLanguage: 'python',
|
|
33
|
+
fallbackTabSize: 4,
|
|
34
|
+
debug: false,
|
|
35
|
+
...options,
|
|
36
|
+
};
|
|
37
|
+
// Register default languages
|
|
38
|
+
this.registerDefaultLanguages();
|
|
39
|
+
// Register any custom configs provided
|
|
40
|
+
if (options.customConfigs) {
|
|
41
|
+
options.customConfigs.forEach(config => this.registerLanguage(config));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Register default language configurations
|
|
46
|
+
* Currently supports: Python, JavaScript, TypeScript
|
|
47
|
+
*/
|
|
48
|
+
registerDefaultLanguages() {
|
|
49
|
+
this.registerLanguage(pythonIndentConfig);
|
|
50
|
+
this.registerLanguage(javascriptIndentConfig);
|
|
51
|
+
this.registerLanguage(typescriptIndentConfig);
|
|
52
|
+
// Add common language aliases
|
|
53
|
+
this.registerAlias('py', 'python');
|
|
54
|
+
this.registerAlias('js', 'javascript');
|
|
55
|
+
this.registerAlias('ts', 'typescript');
|
|
56
|
+
this.registerAlias('jsx', 'javascript');
|
|
57
|
+
this.registerAlias('tsx', 'typescript');
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Register a language configuration
|
|
61
|
+
*
|
|
62
|
+
* @param config - Language indent configuration
|
|
63
|
+
* @throws Error if language already registered (use updateConfig to modify)
|
|
64
|
+
*/
|
|
65
|
+
registerLanguage(config) {
|
|
66
|
+
if (this.configs.has(config.language)) {
|
|
67
|
+
if (this.options.debug) {
|
|
68
|
+
console.warn(`[LanguageIndentRegistry] Language '${config.language}' already registered. Use updateConfig() to modify.`);
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.configs.set(config.language, config);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Register a language alias
|
|
76
|
+
* Example: 'py' -> 'python', 'js' -> 'javascript'
|
|
77
|
+
*
|
|
78
|
+
* @param alias - Short alias name
|
|
79
|
+
* @param targetLanguage - Full language name
|
|
80
|
+
*/
|
|
81
|
+
registerAlias(alias, targetLanguage) {
|
|
82
|
+
const config = this.configs.get(targetLanguage);
|
|
83
|
+
if (config) {
|
|
84
|
+
this.configs.set(alias, config);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get configuration for a language
|
|
89
|
+
*
|
|
90
|
+
* @param language - Language identifier
|
|
91
|
+
* @returns Language config or undefined if not found
|
|
92
|
+
*/
|
|
93
|
+
getConfig(language) {
|
|
94
|
+
if (!language) {
|
|
95
|
+
return this.getConfig(this.options.defaultLanguage);
|
|
96
|
+
}
|
|
97
|
+
// Normalize language name (lowercase, trim)
|
|
98
|
+
const normalized = language.toLowerCase().trim();
|
|
99
|
+
return this.configs.get(normalized);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get configuration for a language with fallback to default
|
|
103
|
+
*
|
|
104
|
+
* @param language - Language identifier
|
|
105
|
+
* @returns Language config (never undefined - returns default if not found)
|
|
106
|
+
*/
|
|
107
|
+
getConfigOrDefault(language) {
|
|
108
|
+
const config = this.getConfig(language);
|
|
109
|
+
if (config) {
|
|
110
|
+
return config;
|
|
111
|
+
}
|
|
112
|
+
// Fallback to default language
|
|
113
|
+
const defaultConfig = this.getConfig(this.options.defaultLanguage);
|
|
114
|
+
if (defaultConfig) {
|
|
115
|
+
if (this.options.debug) {
|
|
116
|
+
console.warn(`[LanguageIndentRegistry] Language '${language}' not found, using default: ${this.options.defaultLanguage}`);
|
|
117
|
+
}
|
|
118
|
+
return defaultConfig;
|
|
119
|
+
}
|
|
120
|
+
// Ultimate fallback: create minimal config
|
|
121
|
+
if (this.options.debug) {
|
|
122
|
+
console.error(`[LanguageIndentRegistry] No config found for '${language}' and default '${this.options.defaultLanguage}' missing!`);
|
|
123
|
+
}
|
|
124
|
+
return this.createFallbackConfig(language || 'unknown');
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Create a minimal fallback configuration
|
|
128
|
+
*/
|
|
129
|
+
createFallbackConfig(language) {
|
|
130
|
+
return {
|
|
131
|
+
language,
|
|
132
|
+
tabSize: this.options.fallbackTabSize || 4,
|
|
133
|
+
useTabs: this.options.preserveTabs || false,
|
|
134
|
+
indentTriggers: [],
|
|
135
|
+
dedentTriggers: [],
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Check if a language is registered
|
|
140
|
+
*
|
|
141
|
+
* @param language - Language identifier
|
|
142
|
+
* @returns True if language has a configuration
|
|
143
|
+
*/
|
|
144
|
+
hasLanguage(language) {
|
|
145
|
+
if (!language) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
const normalized = language.toLowerCase().trim();
|
|
149
|
+
return this.configs.has(normalized);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Update an existing language configuration
|
|
153
|
+
*
|
|
154
|
+
* @param language - Language identifier
|
|
155
|
+
* @param updates - Partial configuration to merge
|
|
156
|
+
* @returns True if update successful, false if language not found
|
|
157
|
+
*/
|
|
158
|
+
updateConfig(language, updates) {
|
|
159
|
+
const normalized = language.toLowerCase().trim();
|
|
160
|
+
const existing = this.configs.get(normalized);
|
|
161
|
+
if (!existing) {
|
|
162
|
+
if (this.options.debug) {
|
|
163
|
+
console.warn(`[LanguageIndentRegistry] Cannot update '${language}' - not registered`);
|
|
164
|
+
}
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
const updated = {
|
|
168
|
+
...existing,
|
|
169
|
+
...updates,
|
|
170
|
+
language: existing.language, // Preserve original language name
|
|
171
|
+
};
|
|
172
|
+
this.configs.set(normalized, updated);
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Get list of all registered languages
|
|
177
|
+
*
|
|
178
|
+
* @returns Array of language identifiers
|
|
179
|
+
*/
|
|
180
|
+
getRegisteredLanguages() {
|
|
181
|
+
return Array.from(this.configs.keys());
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Clear all registered configurations
|
|
185
|
+
* Useful for testing
|
|
186
|
+
*/
|
|
187
|
+
clear() {
|
|
188
|
+
this.configs.clear();
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Reset to default configurations
|
|
192
|
+
* Removes custom configs but keeps built-in languages
|
|
193
|
+
*/
|
|
194
|
+
reset() {
|
|
195
|
+
this.clear();
|
|
196
|
+
this.registerDefaultLanguages();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
export default LanguageIndentRegistry;
|
|
200
|
+
//# sourceMappingURL=LanguageIndentRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LanguageIndentRegistry.js","sourceRoot":"","sources":["../../src/autoindent/LanguageIndentRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,sBAAsB;IACzB,OAAO,CAAoC;IAC3C,OAAO,CAAoB;IAEnC;;;;OAIG;IACH,YAAY,UAA6B,EAAE;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG;YACb,eAAe,EAAE,QAAQ;YACzB,eAAe,EAAE,CAAC;YAClB,KAAK,EAAE,KAAK;YACZ,GAAG,OAAO;SACX,CAAC;QAEF,6BAA6B;QAC7B,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAEhC,uCAAuC;QACvC,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;YAC1B,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED;;;OAGG;IACK,wBAAwB;QAC9B,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;QAC1C,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;QAC9C,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;QAE9C,8BAA8B;QAC9B,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACnC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACvC,IAAI,CAAC,a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