We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Wrong placeholder in the rename quick panel
**Describe the bug**

For LSP-intelephense, it seems that the placeholder in the quick panel is the one under the caret rather than the actual symbol which triggers that. The actual renaming operation is done right though.

Unfortunately `Rename` is a premium feature in intelephense... and I can't reproduce this with LSP-pyright... weird.


**To Reproduce**

```php
<?php

class Foo
{
    public static function getInstance()
    {
        return new static();
    }

    public function abcd()
    {
        echo 'haha';
    }
}

Foo::getInstance()->abcd();
```

Steps to reproduce the behavior:
1. Place caret on `haha`
2. Hover on `bar`
3. Click `Rename` on the popup
4. `haha` will be in the shown quick panel

**Expected behavior**

It should be `bar` in the shown panel.

**Screenshots**

Video recording: https://streamable.com/bw762h

**Environment (please complete the following information):**
- OS: Win7 x64
- Sublime Text version: 4090
- LSP version: the latest commit on `st4000-exploration` 653fd3c4e25c2ed5294f76b0b8b5db79f56f18c2 
- Language servers used: intelephense

**Additional context**

I see the server communication log but I didn't see any "line 11" in it but they are all correct "line 15".

LSP log:

```
:: --> LSP-intelephense textDocument/hover(87): {'position': {'character': 23, 'line': 15}, 'textDocument': {'uri': 'file:///E:/_Test/php/src/test.php'}}
:: <<< LSP-intelephense 87: {'range': {'start': {'character': 20, 'line': 15}, 'end': {'character': 24, 'line': 15}}, 'contents': {'kind': 'markdown', 'value': '__Foo::abcd__\n\n```php\n<?php\npublic function abcd() { }\n```\n\n_@return_ `void`'}}
:: --> LSP-intelephense textDocument/prepareRename(88): {'position': {'character': 23, 'line': 15}, 'textDocument': {'uri': 'file:///E:/_Test/php/src/test.php'}}
:: <<< LSP-intelephense 88: {'start': {'character': 20, 'line': 15}, 'end': {'character': 24, 'line': 15}}
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `plugin/rename.py`
Content:
```
1 import sublime
2 import sublime_plugin
3 from .core.edit import apply_workspace_edit
4 from .core.edit import parse_workspace_edit
5 from .core.protocol import Range
6 from .core.protocol import Request
7 from .core.registry import get_position
8 from .core.registry import LspTextCommand
9 from .core.typing import Any, Optional
10 from .core.views import range_to_region
11 from .core.views import text_document_position_params
12 
13 
14 class RenameSymbolInputHandler(sublime_plugin.TextInputHandler):
15     def __init__(self, view: sublime.View, placeholder: str) -> None:
16         self.view = view
17         self._placeholder = placeholder
18 
19     def name(self) -> str:
20         return "new_name"
21 
22     def placeholder(self) -> str:
23         if self._placeholder:
24             return self._placeholder
25         return self.get_current_symbol_name()
26 
27     def initial_text(self) -> str:
28         return self.placeholder()
29 
30     def validate(self, name: str) -> bool:
31         return len(name) > 0
32 
33     def get_current_symbol_name(self) -> str:
34         pos = get_position(self.view)
35         current_name = self.view.substr(self.view.word(pos))
36         # Is this check necessary?
37         if not current_name:
38             current_name = ""
39         return current_name
40 
41 
42 class LspSymbolRenameCommand(LspTextCommand):
43 
44     capability = 'renameProvider'
45 
46     # mypy: Signature of "is_enabled" incompatible with supertype "LspTextCommand"
47     def is_enabled(  # type: ignore
48         self,
49         new_name: str = "",
50         placeholder: str = "",
51         position: Optional[int] = None,
52         event: Optional[dict] = None,
53         point: Optional[int] = None
54     ) -> bool:
55         if self.best_session("renameProvider.prepareProvider"):
56             # The language server will tell us if the selection is on a valid token.
57             return True
58         return super().is_enabled(event, point)
59 
60     def input(self, args: dict) -> Optional[sublime_plugin.TextInputHandler]:
61         if "new_name" not in args:
62             placeholder = args.get("placeholder", "")
63             if not placeholder:
64                 point = args.get("point")
65                 if isinstance(point, int):
66                     placeholder = self.view.substr(self.view.word(point))
67             return RenameSymbolInputHandler(self.view, placeholder)
68         else:
69             return None
70 
71     def run(
72         self,
73         edit: sublime.Edit,
74         new_name: str = "",
75         placeholder: str = "",
76         position: Optional[int] = None,
77         event: Optional[dict] = None,
78         point: Optional[int] = None
79     ) -> None:
80         if position is None:
81             pos = get_position(self.view, event, point)
82             if new_name:
83                 return self._do_rename(pos, new_name)
84             else:
85                 session = self.best_session("{}.prepareProvider".format(self.capability))
86                 if session:
87                     params = text_document_position_params(self.view, pos)
88                     request = Request.prepareRename(params, self.view)
89                     self.event = event
90                     session.send_request(request, self.on_prepare_result, self.on_prepare_error)
91                 else:
92                     # trigger InputHandler manually
93                     raise TypeError("required positional argument")
94         else:
95             if new_name:
96                 return self._do_rename(position, new_name)
97             else:
98                 # trigger InputHandler manually
99                 raise TypeError("required positional argument")
100 
101     def _do_rename(self, position: int, new_name: str) -> None:
102         session = self.best_session(self.capability)
103         if session:
104             params = text_document_position_params(self.view, position)
105             params["newName"] = new_name
106             session.send_request(
107                 Request.rename(params, self.view),
108                 # This has to run on the main thread due to calling apply_workspace_edit
109                 lambda r: sublime.set_timeout(lambda: self.on_rename_result(r))
110             )
111 
112     def on_rename_result(self, response: Any) -> None:
113         window = self.view.window()
114         if window:
115             if response:
116                 apply_workspace_edit(window, parse_workspace_edit(response))
117             else:
118                 window.status_message('Nothing to rename')
119 
120     def on_prepare_result(self, response: Any) -> None:
121         if response is None:
122             sublime.error_message("The current selection cannot be renamed")
123             return
124         # It must be a dict at this point.
125         if "placeholder" in response:
126             placeholder = response["placeholder"]
127             r = response["range"]
128         else:
129             placeholder = ""
130             r = response
131         region = range_to_region(Range.from_lsp(r), self.view)
132         args = {"placeholder": placeholder, "position": region.a, "event": self.event}
133         self.view.run_command("lsp_symbol_rename", args)
134 
135     def on_prepare_error(self, error: Any) -> None:
136         sublime.error_message("Rename error: {}".format(error["message"]))
137
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/plugin/rename.py b/plugin/rename.py
--- a/plugin/rename.py
+++ b/plugin/rename.py
@@ -20,9 +20,7 @@
         return "new_name"
 
     def placeholder(self) -> str:
-        if self._placeholder:
-            return self._placeholder
-        return self.get_current_symbol_name()
+        return self._placeholder
 
     def initial_text(self) -> str:
         return self.placeholder()
@@ -30,14 +28,6 @@
     def validate(self, name: str) -> bool:
         return len(name) > 0
 
-    def get_current_symbol_name(self) -> str:
-        pos = get_position(self.view)
-        current_name = self.view.substr(self.view.word(pos))
-        # Is this check necessary?
-        if not current_name:
-            current_name = ""
-        return current_name
-
 
 class LspSymbolRenameCommand(LspTextCommand):
 
@@ -87,7 +77,7 @@
                     params = text_document_position_params(self.view, pos)
                     request = Request.prepareRename(params, self.view)
                     self.event = event
-                    session.send_request(request, self.on_prepare_result, self.on_prepare_error)
+                    session.send_request(request, lambda r: self.on_prepare_result(r, pos), self.on_prepare_error)
                 else:
                     # trigger InputHandler manually
                     raise TypeError("required positional argument")
@@ -117,7 +107,7 @@
             else:
                 window.status_message('Nothing to rename')
 
-    def on_prepare_result(self, response: Any) -> None:
+    def on_prepare_result(self, response: Any, pos: int) -> None:
         if response is None:
             sublime.error_message("The current selection cannot be renamed")
             return
@@ -126,7 +116,7 @@
             placeholder = response["placeholder"]
             r = response["range"]
         else:
-            placeholder = ""
+            placeholder = self.view.substr(self.view.word(pos))
             r = response
         region = range_to_region(Range.from_lsp(r), self.view)
         args = {"placeholder": placeholder, "position": region.a, "event": self.event}

{"golden_diff": "diff --git a/plugin/rename.py b/plugin/rename.py\n--- a/plugin/rename.py\n+++ b/plugin/rename.py\n@@ -20,9 +20,7 @@\n         return \"new_name\"\n \n     def placeholder(self) -> str:\n-        if self._placeholder:\n-            return self._placeholder\n-        return self.get_current_symbol_name()\n+        return self._placeholder\n \n     def initial_text(self) -> str:\n         return self.placeholder()\n@@ -30,14 +28,6 @@\n     def validate(self, name: str) -> bool:\n         return len(name) > 0\n \n-    def get_current_symbol_name(self) -> str:\n-        pos = get_position(self.view)\n-        current_name = self.view.substr(self.view.word(pos))\n-        # Is this check necessary?\n-        if not current_name:\n-            current_name = \"\"\n-        return current_name\n-\n \n class LspSymbolRenameCommand(LspTextCommand):\n \n@@ -87,7 +77,7 @@\n                     params = text_document_position_params(self.view, pos)\n                     request = Request.prepareRename(params, self.view)\n                     self.event = event\n-                    session.send_request(request, self.on_prepare_result, self.on_prepare_error)\n+                    session.send_request(request, lambda r: self.on_prepare_result(r, pos), self.on_prepare_error)\n                 else:\n                     # trigger InputHandler manually\n                     raise TypeError(\"required positional argument\")\n@@ -117,7 +107,7 @@\n             else:\n                 window.status_message('Nothing to rename')\n \n-    def on_prepare_result(self, response: Any) -> None:\n+    def on_prepare_result(self, response: Any, pos: int) -> None:\n         if response is None:\n             sublime.error_message(\"The current selection cannot be renamed\")\n             return\n@@ -126,7 +116,7 @@\n             placeholder = response[\"placeholder\"]\n             r = response[\"range\"]\n         else:\n-            placeholder = \"\"\n+            placeholder = self.view.substr(self.view.word(pos))\n             r = response\n         region = range_to_region(Range.from_lsp(r), self.view)\n         args = {\"placeholder\": placeholder, \"position\": region.a, \"event\": self.event}\n", "issue": "Wrong placeholder in the rename quick panel\n**Describe the bug**\r\n\r\nFor LSP-intelephense, it seems that the placeholder in the quick panel is the one under the caret rather than the actual symbol which triggers that. The actual renaming operation is done right though.\r\n\r\nUnfortunately `Rename` is a premium feature in intelephense... and I can't reproduce this with LSP-pyright... weird.\r\n\r\n\r\n**To Reproduce**\r\n\r\n```php\r\n<?php\r\n\r\nclass Foo\r\n{\r\n    public static function getInstance()\r\n    {\r\n        return new static();\r\n    }\r\n\r\n    public function abcd()\r\n    {\r\n        echo 'haha';\r\n    }\r\n}\r\n\r\nFoo::getInstance()->abcd();\r\n```\r\n\r\nSteps to reproduce the behavior:\r\n1. Place caret on `haha`\r\n2. Hover on `bar`\r\n3. Click `Rename` on the popup\r\n4. `haha` will be in the shown quick panel\r\n\r\n**Expected behavior**\r\n\r\nIt should be `bar` in the shown panel.\r\n\r\n**Screenshots**\r\n\r\nVideo recording: https://streamable.com/bw762h\r\n\r\n**Environment (please complete the following information):**\r\n- OS: Win7 x64\r\n- Sublime Text version: 4090\r\n- LSP version: the latest commit on `st4000-exploration` 653fd3c4e25c2ed5294f76b0b8b5db79f56f18c2 \r\n- Language servers used: intelephense\r\n\r\n**Additional context**\r\n\r\nI see the server communication log but I didn't see any \"line 11\" in it but they are all correct \"line 15\".\r\n\r\nLSP log:\r\n\r\n```\r\n:: --> LSP-intelephense textDocument/hover(87): {'position': {'character': 23, 'line': 15}, 'textDocument': {'uri': 'file:///E:/_Test/php/src/test.php'}}\r\n:: <<< LSP-intelephense 87: {'range': {'start': {'character': 20, 'line': 15}, 'end': {'character': 24, 'line': 15}}, 'contents': {'kind': 'markdown', 'value': '__Foo::abcd__\\n\\n```php\\n<?php\\npublic function abcd() { }\\n```\\n\\n_@return_ `void`'}}\r\n:: --> LSP-intelephense textDocument/prepareRename(88): {'position': {'character': 23, 'line': 15}, 'textDocument': {'uri': 'file:///E:/_Test/php/src/test.php'}}\r\n:: <<< LSP-intelephense 88: {'start': {'character': 20, 'line': 15}, 'end': {'character': 24, 'line': 15}}\r\n```\n", "before_files": [{"content": "import sublime\nimport sublime_plugin\nfrom .core.edit import apply_workspace_edit\nfrom .core.edit import parse_workspace_edit\nfrom .core.protocol import Range\nfrom .core.protocol import Request\nfrom .core.registry import get_position\nfrom .core.registry import LspTextCommand\nfrom .core.typing import Any, Optional\nfrom .core.views import range_to_region\nfrom .core.views import text_document_position_params\n\n\nclass RenameSymbolInputHandler(sublime_plugin.TextInputHandler):\n    def __init__(self, view: sublime.View, placeholder: str) -> None:\n        self.view = view\n        self._placeholder = placeholder\n\n    def name(self) -> str:\n        return \"new_name\"\n\n    def placeholder(self) -> str:\n        if self._placeholder:\n            return self._placeholder\n        return self.get_current_symbol_name()\n\n    def initial_text(self) -> str:\n        return self.placeholder()\n\n    def validate(self, name: str) -> bool:\n        return len(name) > 0\n\n    def get_current_symbol_name(self) -> str:\n        pos = get_position(self.view)\n        current_name = self.view.substr(self.view.word(pos))\n        # Is this check necessary?\n        if not current_name:\n            current_name = \"\"\n        return current_name\n\n\nclass LspSymbolRenameCommand(LspTextCommand):\n\n    capability = 'renameProvider'\n\n    # mypy: Signature of \"is_enabled\" incompatible with supertype \"LspTextCommand\"\n    def is_enabled(  # type: ignore\n        self,\n        new_name: str = \"\",\n        placeholder: str = \"\",\n        position: Optional[int] = None,\n        event: Optional[dict] = None,\n        point: Optional[int] = None\n    ) -> bool:\n        if self.best_session(\"renameProvider.prepareProvider\"):\n            # The language server will tell us if the selection is on a valid token.\n            return True\n        return super().is_enabled(event, point)\n\n    def input(self, args: dict) -> Optional[sublime_plugin.TextInputHandler]:\n        if \"new_name\" not in args:\n            placeholder = args.get(\"placeholder\", \"\")\n            if not placeholder:\n                point = args.get(\"point\")\n                if isinstance(point, int):\n                    placeholder = self.view.substr(self.view.word(point))\n            return RenameSymbolInputHandler(self.view, placeholder)\n        else:\n            return None\n\n    def run(\n        self,\n        edit: sublime.Edit,\n        new_name: str = \"\",\n        placeholder: str = \"\",\n        position: Optional[int] = None,\n        event: Optional[dict] = None,\n        point: Optional[int] = None\n    ) -> None:\n        if position is None:\n            pos = get_position(self.view, event, point)\n            if new_name:\n                return self._do_rename(pos, new_name)\n            else:\n                session = self.best_session(\"{}.prepareProvider\".format(self.capability))\n                if session:\n                    params = text_document_position_params(self.view, pos)\n                    request = Request.prepareRename(params, self.view)\n                    self.event = event\n                    session.send_request(request, self.on_prepare_result, self.on_prepare_error)\n                else:\n                    # trigger InputHandler manually\n                    raise TypeError(\"required positional argument\")\n        else:\n            if new_name:\n                return self._do_rename(position, new_name)\n            else:\n                # trigger InputHandler manually\n                raise TypeError(\"required positional argument\")\n\n    def _do_rename(self, position: int, new_name: str) -> None:\n        session = self.best_session(self.capability)\n        if session:\n            params = text_document_position_params(self.view, position)\n            params[\"newName\"] = new_name\n            session.send_request(\n                Request.rename(params, self.view),\n                # This has to run on the main thread due to calling apply_workspace_edit\n                lambda r: sublime.set_timeout(lambda: self.on_rename_result(r))\n            )\n\n    def on_rename_result(self, response: Any) -> None:\n        window = self.view.window()\n        if window:\n            if response:\n                apply_workspace_edit(window, parse_workspace_edit(response))\n            else:\n                window.status_message('Nothing to rename')\n\n    def on_prepare_result(self, response: Any) -> None:\n        if response is None:\n            sublime.error_message(\"The current selection cannot be renamed\")\n            return\n        # It must be a dict at this point.\n        if \"placeholder\" in response:\n            placeholder = response[\"placeholder\"]\n            r = response[\"range\"]\n        else:\n            placeholder = \"\"\n            r = response\n        region = range_to_region(Range.from_lsp(r), self.view)\n        args = {\"placeholder\": placeholder, \"position\": region.a, \"event\": self.event}\n        self.view.run_command(\"lsp_symbol_rename\", args)\n\n    def on_prepare_error(self, error: Any) -> None:\n        sublime.error_message(\"Rename error: {}\".format(error[\"message\"]))\n", "path": "plugin/rename.py"}], "after_files": [{"content": "import sublime\nimport sublime_plugin\nfrom .core.edit import apply_workspace_edit\nfrom .core.edit import parse_workspace_edit\nfrom .core.protocol import Range\nfrom .core.protocol import Request\nfrom .core.registry import get_position\nfrom .core.registry import LspTextCommand\nfrom .core.typing import Any, Optional\nfrom .core.views import range_to_region\nfrom .core.views import text_document_position_params\n\n\nclass RenameSymbolInputHandler(sublime_plugin.TextInputHandler):\n    def __init__(self, view: sublime.View, placeholder: str) -> None:\n        self.view = view\n        self._placeholder = placeholder\n\n    def name(self) -> str:\n        return \"new_name\"\n\n    def placeholder(self) -> str:\n        return self._placeholder\n\n    def initial_text(self) -> str:\n        return self.placeholder()\n\n    def validate(self, name: str) -> bool:\n        return len(name) > 0\n\n\nclass LspSymbolRenameCommand(LspTextCommand):\n\n    capability = 'renameProvider'\n\n    # mypy: Signature of \"is_enabled\" incompatible with supertype \"LspTextCommand\"\n    def is_enabled(  # type: ignore\n        self,\n        new_name: str = \"\",\n        placeholder: str = \"\",\n        position: Optional[int] = None,\n        event: Optional[dict] = None,\n        point: Optional[int] = None\n    ) -> bool:\n        if self.best_session(\"renameProvider.prepareProvider\"):\n            # The language server will tell us if the selection is on a valid token.\n            return True\n        return super().is_enabled(event, point)\n\n    def input(self, args: dict) -> Optional[sublime_plugin.TextInputHandler]:\n        if \"new_name\" not in args:\n            placeholder = args.get(\"placeholder\", \"\")\n            if not placeholder:\n                point = args.get(\"point\")\n                if isinstance(point, int):\n                    placeholder = self.view.substr(self.view.word(point))\n            return RenameSymbolInputHandler(self.view, placeholder)\n        else:\n            return None\n\n    def run(\n        self,\n        edit: sublime.Edit,\n        new_name: str = \"\",\n        placeholder: str = \"\",\n        position: Optional[int] = None,\n        event: Optional[dict] = None,\n        point: Optional[int] = None\n    ) -> None:\n        if position is None:\n            pos = get_position(self.view, event, point)\n            if new_name:\n                return self._do_rename(pos, new_name)\n            else:\n                session = self.best_session(\"{}.prepareProvider\".format(self.capability))\n                if session:\n                    params = text_document_position_params(self.view, pos)\n                    request = Request.prepareRename(params, self.view)\n                    self.event = event\n                    session.send_request(request, lambda r: self.on_prepare_result(r, pos), self.on_prepare_error)\n                else:\n                    # trigger InputHandler manually\n                    raise TypeError(\"required positional argument\")\n        else:\n            if new_name:\n                return self._do_rename(position, new_name)\n            else:\n                # trigger InputHandler manually\n                raise TypeError(\"required positional argument\")\n\n    def _do_rename(self, position: int, new_name: str) -> None:\n        session = self.best_session(self.capability)\n        if session:\n            params = text_document_position_params(self.view, position)\n            params[\"newName\"] = new_name\n            session.send_request(\n                Request.rename(params, self.view),\n                # This has to run on the main thread due to calling apply_workspace_edit\n                lambda r: sublime.set_timeout(lambda: self.on_rename_result(r))\n            )\n\n    def on_rename_result(self, response: Any) -> None:\n        window = self.view.window()\n        if window:\n            if response:\n                apply_workspace_edit(window, parse_workspace_edit(response))\n            else:\n                window.status_message('Nothing to rename')\n\n    def on_prepare_result(self, response: Any, pos: int) -> None:\n        if response is None:\n            sublime.error_message(\"The current selection cannot be renamed\")\n            return\n        # It must be a dict at this point.\n        if \"placeholder\" in response:\n            placeholder = response[\"placeholder\"]\n            r = response[\"range\"]\n        else:\n            placeholder = self.view.substr(self.view.word(pos))\n            r = response\n        region = range_to_region(Range.from_lsp(r), self.view)\n        args = {\"placeholder\": placeholder, \"position\": region.a, \"event\": self.event}\n        self.view.run_command(\"lsp_symbol_rename\", args)\n\n    def on_prepare_error(self, error: Any) -> None:\n        sublime.error_message(\"Rename error: {}\".format(error[\"message\"]))\n", "path": "plugin/rename.py"}]}