-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixd/tools/nixd-attrset-eval: support completion for "builtins"
Basic support for option completion on the worker process. This is the premise for doing this in LSP.
- Loading branch information
Showing
7 changed files
with
214 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# RUN: nixd-attrset-eval --lit-test < %s | FileCheck %s | ||
|
||
|
||
```json | ||
{ | ||
"jsonrpc":"2.0", | ||
"id":0, | ||
"method":"attrset/evalExpr", | ||
"params": "{ py1 = 1; py2 = 2; py3 = 3; }" | ||
} | ||
``` | ||
|
||
|
||
```json | ||
{ | ||
"jsonrpc":"2.0", | ||
"id":1, | ||
"method":"attrset/builtinComplete", | ||
"params": { | ||
"Scope": [ ], | ||
"Prefix": "" | ||
} | ||
} | ||
``` | ||
|
||
``` | ||
CHECK: "id": 1, | ||
CHECK-NEXT: "jsonrpc": "2.0", | ||
CHECK-NEXT: "result": [ | ||
CHECK-NEXT: "abort", | ||
CHECK-NEXT: "add", | ||
CHECK-NEXT: "addDrvOutputDependencies", | ||
CHECK-NEXT: "addErrorContext", | ||
CHECK-NEXT: "all", | ||
CHECK-NEXT: "any", | ||
CHECK-NEXT: "appendContext", | ||
CHECK-NEXT: "attrNames", | ||
CHECK-NEXT: "attrValues", | ||
CHECK-NEXT: "baseNameOf", | ||
CHECK-NEXT: "bitAnd", | ||
CHECK-NEXT: "bitOr", | ||
CHECK-NEXT: "bitXor", | ||
CHECK-NEXT: "break", | ||
CHECK-NEXT: "builtins", | ||
CHECK-NEXT: "catAttrs", | ||
CHECK-NEXT: "ceil", | ||
CHECK-NEXT: "compareVersions", | ||
CHECK-NEXT: "concatLists", | ||
CHECK-NEXT: "concatMap", | ||
CHECK-NEXT: "concatStringsSep", | ||
CHECK-NEXT: "convertHash", | ||
CHECK-NEXT: "currentSystem", | ||
CHECK-NEXT: "currentTime", | ||
CHECK-NEXT: "deepSeq", | ||
CHECK-NEXT: "derivation", | ||
CHECK-NEXT: "derivationStrict", | ||
CHECK-NEXT: "dirOf", | ||
CHECK-NEXT: "div", | ||
CHECK-NEXT: "elem", | ||
CHECK-NEXT: "elemAt" | ||
CHECK-NEXT: ] | ||
``` | ||
|
||
```json | ||
{"jsonrpc":"2.0","method":"exit"} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# RUN: nixd-attrset-eval --lit-test < %s | FileCheck %s | ||
|
||
|
||
```json | ||
{ | ||
"jsonrpc":"2.0", | ||
"id":0, | ||
"method":"attrset/evalExpr", | ||
"params": "{ hello.meta.description = \"A program that produces a familiar, friendly greeting\"; }" | ||
} | ||
``` | ||
|
||
|
||
```json | ||
{ | ||
"jsonrpc":"2.0", | ||
"id":1, | ||
"method":"attrset/builtinInfo", | ||
"params": [ "any" ] | ||
} | ||
``` | ||
|
||
``` | ||
CHECK: "id": 1, | ||
CHECK-NEXT: "jsonrpc": "2.0", | ||
CHECK-NEXT: "result": { | ||
CHECK-NEXT: "arity": 2, | ||
CHECK-NEXT: "doc": "\n Return `true` if the function *pred* returns `true` for at least one\n element of *list*, and `false` otherwise.\n " | ||
CHECK-NEXT: } | ||
CHECK-NEXT:} | ||
``` | ||
|
||
```json | ||
{"jsonrpc":"2.0","method":"exit"} | ||
``` | ||
|