Releases: zigtools/zls
zls 0.13.0
This release is meant to provide compatibility with Zig 0.13.0
New Contributors
- @ert78gb made their first contribution in #1887
- @Sekky61 made their first contribution in #1896
- @WillLillis made their first contribution in #1903
Full Changelog: 0.12.0...0.13.0
zls 0.12.0
Installing ZLS for the first time? Check out the Installation Guide!
What's Changed
New Type Hints (#1444) (#1512) (#1778)
New inlay hints have been added for variable declarations, captured values and struct literal fields.
These new inlay hints can be seperately configured with the following new config options:
inlay_hints_show_parameter_name
inlay_hints_show_variable_type_hints
inlay_hints_show_struct_literal_field_type
Build on Save (#1361)
The new enable_build_on_save
config option enables ZLS compile your project with zig build
and report back diagnostics.
You can control which build step should be executed with the build_on_save_step
config option which defaults to the "install" step.
Note: The vscode-zig extension provides a similar feature.
Completions
highlight symbols that call @compileError
as deprecated (#1764)
Any symbol that calls @compileError
will marked as deprecated in completions, hover and semantic highlighting. Different editors/clients may represent this information differently (or not at all).
Note: The error message does not need to start with "Deprecated;".
Semantic highlighting of deprecated symbols in VS Code
Most Color Themes in VS Code do not visualize deprecated tokens. The following setting can be used in VS Code to highlight deprecated tokens with a strikethrough.
"editor.semanticTokenColorCustomizations": {
"rules": {
"*.deprecated": {
"strikethrough": true
},
}
},
Detail field to pointer deref and optional unwrap operations (#1745)
Completions of the .*
and .?
operations will now show the result type.
Filesystem completion in build files (#1668)
While editing a build.zig
file, you will now receive filesystem completions inside string literals when typing a valid file path.
Module completions for std
and builtin
(#1656)
Completions inside an @import
will include the std
and builtin
module with their file path. (#1656)
completions with 'replace' instead of 'insert' (#1458)
Editor/Client | Config Option | Default Value |
---|---|---|
VS Code | editor.suggest.insertMode |
"insert" |
Sublime Text LSP | completion_insert_mode |
"insert" |
Helix | completion_replace |
false |
Emacs lsp-mode | lsp-completion-default-behaviour |
:replace |
A config option in Vim/Neovim depends on the LSP or completion plugin being used.
Kate Editor has a config option for this feature "Configure
-> Editing
-> Auto Completion
-> Auto word completion
-> Remove tail on complete
" but it does not use ZLS.
completions for function aliases with self parameters (#1656)
Declarations to function alias that take a self parameter are now included when providing completions on member access.
The following example would previously not give any completions.
Snippets
Snippets for float and int types have been removed. (#1681)
There are new snippets that add top level declaration for std
, @import
and std_options
(#1498) (#1830)
Configuration
validate configuration options (#1366)
The config system has been revamped to validate config options like executable or directory paths and provide better diagnostics.
When your editor does not support displaying a message window, you will still find them in ZLS's log output.
ZLS+Zig compatibility check (#1808)
ZLS has the following compatibility requirements:
- A tagged release of Zig or ZLS must be used with the same tagged release of Zig or ZLS
- A master/nightly build of ZLS requires master/nightly build of Zig
As of right now, a master/nightly build of ZLS does try to be mostly usable with the latest tagged release of Zig but this is done as a best effort and is subject to change. (#1020)
When your ZLS and Zig version are incompatible, ZLS will show you a warning:
When your editor does not support displaying a message window, you will still find them in ZLS's log output.
autofix disabled by default
The autofix feature is now disabled by default. (#1657)
removed enable_ast_check_diagnostics
Getting quickly informed about compile errors while coding is a vital feature that has little reason to be disabled.
removed enable_import_embedfile_argument_completions
This feature has been unstable in the past which is no longer the case.
removed include_at_in_builtins
This options served as a workaround for an issue with builtin completions in Sublime Text 3 which has been resolved.
removed max_detail_length
This options served as a workaround for an issue with long completion detail entries bricking the preview window in Sublime Text (#261) which can automatically be set by querying which editor/client is being used.
Performance
The DocumentScope is an internal datastructure of ZLS that keeps track of variables, declarations and their scopes. Most analysis relies on it to perform symbol lookups, iterate symbols or quickly traverse scopes. Every time a document is modified, the DocumentScope is rebuilt for the entire document so it has been rewritten with Data-oriented design principles in mind to reduce its performance footprint. (#1517)
Here is a benchmark where the DocumentScope is constructed and deinitialized 100 times on Zig's Sema.zig:
Benchmark 1 (33 runs): ./document_scope_old
measurement mean ± σ min … max outliers delta
wall_time 3.67s ± 23.5ms 3.64s … 3.74s 2 ( 6%) 0%
peak_rss 11.1MB ± 64.1KB 10.9MB … 11.2MB 0 ( 0%) 0%
cpu_cycles 12.8G ± 99.1M 12.6G … 13.0G 1 ( 3%) 0%
instructions 24.3G ± 689 24.3G … 24.3G 2 ( 6%) 0%
cache_references 45.7M ± 848K 44.5M … 47.9M 1 ( 3%) 0%
cache_misses 6.36M ± 284K 5.89M … 6.92M 0 ( 0%) 0%
branch_misses 111M ± 1.20M 110M … 114M 0 ( 0%) 0%
Benchmark 3 (66 runs): ./document_scope_new
measurement mean ± σ min … max outliers delta
wall_time 1.82s ± 13.4ms 1.79s … 1.88s 3 ( 5%) ⚡- 50.4% ± 0.2%
peak_rss 8.19MB ± 57.8KB 8.08MB … 8.32MB 6 ( 9%) ⚡- 26.0% ± 0.2%
cpu_cycles 7.04G ± 51.3M 6.92G … 7.25G 3 ( 5%) ⚡- 44.9% ± 0.2%
instructions 9.86G ± 2.01K 9.86G … 9.86G 0 ( 0%) ⚡- 59.5% ± 0.0%
cache_references 45.4M ± 327K 44.7M … 46.3M 2 ( 3%) - 0.7% ± 0.5%
cache_misses 1.22M ± 462K 651K … 2.53M 8 (12%) ⚡- 80.9% ± 2.7%
branch_misses 79.4M ± 1.27M 75.9M … 81.0M 3 ( 5%) ⚡- 28.7% ± 0.5%
experiencing issues with ZLS?
When encountering issues, do not hesitate to report your issues on the Github issue tracker or ZLS Discord Server.
New Contributors
- @notcancername made their first contribution in https://gith...
zls 0.11.0
Thanks @Techatrix for writing these release notes!
Feature improvements:
- hover improvements (#1269) (#1281) (#1282) (#1294) (#1303) (#1308) (#1320)
- struct init field completion (#1075) (#1090) (#1115) (#1116) (#1275) (#1298) (#1307)
- completion on error and enums (#887) (#1233) (#1270) (#1302)
- provide more semantic token information (#1057) (#1103)
- implement cInclude completions & goto definition and hover (#970) (#972)
- keyword completion and updated snippets (#763) (#767) (#769) (#1095)
New capabilities:
Analysis:
- experimental comptime interpreter (#724)
- branching type resolution (#1031)
- add anytype resolution based on call references (#1067)
- resolve type of simple labeled block (#1262)
- expand var decl alias resolution (#1273)
- resolve std.ArrayList(T).Slice (#1373)
- resolve type of loop expressions (#1310)
- resolve types of slice.len, slice.ptr, and tuple fields (#1315)
Performance:
- optimize analysis backend (#1062)
- use @silversquirl's binned allocator (#1134)
- multithreaded job processing (#1311)
- optimize inlay hints. (#926) (#948) (#954)
- optimize document symbols (#1050)
Config:
- make argument placeholders optional (#1317)
- make semantic token configuration an enum (#1064)
- enable all capabilities by default (#877)
Behind the scenes:
- switch to diff-match-patch (#982)
- add a replay feature to zls (#857)
- code formatting does not depend on zig executable. (#755)
- update zig submodules to new builtin dependency system (#1017)
- disable and then reenable cimport resolution (#1091) (#1136)
- use zig-lsp-codegen (#850)
- transition from tres to std.json (#1321)
zls 0.10.0
What's Changed
- add builtin data for 0.9.0 by @nektro in #443
- update builtin data for zig master by @nektro in #444
- Update prebuilt release URLs by @jonpalmisc in #446
- add a default option for
@import(builtin)
by @nektro in #445 - add type function symbols to document symbol outline by @ikrima in #448
- Fix build on zig master (0.10.0-dev.500+66cf011aa) by @SebastianKeller in #451
- builtin_uri: Fix typo in log message by @novakne in #449
- update for anytype field yeeting by @slimsag in #453
- Skip char and string literals when highlighting comments by @cascade256 in #463
- fix: ast.lasttoken() does not handle addrspace section by @ikrima in #467
- Fix ZLS config not found crash #410 by @davidgm94 in #455
- update to zig master 0.10.0-dev.1679+d227f76af by @nektro in #473
- fix ast.lastToken() does not handle empty error_value by @v1nh1shungry in #476
- Fix missing doc comment for
inline fn
by @Jarred-Sumner in #479 - update build.zig for recent zig changes by @suirad in #492
- Fix
std.math.cast
,std.ChildProcess
, tests on Windows and enable Windows in CI by @leecannon in #496 - implement workspace/configuration by @vesim987 in #436
- Remove zinput dependency by @SuperAuguste in #500
- Ignore unimplemented notifications by @gpanders in #501
- Add tracy by @SuperAuguste in #502
- Add step to Kate installation instructions by @029onikyu in #474
- Add support for Spacemacs by @rbino in #477
- Update the README by @alvv-z in #460
- only send format editings when necessary by @tw4452852 in #420
- Remove duplicated deinit defer for GPA by @gerred in #504
- fix off by one error in documentRange by @kristoff-it in #505
- Ease debugging package loading from build_runner by @MageJohn in #508
- fix memory leak by @leecannon in #509
- Sort completion items by @ryuukk in #506
- Label details support by @ryuukk in #507
- Add super basic unused variable support by @SuperAuguste in #511
- Fix function snippets not working with details by @SuperAuguste in #512
- Basic variable type resolution on hover by @SuperAuguste in #513
@import
/@embedFile
argument completions by @SuperAuguste in #514- Fix build.zig typo for enable_tracy using better wording by @sepruko in #515
- Workspace configuration server request model implemented! by @SuperAuguste in #520
- Fix out of bound panic by @Techatrix in #525
- setup: Update vscode configuration snippet by @alichraghi in #528
- ZSTD build artifacts by @SuperAuguste in #529
- Beam to felix land! by @SuperAuguste in #530
- Bug Fixes! by @SuperAuguste in #534
- Basic improvements! by @SuperAuguste in #539
- Refactor out most main globals! by @SuperAuguste in #546
- update to IterableDir changes in Zig std by @Vexu in #544
- Fix tokenRelativeLocation by @SuperAuguste in #547
- Add flake support by @leroycep in #549
- Highlight orelse as a keyword by @Techatrix in #557
- docs(neovim/vim): Update instruction for Coc by @xiyaowong in #558
- Implement textDocument/documentHighlight by @gpanders in #484
- Implement textDocument/inlayHint by @Techatrix in #559
- Update setup wizard for ST4 by @alvv-z in #461
- Update README.md and setup by @Techatrix in #560
- build_runner: support 0.9 and master by @leecannon in #561
- Fix tests for real? by @SuperAuguste in #562
- update format specifiers for optional strings by @haze in #564
- fix format string by @leecannon in #565
- Format
zls.json
in setup wizard by @Techatrix in #568 - provide build_runner command on failure by @leecannon in #569
- Revive Session tests by @Techatrix in #570
- Correctly handle sentinel slices by @Techatrix in #573
- fix 'Cannot resolve std library import' by @Techatrix in #572
- Semantic token for keyword 'undefined' by @Techatrix in #574
- Fix memory leaks by @Techatrix in #576
- Only return highlights for symbols in current document by @gpanders in #578
- trigger completion after
]
by @leecannon in #581 - Refactor Ast helper functions by @Techatrix in #582
- Improve CLI, fix leak, & other. by @InKryption in #583
- 2 minor tidy-ups + fix for over-eager unused parameter error in function types by @InKryption in #584
- Improve unused variable report accuracy by @InKryption in #585
- make
zig build
work with latest master by @leecannon in #587 - Better handling for enum field signatures by @Techatrix in #590
- Update dependencies by @Techatrix in #591
- Add Cimport support by @Techatrix in #589
- fix link of VS Code by @Zzzen in #593
- update README.md by @Techatrix in #598
- Fix Path <-> Uri mismatch by @Techatrix in #597
- Add issue templates by @SuperAuguste in #600
- workaround zig tarball bug by @leecannon in #599
- fix: fix memory leaks related to updating config variables by @nullptrdevs in #595
- Text format to return edited ranges instead of entire document by @jefftime in #579
- unmanage all the code by @Techatrix in #602
- patch allocator mismatch in translate_c by @Techatrix in #604
- emit correct c preprocessor macro in convertCInclude by @Techatrix in #605
- fix: fix warning emitted incorrectly when using .. by @nullptrdevs in #607
- Switch to using mitchellh's zig-overlay by @leroycep in #610
- Improve Test coverage by @Techatrix in #609
- Fix textDocument/rename by @Techatrix in #612
- add JSON Schema by @Techatrix in #613
- Only conditionally ask for global configuration in setup wizard by @Techatrix in #615
- add --show-config-path for querying the config path by @Techatrix in #614
- ast-check for zls! by @SuperAuguste in #617
- Report zls version using git describe by @Techatrix in #618
- Report version just like zig by @Techatrix in #619
- fallback when failing to run git describe by @Techatrix in #620
- fix: fix server crash related to parsing incomplete function as a fun… by @nullptrdevs in #606
- Enable ast-check by default by @Techatrix in #621
- Build m1 binaries by @SuperAuguste in #622
- embedFile build_runner.zig in executable by @Techatrix in #624
- Update builtin data by @Techatrix in #625
- Reconstruct diagnostic range end of ast-gen by @Techatrix in #630
- fix: "f..o.o;" crashes the server by @nullptrdevs in #629
- Place build_runner.zig in cache directory by @Techatrix in #635
- NativeTargetInfo.detect() no longer takes an Allocator param by @nullptrdevs in ht...
zls 0.9.0
zls release that works and compiles for the zig 0.9.0 release! Enjoy <3
zls 0.2.0
Second zls release, hope this helps you write awesome Zig code!