HiDeoo/toggler

[Discuss] Array to string toggle?

carusogabriel opened this issue ยท 4 comments

I'm thinking in a toggle for array and string data types toggle. Or will be a better solution implement an array of data types? Ex:
["binary", "int", "float", "double", "long"] for numerics,
["string", "char"] for characters, and
["array", "object"]?

This is an interesting idea altho it may result in a very opinionated package by default. You wouldn't expect the same data types toggles if you're coding in C++, in Swift, in vanilla JS, using Flow or TypeScript.

Including every data types is not an option obviously and I'm not sure that adding per grammar toggles is worth the overhead vs having the user customising its own toggles for the languages they're using.

Did you have any thoughts on how this kind of feature could be implemented?

Manoz commented

Maybe something more global?
["string", "array", "object", "null"]

I'm thinking about the infinite keymap loop for each language data types: Cmd +, r, r, r, r, r, r [...] :D

@HiDeoo That's true, this data types segmentation would be an overhead for us.

What about @Manoz's idea? Make just a global for all languages?

I still think even if the idea is great that would still cause issues or unexpected behaviours, what about languages not having object or null, the languages using Array vs array, the languages using nil and the ones who don't, etc.

The main reason I created this package as highlighted in the README was for it be easily user customizable. Other similar plugins existed before this one for Atom but none of them allowed customizations of the toggles without editing / modifying / republishing a package.

I think this is the kind of thing that should be let to the user so everyone can have their own data types depending on the languages they usually work with.

Having said that, I think it could still be a good idea to add to the README a new section like "Toggles ideas" providing this kind of data types toggles for multiple languages as an example for users with most used languages: C, C++, Swift, JS, etc.

I'll work on adding that for the next release.