castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
425 stars 23 forks source link

Rename Symbol Not Working #252

Open ylg opened 2 years ago

ylg commented 2 years ago

Steps

  1. New window, new file foo.rb:

    module Foo
      def bar
        x = "baz"
        puts x
      end
    end
  2. Place cursor before x.

  3. Command Palette: Rename Symbol: enter "y"

Expect

Editor contents become:

module Foo
  def bar
    y = "baz"
    puts y
  end
end

Actual

Toast error message "Rename failed to apply edits" and Log: Window contains:

[2022-07-14 07:10:07.823] [renderer3] [error] Error: Overlapping ranges are not allowed!
    at m.applyEdits (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:577:547)
    at Dn._doApplyEdits (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:744:1577)
    at Dn.applyEdits (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:744:1390)
    at b.pushEditOperation (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:596:909)
    at Dn._pushEditOperations (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:744:305)
    at Dn.pushEditOperations (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:742:839)
    at b.executeEdits (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:618:475)
    at vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:750:3243
    at v._withViewEventsCollector (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:750:4876)
    at v._executeCursorEdit (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:750:3155)
    at v.executeEdits (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:750:3208)
    at Tn.executeEdits (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:752:10687)
    at b.apply (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:903:19976)
    at o.apply (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:903:22012)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async g._performTextEdits (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2752:28034)
    at async g.perform (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2752:27417)
    at async v.apply (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2752:29733)