GithubHelp home page GithubHelp logo

Comments (5)

y451309839 avatar y451309839 commented on August 16, 2024

php

from better-align.

tananhcs avatar tananhcs commented on August 16, 2024

hope fix soon

from better-align.

FyerPower avatar FyerPower commented on August 16, 2024

I'm not sure if this is the proper solution, but I think it might work to solve the issues described above. I'm not entirely sure how to write atom extensions or even test this change below, but perhaps @WarWithinMe might be able to use this as a solution and we can get this fixed 😄

Basically we're adding a new else if statement after https://github.com/WarWithinMe/better-align/blob/master/src/formatter.ts#L201 to check for the cases above.

      let char = text.charAt(pos);
      let next = text.charAt(pos+1);
      let prev = pos > 0 ? text.charAt(pos-1) : "";

      ...
      } else if ( char == "=" && next == "=" ) {
        currTokenType = TokenType.Word;
        nextSeek = 2;
      } else if ( char == "=" && (prev == "=" || prev == "<" || prev == ">") ){
        currTokenType = TokenType.Word;
        nextSeek = 1;
      }
      ...

For the case where === is encountered, it will first trigger the first if above on when analyzing the first = in the string and then push to the nextSeek to look at the third = which then gets marked as an TokenType.Assignment a few else if statements later. But if we check check to see if the previous character is = we'll mark it as a TokenType.Word and not reach the later else if statement.

For the case of <= and >=, the last logic applies. It reaches our new if and marks it as a Word before it gets a chance to reach the assignment check.

from better-align.

huanguolin avatar huanguolin commented on August 16, 2024

I created a pull-request to fix this #41 .
Please @WarWithinMe check and accept it, thanks!

from better-align.

tony-show avatar tony-show commented on August 16, 2024

Please, update your plagin for VS Сode with this fix. Thanks lot!

from better-align.

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.