Comments (4)
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.
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.
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.
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)
- Make sure the compiler module is this hex package is compiled before other dependencies HOT 1
- `mix compile` fails at the root of an umbrella app if a sub-app requires gleam dependencies HOT 1
- module MixGleam is not available HOT 3
- Use precompiled Erlang modules HOT 3
- when gleam version is higher than v0.19.0, `File.CopyError` raised HOT 11
- Moving .gleam doesn't remove old .erl files HOT 3
- Gleam modules are not compiled to beam when using gleam v0.25.0 HOT 1
- Compiling fails with "mix deps.compile" HOT 9
- `mix compile` fails to compile if importing a gleam package using a local path or a git url HOT 3
- Inform about gleam.toml HOT 1
- Elixir 1.15 support HOT 4
- Cannot compile gleam dependencies (but gleam compilation works) HOT 2
- warning: Transitive dependency imported
- Error when generating Ecto migration with Gleam compiler added
- mix gleam.test warning about dependencies HOT 1
- Elixir-ls infinite compile loop HOT 1
- gleam_stdlib v0.18.1 fails to compile with mix_gleam v0.2 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mix_gleam.