sunjw / jstoolnpp

A JavaScript (JSON) tool for Notepad++ (formerly JSMinNpp) and Visual Studio Code.
GNU General Public License v2.0
283 stars 24 forks source link

Feature request: add option to disable new autoset-langage guess #87

Closed Vinc3r closed 3 years ago

Vinc3r commented 4 years ago

Since few versions JSTools try to "guess JSON content and set document language type according to it" (from the changelog). It could be great to let user choose if he wants this autoset or not.

As example, I use a kind-of custom json, using .patch extension, but I want javascript coloring instead of JSON, so I set up Notepad++ as this:

image

Unfortunatly each time I do a JSFormat operation, I loose this setup.


PS: thanks for your nice plugin by the way ;)

sunjw commented 4 years ago

Hi, @Vinc3r JSTool for Visual Studio Code won't change language setting that hard. If you say it is a JavaScript file, it will keep to be a JavaScript file after format. I'll try to implement this logic on NPP (if its API allow me to do this).

Vinc3r commented 4 years ago

(sorry I haven't made the precision that this was on Notepad++ [actually I haven't noticed until now that you also dev for VSCode!])

thanks

skironDotNet commented 4 years ago

This is relevant to JSON language so changing settings in JavaScript won't do anything https://github.com/notepad-plus-plus/notepad-plus-plus/issues/8035

skironDotNet commented 4 years ago

You could try to clone styles from JavaScript to JSON like I'm proposing here https://github.com/sunjw/jstoolnpp/issues/89#issuecomment-598348845

or just modify the file directly using this file %USERPROFILE%\AppData\Roaming\Notepad++\stylers.xml

Vinc3r commented 4 years ago

ok, thanks for the feedback!