Vscode-ruby: `Expand Select` does not stop at `do..end` blocks

Created on 8 Aug 2018  路  6Comments  路  Source: rubyide/vscode-ruby

Your environment

  • vscode-ruby version: latest
  • Ruby version: 2.4
  • Ruby version manager (if any):
  • VS Code version: 1.25.1
  • Operating System: Linux
  • Using language server? yes

Expected behavior

Expand Select should stop at do..end blocks

Actual behavior

Expand Select does not stop at do..end blocks

Details

image

before do
  puts "hello"
  puts "there"
end

place your cursor at the first puts "hello" , the run "Expand Select", run again to select the full line, then the _next_ run of "Expand Select" should only select the do .. end block; instead, it selects the whole file.

Thank you!

feature-request

Most helpful comment

Hey this API was shipped in v1.33, any update on this?

https://github.com/microsoft/vscode/issues/4795#issuecomment-479419404

All 6 comments

Thanks for the report. Looks like this feature is pretty buggy in VSCode itself (see microsoft/vscode#4795). It looks like third party extensions can introduce custom commands to fix this but not fix the built-in VSCode functionality.

I assume you are looking to emulate the JetBrains functionality here?

Well, sublime text seems to behave well in this situation as well. Thanks for responding so quick. I understand that this is not really core necessary feature, and also that it's not something that's easily correctable.

I guess it might be something to complain about upstream : ) Thanks again!

We can probably roadmap some custom selection commands for the extension but in my cursory investigation VSCode doesn't expose APIs to allow extensions to tell it how the smart select feature should work.

I'll poke around a bit more but I think this is something VSCode itself will need to improve upon before we can make it work properly.

Update here:

VSCode has an in-progress API to facilitate better smart select support. When that support lands in VSCode + the language server protocol I'll add support for it here.

Hi what is the status of this?

Hey this API was shipped in v1.33, any update on this?

https://github.com/microsoft/vscode/issues/4795#issuecomment-479419404

Was this page helpful?
0 / 5 - 0 ratings