-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monaco #2117
Conversation
…ng, webpack need massive cleanup
(make the monaco component fully controlled)
- indent/dedent - commenting - autoSurround ...
fetch chunk highlighting now working. last explicit bug i'm now aware of: chunk delim lines without an explicit type don't highlight correctly. @hamilton @mdboom @wlach we should figure out what the parity-with-codemirror criteria are for Monaco. Getting all the magic of language servers working is still a ways off, but i think i can see a path to some cool stuff that is pretty attainable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool.
Personal preference: I don't know if the overview thing is that helpful -- maybe turn it off to save real estate or make it toggleable, if possible.
The 2 spaces for tabs for Python thing is going to ruffle some feathers. If there's a way to do that on a cell-by-cell basis, that would be awesome, but I couldn't find it in the API docs.
There is some sort of autocompletion going on -- it looks like it pulls words from elsewhere in the document. It's a little weird since it pulls candidates from markdown cells. If it could be limited to looking in cells of the same time (no idea how hard that is) that could be really useful, otherwise, maybe turn it off?
@@ -19,8 +16,6 @@ const PYODIDE_URL = process.env.USE_LOCAL_PYODIDE | |||
const pyLanguageDefinition = { | |||
languageId: "py", | |||
displayName: "Python", | |||
codeMirrorMode: "python", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll want to replace this with something for Monaco so that third-party language plugins can get syntax highlighting. Does it look hard to do that dynamically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think it should be hard, but i think we can address that down the line. there will be a bit more thinking to do on this topic, but not too bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminarily, this seems like a really nice improvement!
I tend to agree that the overview should be skipped. I have a "tabs" sidebar, so every pixel of space in the editor is precious. Here's how it looks for me now:
On a similar note, it would be nice if we used less space for the line numbers -- right now the seem to be taking up 50px of space, most of which is just empty space. I'd rather we just compacted them to just fit the current number of lines, expanding them as needed.
Agree also that the autocompletion doesn't seem to be super useful as is, more often than not the suggestions seem unhelpful / get in the way. I would definitely turn it off until we can make it only pull stuff from the same cell type.
webpack.config.js
Outdated
@@ -55,9 +56,16 @@ module.exports = env => { | |||
entry: { | |||
iodide: `${APP_DIR}/editor/index.jsx`, | |||
"iodide.eval-frame": `${APP_DIR}/eval-frame/index.jsx`, | |||
"server.home": `${APP_DIR}/server/index.jsx` | |||
"server.home": `${APP_DIR}/server/index.jsx`, | |||
// "editor.worker": 'monaco-editor/esm/vs/editor/editor.worker.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover from some earlier work?
webpack.config.js
Outdated
// test: /\.css$/, | ||
// include: MONACO_PATH, | ||
// use: [MiniCssExtractPlugin.loader, "css-loader"] | ||
// }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a WIP or can we just take it out?
md: [mdLang, mdConf], | ||
css: [cssLang, cssConf], | ||
py: [pyLang, pyConf] | ||
}).forEach(lang => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to update the language plugin documentation for any new conventions here?
(oh, also removed the minimap) |
I deployed this to https://definitely-staging.iodide.io in case anyone wants to give it a whirl. Will give actual feedback tomorrow. |
so far planning around with the editor, i think the languages shared refs make sense. i understand the inclusion of the fetch cells as well, that is the loaded data gets its variable assignment there, but what i have noticed with this is that it parts of the url are included in the autocomplete list. |
@teonbrooks -- ok i fooled around with it a bit more, and tried to tighten things up a bit. Since I already had the regex handy from something else, i added a filter so that only the variable names in fetch chunks are added to the autocomplete list, and i added a rudimentary heuristic so that only things in css chunks starting with "#" or "." (ids and classes) are added to the list. please take another look when you can and let me know if you see any other merge blockers. thanks for helping with the QA @teonbrooks ! |
@@ -141,7 +138,6 @@ module.exports = env => { | |||
filename: `[name].${APP_VERSION_STRING}.css` | |||
}), | |||
new WriteFilePlugin() | |||
// Use an external helper script, due to https://github.com/1337programming/webpack-shell-plugin/issues/41 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment for code that was removed
@@ -2,10 +2,8 @@ require("dotenv").config(); | |||
const webpack = require("webpack"); | |||
const path = require("path"); | |||
const fs = require("fs"); | |||
const CreateFileWebpack = require("create-file-webpack"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and the one below were no longer used. noticed this while cleaning out stuff i'd been doing in this file.
@bcolloran that did it for me. looks good! |
note to self: WIP of webpack.config.js with stuff for loading monaco here: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working great! I have some minor nits, but in general everything here is looking good.
src/editor/components/monaco-tools/__tests__/code-chunk-identifiers.test.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks for adding more tests and keeping things 💯
This may now be working at parity with codemirror, but i need extra eyes and review to kick the tires. I guess the one thing that is for sure not working is the fetch chunk code highlighting mode. i can look at that next.
Pull Request checklist