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

Export settings button creates file with contents "[object Object]" #707

Closed
sirnails opened this issue Dec 6, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@sirnails
Copy link

sirnails commented Dec 6, 2024

Describe the bug
Clicking the "Export Settings" button in TerosHDL creates a file, but the file's content is simply [object Object]. This suggests the settings object is not being serialized correctly before being written to the file.

To Reproduce
Steps to reproduce the behavior:

  1. Open TerosHDL in VSCode.
  2. Scroll down to configuration.
  3. Click on the "Export Settings" button.
  4. Navigate to desktop folder
  5. Type teros.json
  6. Inspect the contents of the generated file.

Code
N/A

Please complete the following information:

  • OS: Microsoft Windows [Version 10.0.19045.5131]
  • VSCode version version:
    Version: 1.95.3 (user setup)
    Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813
    Date: 2024-11-13T14:50:04.152Z
    Electron: 32.2.1
    ElectronBuildId: 10427718
    Chromium: 128.0.6613.186
    Node.js: 20.18.0
    V8: 12.8.374.38-electron.0
    OS: Windows_NT x64 10.0.19045

Screenshots
N/A

Additional context
On an tangent, Its not clear to me if this is intended to export the global settings or the project settings.

@sirnails sirnails added the bug Something isn't working label Dec 6, 2024
@el3ctrician
Copy link
Contributor

Same under linux, i will have a look when i have time

@jevogel
Copy link

jevogel commented Feb 28, 2025

Its not clear to me if this is intended to export the global settings or the project settings.

I recently found out that you can export project settings by going to the top of the Files pane in TerosHDL and clicking the Save Project 💾 icon. You can then import this project file using the "Load project from YAML EDAM" option, though it will silently fail if there is an existing project with the same name.

So, I think the Export Settings button is intended to export the global settings. My colleague told me that this used to work properly before, but that was back when there was only one global configuration and no individual project configuration, so the bug might have been introduced when per-project configuration was added.

As a workaround for this issue, you will find that TerosHDL actually creates a few dotfiles in your home directory:

  • ~/.teroshdl2_config.json - global settings
  • ~/.teroshdl2_prj.json - active project and list of per-project settings
  • ~/.vhdl_ls.toml - the current project file list exported to VHDL-LS format

In theory, you could manually edit these (though not .vhdl_ls.toml, because that is overwritten when you switch projects, which is bad behavior because this is the global VHDL-LS configuration file and a user might want to use VHDL-LS as a standalone tool as well).

Also, it would be great if any file paths inside of the configuration or configuration files would support relative paths, because otherwise it is hard to share files with colleagues via Git. One straightforward way to do this would be to specify a project root in one configuration variable and then automatically prefix this value to any other non-absolute path that is specified. (VS Code supports having multiple folders open in a workspace, so it could be hard to automatically infer a project root otherwise.)

@qarlosalberto
Copy link
Contributor

qarlosalberto commented Mar 2, 2025

@jevogel could you send me an email? Check my Github profile.

@qarlosalberto
Copy link
Contributor

Fixed in v7.0.0. Feel free to reopen the issue if it doesn't work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants