1
1
mirror of https://github.com/oxalica/nil.git synced 2024-12-01 14:32:12 +03:00
Commit Graph

138 Commits

Author SHA1 Message Date
oxalica
dbf49b3aab Generate symbol tree syntactically without invalid nesting
Fixes #107
2023-10-09 09:00:19 +08:00
oxalica
2091ef0e1d Fix clippy warnings 2023-10-09 08:48:57 +08:00
oxalica
5b55d6fd79 Avoid breaking words in tests 2023-08-06 22:31:06 +08:00
oxalica
565472e8ae Mass fix typos with typos 2023-08-06 22:31:06 +08:00
Jordan Isaacs
a2668f5680
Fix tests for nix 2.17
* Also updates nixpkgs to utilize 2.17 for tests
2023-07-27 18:54:58 -07:00
oxalica
3b1d36a5ba Add tests for the stability of Module 2023-07-12 08:18:52 +08:00
oxalica
9512111505 Fix diagnostics ordering in liveness analysis 2023-07-12 08:18:52 +08:00
oxalica
05b7d9e936 Update rustfmt and format let-else 2023-07-09 07:47:27 +08:00
oxalica
bc24a2567b Delay path link resolutions
This reduces the time of `textDocument/documentLink` from ~100ms down
to ~20ms. Editors doing frequent query of links like coc.nvim can
benefit a lot from it.
2023-06-26 17:56:47 +08:00
oxalica
9bcb01acc2 Filter far spans from highlight_related results 2023-06-26 16:45:22 +08:00
oxalica
e727e55565 Bump indexmap to 2 2023-06-24 11:04:59 +08:00
oxalica
c7453bb3ea Update dependencies 2023-06-23 14:17:13 +08:00
Manuel
119e56eb4d
Update diagnostics CLI to return non-zero exit code only on errors (#90)
Co-authored-by: Manu [tennox] <tennox+git@txlab.io>
2023-06-12 06:31:37 +08:00
oxalica
dcd38b96c9 Use semantic token type boolean for true/false
This distinguishes boolean literals from other builtin constants like
`null`. The type name is copied from rust-analyzer.

<526507fe22/crates/rust-analyzer/src/semantic_tokens.rs (L67)>

Closes #52
2023-05-31 19:22:45 +08:00
oxalica
ac641a993a Trigger show-references on variable usages
Closes #86
2023-05-31 19:08:18 +08:00
oxalica
7414d583c5 Only check the direct parent node in references query
We should not query `with`'s references just because we are inside a big
`with` expression. It should only trigger exactly on the `with` token.
2023-05-31 18:58:54 +08:00
oxalica
a7d651421d Set rest type for system fields in flake outputs
This helps inference for the common dynamic system access pattern.
Example:

```nix
{
  outputs =
    { flake-utils, nixpkgs, ... }:
    flake-utils.lib.eachDefaultSystem (system: {
      packages.hello = nixpkgs.legacyPackages.${system}.hello;
                                              # ^       ^ What should this resolve to?
                                              # ^ Dynamic attribute.
    }
}
```

Thus we pick a specific "default" system for fallback. Then
`nixpkgs.legacyPackages.${system}.hello` can be resolved to, for
example, `nixpkgs.legacyPackages.x86_64-linux.hello`, which we know is
a `derivation`.
2023-04-22 09:19:15 +08:00
oxalica
5422c3fe82 Infer rest types for dynamic fields 2023-04-22 09:19:15 +08:00
oxalica
ae9fa0c3a2 Also export flake output under outputs 2023-04-22 06:23:12 +08:00
oxalica
7d020d4698 Inject outputs of input flakes 2023-04-22 01:56:50 +08:00
oxalica
7218a6b7ca Add input flake types to database inputs 2023-04-22 01:40:00 +08:00
oxalica
3c6629acd0 Rename ide::ty::options -> ide::ty::convert 2023-04-21 03:10:22 +08:00
oxalica
1d5bc81023 Fix typo 2023-04-14 03:06:42 +08:00
oxalica
df541a798d Suppress unused warnings for flake auto-inputs
Fixes #73
2023-04-14 03:04:26 +08:00
oxalica
9995235134 Update dependencies 2023-04-14 02:12:57 +08:00
oxalica
0718fca59b Parse rec attrsets in flake.nix 2023-03-30 22:04:10 +08:00
oxalica
f3eaa77002 Escape invalid identifiers in completions 2023-03-29 16:24:15 +08:00
oxalica
932803b1de Fix panics when flake inputs contain self 2023-03-28 21:44:43 +08:00
oxalica
8463c135ad Translate and inject option types from Nix 2023-03-14 01:14:22 +08:00
oxalica
5b99f7aab5 Inject NixOS options 2023-03-13 22:46:45 +08:00
oxalica
9a043a5039 Add NixOS configuration type database input 2023-03-13 17:47:56 +08:00
oxalica
fe38ceaae6 Move string escaping to syntax::semantic and fix 2023-03-13 13:39:44 +08:00
figsoda
e5fcdc168c
Add string rewriting assists (#69) 2023-03-11 23:05:19 +08:00
oxalica
bbca41c5ee Apply clippy::uninlined_format_args 2023-03-10 16:10:09 +08:00
oxalica
4ec9367726 Apply clippy::manual-let-else 2023-03-10 16:10:09 +08:00
oxalica
4a9f128200 Apply clippy::{doc_markdown,missing-panics-doc} 2023-03-10 16:10:02 +08:00
figsoda
d101741884
Implement type inference for rest attributes (#68) 2023-03-09 06:17:13 +08:00
figsoda
267e2b4d73 Briefly document _ attributes 2023-03-08 22:18:41 +08:00
figsoda
4e31fede0a Correct and extend types for nixosConfigurations 2023-03-08 22:18:41 +08:00
figsoda
59ffbac047 Consider system attributes when typing flake outputs 2023-03-08 22:18:41 +08:00
oxalica
fc91c3f6d6 Rename confusing SyntaxKind::is_* 2023-03-07 03:30:52 +08:00
Moritz Böhme
bb9a748cce Add remove_empty_let_in assist 2023-03-05 06:19:17 +08:00
oxalica
0f918f956f Warn unused parameters in flake outputs lambda 2023-03-04 02:30:16 +08:00
oxalica
f40199bea2 Warn unused pat parameters for modules and packages 2023-03-04 02:25:42 +08:00
oxalica
dace5df783 Guess ModuleKind for packages and NixOS modules 2023-03-04 01:37:10 +08:00
oxalica
ba70fc01fd Split out ModuleKind guessing 2023-03-03 22:00:24 +08:00
oxalica
d4e6677846 Export file referrer query as experimental/parentModule
See: https://github.com/microsoft/language-server-protocol/issues/1002
2023-02-18 06:12:56 +08:00
oxalica
87d007b2ab Track referrers of modules 2023-02-17 21:21:51 +08:00
oxalica
ea8ee40bd1 Sweep unused dependencies 2023-02-14 23:54:14 +08:00
oxalica
d62d4a4dd4 Improve query cache efficiency 2023-02-14 23:54:14 +08:00