Comments (22)
The latest release of the VS Code extension (v0.2.13) should fix this. Give it a try!
from elixir-ls.
Try downloading the elixir-ls.zip
here and extract it, then try running language_server.sh
(or .bat
on Windows) from a terminal. If that fails, hopefully it'll give a more informative error. If it works, I probably should add better logging to the extension so we can figure out what's going on when it fails to launch.
from elixir-ls.
Oh, also check the dev console (Help > Toggle Developer Tools
)
from elixir-ls.
So I downloaded and extracted the folder.
In terminal, I did:
sammkj@sammkj:~/Downloads$ chmod 777 language_server.sh
sammkj@sammkj:~/Downloads$ ./language_server.sh
Content-Length: 101
{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Started ElixirLS\n","type":4}}
Then in devtool, I saw some errors when I tried to save .ex
file.
from elixir-ls.
Okay, try this: git clone --recursive [email protected]:JakeBecker/vscode-elixir-ls.git
Then open that project in VS Code and run the "Launch Extension" debug configuration. If everything goes wrong, it should break when it gets a message from the server and you can see what it is here:
Hopefully we'll be able to see what the server's sending that's messing things up.
from elixir-ls.
Okay.
Here's what I did:
git clone --recursive https://github.com/JakeBecker/vscode-elixir-ls.git
cd vscode-elixir-ls
yarn install
cd elixir-ls
mix deps.get
Then I opened the folder with VS Code and tried to debug it, saw nothing in any of the panels. 🤔
from elixir-ls.
I even uninstalled and re-installed VS Code. No difference noted.
from elixir-ls.
Open the parent folder, vscode-elixir-ls
. It should have debug configurations already.
from elixir-ls.
yeap. that's what I did.
from elixir-ls.
In the VS Code window it launches, you need to open an Elixir project and open an elixir source file. That should launch the language server, which should then crash and you can debug the exception in the original VS Code window.
from elixir-ls.
This is what I saw:
from elixir-ls.
So apparently this Logger.debug("Disabling Timber logger")
in config/config.ex
is causing problem.
from elixir-ls.
Now I'm intrigued!
Try creating a new, empty Mix project and see if the language server launches on that. If it doesn't, please post a mix project somewhere that reproduces the error so I can check it out.
from elixir-ls.
Looks like I reported the same issue in the wrong repo: JakeBecker/vscode-elixir-ls#43
The source I am using worked on another OS (LinuxMint vs PopOS), so the mix file hasn't changed between working and none working installs.
Project (use the sensors
branch) that causes the issue for me: https://gitlab.com/fkumro/lake_effect/commits/sensors
I launched the debugger for the extension, and my other Elixir project builds the core PLT. Nothing is shown in the debug console for the project that contains the errors (shown below).
from elixir-ls.
@fkumro Thanks for posting that project, I can reproduce the problem on it. I'm looking into it.
from elixir-ls.
Okay, I've figured out the problem.
The first thing ElixirLS does when it launches is replace the built-in process for stdout with another process that wraps any output with a window/logMessage
JSON message. But before Mix even launches the language server task, it loads the mixfile from the current folder, so if there's any print statements in the mixfile, it will print those without wrapping them.
I'm working on a fix.
from elixir-ls.
Excellent! I was also thinking what may have changed between my environments. I ended up upgrading to Nerves 1.0.0-rc.1 which may have changed what is sent to stdout. That would explain the timing of receiving the issue on my end.
from elixir-ls.
I'll do a release sometime in the next week or so with this fix, but for now, you can comment out any print or log calls in your mixfile.
from elixir-ls.
Thanks, in my case it was the call to Mix.shell().info
from elixir-ls.
removing contents of comment, issue was I didn't default a target when using it to include other configs.
from elixir-ls.
Ah... @fkumro, your "lake_effect" project is actually a good test case because of how complicated its setup is. I was able to reproduce the error and I think I've fixed it in a release I've just published (v0.2.14).
In the previous fix, I was able to have Mix avoid loading the project's mixfile until we've started intercepting stdout. But it would still try to load the config files, and in your project, that fails if the mixfile hasn't been loaded.
I've revised the way the server is launched now and it seems to fix it on your project. Please update and give it a try.
from elixir-ls.
Tested the latest release (v0.2.14) with my previous change removed. Works like a charm @JakeBecker, thanks!!
from elixir-ls.
Related Issues (20)
- Using regular atoms as module names kills outline query HOT 1
- Add nested outline view HOT 2
- Switching projects in Sublime Text triggers a crash HOT 2
- Formatter: Unknown dependency ... in the formatter configuration HOT 3
- Idea: put a .gitignore in the .elixir_ls folder HOT 2
- Debugging Scenic silently exits on launch HOT 4
- Using elixir-ls on a network mount HOT 1
- ElixirLS RuntimeError Emacs HOT 2
- Request: Action to auto-create alias for module under cursor HOT 1
- "Failed to run "elixir" command ElixirLs will probably fail to launch HOT 5
- Poor performance on Dialyzer HOT 1
- `editor.acceptSuggestionOnEnter` VSCode setting is not honored HOT 1
- vim-lsc crashes ElixirLS on method `shutdown` HOT 2
- requestMessage doesn't seem to match spec for 2 arity variant HOT 1
- how do I make @spec to print in my code? (if even possible) HOT 1
- Issue with comments in deps list HOT 1
- Incomprehensible Dialyzer warning after erlang elixir update HOT 1
- Sharing _build/deps with main project causes significant system slowdowns when running alongside Phoenix with auto reload HOT 3
- Formatter should use UTF-16 string representation HOT 1
- File issues at the new Repo!
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 elixir-ls.