Gusti
Hi,
I cannot get VS Code with the elixir-ls extension to format my code.
Only thru “mix format” command.
Environment:
Erlang/OTP 23 [erts-11.0.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
Elixir 1.11.3 (compiled with Erlang/OTP 23)
elixir-lsp.elixir-ls-0.6.2
I even tried after recompiling elixirls with my current elixir installation.
I have configured VS Code settings.json, to specify ‘elixir-lsp.elixir-ls’ as the default formatter.
Any ideas what other things I need to tweak in order for it to work?
Best regards,
Gusti.
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










First 9 of 9 Posts
axelson
Hi
! Are you running the “Format Command” in VSCode (defaults to alt+shift+f)?
If that isn’t working then try running through the debugging steps: GitHub - elixir-lsp/vscode-elixir-ls: Elixir language support and debugger for VS Code, powered by ElixirLS. · GitHub
Gusti
I tried with keyboard secuences alt+shift+f.
I also tried with Ctrl+shift+p, then “Format document”
Nothing happens.
View output:
Started ElixirLS v0.6.2
Elixir version: “1.11.3 (compiled with Erlang/OTP 23)”
Erlang version: “23”
ElixirLS compiled with Elixir 1.8.2 and erlang 21
MIX_ENV: test
MIX_TARGET:
[Info - 12:40:35 PM] Compile took 550 milliseconds
[Info - 12:40:35 PM] [ElixirLS WorkspaceSymbols] Indexing…
The toggle developer tools output is:
electron/js2c/renderer_init.js:15 (electron) Security Warning: webFrame.executeJavaScript was called without worldSafeExecuteJavaScript enabled. This is considered unsafe. worldSafeExecuteJavaScript will be enabled by default in Electron 12.
log @ electron/js2c/renderer_init.js:15
electron/js2c/renderer_init.js:135 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security
Policy set or a policy with “unsafe-eval” enabled. This exposes users of
this app to unnecessary security risks.
For more information and help, consult
Security | Electron.
This warning will not show up
once the app is packaged.
(anonymous) @ electron/js2c/renderer_init.js:135
workbench.html:1 A cookie associated with a cross-site resource at https://open-vsx.org/ was set without the
SameSiteattribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set withSameSite=NoneandSecure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at Chrome Platform Status and Chrome Platform Status.webviewElement.ts:90 [Embedded Page] %cElectron Security Warning (enableBlinkFeatures) font-weight: bold; This renderer process has additional “enableBlinkFeatures”
enabled. This exposes users of this app to some security risk. If you do not
need this feature, you should disable it.
For more information and help, consult
Security | Electron.
This warning will not show up
once the app is packaged.
webviewElement.ts:90 [Embedded Page] (electron) Security Warning: webFrame.executeJavaScript was called without worldSafeExecuteJavaScript enabled. This is considered unsafe. worldSafeExecuteJavaScript will be enabled by default in Electron 12.
webviewElement.ts:90 [Embedded Page] %cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
Policy set or a policy with “unsafe-eval” enabled. This exposes users of
this app to unnecessary security risks.
For more information and help, consult
Security | Electron.
This warning will not show up
once the app is packaged.
webviewElement.ts:90 [Embedded Page] %cElectron Security Warning (enableBlinkFeatures) font-weight: bold; This renderer process has additional “enableBlinkFeatures”
enabled. This exposes users of this app to some security risk. If you do not
need this feature, you should disable it.
For more information and help, consult
Security | Electron.
This warning will not show up
once the app is packaged.
webviewElement.ts:90 [Embedded Page] (electron) Security Warning: webFrame.executeJavaScript was called without worldSafeExecuteJavaScript enabled. This is considered unsafe. worldSafeExecuteJavaScript will be enabled by default in Electron 12.
webviewElement.ts:90 [Embedded Page] %cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
Policy set or a policy with “unsafe-eval” enabled. This exposes users of
this app to unnecessary security risks.
For more information and help, consult
Security | Electron.
This warning will not show up
once the app is packaged.
log.ts:191 WARN Settings pattern “workbench.fontAliasing” doesn’t match any settings
log.ts:191 WARN Settings pattern “settingsSync." doesn’t match any settings
log.ts:191 WARN Settings pattern "sync.” doesn’t match any settings
Gusti
But these electron warnings were there at the start of VS Code, before I tried to format.
Gusti
As I could not get it work, I created a VSCode Task, to execute “mix format”, and assigned it a keyboard sequence.
So, instead of pressing just Ctrl+S to save my file and format it, I need to press another key sequence after the save. It is not terribly bad. It’s a workaround, until somebody enlightens me.
Best regards,
Gusti.
hoetmaaiers
Hi, I experience the same problem, the format command from VSCode does not trigger
mix format. When runningmix formatfrom the CLI this goes well.My Elixir-ls output log looks fine:
What else should I check into?
mattbaker
I’d bounce over to Issues · elixir-lsp/elixir-ls · GitHub to see if there are any similar issues logged (and create one if not).
Sebb
Beware, that the code is not formatted if there are syntax errors.
mattbaker
FWIW I’ve been having trouble too (formatter.exs seems to not be respected) and rolled back to the previous version, I just haven’t been able to gather enough details to post a helpful issue yet
It doesn’t seem related to the existing issue about formatter.exs during compilation, but I need to double check first.
jameskent
Try
ctrl + shift + I. CheckFile, Preferences, Keyboard shortcuts.