Replies: 1 comment
-
I don't think it's possible to directly hook up file extensions like you're wanting. It might be possible to allow dynamically chosen languages, though. VSCode lets the user map file extensions to language codes through "files.associations" in their preferences. Formatting providers register as providing services for particular languages in their Presumably in your case you your colorizer is already declaring a language code for your custom language. So it might be possible for FracturedJsonVSC to register as a formatting provider for Of course, it's a big API - there may be better ways to handle all this that I don't know. I'd be interested in hearing if there are other users out there interested in this case, and other extensions that do the same thing. My first impression is that this would be a lot of work for a pretty narrow use case, given that the command palette provides a pretty solid workaround. I'm happy to hear more on the topic of course, or to consider pull requests. |
Beta Was this translation helpful? Give feedback.
-
Hi,
First of all, this is a really nice tool! 👍
Then my issue:
I've created a json based language with it's own file extension (let's say
.foo
).It's a perfectly valid json file, but I've created custom syntactic parser/colorizer in VS Code
I want to use FracturedJson to format those files
I can't set
"files.associations"
for this as it override colorizerCommand: Format JSON Document
work perfectly fine but[Alt] + [Shift] + [F]
Can you let us define custom file extensions for your formatter?
(I've accidentally created Issue here, sorry for all that spamming… Finally the "right" issue is created here : j-brooke/FracturedJsonVSC#8)
Beta Was this translation helpful? Give feedback.
All reactions