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
-
bug good first issue
難度 2/5 1-3 小時 新手友好度 86/100
amponce/archive-movie-browser#354 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
saayam-for-all/webapp#1870 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
Imageomics/OpenCite#66 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 64/100
chr15m/twiiit.com#20 ·
-
documentation
難度 2/5 1-3 小時 新手友好度 88/100
antropos17/Aegis#629 ·
維護者通常 4 天內回覆