-
-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Describe the bug
From this discussion, it is stated that ''\ escapes any other character in indented strings (but I can't find the original source for this). I can confirm it works:
As can be seen, ''\${1:-x} evaluates to ${1:-x}, so the bits within the curly braces are literal, rather than a nix string interpolation. This is useful for creating bash scripts.
However, nixd recognizes the part after the curly brace as an Identifier (as though it was part of a string interpolation), rather than an InterpolableParts (part of a string). It also throws up the following diagnostics:

Logs (Required)
Sorry, I'm not familiar with how to get logs out of neovim's lsp. I can append this on later if required.
Configuration
Nothing unusual:
lspconfig.nixd.setup {
settings = { nixd = {
options = {
-- nixos = { expr = "" },
-- home_manager = { expr = "" },
},
}},
}
To Reproduce
Steps to reproduce the behavior:
- Enter a multiline/indented string
- Escape a dollar sign before a curly open brace (i.e.
''\${) - Enter something which would be invalid in a nix string interpolation
Expected behavior
nixd should ignore whatever follows the curly brace, as this is a literal ${ and not the beginning of a nix string interpolation.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Alejandra seems to have a similar problem.
