HiPhish
Hello,
I know that I can get the documentation of a symbol in iex by typing h whatever, but is there a way to get this documentation programmatically? For context, I use Neovim and I would like a way of reading the documentation inside an editor buffer instead of a REPL running inside a terminal shell. I have already written info.vim which does similar thing for GNU Info documents. Neovim makes it possible to write remote plugins in Elixir, so if there is some Elixir module to get the documentation as a text string it should be fairly simple to pull off.
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
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 have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
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
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
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
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
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
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
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 9 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
lukaszsamson
If you are looking for something more lightweight than a full language server than you could try elixir_sense, the lib utilised by elixirLS - elixir_sense/lib/elixir_sense.ex at 28f8467a349c6ed004aac66a2e8d7020cdde2e0d · elixir-lsp/elixir_sense · GitHub
HiPhish
Yes, I am aware of it and I’m using it, it’s a fantastic tool.
That’s the plan, I am working through the guide right now and I want to try my hands at something useful next. Plus, I prefer reading documentation in a separate buffer I can have open to the side rather than a floating window. I could have probably hacked something using the Lua API of the built-in client, but this seems more interesting. Plus it would work even without a language server running.
axelson
I just wanted to make sure you’re aware that there are existing ElixirLS-powered vim/neovim extension that already support fetching Elixir documentation:
But if you want to create to create this extension for learning purposes, or as an improvement (such as being lighter-weight), then please go ahead
eksperimental
You can use
Kernel, no need for cumbersome and non-standard:'Elixir.Kernel'. BtwKernelis an alias that resolves to:"Elixir.Kernel".:Kernelis just an atom.eksperimental
You can have a look at ExDoc source code, paritcularly to the retriever module.
https://github.com/elixir-lang/ex_doc/blob/master/lib/ex_doc/retriever.ex
Other Elixir modules of interest are:
Have fun!
HiPhish
Great, that works!
Code.fetch_docs(:'Elixir.Kernel')gives me structured data which I can work with. One more question, how do I specify a function? I have triedCode.fetch_docs(:'Elixir.Kernel.is_atom/1'), but I get{:error, :module_not_found}, same thing without the/1part.EDIT: Never mind, I need to look at the implementation of
Ex.Introspection.h/1, notEx.Introspection.h/1.benwilson512
:Kernelis not the same asKernel.Kernelis the same as:'Elixir.Kernel'. TryIEx.Introspection.h(Kernel)HiPhish
Thanks, that looks like what I need. I tried calling it by hand, but I get an error instead:
I looked up the definition of
h, but it uses macros, which I am not yet familiar with.emoragaf
Take a look at
himplementation: elixir/lib/iex/lib/iex/introspection.ex at d8d89b431e197dd230ce01bc20f4656d9ef24e5c · elixir-lang/elixir · GitHubIt seems to be using
Code.fetch_docsunderneath