Giter Club home page Giter Club logo

Comments (4)

stoft avatar stoft commented on August 28, 2024 3

Thanks for the quick reply! Makes sense.

I searched a bit but couldn't find an ignore option in ElixirLS so I solved it with this simple workaround, that excludes the gleam compiler when ElixirLS is running. Since ElixirLS will most likely only run in a developer context and the :dev environment includes the gleam compiler, gleam code should already be up to date when ElixirLS compiles the rest.

Mix.exs (golf version, could be replaced with a proper if-else block):
compilers: ((Mix.env() == :elixirls && []) || [:gleam]) ++ Mix.compilers(),

VSCode settings:
"elixirLS.mixEnv": "elixirls"

In a more complex project (e.g. in my Phoenix project) a config/elixirls.exs is needed. This could simply import one of the others:

use Mix.Config

import_config "test.exs"

from mix_gleam.

alexanderzinolidis avatar alexanderzinolidis commented on August 28, 2024 3

For anybody coming to this now, changing compilers in mix.exs no longer works.

Do this instead:

mix.exs:

Change this:

aliases: MixGleam.add_aliases(aliases()),

To this:

aliases: (Mix.env() == :elixirls && []) || MixGleam.add_aliases(aliases()),

VSCode settings:

"elixirLS.mixEnv": "elixirls"

from mix_gleam.

lpil avatar lpil commented on August 28, 2024 1

Hiya! It looks like the ElixirLS is detecting the generated Erlang created by the Gleam compiler and is triggering compilation again. ElixirLS will need to ignore the gen directory to avoid this.

A later version of Gleam will change where Erlang is written to so this shouldn't be a problem after that point, but ElixirLS will need to handle it until then.

from mix_gleam.

sekunho avatar sekunho commented on August 28, 2024

Ran into this issue as well but it turns out I could have emacs ignore whatever. Maybe this issue would be useful for others.

from mix_gleam.

Related Issues (18)

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.