sublimelsp / LSP-rust-analyzer

Convenience package for rust-analyzer
MIT License
70 stars 11 forks source link

invalid default value for rust-analyzer.debug.sourceFileMap #21

Closed rwols closed 3 years ago

rwols commented 3 years ago

I'm seeing this warning from LSP-json:

Schermafbeelding 2021-06-16 om 21 43 40

Is sublime-package.json incorrect or is the default value incorrect?

daggy1234 commented 3 years ago

this was the default value not sure, lemme check

daggy1234 commented 3 years ago

Doesn't seem to be a reason.

"rust-analyzer.debug.sourceFileMap": {

                              "const": "auto",

                              "default": {

                                "/rustc/<id>": "${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust"

                              },

                              "description": "Optional source file mappings passed to the debug engine.",

                              "type": [

                                "object",

                                "string"

                              ]

                            },

Thats the schema. The type is object or string.

rchl commented 3 years ago

But const ensures that only that value is allowed. See https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values

Not sure what's the reason it's there but removing it should be fine.

daggy1234 commented 3 years ago

I'll remove the const 👍🏽

daggy1234 commented 3 years ago

Fixed in https://github.com/sublimelsp/LSP-rust-analyzer/commit/6b89292c6313efa13c59d06285d48a0e25804b2a