Glavin001/atom-beautify

Can do support for maxscript?

Open

#2,089 opened on Mar 20, 2018

View on GitHub
 (4 comments) (0 reactions) (0 assignees)CoffeeScript (442 forks)batch import
add-beautifieradd-languagegood first issuehelp wanted

Repository metrics

Stars
 (1,503 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

Contributor guide