Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add options to apply formatting by file extension, file syntax, or both#81

Open
owenleonard wants to merge 1 commit into
jdavisclark:master from
owenleonard:master
Open

add options to apply formatting by file extension, file syntax, or both #81
owenleonard wants to merge 1 commit into
jdavisclark:master from
owenleonard:master

Conversation

@owenleonard

@owenleonard owenleonard commented Aug 30, 2013

Copy link
Copy Markdown

I saw issue 69 (#69) and it related to something I was trying to figure out. I like the formatting that jsbeautify does for javascript, but not for JSON. I just find it expands things too much. So, I wanted to be able to continue using jsFormat for javascript files, but not for JSON files.

Since issue 69 also wanted to exclude js.erb files from being formatted, I thought a good solution would be to allow the user to configure jsFormat to format files based on file extension, file syntax, or both. This way, you can enable/disable jsFormat for a file extension regardless of the content of the file, or you can configure it to format based on file syntax regardless of the file extension. The defaults leave the functionality the same as before the changes.

Let me know what you think about these changes. Any recommendations? Optimizations?

Copy link
Copy Markdown
Owner

looks good.
As soon as we get #79 finished up I'll merge this in.

Copy link
Copy Markdown
Author

Thanks. Let me know if I can do anything to help.

Copy link
Copy Markdown
Owner

Promise I haven't forgotten this. I branched off from your pull request and added some more functionality to it; haven't pushed up to a feature branch yet though. Trying to make sure It's well though out before we publish, as it's the type of thing where I keep thinking of more little details that are convenient to make configurable via user settings.

I'll push up to a feature branch some time this week so people can have a look at it.

Copy link
Copy Markdown
Owner

@owenleonard Alright, I know this is ridiculously late, but have a look at the changes in the plugin_activation branch. I took what you started with and added a few more options to it. Welcoming any feedback.

Copy link
Copy Markdown

Hi @jdc0589 did this ever get merged in? Are you still waiting for feedback? If so, how would I go about installing JsFormat from that specific branch?

Thanks for your work on this.

Copy link
Copy Markdown
Owner

@jackocnr it's not merged in yet, mainly because I've been a bad project maintainer lately and forgot about it. mite-node has been taking up a lot of my free time lately...

There have been a few additions in master since the work on that branch, but you could install from the plugin_activation branch if you want to have a look at it, I would certainly appreciate any feedback.

To install that branch, remove the existing JsFormat package, navigate to [Sublime Root]/Packages, git clone this repo there, and then fetch + checkout the plugin_activation branch. Then have a look at the documentation for the new jsFormat specific settings in that branch.

I need to review it all, but it looks like it can still be merged to master relatively easily. I'll try and get it in soon.

ctf0 commented Oct 1, 2014

Copy link
Copy Markdown

as a temp solution for ignoring json formatting ,u can use a plugin call Hook and add this to ur user settings file

"on_pre_save_language": [
 {
 "command": "js_format",
 "context": [{"key": "selector", "operator": "equal", "operand": "source.js"}]
 },
 ]

but to say the least ,the plugin_activation branch has some ridiculously awesome options which i hope it get merged sometime soon.

Copy link
Copy Markdown

Any news? This feature would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /