saem/vscode-nim

Incorrect configuration schema

rotu opened this issue · 1 comments

rotu commented

In this project, nim.projectMapping is defined as an object:

vscode-nim/package.json

Lines 202 to 207 in a937ed1

"nim.projectMapping": {
"type": "object",
"default": {},
"description": "For non project mode list of per file project mapping using regex, for example ```{\"(.*).inim\": \"$1.nim\"}```",
"scope": "resource"
},

But in the language server, it's defined as a sequence/list: https://github.com/nim-lang/langserver/blob/4878cbce6fb0b097f2dcef7cd6d3e5d494bf278a/nimlangserver.nim#L22
https://github.com/nim-lang/langserver/blob/3fcf4c87904ec691ebca035872a4913000fa85df/README.md?plain=1#L40-L44

This mismatch causes either:

  • the settings editor to complain "Incorrect type. Expected "object"."
  • the nim langage server to ignore the configuration with "DBG Failed to parse the configuration." and seemingly not work at all. There also seem to be other error messages like "A request has failed. See the output for more information."

This should be corrected and a more descriptive error message should happen when the config is broken.

rotu commented

Possibly responsible for:

#102
#103