← 输入框|github.com|刷新
Skip to content

Add named cells - #1338

Open
omidmogasemi wants to merge 4 commits into
masterfrom
named-cells
Open

omidmogasemi wants to merge 4 commits into
masterfrom
named-cells

Conversation

@omidmogasemi

Copy link
Copy Markdown
Collaborator

Adds support for named cells (see #1332).

Screen.Recording.2022-10-09.at.12.11.12.PM.mov

override def parametersAt(code: String, pos: Int, state: State): RIO[Blocking, Option[Signatures]] = for {
collectedState <- injectState(collectState(state)).provideLayer(CurrentRuntime.noRuntime)
valDefs = collectedState.values.mapValues(_._1).values.toList
cellCode <- scalaCompiler.cellCode(s"Cell${state.id.toString}", s"\n\n$code ", collectedState.prevCells, valDefs, collectedState.imports, strictParse = false)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I just missed it in testing, but I didn't see a reason to keep the ID as a string formatted like this (and it makes lookups on the client-side harder as you have to parse the string for a number). Thought this would be easier, so I refactored this in a few places.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we were hoping to eventually move away from the monotonic numbering as the identifier, and use UUIDs or something instead.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants