patrickdavey

patrickdavey

Heex formatting with vim (and coc.vim)

My vim setup is not formatting heex files (it’ll format .ex files on save happily).

When I run it manually with :call CocAction('format') I get Error invoking 'format' on channel 3 (coc):^@Format provider not found for buffer: and I’m a little lost.

My config has:

      "elixir",
      "heex",
      "javascript"
    ],

And if I run :set filetype it has filetype=heex.

If I run the formatter manually with mix format it works fine.

anyone have this working and can give me a pointer?

Most Liked

arcanemachine

arcanemachine

Here’s the Elixir-related stuff from my ~/.config/nvim/coc-settings.json file:

{
  "coc.preferences.formatOnSave": true,
  "coc.preferences.formatOnSaveFiletypes": [
    "elixir",
    "eelixir",
    "heex",
    "json",
    "jsonc"
  ],
  "diagnostic.checkCurrentLine": true,
  "diagnostic-languageserver.filetypes": {
    "elixir": ["mix_credo", "mix_credo_compile"],
    "eelixir": ["mix_credo", "mix_credo_compile"],
    "heex": ["mix_credo", "mix_credo_compile"]
  },
  "elixir.pathToElixirLS": "~/.local/lib/elixir-ls/language_server.sh",
  "elixirLS.dialyzerEnabled": true,
  "tailwindCSS.includeLanguages": {
    "eelixir": "html",
    "elixir": "html",
    "heex": "html"
  }
}

I’ll be honest, I wouldn’t be surprised if some of those lines aren’t actually doing anything, and might just be residue left over from a previous time where I was in the same position as you.

The Tailwind stuff is for some CoC Tailwind plugin, and the pathToElixirLS is where I saved a copy of ElixirLS that I downloaded from their GitHub releases page.

As for the Credo stuff, well… I have no idea when or why I put that there. Might need to do some spring cleaning for my cluttered CoC config…

Where Next?

Popular in Questions Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement