Automatic code formatting duplicates lines and blocks of code
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, python
- 领域
- tooling
调研方向
首先,在 Atom 中使用 ide-python 1.9.4 或 1.9.5,启用保存时格式化,并在多个窗格中打开同一个 Python 文件,以重现该问题。跟踪自动格式化和保存路径,以确定为什么每个额外的标签页都会复制内容;当格式化不再复制行或代码块,并且文件在保存一次后不再保持修改状态时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
There seems to be a bug in automatic code formatting. The bug is triggered by opening the same code file into multiple tabs in separate panes. Having two tabs (of the same file) will cause the bug to occur once, three tabs will cause it to repeat twice, and so on.
I have been using the ide-python package only for a couple days, so I don't know about the specifics. This bug is present in both versions 1.9.4 and 1.9.5 at least. I turned off all checkboxes in the module's settings and restarted Atom, but this bug will still persist. I am using the "format on save" option.
Also, the file status is "modified" again after I save the file and automatic formatting is applied, so the file has to be manually saved twice. I don't think it should be like this.
Example 1
Original code
def foo():
pass
def bar():
pass
Result after automating formatting
def foo():
pass
def bar():
pass
pass
Here the keyword pass is duplicated inside function bar.
Example 2
Original code
def foo():
pass
def bar():
pass
Result after automating formatting
def foo():
pass
def bar():
pass
def bar():
pass
Here the whole function block for bar is duplicated. Formatting is also messed up.
- 主要语言
- JavaScript
- 星标
- 238
- 派生
- 41
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
atom-community/ide-python 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 25/100
atom-community/ide-python#575 · 5 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 25/100
atom-community/ide-python#570 · 2 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 25/100
atom-community/ide-python#568 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
atom-community/ide-python#567 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
atom-community/ide-python#566 ·
查看 atom-community/ide-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
parse-community/parse-server#10699 · 1 条评论 ·
维护者通常 1 天内回复
-
area: dashboard bug perceived difficulty: 3
难度 2/5 1-3 小时 新手友好度 88/100
Nitjsefnie-Harness-Commons/daedalus#1179 ·
维护者通常 1 天内回复
-
Aframe enhancement javascript
难度 1/5 1 小时以内 新手友好度 92/100
webarkit/Aframe-nft#17 ·
-
spec-feedback
难度 2/5 1-3 小时 新手友好度 75/100