Giter Site home page Giter Site logo

Comments (9)

dima74 avatar dima74 commented on June 14, 2024

@t-ricci-delta thanks for report!

Plugin highlights indent in red based on default IntelliJ formatter. If some line is highlighted in red, it means that after "Reformat Code" action this line indent will be changed. So you have four options:

  1. Reformat your code
  2. Configure your code style
  3. Enable checkbox "Never highlight indent as error" in settings
  4. Use "simple highlighter" (not recommended)

from intellij-indent-rainbow.

t-ricci-delta avatar t-ricci-delta commented on June 14, 2024

@t-ricci-delta thanks for report!

Plugin highlights indent in red based on default IntelliJ formatter. If some line is highlighted in red, it means that after "Reformat Code" action this line indent will be changed. So you have four options:

  1. Reformat your code
  2. Configure your code style
  3. Enable checkbox "Never highlight indent as error" in settings
  4. Use "simple highlighter" (not recommended)

I tried to run "Reformat Code" but the coding style remained the same. Also I'm using the Prettier extension as well:
https://plugins.jetbrains.com/plugin/10456-prettier

from intellij-indent-rainbow.

t-ricci-delta avatar t-ricci-delta commented on June 14, 2024

@t-ricci-delta thanks for report!

Plugin highlights indent in red based on default IntelliJ formatter. If some line is highlighted in red, it means that after "Reformat Code" action this line indent will be changed. So you have four options:

  1. Reformat your code
  2. Configure your code style
  3. Enable checkbox "Never highlight indent as error" in settings
  4. Use "simple highlighter" (not recommended)

Regarding point 2. I haven't found any option to allow to indent if the parameter destructuring is carried over multiple lines instead of in the same line.

I'd avoid solutions 3 and 4

from intellij-indent-rainbow.

dima74 avatar dima74 commented on June 14, 2024

Looks like the only option is to use "simple highlighter", since non-default formatter is used (Prettier)

from intellij-indent-rainbow.

t-ricci-delta avatar t-ricci-delta commented on June 14, 2024

Seems a problem of the default formatter for typescript (I disabled Prettier), this is what formatting the code looked like (ugly alignment of destructured parameter)

image

I'm still tinkering with the default code style to find out which option is behaving like that exactly

from intellij-indent-rainbow.

t-ricci-delta avatar t-ricci-delta commented on June 14, 2024

The error color to me was useful if the number of spaces was not even (multiple of configured tab width), but it's not what the plugin implementation is checking, if it relies on the formatter

(maybe it's the simple highlighter for this use case)

from intellij-indent-rainbow.

dima74 avatar dima74 commented on June 14, 2024

The error color to me was useful if the number of spaces was not even (multiple of configured tab width)

This is exactly how simple highlighter works, if I remember correctly

from intellij-indent-rainbow.

t-ricci-delta avatar t-ricci-delta commented on June 14, 2024

The error color to me was useful if the number of spaces was not even (multiple of configured tab width)

This is exactly how simple highlighter works, if I remember correctly

Then I'll stick to it since for js/ts using Prettier is far more useful. It would be a nice to have the possibility to have the other languages (C#/Java) show the spacing from the default formatter though.

For now I'm content with the "simple highligher option" since I only care if there are mixed tabs/spaces or uneven number of spaces

from intellij-indent-rainbow.

dima74 avatar dima74 commented on June 14, 2024

It would be a nice to have the possibility to have the other languages (C#/Java) show the spacing from the default formatter though.

The option to use different highlighters for different languages was added in the latest release 1.7.0:

image

from intellij-indent-rainbow.

Related Issues (20)

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.