Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use formatter API for better integration #5

Closed
jrieken opened this issue Oct 18, 2016 · 5 comments
Closed

Use formatter API for better integration #5

jrieken opened this issue Oct 18, 2016 · 5 comments
Assignees

Comments

@jrieken
Copy link

jrieken commented Oct 18, 2016

I'd recommend to use the languages API to register a formatting edits provider because it will allow for a better integration in VS Code. There is the registerDocumentFormattingEditProvider-function which is the way to introduce a formatter for certain document types. It will integrate you into the Format Code action (context menu, F1) and also into the Format On Save-feature.

It's more or less a matter of calling this code from within DocumentFormattingEditProvider

@maxmatthews
Copy link

@jrieken @Dickurt made a pull request for this: #6

@vysker
Copy link
Owner

vysker commented Oct 20, 2016

Thank you for actually looking at my code guys. I have been meaning to do this, but after the vscode 1.6.0 update came out, I didn't know where to look for the right events to hook into. So you pointed me into the right direction, @jrieken. Unfortunately, my extension is in plain old JS, so I couldn't figure out how to translate the TypeScript to plain JS. I struggled with that for a couple of hours and eventually gave up because I had other things to do.

@maxmatthews I saw your pull request and tested it locally. Unfortunately it doesn't seem to be working. I wrote a review on the pull request.

@jrieken
Copy link
Author

jrieken commented Nov 18, 2016

Anything I can help you guys with?

@vysker
Copy link
Owner

vysker commented Nov 21, 2016

I will be rewriting the plugin in TypeScript somewhere in the near future. That will help with integrating the new VSCode features more easily.

So, for now, I don't think there is anything you could necessarily help with. Other than that, I want to commend you on your superb commitment @jrieken. Thanks!

@vysker vysker self-assigned this Nov 21, 2016
@vysker vysker added this to the Utilize new VSCode features milestone Nov 21, 2016
@vysker
Copy link
Owner

vysker commented Nov 22, 2016

Resolved with conversion to TypeScript in latest milestone.

@vysker vysker closed this as completed Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants