Closed jrieken closed 6 years ago
Thanks for the heads up, I got a bit confused whether the range
parameter provides document.selection already (it wasn't the case a couple of versions ago). I'll check and fix the code once I confirm that (or when a new version of VSCode with the discussed changes arrives).
Yeah, it's almost always the selection but something something different...
@xsburg Hey! Now that Microsoft/vscode#49024 is deployed in Stable, did you have any plans to refactor your code actions to use it? This change would actually benefit VS Live Share, since the use of activeEditor
prevents a "guest" in a collaboration session from running a code action within a file that the "host" isn't also actively editing. I'd love to get JS Booster working great with Live Share!
@lostintangent Hi! I was delaying the fix so that everybody gets the updated version of VSCode. Now I think it's time to release the refactoring on my part. I've just pushed the changes and will probably release an update in a couple of days.
I have a related question though, will the command triggered by a code action have access to activeEditor
when a "guest" is editing a file which is not being edited by the "host"? I assume it has but based on your description I have a few doubts about how VS Live Share handles it.
The issue is addressed in v0.10.0.
We have found that this extension uses
activeTextEditor
inside theprovideCodeActions
-function, see https://github.com/xsburg/vscode-javascript-booster/blob/bb541fef09d85942bb8be5d52ca8fd94aab0f572/src/CodeModCodeActionProvider.ts#L18While the assumption is often true it's not always the active editor in which code actions are being requested for. Think of api-commands or the run-code-action-on-save feature that are going to ship with 1.23.
Please join our discussion here https://github.com/Microsoft/vscode/issues/49024.
Thanks & Happy Coding