dogweather

dogweather

ByeSpec—a VS Code extension to customize @spec appearance

The byesig extension is one of my favorites when doing Ruby+Sorbet coding. I forked it to create ByeSpec to do the same for Elixir specs. Here’s how I use it:

Before

After

On a light theme

I want to see my specs, but I also want to reduce visual noise from so much text on the screen. Opacity and some other settings are configurable, like the option to show the green markers in the left-hand column. Personally, they help me navigate my code, seeing where the functions begin.

Byesig does code folding too for the Sorbet sigs, which needs a little effort to get working with specs.

This is v1.0.0 and my first IDE extension, so YMMV. :slight_smile:

Most Liked

cmo

cmo

Nice one @dogweather. It doesn’t seem to work on multi-line specs. The first line is subdued, but the following lines are not.

Would be handy to be able to subdue @impl too.

sodapopcan

sodapopcan

Vim users can achieve this with the following:

" ~/.vim/after/colors/elixir.vim

hi link elixirFunctionSpec Comment
call matchadd("elixirFunctionSpec", '^\s\+@spec\_.*::.*$')

Regex may need tweaking, I haven’t used this since my old job.

sheerlox

sheerlox

Great idea! I’m definitely installing that tomorrow when I get back to work :wink:

Quick licensing heads up: I noticed you’ve replaced the original license file. You should probably restore the original copyright (while keeping your own), as mentioned in the MIT License (“The above copyright notice […] shall be included in all […] substantial portions of the Software.”)

This would do the trick:

MIT License

Copyright (c) 2023 Public.Law
Copyright (c) 2022 Peter Arato

Last Post!

Malian

Malian

@dogweather Same for @type

Capture d’écran 2023-12-21 à 16.14.09

Thanks for this useful extension for people like me who customizes their IDE a lot (perhaps too much :sweat_smile:)

Where Next?

Popular in Announcing Top

mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
versilov
Could not wait for the missing Elixir ML libraries to appear, so, I wrote one myself, taking https://github.com/sdwolfz/exlearn as a foun...
New
tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement