Request for Feature: Code Indentation

未关闭
#1,859 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
dart, flutter
领域
mobile

调研方向

Start by locating the Android app’s code editor and checking how it handles Enter and indentation; the issue does not name a file, test, or editor entry point. Determine how the editor supports indentation across the programming languages it offers, then define and test behavior for nested blocks and closing braces. Done means pressing Enter carries or adjusts indentation to match the surrounding code.

由索引模型根据 Issue 内容生成。

描述

status: waiting triage type: feature request

In the freeCodeCamp Android application, the following problem was found: pressing Enter does not transfer indentation to the next line, and thus, there is a need to add spaces or tabs to properly format code, which might be inconvenient in case of nested functions, loops, and conditions.
The problem has been encountered only in the freeCodeCamp Android application, and thus, it is unknown if the same applies to other platforms.
Describe the solution you'd like
It would be nice to have the Auto Indentation feature implemented in the code editor in the freeCodeCamp Android application. When Enter is pressed, the indentation of the next line should be automatically calculated based on the indentation of the previous line and the structure of the code.
For instance, when writing code within a function, a loop, or a condition, the next line should be automatically indented accordingly. At the same time, indentation should change according to the entered syntax when closing braces, etc.
Describe alternatives you've considered
The current alternative is adding spaces or tabs manually to indent each line; however, it is inconvenient and interrupts the coding process.
More background
It would be easier to read the code, it would save us from having to format our code manually and it would be more comfortable for those learning to code, especially those beginners that use the freeCodeCamp Android app.
I have not tested this behavior on other platforms so I cannot confirm if this problem is Android-only or if the web version or other apps are also affected. Ideally , automatic indentation should be aware of all programming languages in the editor , following the indentation conventions of each language .

主要语言
Dart
星标
589
派生
206
平均合并
3 天 14 小时
30 天内合并 PR
23

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

freeCodeCamp/mobile 的其他 Issue

查看 freeCodeCamp/mobile 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。