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

Default or generated configs can't be parsed #182

Closed
last-genius opened this issue Nov 24, 2024 · 2 comments
Closed

Default or generated configs can't be parsed #182

last-genius opened this issue Nov 24, 2024 · 2 comments

Comments

@last-genius
Copy link

Generating a config with asm-lsp gen-config with asm-lsp compiled from github at 7ab549e:

[default_config]
version = "0.9.0"
assembler = "gas"
instruction_set = "riscv"

Results in errors like this in LspLog: (shortened to the important parts, can send full logs if that matters)

ERROR [asm_lsp::lsp] Failed to parse project config file /home/lastgenius/Documents/notes/asm/aoc23/.asm-lsp.toml - Error: TOML parse error at line 1, column 1\n  |\n1 | [default_config]\n  | ^\nmissing field `version`\n\nINFO [asm_lsp] Server Configuration: Config { version: "0.1", assemblers: Assemblers { gas: Some(true), go: Some(true), masm: Some(false), nasm: Some(false), z80: Some(false) }, instruction_sets: InstructionSets { x86: Some(true), x86_64: Some(true), z80: Some(false), arm: Some(false), riscv: Some(false) }, opts: ConfigOptions { compiler: None, diagnostics: Some(true), default_diagnostics: Some(true) } }\n'

Removing the default_config line in the config, you get a different error

ERROR [asm_lsp::lsp] Failed to parse project config file /home/lastgenius/Documents/notes/asm/aoc23/.asm-lsp.toml - Error: TOML parse error at line 1, column 1\n  |\n1 | version = "0.9.0"\n  | ^^^^^^^^^^^^^^^^^\nmissing field `assemblers`\n\nINFO [asm_lsp] Server Configuration: Config { version: "0.1", assemblers: Assemblers { gas: Some(true), go: Some(true), masm: Some(false), nasm: Some(false), z80: Some(false) }, instruction_sets: InstructionSets { x86: Some(true), x86_64: Some(true), z80: Some(false), arm: Some(false), riscv: Some(false) }, opts: ConfigOptions { compiler: None, diagnostics: Some(true), default_diagnostics: Some(true) } }\n'
@WillLillis
Copy link
Collaborator

This looks like the same issue mentioned here in #173. I suspect there is an older version of asm-lsp being launched by your editor and attempting to read the config file. At the start of the logs, is there a line like the following? (Note the missing version number)

Starting asm_lsp...\n 

Unfortunately, it wasn't possible to make the recent config overhaul backwards compatible.

@last-genius
Copy link
Author

You're completely right! I totally forgot mason maintains a separate installation. Thank you very much for the help here and in other issues I've been opening!

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