Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add basic indents #75

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

Draft
aspeddro wants to merge 4 commits into rescript-lang:main
base: main
Choose a base branch
Loading
from aspeddro:add-indents
Draft

Conversation

Copy link
Collaborator

@aspeddro aspeddro commented Feb 9, 2022
edited
Loading

This PR add basic support to indents.

Some cases that have not been implemented:

Variant

type user = 
 | Id
 | Name
2022年02月10日_17-05_15.mp4

How to set the node/rule where indentation ends?

Labeled Variant Payloads (Inline Record)

| is the cursor

type user =
 | Id
 | Name({|})

Press enter:

type user =
 | Id
 | Name({
 |
 })

Here the indentation not work because Name({}) is a ERROR. record_type rule require a field

ERROR [0, 0] - [2, 12]
 type_identifier [0, 5] - [0, 9]
 variant_declaration [1, 4] - [1, 6]
 variant_identifier [1, 4] - [1, 6]
 variant_identifier [2, 4] - [2, 8]

Could record_type be an optional rule to not generate an ERROR node in the parser?

nkrkv reacted with thumbs up emoji nkrkv reacted with eyes emoji
@aspeddro aspeddro marked this pull request as draft November 5, 2022 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /