Coder Social home page Coder Social logo

processing-formatter's Introduction

Im sorry.

processing-formatter's People

Contributors

millenniumambiguity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

artze

processing-formatter's Issues

Switch Case Statements will melt to the left with each reformat

Describe the bug
When you format the indentation of switch-case statements will be lost

To Reproduce

  1. Write a switch-case
  2. Format it yourself
  3. Run the auto formatter

Expected behavior
The users indentation should be kept, or better, the switch case should be recognized and the formatting should act accordingly.

Screenshots
2021-05-10_23-35-36

Additional context
I'm using spaces, if that matters.

Bad reformatting at some beginning

Describe the bug
Writing a code in Processing IDE, i go to VSC to reformat it and found a wrong result.
In use:
Visual Studio Code 1.52.1.
Windows 10

Screenshots
Source code (part) was :
Screen Shot 02-01-21 at 07 32 PM
And after formatting :
Screen Shot 02-01-21 at 07 32 PM 001
You can see the wrong floatxNew and floatyNew .

Additional context
Could be some stuff with spaces and tabs ?

A try a better sample with several beginnings:
Screen Shot 02-01-21 at 07 41 PM
In notepad++ to see spaces:
Screen Shot 02-01-21 at 07 47 PM
One line is ok, the other nok :
Screen Shot 02-01-21 at 07 41 PM 001

HTH

Formatter also formats inside strings and coments

Hey! I like this alot and I'm very happy that I found this extension. It is almost identical to processing IDE's default formatting but one issue that I found is that the formatter also formats inside strings which sometimes causes errorrs with font & image loading.
A fix for that would be very nice!

[feature-request] Add semicolon at end of statements

I think it will be a good idea to auto-add missing semicolons at end of line during format. It's quite a common issue to miss out on semicolons...

Is your feature request related to a problem? Please describe.
Missing semi-colons causing processing to terminate.

Describe the solution you'd like
Auto-add semicolons at end of line during format.

Describe alternatives you've considered
N/A

Additional context
N/A

I will be interested to help out with this feature if you can give me some pointers on how it could be implemented on this ext!

Weird behaviour with negative numbers

Describe the bug
For negative numbers, the extension seems to insert a space between the number and the sign (if the insert spaces option is turned on or off doesn't seem to make a difference here; though I don't think this is desirable behavior either way) and then proceeds to insert and remove a space left or the negative sign with each formatting run.

To Reproduce

  1. Type a negative number anywhere, for example on an empty line -15
  2. Format. The line will turn into - 15
  3. Format again. The line will turn into - 15
  4. Goto 2.

Expected behavior
For the screenshot I've shared, the expected formatting would in my opinion be:

········triangle(-10, 10, 0, -20, 10, 10);

Screenshots
2021-05-12_20-56-44

Settings and Version information

  • Insert spaces: yes
  • Formatter version: v0.4.1
  • VS Code version: 1.56.1

Additional context
Thanks for smashing that other bug yesterday so quickly <3

Formatter should use the indentation setting for the current file (tab vs. spaces)

Description
The formatter seems to force indentation using tabs. When formatting a pde file that uses spaces for indentation the formatter will replace the indentations to use tabs.

To Reproduce
Steps to reproduce the behavior:

  1. Open a pde file that uses spaces for indentation
  2. Run a format document command
  3. Notice how all indentations are changed to tabs
  4. Notice how indentation level i wrong -> everything is indented only by one level. (This is fixed when doing a second format document though)

Expected behavior
The formatter should honour the current indentaion mode of the current file -> Tabs or Spaces (and the spaces count).

Version information

  • Formatter version: v0.3.14
  • VsCode version: v1.52.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.