You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Editor with syntax highlighting. Can use #2 for providing more details for the end user.
Features
Reference cells via click during formula editing
Visible traceability of cells within a formula
Formula auto-complete
See a cell’s underlying formula without having to click into it (formula bar)
How is it going with this feature? Have you made the choice about the underlying rich text editor?
I'm trying to implement it too. So far I was using https://microsoft.github.io/monaco-editor/index.html because of its great support for autocomplete (GSheets-like, with arguments list and documentation). However, it's very heavy and requires a service worker, which feels like an overkill for this use case.
We're not going to use any of them. As you noticed, those packages are heavy and overkill for this use case. Those editors have their own AST parsers and lexer, IMO totally useless for us. Everything we need is already in HyperFormula engine. Chevrotain already provides us with AST and we will use it for syntax highlighting and suggesting docs that are based on our meta-data format. When we add point&click, named expression, expanded docs and i18n features to the mix I don't think any of them would meet our needs and the more advanced features of stand-alone code editors will stand in our way.
My gut feeling is that it might be hard to accomplish with input / textarea, like syntax highlighting for instance. The best fit would be div with contenteditable=true, but from what I remember it's very buggy and those rich text editors try to make it usable :) maybe this could work: https://github.com/lovasoa/react-contenteditable
You're right, some work will be needed to do it right. But IMO working around assumptions made by those full flagged editors would take the same effort or more.
I ended up with Codemirror 6, its parser and autocomplete are great, lezer outputs pretty accurate tokens based on the input and with high tolerance to syntax errors. 40KB gzipped but I can live with that for now :)
@marek-baranowski Hi, would it be possible to share the autocomplete code? I'm about to also use codemirror 6 for a hyperformula cell editor with autocomplete support.
Activity
marek-baranowski commentedon Jan 25, 2020
Hi @wojciechczerniak,
FYI. I'm an early adopter :)
How is it going with this feature? Have you made the choice about the underlying rich text editor?
I'm trying to implement it too. So far I was using https://microsoft.github.io/monaco-editor/index.html because of its great support for autocomplete (GSheets-like, with arguments list and documentation). However, it's very heavy and requires a service worker, which feels like an overkill for this use case.
I will probably choose one of those:
Wondering about your solution, could you share your experience?
Best,
Marek
wojciechczerniak commentedon Jan 25, 2020
Hi!
Great to have you here.
We're not going to use any of them. As you noticed, those packages are heavy and overkill for this use case. Those editors have their own AST parsers and lexer, IMO totally useless for us. Everything we need is already in HyperFormula engine. Chevrotain already provides us with AST and we will use it for syntax highlighting and suggesting docs that are based on our meta-data format. When we add point&click, named expression, expanded docs and i18n features to the mix I don't think any of them would meet our needs and the more advanced features of stand-alone code editors will stand in our way.
marek-baranowski commentedon Jan 25, 2020
Thx for answer.
My gut feeling is that it might be hard to accomplish with input / textarea, like syntax highlighting for instance. The best fit would be div with contenteditable=true, but from what I remember it's very buggy and those rich text editors try to make it usable :) maybe this could work: https://github.com/lovasoa/react-contenteditable
wojciechczerniak commentedon Jan 25, 2020
You're right, some work will be needed to do it right. But IMO working around assumptions made by those full flagged editors would take the same effort or more.
Thanks for the link. Will look into it
marek-baranowski commentedon Jan 26, 2020
In the meantime I've discovered a couple other libs that deal with contenteditable and are pretty lightweight (~2KB), like http://jakiestfu.github.io/Medium.js/docs or https://yabwe.github.io/medium-editor.
I ended up with Codemirror 6, its parser and autocomplete are great,
lezeroutputs pretty accurate tokens based on the input and with high tolerance to syntax errors. 40KB gzipped but I can live with that for now :)marek-baranowski commentedon Jan 26, 2020
I will share the code once it's complete.
wojciechczerniak commentedon Jul 13, 2020
Just cleaning up. Formula Editor is a UI component. It doesn't belong here. Will be created separately, outside of the HF repo.
Ref: handsontable/handsontable#6466
BrianHung commentedon Jun 25, 2023
@marek-baranowski Hi, would it be possible to share the autocomplete code? I'm about to also use codemirror 6 for a hyperformula cell editor with autocomplete support.
scrapeable commentedon Dec 20, 2023
Does this feature exist?
sequba commentedon Dec 21, 2023
Hi, @scrapeable!
As @wojciechczerniak said:
HyperFormula is a headless library without a GUI. It's the responsibility of the UI app to provide a way for the end user to enter formulas.
Add SEQUENCE built-in function (#1645)