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

Add VS Code support for --open #206

Merged
merged 1 commit into from
May 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ Fix it by setting path to your editor of choice in ~/.bashrc or ~/.zshrc:
report.results
.filter(file => file.errorCount > 0)
.forEach(file => {
// Sublime Text and Atom support opening file at exact position
if (['subl', 'atom'].indexOf(executableName) >= 0) {
// VS Code requires --goto option for path:line:column
if (executableName === 'code') {
args.push('--goto');
}

// Sublime Text, Atom, and VS Code support opening file at exact position
if (['subl', 'atom', 'code'].indexOf(executableName) >= 0) {
args.push(file.filePath + ':' + lineColumn(file.messages[0]));
return;
}
Expand Down