dcermak / rpm-spec-language-server

Language Server for RPM spec files
GNU General Public License v2.0
21 stars 4 forks source link

Improve robustness of the spec.md section extraction #187

Closed dcermak closed 4 months ago

dcermak commented 4 months ago

cc @frostyx

FrostyX commented 4 months ago

@dcermak this is related to #148 or something else? Just to know what I should test.

dcermak commented 4 months ago

@dcermak this is related to #148 or something else? Just to know what I should test.

Yes, #148 and #30

FrostyX commented 4 months ago

Possibly I am testing this wrong but I think #148 still happens. But this time with different functions and line numbers:

Traceback (most recent call last):
  File "/usr/local/bin/rpm_lsp_server", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/site-packages/rpm_spec_language_server/main.py", line 46, in main
    server = create_rpm_lang_server()
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/rpm_spec_language_server/server.py", line 126, in create_rpm_lang_server
    rpm_spec_server = RpmSpecLanguageServer()
                      ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/rpm_spec_language_server/server.py", line 77, in __init__
    retrieve_spec_md() or ""
    ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/rpm_spec_language_server/extract_docs.py", line 198, in retrieve_spec_md
    with open(path) as spec_md_f:
         ^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/doc/rpm/spec.md'
dcermak commented 4 months ago

Possibly I am testing this wrong but I think https://github.com/dcermak/rpm-spec-language-server/issues/148 still happens.

My bad! I've added a workaround for that and a regression test. It shouldn't happen now anymore.

FrostyX commented 4 months ago

Thank you for the update, I can confirm that it fixes #148 now.

dcermak commented 4 months ago

Thank you for the update, I can confirm that it fixes https://github.com/dcermak/rpm-spec-language-server/issues/148 now.

Awesome, thank you!