Skip to content
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

CodeEditor improvements #11852

Merged
merged 3 commits into from
Dec 16, 2024
Merged

CodeEditor improvements #11852

merged 3 commits into from
Dec 16, 2024

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented Dec 12, 2024

CodeEditor improvements in preparation for rendering uncommitted edits (#11798)

  • New Ast-based implementation of ensoSyntax extension
  • Auto-indent:
    • New line matches indentation of previous line
    • Backspace now deletes 4 spaces of indentation
  • Switch to CM-compatible SourceRange type so that we can use the same text algorithms for module sources and CM editor contents
  • Update CodeMirror dependencies

Pull Request Description

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

- Auto-indent:
  - New line matches indentation of previous line
  - Backspace now deletes 4 spaces of indentation
- New `Ast`-based implementation of `ensoSyntax` extension
  - Stylesheet-defined syntax highlighting (fixes #11475)
  - Vue component implementation of code editor tooltips
  - Removes 2nd-to-last usage of `RawAst` (#10753)
- Switch to CM-compatible SourceRange so that we can use the same text
  algorithms for module sources and CM editor contents
- Update CodeMirror dependencies
@kazcw kazcw added the CI: No changelog needed Do not require a changelog entry for this PR. label Dec 12, 2024
@kazcw kazcw self-assigned this Dec 12, 2024
Copy link

github-actions bot commented Dec 12, 2024

🧪 Storybook is successfully deployed!

📊 Dashboard:

Comment on lines 12 to 20
/** TODO: Add docs */
export function sourceRangeKey({ from, to }: SourceRange): SourceRangeKey {
return `${from.toString(16)}:${to.toString(16)}` as SourceRangeKey
}
/** TODO: Add docs */
export function sourceRangeFromKey(key: SourceRangeKey): SourceRange {
const [from, to] = key.split(':').map(x => parseInt(x, 16)) as [number, number]
return { from, to }
}
Copy link
Contributor

Choose a reason for hiding this comment

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

As these functions are now outside their usage context, let's add short docs there.

@kazcw kazcw added the CI: Ready to merge This PR is eligible for automatic merge label Dec 16, 2024
@mergify mergify bot merged commit aebfacd into develop Dec 16, 2024
50 checks passed
@mergify mergify bot deleted the wip/kw/code-editor-divergence-prep branch December 16, 2024 15:15
jdunkerley pushed a commit that referenced this pull request Dec 17, 2024
(cherry picked from commit aebfacd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

private isn't recognized as a keyword by the IDE's editor
2 participants