Skip to content
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

Mixed Indentation in Template Files #674

Open
JoelProminic opened this issue Feb 27, 2020 · 1 comment
Open

Mixed Indentation in Template Files #674

JoelProminic opened this issue Feb 27, 2020 · 1 comment

Comments

@JoelProminic
Copy link
Contributor

This issue is a low priority for now, but I have written up my findings since this may be important later to #151.

While testing #606, I noticed that many of the templates have mixed spaces and tabs for indents.
I would like to have the indentation be consistent so that we are not introducing indent issues that may annoy users later. Since #606 improved how indents are handled, this may not matter much if the user is only working in Moonshine. However, if the code is used in other editors, this can cause the code to not be lined up as expected.

Also, when we are ready to implement the indent configuration for #151, it will be helpful if the indents are standardized.

Here is a quick command I used to find the files that have space indentation or mixed indentation. Note that this may have catch some cases where mixed tabs and spaces are expected like when we are lining up html attributes split across multiple lines (although this case is one of the reasons not to use tabs).

cd Moonshine-IDE/ide/MoonshineSharedCore/src/elements/templates/
egrep -r -l "^\t*  " .

For example:

$ egrep -r -l "^\t*  " .
./files/AS3 Class.as.template
./files/AS3 Interface.as.template
./files/MXML File.mxml.template
./files/Visual Editor Flex File.mxml.template
./files/Visual Editor PrimeFaces File.xhml.template
./files/mxml/flex/Application.mxml.template
./files/mxml/flex/TitleWindow.mxml.template
./files/visualeditor/primeFaces/Div.xhml.template
./projects/AS3 Project.xml
./projects/ActionScript Browser Project/$Settings.as3proj.template
./projects/ActionScript Browser Project/bin-debug/$SourceNameOnly.html.template
./projects/ActionScript Browser Project/bin-debug/history/history.js
./projects/ActionScript Browser Project/bin-debug/history/historyFrame.html
./projects/ActionScript Browser Project/build/build.xml.template
./projects/ActionScript Browser Project/html-template/$Wrapper.html.template
./projects/ActionScript Browser Project/html-template/history/history.js
./projects/ActionScript Browser Project/html-template/history/historyFrame.html
./projects/ActionScript Browser Project/src/$ProjectName.as.template
./projects/ActionScript Desktop Project/$Settings.as3proj.template
./projects/ActionScript Desktop Project/build_air/$DesktopDescriptor-app.xml.template
./projects/ActionScript Desktop Project/build_air/build.xml.template
./projects/ActionScript Desktop Project/src/$ProjectName.as.template
./projects/ActionScript Mobile Project/$Settings.as3proj.template
./projects/ActionScript Mobile Project/build_air/$DesktopDescriptor-app.xml.template
./projects/ActionScript Mobile Project/build_air/build.xml.template
./projects/ActionScript Mobile Project/src/$ProjectName.as.template
./projects/Away3D Project/$Settings.as3proj.template
./projects/Away3D Project/libs/away3d-core-fp11_4_1_6.swc
./projects/Away3D Project/src/$ProjectName.as.template
./projects/Away3D Project.xml
./projects/Feathers SDK Desktop Project (MacOS, Windows)/$Settings.as3proj.template
./projects/Feathers SDK Desktop Project (MacOS, Windows)/build_air/$DesktopDescriptor-app.xml.template
./projects/Feathers SDK Desktop Project (MacOS, Windows)/build_air/build.xml.template
./projects/Feathers SDK Desktop Project (MacOS, Windows)/src/Main.as.template
./projects/Feathers SDK Mobile Project (iOS, Android)/$Settings.as3proj.template
./projects/Feathers SDK Mobile Project (iOS, Android)/build_air/$DesktopDescriptor-app.xml.template
./projects/Feathers SDK Mobile Project (iOS, Android)/build_air/build.xml.template
./projects/Feathers SDK Project.xml
./projects/Flex Browser Project (SWF)/$Settings.as3proj.template
./projects/Flex Browser Project (SWF)/bin-debug/$SourceNameOnly.html.template
./projects/Flex Browser Project (SWF)/bin-debug/history/history.js
./projects/Flex Browser Project (SWF)/bin-debug/history/historyFrame.html
./projects/Flex Browser Project (SWF)/build/build.xml.template
./projects/Flex Browser Project (SWF)/html-template/$Wrapper.html.template
./projects/Flex Browser Project (SWF)/html-template/history/history.js
./projects/Flex Browser Project (SWF)/html-template/history/historyFrame.html
./projects/Flex Browser Project (SWF)/src/$ProjectName.mxml.template
./projects/Flex Desktop Project (MacOS, Windows)/$Settings.as3proj.template
./projects/Flex Desktop Project (MacOS, Windows)/build_air/$DesktopDescriptor-app.xml.template
./projects/Flex Desktop Project (MacOS, Windows)/build_air/build.xml.template
./projects/Flex Desktop Project (MacOS, Windows)/src/$ProjectName.mxml.template
./projects/Flex Mobile Project (iOS, Android)/$Settings.as3proj.template
./projects/Flex Mobile Project (iOS, Android)/build_air/$DesktopDescriptor-app.xml.template
./projects/Flex Mobile Project (iOS, Android)/build_air/build.xml.template
./projects/Flex Mobile Project (iOS, Android)/src/$ProjectName.mxml.template
./projects/Flex Mobile Project (iOS, Android)/src/HomeView.mxml.template
./projects/Flex Project.xml
./projects/Grails Project/$Settings.grailsproj.template
./projects/Grails Project.xml
./projects/Haxe Feathers UI Project/$Settings.hxproj.template
./projects/Haxe Feathers UI Project/assets/feathersui.svg
./projects/Haxe OpenFL Project/$Settings.hxproj.template
./projects/Haxe Project/$Settings.hxproj.template
./projects/Haxe Project.xml
./projects/Java Gradle Project/$Settings.javaproj.template
./projects/Java Gradle Project/build.gradle.template
./projects/Java Gradle Project/src/main/java/$ProjectName.java.template
./projects/Java Maven Project/$Settings.javaproj.template
./projects/Java Maven Project/pom.xml.template
./projects/Java Maven Project/src/main/java/$ProjectName.java.template
./projects/Java Project.xml
./projects/Library Project/$Settings.as3proj.template
./projects/PrimeFaces Project/pom.xml.template
./projects/PrimeFaces Project/src/main/webapp/WEB-INF/web.xml.template
./projects/Royale Browser Project Basic/$Settings.as3proj.template
./projects/Royale Browser Project Basic/bin-debug/$SourceNameOnly.html.template
./projects/Royale Browser Project Basic/bin-debug/history/history.js
./projects/Royale Browser Project Basic/bin-debug/history/historyFrame.html
./projects/Royale Browser Project Basic/build/build.xml.template
./projects/Royale Browser Project Basic/html-template/$Wrapper.html.template
./projects/Royale Browser Project Basic/html-template/history/history.js
./projects/Royale Browser Project Basic/html-template/history/historyFrame.html
./projects/Royale Browser Project Basic/src/$ProjectName.mxml.template
./projects/Royale Browser Project Jewel/$Settings.as3proj.template
./projects/Royale Browser Project Jewel/build/build.xml.template
./projects/Royale Browser Project Jewel/src/$ProjectName.mxml.template
./projects/Royale Browser Project Jewel/src/MainContent.mxml.template
./projects/Royale Browser Project Jewel/src/resources/jewel-index-template.html
./projects/Royale Browser Project.xml
./projects/Visual Editor Project/$Settings.veditorproj.template
./projects/Visual Editor Project/$pom.xml.template
./projects/Visual Editor Project/src_flex/$ProjectName.mxml.template
./projects/Visual Editor Project/src_primeface/main/webapp/$ProjectName.xhtml.template
./projects/Visual Editor Project/src_primeface/main/webapp/WEB-INF/web.xml
./projects/Visual Editor Project/visualeditor-src/main/webapp/$ProjectName.xml.template
./projects/Visual Editor Project.xml
@JoelProminic
Copy link
Contributor Author

In many editors, it will be difficult to spot the mismatches. Here is a Vim script that you can use to highlight the problematic indents:

set tabstop=4
let @/="\\(^\\t*\\)\\@<=  \\+"
set hls

Save this text to a file like ~/.vim/HighlightSpaceIndent.vim. Then, you can import the settings into an existing Vim instance by typing ":source ~/.vim/HighlightSpaceIndent.vim" and hitting Enter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Moonshine-IDE - Bug Fixing
  
Awaiting triage
Development

No branches or pull requests

1 participant