We’ve spent some time thinking about how we can allow customizing some of the editor tooling behavior. This is so that primarily library authors could improve the DX of using their libraries by hiding irrelevant modules/values from autocomplete, and so on. But, we need your help to come up with the most important customizations, and what would help improving the DX most.
Here are a few ideas me and @cristianoc have had. Ignore the names of attributes etc for now, we’ll make sure they’re good before we build anything. Let’s focus on the function of them to start.
Values and types
// `someFunc` will only appear in autocomplete _inside_ of the file it's defined in, but never outside.
// Useful as a sort of editor level %%private, but where making the function private isn't possible for various reasons
@editor.autocomplete.ignoreOutsideOfFile
let someFunc = () => {...}
// This function will now appear at the top of the autocomplete list. Any items in the same priority will be sorted alphabetically.
@editor.autocomplete.priority(1)
let otherFunc = () => {...}
These examples above could be applied to values/types equally.
Files
@@editor.autocomplete.hide
The above annotation would be required to be at the top of a file, and would hide that file entirely from autocomplete. Useful for hiding internal or sub modules. For instance, one fairly established pattern is to have a main module MyLib
and then have sub modules MyLib__SubModule
, MyLib__SubModule2
etc, that are then linked into MyLib
like MyLib.SubModule
. In this scenario, you typically don’t ever want the user to see MyLib__SubModule
in the autocomplete list.
This is also highly relevant for codegen tools, where some/all of the code you codegen might not be something you want the user to access directly.
Please note that all of these things would only be at the editor level. You could still access them if you type them out, and hovers etc will work as usual. They’ll just be hidden from the autocomplete list, that’s all.
Your thoughts?
What are your thoughts and ideas around what type of customizations we could allow to help improve DX? Feel free to post any thoughts, we’re trying to familiarize ourselves with the problem space. Some things will be harder/lower prio than others to do, but we do want to get all of the potential use cases on the table.
Thank you in advance, we’re looking forward to hear your ideas!