Skip to content

Commit

Permalink
Update import
Browse files Browse the repository at this point in the history
Co-Authored-By: Sergio A. Vargas <[email protected]>
  • Loading branch information
fonsp and savq committed Aug 6, 2024
1 parent be3ccb8 commit a71ce27
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 81 deletions.
6 changes: 3 additions & 3 deletions frontend/components/CellInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
} from "../imports/CodemirrorPlutoSetup.js"

import { markdown, html as htmlLang, javascript, sqlLang, python, julia_mixed } from "./CellInput/mixedParsers.js"
import { julia_andrey } from "../imports/CodemirrorPlutoSetup.js"
import { julia } from "../imports/CodemirrorPlutoSetup.js"

Check failure on line 46 in frontend/components/CellInput.js

View workflow job for this annotation

GitHub Actions / test

Module '"../imports/CodemirrorPlutoSetup.js"' declares 'julia' locally, but it is exported as 'julia_andrey'.
import { pluto_autocomplete } from "./CellInput/pluto_autocomplete.js"
import { NotebookpackagesFacet, pkgBubblePlugin } from "./CellInput/pkg_bubble_plugin.js"
import { awesome_line_wrapping, get_start_tabs } from "./CellInput/awesome_line_wrapping.js"
Expand Down Expand Up @@ -142,7 +142,7 @@ export const pluto_syntax_colors = HighlightStyle.define(
],
{
all: { color: `var(--cm-editor-text-color)` },
scope: julia_andrey().language,
scope: julia().language,
}
)

Expand Down Expand Up @@ -776,7 +776,7 @@ export const CellInput = ({
]
: [
//
julia_andrey(),
julia(),
]),
go_to_definition_plugin,
pluto_autocomplete({
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/CellInput/lezer_template.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { julia_andrey, NodeProp, syntaxTree, Text } from "../../imports/CodemirrorPlutoSetup.js"
import { julia, NodeProp, syntaxTree, Text } from "../../imports/CodemirrorPlutoSetup.js"

Check failure on line 1 in frontend/components/CellInput/lezer_template.js

View workflow job for this annotation

GitHub Actions / test

Module '"../../imports/CodemirrorPlutoSetup.js"' declares 'julia' locally, but it is exported as 'julia_andrey'.
import lodash from "../../imports/lodash.js"

// @ts-ignore
Expand All @@ -9,7 +9,7 @@ import ManyKeysWeakMap from "https://esm.sh/[email protected]?pin=v113&tar
* @returns {SyntaxNode}
*/
export let julia_to_ast = (julia_code) => {
return /** @type {any} */ (julia_andrey().language.parser.parse(julia_code).topNode.firstChild)
return /** @type {any} */ (julia().language.parser.parse(julia_code).topNode.firstChild)
}

// When you get errors while creating the templates (stuff related to substitutions),
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/CellInput/mixedParsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
sql,
javascript,
python,
julia_andrey,
julia,

Check failure on line 15 in frontend/components/CellInput/mixedParsers.js

View workflow job for this annotation

GitHub Actions / test

Module '"../../imports/CodemirrorPlutoSetup.js"' declares 'julia' locally, but it is exported as 'julia_andrey'.
parseCode,
} from "../../imports/CodemirrorPlutoSetup.js"

Expand Down Expand Up @@ -166,10 +166,10 @@ const juliaWrapper = parseMixed((node, input) => {
})

const julia_mixed = (config) => {
const julia = julia_andrey(config)
const julia_simple = julia(config)
// @ts-ignore
julia.language.parser = julia.language.parser.configure({ wrap: juliaWrapper })
return julia
julia_simple.language.parser = julia_simple.language.parser.configure({ wrap: juliaWrapper })
return julia_simple
}

export { julia_mixed, sqlLang, pythonLanguage, javascript, htmlLanguage, javascriptLanguage, python, markdown, html }
4 changes: 2 additions & 2 deletions frontend/components/CellOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { pluto_syntax_colors, ENABLE_CM_MIXED_PARSER } from "./CellInput.js"

import hljs from "../imports/highlightjs.js"
import { julia_mixed } from "./CellInput/mixedParsers.js"
import { julia_andrey } from "../imports/CodemirrorPlutoSetup.js"
import { julia } from "../imports/CodemirrorPlutoSetup.js"

Check failure on line 28 in frontend/components/CellOutput.js

View workflow job for this annotation

GitHub Actions / test

Module '"../imports/CodemirrorPlutoSetup.js"' declares 'julia' locally, but it is exported as 'julia_andrey'.
import { SafePreviewSanitizeMessage } from "./SafePreviewUI.js"

const prettyAssignee = (assignee) =>
Expand Down Expand Up @@ -680,7 +680,7 @@ export let highlight = (code_element, language) => {
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
EditorState.tabSize.of(4),
// TODO Other languages possibly?
...(language === "julia" ? [ENABLE_CM_MIXED_PARSER ? julia_mixed() : julia_andrey()] : []),
...(language === "julia" ? [ENABLE_CM_MIXED_PARSER ? julia_mixed() : julia()] : []),
EditorView.lineWrapping,
EditorView.editable.of(false),
].filter((x) => x != null),
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/ErrorMessage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cl } from "../common/ClassTable.js"
import { PlutoActionsContext } from "../common/PlutoContext.js"
import { EditorState, EditorView, julia_andrey, lineNumbers, syntaxHighlighting } from "../imports/CodemirrorPlutoSetup.js"
import { EditorState, EditorView, julia, lineNumbers, syntaxHighlighting } from "../imports/CodemirrorPlutoSetup.js"

Check failure on line 3 in frontend/components/ErrorMessage.js

View workflow job for this annotation

GitHub Actions / test

Module '"../imports/CodemirrorPlutoSetup.js"' declares 'julia' locally, but it is exported as 'julia_andrey'.
import { html, useContext, useEffect, useLayoutEffect, useRef, useState } from "../imports/Preact.js"
import { pluto_syntax_colors } from "./CellInput.js"
import { highlight } from "./CellOutput.js"
Expand Down
72 changes: 3 additions & 69 deletions frontend/imports/CodemirrorPlutoSetup.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
export {
EditorState,
EditorSelection,
Compartment,
EditorView,
placeholder,
julia_andrey,
julia,
keymap,
syntaxHighlighting,
history,
Expand Down Expand Up @@ -64,70 +64,4 @@ import {
linter,
setDiagnostics,
//@ts-ignore
} from "https://cdn.jsdelivr.net/gh/JuliaPluto/[email protected]/dist/index.es.min.js"

export {
linter,
setDiagnostics,
EditorState,
EditorSelection,
Compartment,
EditorView,
placeholder,
julia_andrey,
keymap,
history,
historyKeymap,
defaultKeymap,
indentMore,
indentLess,
moveLineUp,
moveLineDown,
tags,
HighlightStyle,
lineNumbers,
highlightSpecialChars,
foldGutter,
drawSelection,
indentOnInput,
defaultHighlightStyle,
bracketMatching,
closeBrackets,
rectangularSelection,
highlightSelectionMatches,
closeBracketsKeymap,
searchKeymap,
foldKeymap,
syntaxTree,
syntaxTreeAvailable,
Decoration,
ViewUpdate,
ViewPlugin,
WidgetType,
Facet,
StateField,
StateEffect,
Transaction,
SelectionRange,
indentUnit,
combineConfig,
NodeProp,
autocomplete,
html,
htmlLanguage,
javascriptLanguage,
markdown,
markdownLanguage,
parseCode,
parseMixed,
PostgreSQL,
pythonLanguage,
sql,
syntaxHighlighting,
javascript,
python,
Text,
css,
cssLanguage,
selectNextOccurrence,
}
} from "https://cdn.jsdelivr.net/gh/JuliaPluto/codemirror-pluto-setup@07a6ae6/dist/index.es.min.js"

0 comments on commit a71ce27

Please sign in to comment.