handsontable / handsontable/hyperformula

[Research/Spike]: Ability to parse formulas for highlighting

Open
#854 13 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Impact: Medium
Dominant language
TypeScript
Stars
2.8k
Forks
171
Avg merge
1d 22h
Merged PRs (30d)
7

Description

So I'm doing formula syntax highlighting in my spreadsheet like this example:

image

Currently hyperformula does formula parsing internally however there's no way to access it and the indexes in the string for it.

I tried to internally access lexer to do it but that doesn't work as it hasn't been parsed in the AST yet.

I also looked at getCellPrecedents, however this requires the cells to have been set already and in the dependency tree I think.

So something like:

@helper~
parseFormulas(text: string): string[].

Would be great.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing HyperFormula's internal lexer and AST parsing, then compare that path with getCellPrecedents and its dependency-tree requirements. The issue does not name files or tests; done means agreeing on and exposing a parsing entry point such as parseFormulas(text: string) that provides formula positions usable for syntax highlighting.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.