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

'Uncaught error' when a file in 'hdl-prj.json' does not exist #4

Closed
eine opened this issue Jun 17, 2019 · 5 comments
Closed

'Uncaught error' when a file in 'hdl-prj.json' does not exist #4

eine opened this issue Jun 17, 2019 · 5 comments

Comments

@eine
Copy link
Contributor

eine commented Jun 17, 2019

I tried the following hdl-prj.json in VUnit's examples/vhdl/array_axis_vcs example:

{
    "files": [
        { "file": "./fifo.vhdl", "language": "vhdl" },
        { "file": "./axis_buffer.vhdl", "language": "vhdl" },
        { "file": "./test/tb_axis_loop.vhdl", "language": "vhdl" }
    ]
}

The language server crashes, because it tries to open one of the files, and the location is not valid.

2019-06-17 17:51:57,018 [ERROR] Uncaught error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/vhdl_langserver/main.py", line 106, in main
    server.run()
  File "/usr/local/lib/python3.7/site-packages/vhdl_langserver/lsp.py", line 99, in run
    reply = self.handle(msg)
  File "/usr/local/lib/python3.7/site-packages/vhdl_langserver/lsp.py", line 117, in handle
    response = fmethod(**params)
  File "/usr/local/lib/python3.7/site-packages/vhdl_langserver/vhdl_ls.py", line 70, in initialize
    self.workspace = Workspace(rootUri, self.lsp)
  File "/usr/local/lib/python3.7/site-packages/vhdl_langserver/workspace.py", line 49, in __init__
    self.read_files_from_project()
  File "/usr/local/lib/python3.7/site-packages/vhdl_langserver/workspace.py", line 140, in read_files_from_project
    self.add_vhdl_file(name)
  File "/usr/local/lib/python3.7/site-packages/vhdl_langserver/workspace.py", line 92, in add_vhdl_file
    sfe = document.Document.load(open(absname).read(), self._root_path, name)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/files/vunit/examples/vhdl/array_axis_vcs/./fifo.vhdl'
[Error - 17:51:57] Connection to server got closed. Server will not be restarted.

The correct JSON is:

{
    "files": [
        { "file": "src/fifo.vhd", "language": "vhdl" },
        { "file": "src/axis_buffer.vhd", "language": "vhdl" },
        { "file": "src/test/tb_axis_loop.vhd", "language": "vhdl" }
    ]
}

BTW, when the language server crashes I don't know how to restart it. Reloading the window does not work. I need to close it and attach to the container again. No need to restart the container itself, tho.

@tgingold
Copy link
Member

I think this is now fixed.

@eine
Copy link
Contributor Author

eine commented Jun 24, 2019

The 'uncaught error' is not shown now. But I cannot ensure whether it is because the issue is fixed or because the error reported in #6 (comment) is triggered before.

@tgingold
Copy link
Member

tgingold commented Jun 25, 2019 via email

@eine
Copy link
Contributor Author

eine commented Jun 25, 2019

Yes, I get a raised ERROROUT.OPTION_ERROR : errorout.adb:399 error as soon as I open any VHDL file. Hence, although the issue in this thread might be fixed, I cannot test it.

@eine
Copy link
Contributor Author

eine commented Jul 12, 2019

I can confirm that this is fixed now. When an invalid file path is provided in the hdl-prj.json, an information message is shown telling that the file does not exist.

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

2 participants