Glavin001/atom-beautify

Can do support for maxscript?

Open

#2,089 创建于 2018年3月20日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)CoffeeScript (442 fork)batch import
add-beautifieradd-languagegood first issuehelp wanted

仓库指标

Star
 (1,503 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Description

Dont have support for maxscript

Input Before Beautification

This is what the code looked like before:

	fn readLayers prefix:"01-" =(
		arrayLayersName=#()
		arrayLayersOnOff=#()
		aLayers=#()
		clearSelection()
		
		if not LayerManager.count-1 == 0 then(
			
			for i= 1 to (LayerManager.count-1) do(
				
				ilayer = layerManager.getLayer i
				
				if prefix != "" then (
					if matchpattern ilayer.name pattern:(prefix+"*")  do(--this is a comment
						
						join arrayLayersName #(ilayer.name)
						join arrayLayersOnOff #(ilayer.ishidden)))
				else(
					join arrayLayersName #(ilayer.name)
					join arrayLayersOnOff #(ilayer.ishidden)))

			join aLayers #(arrayLayersName,arrayLayersOnOff)
					
			return aLayers)
			
		else(
				
			messagebox ("No existe layers")
		
			return aLayers))

Expected Output

Ident similar a python please.

fn readLayers prefix:"01-" =(
    arrayLayersName=#()
    arrayLayersOnOff=#()
    aLayers=#()
    clearSelection()

    if not LayerManager.count-1 == 0 then(

        for i= 1 to (LayerManager.count-1) do(
            ilayer = layerManager.getLayer i

            if prefix != "" then (

                if matchpattern ilayer.name pattern:(prefix+"*")  do( --This is a comment
                    join arrayLayersName #(ilayer.name)
                    join arrayLayersOnOff #(ilayer.ishidden)))
                else(
                    join arrayLayersName #(ilayer.name)
                    join arrayLayersOnOff #(ilayer.ishidden)))

                join aLayers #(arrayLayersName,arrayLayersOnOff)
                return aLayers)
			
            else(
                messagebox ("No existe layers")
		return aLayers))

Actual Output

The beautified code actually looked like this:

	fn readLayers prefix:"01-" =(
		arrayLayersName=#()
		arrayLayersOnOff=#()
		aLayers=#()
		clearSelection()
		
		if not LayerManager.count-1 == 0 then(
			
			for i= 1 to (LayerManager.count-1) do(
				

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. Atom Beautify could not find a supported beautifier for this file

Debug

warning error

Checklist

I have:

  • Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • Reloaded (or restarted) Atom to ensure it is not a caching issue
  • Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues so I know this is not a duplicate issue
  • Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue

贡献者指南