BoostIO / BoostNote-Legacy

This repository is outdated and new Boost Note app is available! We've launched a new Boost Note app which supports real-time collaborative writing. https://github.com/BoostIO/BoostNote-App
Other
17.07k stars 1.47k forks source link

Snippet Default Language by folder #3009

Open stalonium opened 5 years ago

stalonium commented 5 years ago

Current behavior

Currently it is only possible to set a Snippet Default Language globally in the settings.

Expected/Suggested behavior

It would be nice to have the option to set a different default language on folder level so that different folders for different languages don't force me to manually change the language on every snippet if it doesn't match the global default language.

I made a UI mockup to visualize how it could look for the User:

UI Mockup

Steps to reproduce

Currently

  1. Select Preferences
  2. Select the Interface tab
  3. In the category Editor select the Snippet Default Language in the dropdown

Suggested Addition

  1. Select Preferences
  2. Select the Storage tab
  3. Click Edit on a folder in your Storage Locations
  4. In addition to the label for the name switching to a textbox to change the name there should also be a dropdown that enables the user to select a default language for that folder.

Environment

Desktop

MiloTodt commented 5 years ago

Idea for alternative implementation:

If the name of the location is a language on that list, how about setting that as the default snippet language for that folder?

I'd have to imagine if you're calling a folder something like C++, Javascript, etc it's a somewhat fair assumption that it will contain code in that language.

arcturus140 commented 5 years ago

I like the idea. languages could be sorted by frequency per folder. Also a way to disable language options, like in a config file for example. There are so many you aren't gonna need them all.

Otherwise I'd need a monitor twice as high to pick my language without scrolling.

stalonium commented 5 years ago

If the name of the location is a language on that list, how about setting that as the default snippet language for that folder?

Mh.. It would be better than nothing but would still not work so well in a few scenarios.. For example, I have a folder named WPF, but the language (markup) setting for that would be XML (or XAML). As you describe it this wouldnt really work in these cases unless you could map it somehow.