-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Execute SQL statement at cursor location #934
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I think this looks pretty decent. Take a look at my question/comment for the onRunQuery method, but otherwise, I think this is fine.
src/controllers/mainController.ts
Outdated
@@ -307,6 +316,15 @@ export default class MainController implements vscode.Disposable { | |||
|
|||
Telemetry.sendTelemetryEvent('RunQuery'); | |||
|
|||
if (execStatment) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not certain on how this is supposed to work. Isn't the contract to send a line and column number? If so, how does the start/end position play into this?
I think it might be a bit cleaner to factor out the prompting/retry logic and have two onRunQuery methods, one for a single statement, one for a selection/entire doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benrr101 I've refactored that code that to make it more clear what's going on. When there is no selection range the editor selection property gives the cursor position, otherwise we use the start position in the selection as the cursor position.
No description provided.