You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fresh git clone and build/install today. Ran VSCode pointing at podman package checkout from SUSE:SLE-15-SP5:Update.
Started to modify the spec file and only added a "{_datadir}" entry on a new line and hovering over that pops up a "Request textDocument/hover failed" message box and the command line shows the following python exception
ERROR:_handle_request:Failed to handle request 29 textDocument/hover HoverParams(text_document=TextDocumentIdentifier(uri='file:///home/vmuser1/obs_internal/podman/podman.spec'), position=63:6, work_done_token=None)
Traceback (most recent call last):
File "/home/vmuser1/.cache/pypoetry/virtualenvs/rpm-spec-language-server-Ve3TtjRo-py3.11/lib/python3.11/site-packages/pygls/protocol/json_rpc.py", line 265, in _handle_request
self._execute_request(msg_id, handler, params)
File "/home/vmuser1/.cache/pypoetry/virtualenvs/rpm-spec-language-server-Ve3TtjRo-py3.11/lib/python3.11/site-packages/pygls/protocol/json_rpc.py", line 187, in _execute_request
self._send_response(msg_id, handler(params))
^^^^^^^^^^^^^^^
File "/home/vmuser1/git_repo/rpm-spec-language-server/rpm_spec_language_server/server.py", line 400, in expand_macro
macro = get_macro_under_cursor(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vmuser1/git_repo/rpm-spec-language-server/rpm_spec_language_server/macros.py", line 103, in get_macro_under_cursor
symbol = get_macro_string_at_position(lines[position.line], position.character)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vmuser1/git_repo/rpm-spec-language-server/rpm_spec_language_server/macros.py", line 19, in get_macro_string_at_position
line[i] == "%"
~~~~^^^
IndexError: string index out of range
The text was updated successfully, but these errors were encountered:
Ok, this is a nasty issue. What happens under the hood is the following: you added %_datadir below the preamble section. But that renders the spec file invalid, which results in the LSP server having a stale internal spec state (as rpm fails to parse the spec now). Thereby it keeps looking for the macro on the correct line, but in its internal state, that line is empty.
Fresh git clone and build/install today. Ran VSCode pointing at podman package checkout from SUSE:SLE-15-SP5:Update.
Started to modify the spec file and only added a "{_datadir}" entry on a new line and hovering over that pops up a "Request textDocument/hover failed" message box and the command line shows the following python exception
The text was updated successfully, but these errors were encountered: