-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Explore indentation issues with the indentation test tool #209863
Comments
The indentation test tool is introduced in the following PR: #209928. It takes in a directory as input, runs over all the TS files (for example), applies the reindentation and writes back the files. Since the files are already properly indented/formatted, edits proposed the reindentation operation correspond presumably to incorrect indentation edits. This comment will be used to record the findings from running the tool on different repos. Repo: VS Code
When the following is finished (#209862), this should no longer be an issue.
This happens because we do not have a pattern to increase the indentation after a comma after a const statement. We would like to decrease the indentation when the assignments are finished. We can not easily detect when to decrease the indentation. Link to pairs of indent/outdent pairs idea. indentNextLinePattern is not enough here, because indentation should apply over several lines following the comma. Another similar example is (bundle.ts)
The following is a similar case: As well as: As well as: As well as (extensions.ts)
This happens because our decrease indentation pattern contains a check on string which will no longer be needed when we will process the strings before appliyng the indentation patterns.
Should be fixed by #209862
Indentation should not be increased because it already has previously been increased through indentation of if statement. In a similar manner, indentation should be decreased in the following case but is not:
Consider the case above. The if statement on line 31 should be on the same indentation level as line 28.
When taking into account indentation of multi-line comments:
When ignoring the incorrect indentation of multi-line comments:
|
After some analysis it appears that the An issue has been opened here: #209938 More specifically, if the In the meantime, a new tool will be developed, the |
This issue has been created to track indentation issues that have been found through the usage of the indentation test tool. The indentation test tool applies the reindent lines operation on consecutive pairs of lines on well indented/formatted code, and finds the cases when the suggested indentation differs from the existing indentation. This tool can be run on large repos in order to quickly find cases when the indentation is incorrect.
The text was updated successfully, but these errors were encountered: