Giter VIP home page Giter VIP logo

Comments (4)

michalmuskala avatar michalmuskala commented on May 20, 2024 1

What we have in eqwalizer is actually not available in regular Erlang. We not only have line + column, but we actually have full start/end range for every construct in AST (the price is that the AST format is not backwards compatible). This allows the reported ranges to be precise, rather than just the single point information that Erlang compiler has - that said, this is still better than just line information.

from rebar3.

ferd avatar ferd commented on May 20, 2024

This isn't really hard and I wanted to give it a try for a partial implementation to see the style, it looks like this so far:

-module(rebar_fake).

-export([diagnostic/1]).

diagnostic(A) ->
    X = add(5 / 0),
    {X,X}.

add(X) -> X.

add(X, Y) -> X + Y.

Calling rebar3 escriptize:

...
===> Compiling rebar
===> Compiling apps/rebar/src/rebar_fake.erl failed
apps/rebar/src/rebar_fake.erl:5:12:
  diagnostic(A) ->
             ^-- variable 'A' is unused
apps/rebar/src/rebar_fake.erl:6:15:
      X = add(5 / 0),
                ^-- evaluation of operator '/'/2 will fail with a 'badarith' exception
apps/rebar/src/rebar_fake.erl:11:1:
  add(X, Y) -> X + Y.
  ^-- function add/2 is unused

Seems to be okay-ish.

See #2783

from rebar3.

ferd avatar ferd commented on May 20, 2024

(this draft PR is likely to look like garbage on errors on long long lines I guess, but it shows a very easy way to get improvements)

from rebar3.

tsloughter avatar tsloughter commented on May 20, 2024

Ah, I thought it did the range based on the error itself. Like if the error says there is an issue at when then you know to highlight the whole when.

from rebar3.

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.