We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following is a common scenario when editing Nix:
rec { foo.bar = 13; xyz = foo.; # trailing period was just typed }
rnix-parser consumes the rest of the file as an error, rather than stopping at the semicolon:
rnix-parser
error: unexpected TOKEN_SEMICOLON at 38..41, wanted any of [TOKEN_IDENT] error: unexpected end of file, wanted any of [TOKEN_IDENT] error: unexpected end of file, wanted any of [TOKEN_SEMICOLON] error: unexpected end of file NODE_ROOT 0..41 { NODE_ATTR_SET 0..41 { TOKEN_REC("rec") 0..3 TOKEN_WHITESPACE(" ") 3..4 TOKEN_CURLY_B_OPEN("{") 4..5 TOKEN_WHITESPACE("\n ") 5..10 NODE_KEY_VALUE 10..23 { NODE_KEY 10..17 { NODE_IDENT 10..13 { TOKEN_IDENT("foo") 10..13 } TOKEN_DOT(".") 13..14 NODE_IDENT 14..17 { TOKEN_IDENT("bar") 14..17 } } TOKEN_WHITESPACE(" ") 17..18 TOKEN_ASSIGN("=") 18..19 TOKEN_WHITESPACE(" ") 19..20 NODE_LITERAL 20..22 { TOKEN_INTEGER("13") 20..22 } TOKEN_SEMICOLON(";") 22..23 } TOKEN_WHITESPACE("\n ") 23..28 NODE_KEY_VALUE 28..41 { NODE_KEY 28..31 { NODE_IDENT 28..31 { TOKEN_IDENT("xyz") 28..31 } } TOKEN_WHITESPACE(" ") 31..32 TOKEN_ASSIGN("=") 32..33 TOKEN_WHITESPACE(" ") 33..34 NODE_SELECT 34..41 { NODE_IDENT 34..37 { TOKEN_IDENT("foo") 34..37 } TOKEN_DOT(".") 37..38 NODE_ERROR 38..41 { TOKEN_SEMICOLON(";") 38..39 TOKEN_WHITESPACE("\n") 39..40 TOKEN_CURLY_B_CLOSE("}") 40..41 } } } } }
It would be nice if this scenario were handled, since that would allow rnix-lsp to provide autocomplete here.
rnix-lsp
I'd be happy to create a PR if this (presumably minor) change to rnix-parser is wanted.
The text was updated successfully, but these errors were encountered:
Actually, I don't think I understand rowan well enough to make a PR short-term, but I'd be happy to learn if needed
rowan
EDIT: I've made a WIP pull request
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
The following is a common scenario when editing Nix:
rnix-parser
consumes the rest of the file as an error, rather than stopping at the semicolon:`dump-ast` output
It would be nice if this scenario were handled, since that would allow
rnix-lsp
to provide autocomplete here.I'd be happy to create a PR if this (presumably minor) change to rnix-parser is wanted.
The text was updated successfully, but these errors were encountered: