Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.5k stars 453 forks source link

Can do support for maxscript? #2089

Open pabloemmanueldeleo opened 6 years ago

pabloemmanueldeleo commented 6 years ago

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:

stevenzeck commented 6 years ago

@pabloemmanueldeleo are there existing formatters for maxscript that you could recommend?

pabloemmanueldeleo commented 6 years ago

hi @szeck87 . i now only two ways, the editors most known editors visual studio code [notepad++](most known editors) , sublime and in the same editor of 3d max with that script but there is nothing in atom.

stevenzeck commented 6 years ago

Does http://www.scriptspot.com/3ds-max/scripts/visual-studio-code-maxscript-support actually format maxscript though?

I see there is a package for Atom that supports the language (like highlighting): https://atom.io/packages/language-maxscript

pabloemmanueldeleo commented 6 years ago

I tested this add but does not support all syntax and dont auto identy how beautify.