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
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted”
Version...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
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
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
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.