Improve syntax-aware auto indentation

Open
#61 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
64/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
tooling

Research direction

Start with the scanner described in issue #59 and reproduce the block-comment example from this issue. Track lexical state across lines so delimiters inside block comments do not affect indentation, and verify that pressing Enter after the example's second line no longer adds an indentation level; multi-line strings and JavaScript regex literals remain out of scope.

Written by the indexing model from the issue text.

Description

The scanner in #59 only reads the current line and carries no state across lines, so it cannot recognize that a line is still inside a comment.

For example, pressing Enter after the second line below incorrectly adds an indentation level:

/*
 * setup {
 */

A follow-up should track lexical state across lines so delimiters inside block comments do not affect indentation. Multi-line strings and JavaScript regex literals also remain outside the current scanner's scope.

Dominant language
Rust
Stars
54
Forks
8
Avg merge
11h 57m
Merged PRs (30d)
44

Contributor guide

No contributing guide indexed for this repository

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.

More from sysprog21/codetrial

All issues in sysprog21/codetrial

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.