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

vscode.executeSelectionRangeProvider returns array of empty objects #75746

Closed
sergei-dyshel opened this issue Jun 19, 2019 · 1 comment
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug smart-select verified Verification succeeded
Milestone

Comments

@sergei-dyshel
Copy link

  • VSCode Version: 1.35.1
  • OS Version: Linux

By looking at the source there is a (still) undocumented command vscode.executeSelectionRangeProvider which is supposed to work similarly to other execute...Provider commands.

When running the following code inside extension

  const result = await commands.executeCommand(
      'vscode.executeSelectionRangeProvider', window.activeTextEditor!.document.uri,
      [window.activeTextEditor!.selection.active]);
  console.info(result);

and looking at the result in DevTools I see that the size of returned array looks valid but all objects (that are supposed to be of type SelectionRange) are empty.

image

It's important to note that expand/shrink commands work normally in editor so it's just extension host that receives empty objects.

BTW, by looking at command's test in

let value = await commands.executeCommand<vscode.SelectionRange[][]>('vscode.executeSelectionRangeProvider', model.uri, [new types.Position(0, 10)]);
assert.equal(value.length, 1);
assert.ok(value[0].length >= 2);
I see that only array size appears to be tested (which works correctly) but not array contents.

@jrieken jrieken added info-needed Issue requires more information from poster bug Issue identified by VS Code Team member as probable bug smart-select and removed info-needed Issue requires more information from poster labels Jun 19, 2019
@jrieken jrieken added this to the June 2019 milestone Jun 19, 2019
@jrieken
Copy link
Member

jrieken commented Jun 19, 2019

Yeah, looks like this is using the wrong type...

@jrieken jrieken closed this as completed Jun 19, 2019
jrieken added a commit that referenced this issue Jun 19, 2019
sergei-dyshel pushed a commit to sergei-dyshel/vscode that referenced this issue Jun 21, 2019
@RMacfarlane RMacfarlane added the verified Verification succeeded label Jun 26, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug smart-select verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants