misogi / vscode-ruby-rubocop

Rubocop extension for Visual Studio Code
https://marketplace.visualstudio.com/items/misogi.ruby-rubocop
MIT License
137 stars 68 forks source link

Lint on open #29

Closed agross closed 8 years ago

agross commented 8 years ago

Hello,

first off, thanks for writing this extension!

I'd like to run rubocop when the file is opened in the editor without having to press a keyboard shortcut. Would you mind adding this feature?

Thanks!

misogi commented 8 years ago

Hello @agross. This feature is sounds good to me. First time I opened a ruby file. I had to edit and save.

Please let me know about event handler like onDidSaveTextDocument() if you know.

agross commented 8 years ago

https://code.visualstudio.com/Docs/extensionAPI/vscode-api

onDidOpenTextDocument: Event<TextDocument>

An event that is emitted when a text document is opened.

agross commented 8 years ago

Also see lint modes of Sublime Text.

http://www.sublimelinter.com/en/latest/lint_modes.html

This is my favorite and also the default:

In background mode, lint requests are generated for every modification of a view, as well as on file loading and saving. This is the default mode.

misogi commented 8 years ago

I release a new version and executing rubocop also onDidOpenTextDocument.

agross commented 8 years ago

👍