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

Renaming fails in vscode #135

Closed
macifell opened this issue Jan 11, 2019 · 16 comments
Closed

Renaming fails in vscode #135

macifell opened this issue Jan 11, 2019 · 16 comments

Comments

@macifell
Copy link

I'm really enjoying this extension so far, but I have noticed an issue. My attempts to rename a symbol, method, class/module, etc.. almost always fail in vscode. The only time I have had success is right after opening a new folder.

This error message is displayed: Overlapping ranges are not allowed!

The console log shows:

  ERR Error: Overlapping ranges are not allowed!
    at e.applyEdits (pieceTreeTextBuffer.ts:216)
    at o._applyEdits (textModel.ts:1314)
    at o.applyEdits (textModel.ts:1271)
    at e.pushEditOperation (editStack.ts:168)
    at o._pushEditOperations (textModel.ts:1264)
    at o.pushEditOperations (textModel.ts:1173)
    at t.executeEdits (codeEditorWidget.ts:989)
    at t.apply (bulkEditService.ts:120)
    at e.apply (bulkEditService.ts:213)
    at e.<anonymous> (bulkEditService.ts:355)
    at errors.ts:237
    at Object.s.__generator.a.label [as next] (errors.ts:237)
    at s (errors.ts:237)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188)

vscode:

Version: 1.30.2
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-07T22:49:48.319Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Linux x64 4.15.0-43-generic

vscode ruby extensions:

Ruby 0.21.0
Ruby Solargraph 0.19.1

vscode settings.json:

{
...
  "ruby.lint": {
    "rubocop": true,
    "ruby": true
  },
  "solargraph.formatting": true,
...
}

solargraph:

$ solargraph --version
0.30.2
$ solargraph list-cores
2.5.3
2.2.2
$ solargraph reporters
rubocop
require_not_found
type_not_defined
update_errors

ruby:

$ ruby --version
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
@castwide
Copy link
Owner

castwide commented Jan 12, 2019

Confirmed in v0.30.2. There's a fix for it in the v0.31.0 branch. I expect to publish the gem sometime this week.

@macifell
Copy link
Author

nice! 🙂

@castwide
Copy link
Owner

The fix is published in v0.31.0.

@macifell
Copy link
Author

Thank you! It is working much better now, though there is still some behavior that seems a bit strange. When I go to rename a method parameter, it does not seem to know about the connection between the parameter in the method definition and the one that appears in the method body.

For example, renaming param1 to p1 in the method body of the following example:

module Example
  def self.example(param1, param2)
    param1 + param2 + param1 + param2
  end
end

produces:

module Example
  def self.example(param1, param2)
    p1 + param2 + p1 + param2
  end
end

Renaming it in the definition produces:

module Example
  def self.example(p1, param2)
    param1 + param2 + param1 + param2
  end
end

This is also the case for block parameters. I noticed that the 'Find all References' command works in the same way and does not seem to recognize the connection between these symbols.

@castwide
Copy link
Owner

Confirmed. I suspect there's an easy fix for this, so I should be able to work it into a patch release.

@macifell
Copy link
Author

Ok, that sounds good

@castwide
Copy link
Owner

There's a fix in the master branch. It'll be released in v0.31.1.

@macifell
Copy link
Author

Cool, thank you for fixing this so fast 🙂

@castwide
Copy link
Owner

Published in v0.31.1.

@macifell
Copy link
Author

This is working much better in v0.31.1

Thank you! 🙂

@taylorthurlow
Copy link

@castwide I'm seeing this one again in 0.40.4.

  ERR Error: Overlapping ranges are not allowed!
    at C.applyEdits (pieceTreeTextBuffer.ts:300)
    at W._doApplyEdits (textModel.ts:1438)
    at W.applyEdits (textModel.ts:1428)
    at b.pushEditOperation (editStack.ts:428)
    at W._pushEditOperations (textModel.ts:1376)
    at W.pushEditOperations (textModel.ts:1282)
    at b.executeEdits (cursor.ts:563)
    at viewModelImpl.ts:938
    at i._withViewEventsCollector (viewModelImpl.ts:1016)
    at i._executeCursorEdit (viewModelImpl.ts:935)
    at i.executeEdits (viewModelImpl.ts:938)
    at tn.executeEdits (codeEditorWidget.ts:1163)
    at d.apply (bulkTextEdits.ts:120)
    at b.apply (bulkTextEdits.ts:243)
    at async o._performTextEdits (bulkEditService.ts:103)
    at async o.perform (bulkEditService.ts:84)
    at async r.apply (bulkEditService.ts:199)

@j-monteiro
Copy link

Same on 0.42.3

System
Platform: x86_64-darwin20
Shell: /bin/zsh
Ruby Version: 2.6.6
RuboCop Version: 0.93.1
Solargraph
Solargraph Version: 0.42.3
Core Documentation Version: 2.2.2
Using Bundler: false

@phillipoertel
Copy link

Seeing this too in 0.44.0

@amdorra
Copy link

amdorra commented Nov 20, 2021

I'm facing the same issue on version 0.44.1

@jmburges
Copy link

jmburges commented Jan 5, 2022

Facing this issue in 0.44.2 with NeoVim. Can we reopen?

@preslavmihaylov
Copy link

confirm this still happens in neovim @castwide pls halp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants