@elice/material-exercise 1.231227.0 → 1.231228.0
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/cjs/components/material-exercise/MaterialExercise.i18n.js +2 -4
- package/cjs/components/material-exercise/MaterialExercise.js +54 -59
- package/cjs/components/material-exercise/MaterialExercise.styled.js +14 -20
- package/cjs/components/material-exercise/MaterialExerciseMobile.js +8 -15
- package/cjs/components/material-exercise/context/ExerciseIntlProvider.js +14 -18
- package/cjs/components/material-exercise/context/ExerciseProvider.js +58 -66
- package/cjs/components/material-exercise/context/ExerciseProviderNoImage.js +19 -24
- package/cjs/components/material-exercise/context/context.js +1 -7
- package/cjs/components/material-exercise/context/locales/noImage.en.json.js +1 -1
- package/cjs/components/material-exercise/context/locales/noImage.ko.json.js +1 -1
- package/cjs/components/material-exercise/context/recoil.js +293 -544
- package/cjs/components/material-exercise/context/recoilTypes.js +0 -2
- package/cjs/components/material-exercise/context/subjects.js +3 -5
- package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +60 -67
- package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.styled.js +8 -14
- package/cjs/components/material-exercise/exercise-code-history/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-code-history/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-file/ExerciseFile.js +17 -21
- package/cjs/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +133 -203
- package/cjs/components/material-exercise/exercise-file-editor/ExerciseFileReadOnlyBanner.js +8 -12
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabs.js +24 -40
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsFileTreeButton.js +38 -52
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.js +5 -9
- package/cjs/components/material-exercise/exercise-file-tabs/locales/fileTreeButton.en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-file-tabs/locales/fileTreeButton.ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTree.js +189 -328
- package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.js +5 -9
- package/cjs/components/material-exercise/exercise-file-tree/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-file-tree/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-file-viewer/ExerciseFileViewer.js +14 -17
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenu.js +11 -15
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuArduinoAgentModalButton.js +7 -11
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +44 -65
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +32 -61
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuReset.js +19 -35
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +48 -62
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.styled.js +12 -18
- package/cjs/components/material-exercise/exercise-menu/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-menu/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +21 -32
- package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js +4 -8
- package/cjs/components/material-exercise/exercise-preview/ExercisePreview.js +23 -27
- package/cjs/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.js +7 -17
- package/cjs/components/material-exercise/exercise-preview/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-preview/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +23 -32
- package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpaneEditorPerference.js +7 -15
- package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpaneEnvironment.js +79 -86
- package/cjs/components/material-exercise/exercise-rightpane/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-rightpane/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-room/ExerciseRoom.js +11 -22
- package/cjs/components/material-exercise/exercise-room/ExerciseRoom.styled.js +12 -20
- package/cjs/components/material-exercise/exercise-room/ExerciseRoomDetail.js +180 -288
- package/cjs/components/material-exercise/exercise-room/ExerciseRoomList.js +82 -116
- package/cjs/components/material-exercise/exercise-room/helpers/exerciseRoomPermissionStringConvertor.js +2 -4
- package/cjs/components/material-exercise/exercise-room/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-room/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunner.js +125 -181
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerContext.js +1 -7
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerController.js +13 -17
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +43 -58
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoStatusMessage.js +15 -27
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerButtonGroup.js +65 -68
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +23 -32
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerRunningInfo.js +58 -92
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusIndicator.js +3 -7
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusMessage.js +11 -16
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerTimer.js +18 -29
- package/cjs/components/material-exercise/exercise-runner/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-runner/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.js +162 -282
- package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.styled.js +8 -14
- package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistoryOutput.js +41 -54
- package/cjs/components/material-exercise/exercise-submit-history/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-submit-history/locales/ko.json.js +1 -1
- package/cjs/components/shared/exercise-menu-button/ExerciseMenuButton.js +15 -21
- package/cjs/components/shared/exercise-shimmer/ExerciseFileShimmer.js +14 -19
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTabShimmer.js +16 -21
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTabsShimmer.js +5 -10
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTreeListItemShimmer.js +18 -23
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTreeListShimmer.js +10 -21
- package/cjs/components/shared/exercise-version-list/ExerciseVersionList.js +5 -8
- package/cjs/components/shared/exercise-version-list/ExerciseVersionList.styled.js +1 -7
- package/cjs/components/shared/exercise-version-list/ExerciseVersionListItem.js +8 -11
- package/cjs/components/shared/exercise-version-list/ExerciseVersionListItem.styled.js +5 -15
- package/cjs/components/shared/file-icon/FileIcon.js +17 -23
- package/cjs/components/shared/file-tabs/FileTab.js +30 -36
- package/cjs/components/shared/file-tabs/FileTab.styled.js +15 -25
- package/cjs/components/shared/file-tabs/FileTabs.js +38 -63
- package/cjs/components/shared/file-tabs/FileTabs.styled.js +2 -8
- package/cjs/components/shared/file-tabs/util.js +14 -29
- package/cjs/components/shared/file-tree/FileTree.js +12 -17
- package/cjs/components/shared/file-tree/FileTreeConfig.js +22 -25
- package/cjs/components/shared/file-tree/FileTreeList.js +37 -39
- package/cjs/components/shared/file-tree/FileTreeListItemContent.js +61 -75
- package/cjs/components/shared/file-tree/FileTreeListItemContent.styled.js +21 -31
- package/cjs/components/shared/file-tree/FileTreeListItemContentInput.js +64 -72
- package/cjs/components/shared/file-tree/FileTreeListItemContentInput.styled.js +6 -12
- package/cjs/components/shared/file-tree/FileTreeListItemContentMenu.js +63 -74
- package/cjs/components/shared/file-tree/FileTreeListItems.js +136 -151
- package/cjs/components/shared/file-tree/FileTreeListItems.styled.js +2 -8
- package/cjs/components/shared/file-tree/FileTreeToolbar.js +31 -32
- package/cjs/components/shared/file-tree/FileTreeToolbar.styled.js +1 -7
- package/cjs/components/shared/file-tree/context/FileTreeContext.js +76 -97
- package/cjs/components/shared/file-tree/locales/en.json.js +1 -1
- package/cjs/components/shared/file-tree/locales/ko.json.js +1 -1
- package/cjs/components/shared/file-tree/utils/fileTreeFiles.js +20 -26
- package/cjs/components/shared/file-tree/utils/fileTreeGenerator.js +146 -195
- package/cjs/components/shared/file-tree/utils/fileTreeInput.js +0 -2
- package/cjs/components/shared/file-tree/utils/fileTreeItem.js +1 -3
- package/cjs/components/shared/file-tree/utils/fileTreePath.js +6 -7
- package/cjs/components/shared/file-viewer/FileViewer.js +37 -61
- package/cjs/components/shared/file-viewer/FileViewerCsv.js +108 -172
- package/cjs/components/shared/file-viewer/FileViewerImage.js +8 -12
- package/cjs/components/shared/file-viewer/FileViewerIpynb.js +10 -23
- package/cjs/components/shared/file-viewer/FileViewerNonViewable.js +33 -42
- package/cjs/components/shared/file-viewer/FileViewerText.js +12 -24
- package/cjs/components/shared/file-viewer/locales/en.json.js +1 -1
- package/cjs/components/shared/file-viewer/locales/ko.json.js +1 -1
- package/cjs/components/shared/file-viewer/locales/nonViewable.en.json.js +1 -1
- package/cjs/components/shared/file-viewer/locales/nonViewable.ko.json.js +1 -1
- package/cjs/components/shared/material-modal/MaterialModal.js +11 -14
- package/cjs/components/shared/material-modal/MaterialModal.styled.js +5 -11
- package/cjs/components/shared/monaco-editor/MonacoEditor.js +74 -99
- package/cjs/components/shared/monaco-editor/MonacoEditorLazy.js +6 -12
- package/cjs/components/shared/monaco-editor/MonacoEditorMobile.js +36 -50
- package/cjs/components/shared/monaco-editor/MonacoEditorPerferenceForm.js +91 -110
- package/cjs/components/shared/monaco-editor/constants/grammars/JSON.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/MagicPython.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/TypeScriptReact.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/asp-vb-net.tmlanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/c.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/cpp.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/csharp.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/css.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/dart.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/fsharp.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/go.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/html.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/index.js +28 -84
- package/cjs/components/shared/monaco-editor/constants/grammars/java.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/lua.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/objective-c.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/php.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/r.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/ruby.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/rust.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/scss.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/sql.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/swift.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/xml.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/yaml.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/monaco/preferences.js +5 -7
- package/cjs/components/shared/monaco-editor/constants/themes/abyss.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/elice.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/index.js +17 -51
- package/cjs/components/shared/monaco-editor/constants/themes/kimbie-dark.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/monokai.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/quietlight.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/red.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/solarized-dark.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/solarized-light.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/tomorrow-night-blue.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-dark-plus.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-dark.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-hc-black.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-hc-light.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-light-plus.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-light.json.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.js +10 -13
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.js +14 -17
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.js +8 -11
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.js +30 -36
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +7 -11
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoTheme.js +6 -8
- package/cjs/components/shared/monaco-editor/editor-languages/css/formatter.js +11 -52
- package/cjs/components/shared/monaco-editor/editor-languages/css/index.js +7 -8
- package/cjs/components/shared/monaco-editor/editor-languages/html/formatter.js +11 -52
- package/cjs/components/shared/monaco-editor/editor-languages/html/index.js +5 -6
- package/cjs/components/shared/monaco-editor/editor-languages/index.js +4 -4
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.js +1 -3
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/express.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/propTypes.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/react.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/formatter.js +11 -56
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/index.js +17 -18
- package/cjs/components/shared/monaco-editor/hooks/useEditorOptions.js +5 -13
- package/cjs/components/shared/monaco-editor/locales/en.json.js +1 -1
- package/cjs/components/shared/monaco-editor/locales/ko.json.js +1 -1
- package/cjs/components/shared/monaco-editor/utils/emmet/abbreviationActions.js +12 -12
- package/cjs/components/shared/monaco-editor/utils/emmet/emmet.js +0 -2
- package/cjs/components/shared/monaco-editor/utils/emmet/registerProvider.js +6 -14
- package/cjs/components/shared/monaco-editor/utils/grammar/index.js +25 -69
- package/cjs/components/shared/monaco-editor/utils/grammar/onigasm.js +6 -27
- package/cjs/components/shared/monaco-editor/utils/grammar/textmate.js +38 -73
- package/cjs/components/shared/monaco-editor/utils/monacoLanguage.js +8 -11
- package/cjs/components/shared/monaco-editor/utils/monacoPreference.js +4 -8
- package/cjs/components/shared/monaco-editor/utils/prettier/config.js +2 -4
- package/cjs/components/shared/monaco-editor/utils/prettier/index.js +8 -46
- package/cjs/components/shared/monaco-editor/utils/theme/convert.js +14 -26
- package/cjs/components/shared/monaco-editor/utils/theme/index.js +3 -24
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursor.js +56 -79
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorManager.js +68 -84
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorWidget.js +93 -122
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +133 -158
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelectionManager.js +92 -106
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/styles.js +2 -4
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/configCompat.js +6 -3
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/data.js +2 -4
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.js +158 -179
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/utils.js +3 -5
- package/cjs/components/shared/no-vnc/NoVnc.js +57 -86
- package/cjs/components/shared/no-vnc/NoVncLazy.js +5 -11
- package/cjs/components/shared/preview-container/PreviewContainer.js +11 -15
- package/cjs/components/shared/web-browser/WebBrowser.js +37 -53
- package/cjs/components/shared/xterm/Xterm.js +58 -81
- package/cjs/components/shared/xterm/XtermLazy.js +5 -11
- package/cjs/components/shared/xterm/locales/en.json.js +1 -1
- package/cjs/components/shared/xterm/locales/ko.json.js +1 -1
- package/cjs/components/shared/xterm/utils/index.js +0 -2
- package/cjs/constants/arduino.js +10 -12
- package/cjs/constants/shortcutKeyMap.js +2 -4
- package/cjs/constants/stylesheets.js +5 -9
- package/cjs/hooks/useArduino.js +141 -284
- package/cjs/hooks/useExerciseFile.js +22 -26
- package/cjs/hooks/useExericseShortcut.js +4 -8
- package/cjs/hooks/useMaterialExerciseFileUrl.js +33 -57
- package/cjs/hooks/useRunnerRoomWebSocket.js +27 -53
- package/cjs/hooks/useStdioTextConcator.js +10 -22
- package/cjs/hooks/useStdioWebSocket.js +28 -34
- package/cjs/hooks/useUsercodeEditWebSocket.js +158 -240
- package/cjs/hooks/useUsercodeHistory.js +63 -117
- package/cjs/index.js +4 -6
- package/cjs/utils/arduino.js +11 -25
- package/cjs/utils/exerciseFile.js +10 -10
- package/cjs/utils/runner.js +15 -31
- package/es/components/material-exercise/MaterialExercise.i18n.js +2 -2
- package/es/components/material-exercise/MaterialExercise.js +34 -35
- package/es/components/material-exercise/MaterialExercise.styled.js +14 -14
- package/es/components/material-exercise/MaterialExerciseMobile.js +6 -9
- package/es/components/material-exercise/context/ExerciseIntlProvider.js +10 -8
- package/es/components/material-exercise/context/ExerciseProvider.js +52 -55
- package/es/components/material-exercise/context/ExerciseProviderNoImage.js +10 -10
- package/es/components/material-exercise/context/context.js +1 -1
- package/es/components/material-exercise/context/recoil.js +290 -535
- package/es/components/material-exercise/context/subjects.js +3 -3
- package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +51 -53
- package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.styled.js +8 -8
- package/es/components/material-exercise/exercise-file/ExerciseFile.js +9 -8
- package/es/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +127 -193
- package/es/components/material-exercise/exercise-file-editor/ExerciseFileReadOnlyBanner.js +5 -4
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabs.js +20 -31
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsFileTreeButton.js +35 -44
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.js +1 -1
- package/es/components/material-exercise/exercise-file-tree/ExerciseFileTree.js +181 -315
- package/es/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.js +1 -1
- package/es/components/material-exercise/exercise-file-viewer/ExerciseFileViewer.js +11 -10
- package/es/components/material-exercise/exercise-menu/ExerciseMenu.js +7 -6
- package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoAgentModalButton.js +3 -3
- package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +25 -42
- package/es/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +26 -51
- package/es/components/material-exercise/exercise-menu/ExerciseMenuReset.js +11 -23
- package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +21 -31
- package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.styled.js +12 -12
- package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +19 -26
- package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js +1 -1
- package/es/components/material-exercise/exercise-preview/ExercisePreview.js +15 -14
- package/es/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.js +5 -11
- package/es/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +11 -15
- package/es/components/material-exercise/exercise-rightpane/ExerciseRightpaneEditorPerference.js +5 -9
- package/es/components/material-exercise/exercise-rightpane/ExerciseRightpaneEnvironment.js +78 -80
- package/es/components/material-exercise/exercise-room/ExerciseRoom.js +6 -13
- package/es/components/material-exercise/exercise-room/ExerciseRoom.styled.js +12 -14
- package/es/components/material-exercise/exercise-room/ExerciseRoomDetail.js +134 -236
- package/es/components/material-exercise/exercise-room/ExerciseRoomList.js +65 -94
- package/es/components/material-exercise/exercise-room/helpers/exerciseRoomPermissionStringConvertor.js +2 -2
- package/es/components/material-exercise/exercise-runner/ExerciseRunner.js +116 -167
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerContext.js +1 -1
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerController.js +8 -7
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +17 -27
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoStatusMessage.js +11 -18
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerButtonGroup.js +52 -50
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +10 -14
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerRunningInfo.js +46 -75
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusIndicator.js +2 -2
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusMessage.js +4 -4
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerTimer.js +15 -21
- package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.js +138 -253
- package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.styled.js +8 -8
- package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistoryOutput.js +29 -37
- package/es/components/shared/exercise-menu-button/ExerciseMenuButton.js +12 -13
- package/es/components/shared/exercise-shimmer/ExerciseFileShimmer.js +2 -2
- package/es/components/shared/exercise-shimmer/ExerciseFileTabShimmer.js +12 -12
- package/es/components/shared/exercise-shimmer/ExerciseFileTabsShimmer.js +2 -2
- package/es/components/shared/exercise-shimmer/ExerciseFileTreeListItemShimmer.js +14 -14
- package/es/components/shared/exercise-shimmer/ExerciseFileTreeListShimmer.js +9 -15
- package/es/components/shared/exercise-version-list/ExerciseVersionList.js +3 -2
- package/es/components/shared/exercise-version-list/ExerciseVersionList.styled.js +1 -1
- package/es/components/shared/exercise-version-list/ExerciseVersionListItem.js +6 -5
- package/es/components/shared/exercise-version-list/ExerciseVersionListItem.styled.js +5 -9
- package/es/components/shared/file-icon/FileIcon.js +15 -17
- package/es/components/shared/file-tabs/FileTab.js +22 -24
- package/es/components/shared/file-tabs/FileTab.styled.js +15 -19
- package/es/components/shared/file-tabs/FileTabs.js +35 -55
- package/es/components/shared/file-tabs/FileTabs.styled.js +2 -2
- package/es/components/shared/file-tabs/util.js +14 -27
- package/es/components/shared/file-tree/FileTree.js +3 -3
- package/es/components/shared/file-tree/FileTreeConfig.js +18 -15
- package/es/components/shared/file-tree/FileTreeList.js +33 -29
- package/es/components/shared/file-tree/FileTreeListItemContent.js +45 -55
- package/es/components/shared/file-tree/FileTreeListItemContent.styled.js +21 -25
- package/es/components/shared/file-tree/FileTreeListItemContentInput.js +60 -64
- package/es/components/shared/file-tree/FileTreeListItemContentInput.styled.js +6 -6
- package/es/components/shared/file-tree/FileTreeListItemContentMenu.js +39 -46
- package/es/components/shared/file-tree/FileTreeListItems.js +134 -145
- package/es/components/shared/file-tree/FileTreeListItems.styled.js +2 -2
- package/es/components/shared/file-tree/FileTreeToolbar.js +25 -22
- package/es/components/shared/file-tree/FileTreeToolbar.styled.js +1 -1
- package/es/components/shared/file-tree/context/FileTreeContext.js +74 -89
- package/es/components/shared/file-tree/utils/fileTreeFiles.js +20 -20
- package/es/components/shared/file-tree/utils/fileTreeGenerator.js +146 -193
- package/es/components/shared/file-tree/utils/fileTreeItem.js +1 -1
- package/es/components/shared/file-tree/utils/fileTreePath.js +6 -5
- package/es/components/shared/file-viewer/FileViewer.js +21 -38
- package/es/components/shared/file-viewer/FileViewerCsv.js +70 -129
- package/es/components/shared/file-viewer/FileViewerImage.js +4 -3
- package/es/components/shared/file-viewer/FileViewerIpynb.js +7 -14
- package/es/components/shared/file-viewer/FileViewerNonViewable.js +15 -18
- package/es/components/shared/file-viewer/FileViewerText.js +9 -17
- package/es/components/shared/material-modal/MaterialModal.js +8 -7
- package/es/components/shared/material-modal/MaterialModal.styled.js +5 -5
- package/es/components/shared/monaco-editor/MonacoEditor.js +67 -87
- package/es/components/shared/monaco-editor/MonacoEditorLazy.js +2 -4
- package/es/components/shared/monaco-editor/MonacoEditorMobile.js +31 -41
- package/es/components/shared/monaco-editor/MonacoEditorPerferenceForm.js +52 -66
- package/es/components/shared/monaco-editor/constants/grammars/index.js +28 -82
- package/es/components/shared/monaco-editor/constants/monaco/preferences.js +5 -5
- package/es/components/shared/monaco-editor/constants/themes/index.js +17 -49
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.js +10 -11
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.js +14 -15
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.js +8 -9
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.js +30 -34
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +7 -9
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoTheme.js +6 -6
- package/es/components/shared/monaco-editor/editor-languages/css/formatter.js +10 -33
- package/es/components/shared/monaco-editor/editor-languages/html/formatter.js +10 -33
- package/es/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.js +1 -1
- package/es/components/shared/monaco-editor/editor-languages/typescript/formatter.js +10 -37
- package/es/components/shared/monaco-editor/editor-languages/typescript/index.js +3 -3
- package/es/components/shared/monaco-editor/hooks/useEditorOptions.js +5 -11
- package/es/components/shared/monaco-editor/utils/emmet/abbreviationActions.js +12 -10
- package/es/components/shared/monaco-editor/utils/emmet/registerProvider.js +6 -12
- package/es/components/shared/monaco-editor/utils/grammar/index.js +24 -68
- package/es/components/shared/monaco-editor/utils/grammar/onigasm.js +6 -25
- package/es/components/shared/monaco-editor/utils/grammar/textmate.js +35 -67
- package/es/components/shared/monaco-editor/utils/monacoLanguage.js +5 -5
- package/es/components/shared/monaco-editor/utils/monacoPreference.js +4 -6
- package/es/components/shared/monaco-editor/utils/prettier/config.js +2 -2
- package/es/components/shared/monaco-editor/utils/prettier/index.js +7 -27
- package/es/components/shared/monaco-editor/utils/theme/convert.js +13 -19
- package/es/components/shared/monaco-editor/utils/theme/index.js +3 -22
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursor.js +56 -77
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorManager.js +68 -82
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorWidget.js +93 -120
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +130 -152
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelectionManager.js +92 -104
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/styles.js +2 -2
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/configCompat.js +6 -1
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/data.js +2 -2
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.js +157 -172
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/utils.js +3 -3
- package/es/components/shared/no-vnc/NoVnc.js +42 -59
- package/es/components/shared/no-vnc/NoVncLazy.js +2 -4
- package/es/components/shared/preview-container/PreviewContainer.js +8 -7
- package/es/components/shared/web-browser/WebBrowser.js +29 -40
- package/es/components/shared/xterm/Xterm.js +51 -69
- package/es/components/shared/xterm/XtermLazy.js +2 -4
- package/es/constants/arduino.js +10 -10
- package/es/constants/shortcutKeyMap.js +1 -3
- package/es/constants/stylesheets.js +5 -7
- package/es/hooks/useArduino.js +141 -278
- package/es/hooks/useExerciseFile.js +22 -24
- package/es/hooks/useExericseShortcut.js +4 -6
- package/es/hooks/useMaterialExerciseFileUrl.js +34 -52
- package/es/hooks/useRunnerRoomWebSocket.js +27 -51
- package/es/hooks/useStdioTextConcator.js +10 -16
- package/es/hooks/useStdioWebSocket.js +28 -32
- package/es/hooks/useUsercodeEditWebSocket.js +157 -232
- package/es/hooks/useUsercodeHistory.js +63 -115
- package/es/utils/arduino.js +11 -23
- package/es/utils/exerciseFile.js +10 -8
- package/es/utils/runner.js +15 -29
- package/package.json +11 -7
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -521
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -499
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
3
|
var expand = require('emmet');
|
|
7
4
|
var data = require('./data.js');
|
|
8
5
|
var configCompat = require('./configCompat.js');
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
/* ====================================================================================================
|
|
8
|
+
* These codes forked and modified from `microsoft/vscode-emmet-helper`
|
|
9
|
+
* under the terms of the MIT license.
|
|
10
|
+
* Make sure to check the original project if any issue exists.
|
|
11
|
+
* - project: https://github.com/microsoft/vscode-emmet-helper
|
|
12
|
+
* - codes: https://github.com/microsoft/vscode-emmet-helper/blob/e64481648451f0189216794979ce2ace82ee8148/src/emmetHelper.ts
|
|
13
|
+
* ==================================================================================================== */
|
|
14
|
+
/* istanbul ignore file */
|
|
15
|
+
/* tslint:disable */
|
|
16
|
+
/* eslint-disable */
|
|
14
17
|
// /* workaround for webpack issue: https://github.com/webpack/webpack/issues/5756
|
|
15
18
|
// @emmetio/extract-abbreviation has a cjs that uses a default export
|
|
16
19
|
// */
|
|
17
20
|
// const extract = typeof _extractAbbreviation === 'function' ? _extractAbbreviation : _extractAbbreviation.default;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const snippetKeyCache = new Map();
|
|
22
|
+
let markupSnippetKeys;
|
|
23
|
+
const stylesheetCustomSnippetsKeyCache = new Map();
|
|
24
|
+
const htmlAbbreviationStartRegex = /^[a-z,A-Z,!,(,[,#,\.\{]/;
|
|
22
25
|
// take off { for jsx because it interferes with the language
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const jsxAbbreviationStartRegex = /^[a-z,A-Z,!,(,[,#,\.]/;
|
|
27
|
+
const cssAbbreviationRegex = /^-?[a-z,A-Z,!,@,#]/;
|
|
28
|
+
const htmlAbbreviationRegex = /[a-z,A-Z\.]/;
|
|
29
|
+
const commonlyUsedTags = [...data.htmlData.tags, 'lorem'];
|
|
30
|
+
const bemFilterSuffix = 'bem';
|
|
31
|
+
const filterDelimitor = '|';
|
|
32
|
+
const trimFilterSuffix = 't';
|
|
33
|
+
const commentFilterSuffix = 'c';
|
|
34
|
+
const maxFilters = 3;
|
|
32
35
|
/**
|
|
33
36
|
* Returns all applicable emmet expansions for abbreviation at given position in a CompletionList
|
|
34
37
|
*/
|
|
@@ -37,45 +40,47 @@ function doComplete(_monaco, model, position, syntax, emmetConfig) {
|
|
|
37
40
|
if (emmetConfig.showExpandedAbbreviation === 'never' || !getEmmetMode(syntax, emmetConfig.excludeLanguages)) {
|
|
38
41
|
return;
|
|
39
42
|
}
|
|
40
|
-
|
|
43
|
+
const isStyleSheetRes = isStyleSheet(syntax);
|
|
41
44
|
// Fetch markupSnippets so that we can provide possible abbreviation completions
|
|
42
45
|
// For example, when text at position is `a`, completions should return `a:blank`, `a:link`, `acr` etc.
|
|
43
46
|
if (!isStyleSheetRes) {
|
|
44
47
|
if (!snippetKeyCache.has(syntax)) {
|
|
45
|
-
|
|
48
|
+
const registry = (_a = customSnippetsRegistry[syntax]) !== null && _a !== void 0 ? _a : getDefaultSnippets(syntax);
|
|
46
49
|
snippetKeyCache.set(syntax, Object.keys(registry));
|
|
47
50
|
}
|
|
48
51
|
markupSnippetKeys = (_b = snippetKeyCache.get(syntax)) !== null && _b !== void 0 ? _b : [];
|
|
49
52
|
}
|
|
50
|
-
|
|
53
|
+
const extractOptions = {
|
|
51
54
|
lookAhead: !isStyleSheetRes,
|
|
52
55
|
type: isStyleSheetRes ? 'stylesheet' : 'markup'
|
|
53
56
|
};
|
|
54
|
-
|
|
57
|
+
const extractedValue = extractAbbreviation(_monaco, model, position, extractOptions);
|
|
55
58
|
if (!extractedValue) {
|
|
56
59
|
return;
|
|
57
60
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
const {
|
|
62
|
+
abbreviationRange,
|
|
63
|
+
abbreviation,
|
|
64
|
+
filter
|
|
65
|
+
} = extractedValue;
|
|
66
|
+
const currentLineTillPosition = getCurrentLine(model, position).substr(0, position.column - 1);
|
|
67
|
+
const currentWord = getCurrentWord(currentLineTillPosition);
|
|
63
68
|
// Don't attempt to expand open tags
|
|
64
|
-
if (currentWord === abbreviation && currentLineTillPosition.endsWith(
|
|
69
|
+
if (currentWord === abbreviation && currentLineTillPosition.endsWith(`<${abbreviation}`) && configCompat.syntaxes.markup.includes(syntax)) {
|
|
65
70
|
return;
|
|
66
71
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
const expandOptions = getExpandOptions(syntax, emmetConfig, filter);
|
|
73
|
+
let expandedText = "";
|
|
74
|
+
let expandedAbbr;
|
|
75
|
+
let completionItems = [];
|
|
71
76
|
// Create completion item after expanding given abbreviation
|
|
72
77
|
// if abbreviation is valid and expanded value is not noise
|
|
73
|
-
|
|
78
|
+
const createExpandedAbbr = (syntax, abbr) => {
|
|
74
79
|
if (!isAbbreviationValid(syntax, abbreviation)) {
|
|
75
80
|
return;
|
|
76
81
|
}
|
|
77
82
|
try {
|
|
78
|
-
expandedText =
|
|
83
|
+
expandedText = expand(abbr, expandOptions);
|
|
79
84
|
// manually patch https://github.com/microsoft/vscode/issues/120245 for now
|
|
80
85
|
if (isStyleSheetRes && '!important'.startsWith(abbr)) {
|
|
81
86
|
expandedText = '!important';
|
|
@@ -98,9 +103,7 @@ function doComplete(_monaco, model, position, syntax, emmetConfig) {
|
|
|
98
103
|
if (isStyleSheet(syntax)) {
|
|
99
104
|
createExpandedAbbr(syntax, abbreviation);
|
|
100
105
|
// When abbr is longer than usual emmet snippets and matches better with existing css property, then no emmet
|
|
101
|
-
if (abbreviation.length > 4 && data.cssData.properties.find(
|
|
102
|
-
return x.startsWith(abbreviation);
|
|
103
|
-
})) {
|
|
106
|
+
if (abbreviation.length > 4 && data.cssData.properties.find(x => x.startsWith(abbreviation))) {
|
|
104
107
|
return {
|
|
105
108
|
suggestions: [],
|
|
106
109
|
incomplete: true
|
|
@@ -113,17 +116,13 @@ function doComplete(_monaco, model, position, syntax, emmetConfig) {
|
|
|
113
116
|
expandedAbbr.label = removeTabStops(expandedText);
|
|
114
117
|
expandedAbbr.filterText = abbreviation;
|
|
115
118
|
// Custom snippets should show up in completions if abbreviation is a prefix
|
|
116
|
-
|
|
119
|
+
const stylesheetCustomSnippetsKeys = stylesheetCustomSnippetsKeyCache.has(syntax) ? stylesheetCustomSnippetsKeyCache.get(syntax) : stylesheetCustomSnippetsKeyCache.get('css');
|
|
117
120
|
completionItems = makeSnippetSuggestion(_monaco, stylesheetCustomSnippetsKeys !== null && stylesheetCustomSnippetsKeys !== void 0 ? stylesheetCustomSnippetsKeys : [], abbreviation, abbreviation, abbreviationRange, expandOptions, 'Emmet Custom Snippet', false);
|
|
118
|
-
if (!completionItems.find(
|
|
119
|
-
return x.insertText === (expandedAbbr === null || expandedAbbr === void 0 ? void 0 : expandedAbbr.insertText);
|
|
120
|
-
})) {
|
|
121
|
+
if (!completionItems.find(x => x.insertText === (expandedAbbr === null || expandedAbbr === void 0 ? void 0 : expandedAbbr.insertText))) {
|
|
121
122
|
// Fix for https://github.com/Microsoft/vscode/issues/28933#issuecomment-309236902
|
|
122
123
|
// When user types in propertyname, emmet uses it to match with snippet names, resulting in width -> widows or font-family -> font: family
|
|
123
124
|
// Filter out those cases here.
|
|
124
|
-
|
|
125
|
-
return x === '$' || x === '+' ? '\\' + x : x;
|
|
126
|
-
}).join('.*') + '.*', 'i');
|
|
125
|
+
const abbrRegex = new RegExp('.*' + abbreviation.split('').map(x => x === '$' || x === '+' ? '\\' + x : x).join('.*') + '.*', 'i');
|
|
127
126
|
if (/\d/.test(abbreviation) || abbrRegex.test(expandedAbbr.label)) {
|
|
128
127
|
completionItems.push(expandedAbbr);
|
|
129
128
|
}
|
|
@@ -131,23 +130,21 @@ function doComplete(_monaco, model, position, syntax, emmetConfig) {
|
|
|
131
130
|
}
|
|
132
131
|
} else {
|
|
133
132
|
createExpandedAbbr(syntax, abbreviation);
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
let tagToFindMoreSuggestionsFor = abbreviation;
|
|
134
|
+
const newTagMatches = /(>|\+)([\w:-]+)$/.exec(abbreviation);
|
|
136
135
|
if (newTagMatches && newTagMatches.length === 3) {
|
|
137
136
|
tagToFindMoreSuggestionsFor = newTagMatches[2];
|
|
138
137
|
}
|
|
139
138
|
if (syntax !== 'xml') {
|
|
140
|
-
|
|
139
|
+
const commonlyUsedTagSuggestions = makeSnippetSuggestion(_monaco, commonlyUsedTags, tagToFindMoreSuggestionsFor, abbreviation, abbreviationRange, expandOptions, 'Emmet Abbreviation');
|
|
141
140
|
completionItems = completionItems.concat(commonlyUsedTagSuggestions);
|
|
142
141
|
}
|
|
143
142
|
if (emmetConfig.showAbbreviationSuggestions === true) {
|
|
144
|
-
|
|
145
|
-
return !commonlyUsedTags.includes(x);
|
|
146
|
-
}), tagToFindMoreSuggestionsFor, abbreviation, abbreviationRange, expandOptions, 'Emmet Abbreviation');
|
|
143
|
+
const abbreviationSuggestions = makeSnippetSuggestion(_monaco, markupSnippetKeys.filter(x => !commonlyUsedTags.includes(x)), tagToFindMoreSuggestionsFor, abbreviation, abbreviationRange, expandOptions, 'Emmet Abbreviation');
|
|
147
144
|
// Workaround for the main expanded abbr not appearing before the snippet suggestions
|
|
148
145
|
if (expandedAbbr && abbreviationSuggestions.length > 0 && tagToFindMoreSuggestionsFor !== abbreviation) {
|
|
149
146
|
expandedAbbr.sortText = '0' + expandedAbbr.label;
|
|
150
|
-
abbreviationSuggestions.forEach(
|
|
147
|
+
abbreviationSuggestions.forEach(item => {
|
|
151
148
|
// Workaround for snippet suggestions items getting filtered out as the complete abbr does not start with snippetKey
|
|
152
149
|
item.filterText = abbreviation;
|
|
153
150
|
// Workaround for the main expanded abbr not appearing before the snippet suggestions
|
|
@@ -157,16 +154,12 @@ function doComplete(_monaco, model, position, syntax, emmetConfig) {
|
|
|
157
154
|
completionItems = completionItems.concat(abbreviationSuggestions);
|
|
158
155
|
}
|
|
159
156
|
// https://github.com/microsoft/vscode/issues/66680
|
|
160
|
-
if (syntax === 'html' && completionItems.length >= 2 && abbreviation.includes(":") && (expandedAbbr === null || expandedAbbr === void 0 ? void 0 : expandedAbbr.insertText) ===
|
|
161
|
-
completionItems = completionItems.filter(
|
|
162
|
-
return item.label !== abbreviation;
|
|
163
|
-
});
|
|
157
|
+
if (syntax === 'html' && completionItems.length >= 2 && abbreviation.includes(":") && (expandedAbbr === null || expandedAbbr === void 0 ? void 0 : expandedAbbr.insertText) === `<${abbreviation}>\${0}</${abbreviation}>`) {
|
|
158
|
+
completionItems = completionItems.filter(item => item.label !== abbreviation);
|
|
164
159
|
}
|
|
165
160
|
}
|
|
166
161
|
if (emmetConfig.showSuggestionsAsSnippets === true) {
|
|
167
|
-
completionItems.forEach(
|
|
168
|
-
return x.kind = _monaco.languages.CompletionItemKind.Snippet;
|
|
169
|
-
});
|
|
162
|
+
completionItems.forEach(x => x.kind = _monaco.languages.CompletionItemKind.Snippet);
|
|
170
163
|
}
|
|
171
164
|
return completionItems.length ? {
|
|
172
165
|
suggestions: completionItems,
|
|
@@ -176,25 +169,24 @@ function doComplete(_monaco, model, position, syntax, emmetConfig) {
|
|
|
176
169
|
/**
|
|
177
170
|
* Create & return snippets for snippet keys that start with given prefix
|
|
178
171
|
*/
|
|
179
|
-
function makeSnippetSuggestion(_monaco, snippetKeys, prefix, abbreviation, abbreviationRange, expandOptions, snippetDetail) {
|
|
180
|
-
var skipFullMatch = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
|
|
172
|
+
function makeSnippetSuggestion(_monaco, snippetKeys, prefix, abbreviation, abbreviationRange, expandOptions, snippetDetail, skipFullMatch = true) {
|
|
181
173
|
if (!prefix || !snippetKeys) {
|
|
182
174
|
return [];
|
|
183
175
|
}
|
|
184
|
-
|
|
185
|
-
snippetKeys.forEach(
|
|
176
|
+
const snippetCompletions = [];
|
|
177
|
+
snippetKeys.forEach(snippetKey => {
|
|
186
178
|
if (!snippetKey.startsWith(prefix.toLowerCase()) || skipFullMatch && snippetKey === prefix.toLowerCase()) {
|
|
187
179
|
return;
|
|
188
180
|
}
|
|
189
|
-
|
|
190
|
-
|
|
181
|
+
const currentAbbr = abbreviation + snippetKey.substr(prefix.length);
|
|
182
|
+
let expandedAbbr;
|
|
191
183
|
try {
|
|
192
|
-
expandedAbbr =
|
|
184
|
+
expandedAbbr = expand(currentAbbr, expandOptions);
|
|
193
185
|
} catch (e) {}
|
|
194
186
|
if (!expandedAbbr) {
|
|
195
187
|
return;
|
|
196
188
|
}
|
|
197
|
-
|
|
189
|
+
const item = {
|
|
198
190
|
kind: _monaco.languages.CompletionItemKind.Property,
|
|
199
191
|
label: prefix + snippetKey.substr(prefix.length),
|
|
200
192
|
documentation: replaceTabStopsWithCursors(expandedAbbr),
|
|
@@ -209,7 +201,7 @@ function makeSnippetSuggestion(_monaco, snippetKeys, prefix, abbreviation, abbre
|
|
|
209
201
|
}
|
|
210
202
|
function getCurrentWord(currentLineTillPosition) {
|
|
211
203
|
if (currentLineTillPosition) {
|
|
212
|
-
|
|
204
|
+
const matches = /[\w,:,-,\.]*$/.exec(currentLineTillPosition);
|
|
213
205
|
if (matches) {
|
|
214
206
|
return matches[0];
|
|
215
207
|
}
|
|
@@ -228,12 +220,12 @@ function addFinalTabStop(text) {
|
|
|
228
220
|
if (!text || !text.trim()) {
|
|
229
221
|
return text;
|
|
230
222
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
223
|
+
let maxTabStop = -1;
|
|
224
|
+
let maxTabStopRanges = [];
|
|
225
|
+
let foundLastStop = false;
|
|
226
|
+
let replaceWithLastStop = false;
|
|
227
|
+
let i = 0;
|
|
228
|
+
const n = text.length;
|
|
237
229
|
try {
|
|
238
230
|
while (i < n && !foundLastStop) {
|
|
239
231
|
// Look for ${
|
|
@@ -241,8 +233,8 @@ function addFinalTabStop(text) {
|
|
|
241
233
|
continue;
|
|
242
234
|
}
|
|
243
235
|
// Find tabstop
|
|
244
|
-
|
|
245
|
-
|
|
236
|
+
let numberStart = -1;
|
|
237
|
+
let numberEnd = -1;
|
|
246
238
|
while (i < n && /\d/.test(text[i])) {
|
|
247
239
|
numberStart = numberStart < 0 ? i : numberStart;
|
|
248
240
|
numberEnd = i + 1;
|
|
@@ -253,12 +245,12 @@ function addFinalTabStop(text) {
|
|
|
253
245
|
continue;
|
|
254
246
|
}
|
|
255
247
|
// If ${0} was found, then break
|
|
256
|
-
|
|
248
|
+
const currentTabStop = text.substring(numberStart, numberEnd);
|
|
257
249
|
foundLastStop = currentTabStop === '0';
|
|
258
250
|
if (foundLastStop) {
|
|
259
251
|
break;
|
|
260
252
|
}
|
|
261
|
-
|
|
253
|
+
let foundPlaceholder = false;
|
|
262
254
|
if (text[i++] == ':') {
|
|
263
255
|
// TODO: Nested placeholders may break here
|
|
264
256
|
while (i < n) {
|
|
@@ -273,37 +265,35 @@ function addFinalTabStop(text) {
|
|
|
273
265
|
if (Number(currentTabStop) > Number(maxTabStop)) {
|
|
274
266
|
maxTabStop = Number(currentTabStop);
|
|
275
267
|
maxTabStopRanges = [{
|
|
276
|
-
numberStart
|
|
277
|
-
numberEnd
|
|
268
|
+
numberStart,
|
|
269
|
+
numberEnd
|
|
278
270
|
}];
|
|
279
271
|
replaceWithLastStop = !foundPlaceholder;
|
|
280
272
|
} else if (Number(currentTabStop) === maxTabStop) {
|
|
281
273
|
maxTabStopRanges.push({
|
|
282
|
-
numberStart
|
|
283
|
-
numberEnd
|
|
274
|
+
numberStart,
|
|
275
|
+
numberEnd
|
|
284
276
|
});
|
|
285
277
|
}
|
|
286
278
|
}
|
|
287
279
|
} catch (e) {}
|
|
288
280
|
if (replaceWithLastStop && !foundLastStop) {
|
|
289
|
-
for (
|
|
290
|
-
|
|
291
|
-
|
|
281
|
+
for (let i = 0; i < maxTabStopRanges.length; i++) {
|
|
282
|
+
const rangeStart = maxTabStopRanges[i].numberStart;
|
|
283
|
+
const rangeEnd = maxTabStopRanges[i].numberEnd;
|
|
292
284
|
text = text.substr(0, rangeStart) + '0' + text.substr(rangeEnd);
|
|
293
285
|
}
|
|
294
286
|
}
|
|
295
287
|
return text;
|
|
296
288
|
}
|
|
297
289
|
function getCurrentLine(model, position) {
|
|
298
|
-
|
|
290
|
+
const currentLine = model.getLineContent(position.lineNumber);
|
|
299
291
|
return currentLine;
|
|
300
292
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
return "${".concat(index).concat(placeholder ? ':' + placeholder : '', "}");
|
|
306
|
-
};
|
|
293
|
+
let customSnippetsRegistry = {};
|
|
294
|
+
let variablesFromFile = {};
|
|
295
|
+
let profilesFromFile = {};
|
|
296
|
+
const emmetSnippetField = (index, placeholder) => `\${${index}${placeholder ? ':' + placeholder : ''}}`;
|
|
307
297
|
/** Returns whether or not syntax is a supported stylesheet syntax, like CSS */
|
|
308
298
|
function isStyleSheet(syntax) {
|
|
309
299
|
return configCompat.syntaxes.stylesheet.includes(syntax);
|
|
@@ -318,26 +308,26 @@ function getDefaultSyntax(syntax) {
|
|
|
318
308
|
}
|
|
319
309
|
/** Returns the default snippets that Emmet suggests */
|
|
320
310
|
function getDefaultSnippets(syntax) {
|
|
321
|
-
|
|
322
|
-
|
|
311
|
+
const syntaxType = getSyntaxType(syntax);
|
|
312
|
+
const emptyUserConfig = {
|
|
323
313
|
type: syntaxType,
|
|
324
|
-
syntax
|
|
314
|
+
syntax
|
|
325
315
|
};
|
|
326
|
-
|
|
316
|
+
const resolvedConfig = expand.resolveConfig(emptyUserConfig);
|
|
327
317
|
// https://github.com/microsoft/vscode/issues/97632
|
|
328
318
|
// don't return markup (HTML) snippets for XML
|
|
329
319
|
return syntax === 'xml' ? {} : resolvedConfig.snippets;
|
|
330
320
|
}
|
|
331
321
|
function getFilters(text, pos) {
|
|
332
|
-
|
|
333
|
-
for (
|
|
334
|
-
if (text.endsWith(
|
|
322
|
+
let filter;
|
|
323
|
+
for (let i = 0; i < maxFilters; i++) {
|
|
324
|
+
if (text.endsWith(`${filterDelimitor}${bemFilterSuffix}`, pos)) {
|
|
335
325
|
pos -= bemFilterSuffix.length + 1;
|
|
336
326
|
filter = filter ? bemFilterSuffix + ',' + filter : bemFilterSuffix;
|
|
337
|
-
} else if (text.endsWith(
|
|
327
|
+
} else if (text.endsWith(`${filterDelimitor}${commentFilterSuffix}`, pos)) {
|
|
338
328
|
pos -= commentFilterSuffix.length + 1;
|
|
339
329
|
filter = filter ? commentFilterSuffix + ',' + filter : commentFilterSuffix;
|
|
340
|
-
} else if (text.endsWith(
|
|
330
|
+
} else if (text.endsWith(`${filterDelimitor}${trimFilterSuffix}`, pos)) {
|
|
341
331
|
pos -= trimFilterSuffix.length + 1;
|
|
342
332
|
filter = filter ? trimFilterSuffix + ',' + filter : trimFilterSuffix;
|
|
343
333
|
} else {
|
|
@@ -353,21 +343,22 @@ function getFilters(text, pos) {
|
|
|
353
343
|
* Extracts abbreviation from the given position in the given document
|
|
354
344
|
*/
|
|
355
345
|
function extractAbbreviation(_monaco, model, position, options) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
pos
|
|
360
|
-
filter
|
|
361
|
-
|
|
362
|
-
|
|
346
|
+
const currentLine = model.getLineContent(position.lineNumber);
|
|
347
|
+
const currentLineTillPosition = currentLine.substr(0, position.column - 1);
|
|
348
|
+
const {
|
|
349
|
+
pos,
|
|
350
|
+
filter
|
|
351
|
+
} = getFilters(currentLineTillPosition, position.column - 1);
|
|
352
|
+
const lengthOccupiedByFilter = filter ? filter.length + 1 : 0;
|
|
353
|
+
const result = expand.extract(currentLine, pos, options);
|
|
363
354
|
if (!result) {
|
|
364
355
|
return;
|
|
365
356
|
}
|
|
366
|
-
|
|
357
|
+
const rangeToReplace = new _monaco.Range(position.lineNumber, result.location + 1, position.lineNumber, result.location + result.abbreviation.length + lengthOccupiedByFilter + 1);
|
|
367
358
|
return {
|
|
368
359
|
abbreviationRange: rangeToReplace,
|
|
369
360
|
abbreviation: result.abbreviation,
|
|
370
|
-
filter
|
|
361
|
+
filter
|
|
371
362
|
};
|
|
372
363
|
}
|
|
373
364
|
/**
|
|
@@ -383,7 +374,7 @@ function isAbbreviationValid(syntax, abbreviation) {
|
|
|
383
374
|
if (isStyleSheet(syntax)) {
|
|
384
375
|
if (abbreviation.includes('#')) {
|
|
385
376
|
if (abbreviation.startsWith('#')) {
|
|
386
|
-
|
|
377
|
+
const hexColorRegex = /^#[\d,a-f,A-F]{1,6}$/;
|
|
387
378
|
return hexColorRegex.test(abbreviation);
|
|
388
379
|
} else if (commonlyUsedTags.includes(abbreviation.substring(0, abbreviation.indexOf('#')))) {
|
|
389
380
|
return false;
|
|
@@ -409,18 +400,16 @@ function isExpandedTextNoise(syntax, abbreviation, expandedText, options) {
|
|
|
409
400
|
// Unresolved css abbreviations get expanded to a blank property value
|
|
410
401
|
// Eg: abc -> abc: ; or abc:d -> abc: d; which is noise if it gets suggested for every word typed
|
|
411
402
|
if (isStyleSheet(syntax) && options) {
|
|
412
|
-
|
|
413
|
-
|
|
403
|
+
const between = (_a = options['stylesheet.between']) !== null && _a !== void 0 ? _a : ': ';
|
|
404
|
+
const after = (_b = options['stylesheet.after']) !== null && _b !== void 0 ? _b : ';';
|
|
414
405
|
// Remove overlapping between `abbreviation` and `between`, if any
|
|
415
|
-
|
|
406
|
+
let endPrefixIndex = abbreviation.indexOf(between[0], Math.max(abbreviation.length - between.length, 0));
|
|
416
407
|
endPrefixIndex = endPrefixIndex >= 0 ? endPrefixIndex : abbreviation.length;
|
|
417
|
-
|
|
418
|
-
return expandedText ===
|
|
408
|
+
const abbr = abbreviation.substring(0, endPrefixIndex);
|
|
409
|
+
return expandedText === `${abbr}${between}\${0}${after}` || expandedText.replace(/\s/g, '') === abbreviation.replace(/\s/g, '') + after;
|
|
419
410
|
}
|
|
420
411
|
// we don't want common html tags suggested for xml
|
|
421
|
-
if (syntax === 'xml' && commonlyUsedTags.some(
|
|
422
|
-
return tag.startsWith(abbreviation.toLowerCase());
|
|
423
|
-
})) {
|
|
412
|
+
if (syntax === 'xml' && commonlyUsedTags.some(tag => tag.startsWith(abbreviation.toLowerCase()))) {
|
|
424
413
|
return true;
|
|
425
414
|
}
|
|
426
415
|
if (commonlyUsedTags.includes(abbreviation.toLowerCase()) || markupSnippetKeys.includes(abbreviation)) {
|
|
@@ -438,7 +427,7 @@ function isExpandedTextNoise(syntax, abbreviation, expandedText, options) {
|
|
|
438
427
|
if (abbreviation === '.') {
|
|
439
428
|
return false;
|
|
440
429
|
}
|
|
441
|
-
|
|
430
|
+
const dotMatches = /^([a-z,A-Z,\d]*)\.$/.exec(abbreviation);
|
|
442
431
|
if (dotMatches) {
|
|
443
432
|
// Valid html tags such as `div.`
|
|
444
433
|
if (dotMatches[1] && data.htmlData.tags.includes(dotMatches[1])) {
|
|
@@ -454,7 +443,7 @@ function isExpandedTextNoise(syntax, abbreviation, expandedText, options) {
|
|
|
454
443
|
}
|
|
455
444
|
// Unresolved html abbreviations get expanded as if it were a tag
|
|
456
445
|
// Eg: abc -> <abc></abc> which is noise if it gets suggested for every word typed
|
|
457
|
-
return expandedText.toLowerCase() ===
|
|
446
|
+
return expandedText.toLowerCase() === `<${abbreviation.toLowerCase()}>\${1}</${abbreviation.toLowerCase()}>`;
|
|
458
447
|
}
|
|
459
448
|
/**
|
|
460
449
|
* Returns options to be used by emmet
|
|
@@ -463,26 +452,20 @@ function getExpandOptions(syntax, emmetConfig, filter) {
|
|
|
463
452
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
464
453
|
emmetConfig = emmetConfig !== null && emmetConfig !== void 0 ? emmetConfig : {};
|
|
465
454
|
emmetConfig['preferences'] = (_a = emmetConfig['preferences']) !== null && _a !== void 0 ? _a : {};
|
|
466
|
-
|
|
467
|
-
|
|
455
|
+
const preferences = emmetConfig['preferences'];
|
|
456
|
+
const stylesheetSyntax = isStyleSheet(syntax) ? syntax : 'css';
|
|
468
457
|
// Fetch Profile
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
var bemEnabled = filter && filter.split(',').some(function (x) {
|
|
475
|
-
return x.trim() === 'bem';
|
|
476
|
-
}) || trimmedFilters.includes('bem');
|
|
477
|
-
var commentEnabled = filter && filter.split(',').some(function (x) {
|
|
478
|
-
return x.trim() === 'c';
|
|
479
|
-
}) || trimmedFilters.includes('c');
|
|
458
|
+
const profile = getProfile(syntax, (_b = emmetConfig['syntaxProfiles']) !== null && _b !== void 0 ? _b : {});
|
|
459
|
+
const filtersFromProfile = profile && profile['filters'] ? profile['filters'].split(',') : [];
|
|
460
|
+
const trimmedFilters = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
|
|
461
|
+
const bemEnabled = filter && filter.split(',').some(x => x.trim() === 'bem') || trimmedFilters.includes('bem');
|
|
462
|
+
const commentEnabled = filter && filter.split(',').some(x => x.trim() === 'c') || trimmedFilters.includes('c');
|
|
480
463
|
// Fetch formatters
|
|
481
|
-
|
|
482
|
-
|
|
464
|
+
const formatters = getFormatters(syntax, emmetConfig['preferences']);
|
|
465
|
+
const unitAliases = (formatters === null || formatters === void 0 ? void 0 : formatters.stylesheet) && formatters.stylesheet['unitAliases'] || {};
|
|
483
466
|
// These options are the default values provided by vscode for
|
|
484
467
|
// extension preferences
|
|
485
|
-
|
|
468
|
+
const defaultVSCodeOptions = {
|
|
486
469
|
// inlineElements: string[],
|
|
487
470
|
// 'output.indent': string,
|
|
488
471
|
// 'output.baseIndent': string,
|
|
@@ -528,7 +511,7 @@ function getExpandOptions(syntax, emmetConfig, filter) {
|
|
|
528
511
|
'stylesheet.fuzzySearchMinScore': 0.3
|
|
529
512
|
};
|
|
530
513
|
// These options come from user prefs in the vscode repo
|
|
531
|
-
|
|
514
|
+
const userPreferenceOptions = {
|
|
532
515
|
// inlineElements: string[],
|
|
533
516
|
// 'output.indent': string,
|
|
534
517
|
// 'output.baseIndent': string,
|
|
@@ -559,8 +542,8 @@ function getExpandOptions(syntax, emmetConfig, filter) {
|
|
|
559
542
|
// 'stylesheet.keywords': string[],
|
|
560
543
|
// 'stylesheet.unitless': string[],
|
|
561
544
|
'stylesheet.shortHex': preferences['css.color.short'],
|
|
562
|
-
'stylesheet.between': preferences[
|
|
563
|
-
'stylesheet.after': preferences[
|
|
545
|
+
'stylesheet.between': preferences[`${stylesheetSyntax}.valueSeparator`],
|
|
546
|
+
'stylesheet.after': preferences[`${stylesheetSyntax}.propertyEnd`],
|
|
564
547
|
'stylesheet.intUnit': preferences['css.intUnit'],
|
|
565
548
|
'stylesheet.floatUnit': preferences['css.floatUnit'],
|
|
566
549
|
'stylesheet.unitAliases': unitAliases,
|
|
@@ -568,24 +551,24 @@ function getExpandOptions(syntax, emmetConfig, filter) {
|
|
|
568
551
|
// 'stylesheet.jsonDoubleQuotes': boolean,
|
|
569
552
|
'stylesheet.fuzzySearchMinScore': preferences['css.fuzzySearchMinScore']
|
|
570
553
|
};
|
|
571
|
-
|
|
572
|
-
[
|
|
554
|
+
const combinedOptions = {};
|
|
555
|
+
[...Object.keys(defaultVSCodeOptions), ...Object.keys(userPreferenceOptions)].forEach(key => {
|
|
573
556
|
var _a;
|
|
574
|
-
|
|
557
|
+
const castKey = key;
|
|
575
558
|
combinedOptions[castKey] = (_a = userPreferenceOptions[castKey]) !== null && _a !== void 0 ? _a : defaultVSCodeOptions[castKey];
|
|
576
559
|
});
|
|
577
|
-
|
|
560
|
+
const mergedAliases = Object.assign(Object.assign({}, defaultVSCodeOptions['stylesheet.unitAliases']), userPreferenceOptions['stylesheet.unitAliases']);
|
|
578
561
|
combinedOptions['stylesheet.unitAliases'] = mergedAliases;
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
562
|
+
const type = getSyntaxType(syntax);
|
|
563
|
+
const variables = getVariables(emmetConfig['variables']);
|
|
564
|
+
const baseSyntax = getDefaultSyntax(syntax);
|
|
565
|
+
const snippets = type === 'stylesheet' ? (_k = customSnippetsRegistry[syntax]) !== null && _k !== void 0 ? _k : customSnippetsRegistry[baseSyntax] : customSnippetsRegistry[syntax];
|
|
583
566
|
return {
|
|
584
|
-
type
|
|
567
|
+
type,
|
|
585
568
|
options: combinedOptions,
|
|
586
|
-
variables
|
|
587
|
-
snippets
|
|
588
|
-
syntax
|
|
569
|
+
variables,
|
|
570
|
+
snippets,
|
|
571
|
+
syntax,
|
|
589
572
|
// context: null,
|
|
590
573
|
text: undefined,
|
|
591
574
|
maxRepeat: 1000
|
|
@@ -615,8 +598,8 @@ function getProfile(syntax, profilesFromSettings) {
|
|
|
615
598
|
if (!profilesFromSettings) {
|
|
616
599
|
profilesFromSettings = {};
|
|
617
600
|
}
|
|
618
|
-
|
|
619
|
-
|
|
601
|
+
const profilesConfig = Object.assign({}, profilesFromFile, profilesFromSettings);
|
|
602
|
+
const options = profilesConfig[syntax];
|
|
620
603
|
if (!options || typeof options === 'string') {
|
|
621
604
|
if (options === 'xhtml') {
|
|
622
605
|
return {
|
|
@@ -625,8 +608,8 @@ function getProfile(syntax, profilesFromSettings) {
|
|
|
625
608
|
}
|
|
626
609
|
return {};
|
|
627
610
|
}
|
|
628
|
-
|
|
629
|
-
for (
|
|
611
|
+
const newOptions = {};
|
|
612
|
+
for (const key in options) {
|
|
630
613
|
switch (key) {
|
|
631
614
|
case 'tag_case':
|
|
632
615
|
newOptions['tagCase'] = options[key] === 'lower' || options[key] === 'upper' ? options[key] : '';
|
|
@@ -674,12 +657,12 @@ function getVariables(variablesFromSettings) {
|
|
|
674
657
|
return Object.assign({}, variablesFromFile, variablesFromSettings);
|
|
675
658
|
}
|
|
676
659
|
function getFormatters(syntax, preferences) {
|
|
677
|
-
if (!preferences ||
|
|
660
|
+
if (!preferences || typeof preferences !== 'object') {
|
|
678
661
|
return {};
|
|
679
662
|
}
|
|
680
663
|
if (!isStyleSheet(syntax)) {
|
|
681
|
-
|
|
682
|
-
for (
|
|
664
|
+
const commentFormatter = {};
|
|
665
|
+
for (const key in preferences) {
|
|
683
666
|
switch (key) {
|
|
684
667
|
case 'filter.commentAfter':
|
|
685
668
|
commentFormatter['after'] = preferences[key];
|
|
@@ -696,31 +679,31 @@ function getFormatters(syntax, preferences) {
|
|
|
696
679
|
comment: commentFormatter
|
|
697
680
|
};
|
|
698
681
|
}
|
|
699
|
-
|
|
682
|
+
let fuzzySearchMinScore = typeof (preferences === null || preferences === void 0 ? void 0 : preferences['css.fuzzySearchMinScore']) === 'number' ? preferences['css.fuzzySearchMinScore'] : 0.3;
|
|
700
683
|
if (fuzzySearchMinScore > 1) {
|
|
701
684
|
fuzzySearchMinScore = 1;
|
|
702
685
|
} else if (fuzzySearchMinScore < 0) {
|
|
703
686
|
fuzzySearchMinScore = 0;
|
|
704
687
|
}
|
|
705
|
-
|
|
688
|
+
const stylesheetFormatter = {
|
|
706
689
|
'fuzzySearchMinScore': fuzzySearchMinScore
|
|
707
690
|
};
|
|
708
|
-
|
|
709
|
-
switch (
|
|
691
|
+
for (const key in preferences) {
|
|
692
|
+
switch (key) {
|
|
710
693
|
case 'css.floatUnit':
|
|
711
|
-
stylesheetFormatter['floatUnit'] = preferences[
|
|
694
|
+
stylesheetFormatter['floatUnit'] = preferences[key];
|
|
712
695
|
break;
|
|
713
696
|
case 'css.intUnit':
|
|
714
|
-
stylesheetFormatter['intUnit'] = preferences[
|
|
697
|
+
stylesheetFormatter['intUnit'] = preferences[key];
|
|
715
698
|
break;
|
|
716
699
|
case 'css.unitAliases':
|
|
717
|
-
|
|
718
|
-
preferences[
|
|
700
|
+
const unitAliases = {};
|
|
701
|
+
preferences[key].split(',').forEach(alias => {
|
|
719
702
|
if (!alias || !alias.trim() || !alias.includes(':')) {
|
|
720
703
|
return;
|
|
721
704
|
}
|
|
722
|
-
|
|
723
|
-
|
|
705
|
+
const aliasName = alias.substr(0, alias.indexOf(':'));
|
|
706
|
+
const aliasValue = alias.substr(aliasName.length + 1);
|
|
724
707
|
if (!aliasName.trim() || !aliasValue) {
|
|
725
708
|
return;
|
|
726
709
|
}
|
|
@@ -728,16 +711,13 @@ function getFormatters(syntax, preferences) {
|
|
|
728
711
|
});
|
|
729
712
|
stylesheetFormatter['unitAliases'] = unitAliases;
|
|
730
713
|
break;
|
|
731
|
-
case
|
|
732
|
-
stylesheetFormatter['between'] = preferences[
|
|
714
|
+
case `${syntax}.valueSeparator`:
|
|
715
|
+
stylesheetFormatter['between'] = preferences[key];
|
|
733
716
|
break;
|
|
734
|
-
case
|
|
735
|
-
stylesheetFormatter['after'] = preferences[
|
|
717
|
+
case `${syntax}.propertyEnd`:
|
|
718
|
+
stylesheetFormatter['after'] = preferences[key];
|
|
736
719
|
break;
|
|
737
720
|
}
|
|
738
|
-
};
|
|
739
|
-
for (var _key in preferences) {
|
|
740
|
-
_loop();
|
|
741
721
|
}
|
|
742
722
|
return {
|
|
743
723
|
stylesheet: stylesheetFormatter
|
|
@@ -752,8 +732,7 @@ function getFormatters(syntax, preferences) {
|
|
|
752
732
|
* @param language
|
|
753
733
|
* @param exlcudedLanguages Array of language ids that user has chosen to exlcude for emmet
|
|
754
734
|
*/
|
|
755
|
-
function getEmmetMode(language) {
|
|
756
|
-
var excludedLanguages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
735
|
+
function getEmmetMode(language, excludedLanguages = []) {
|
|
757
736
|
if (!language || excludedLanguages.includes(language)) {
|
|
758
737
|
return;
|
|
759
738
|
}
|