Commit Graph

1031 Commits

Author SHA1 Message Date
Techatrix
861e2ffb05 add formatting to recordError 2023-01-20 19:55:26 +01:00
Techatrix
1e73ac91e5 small comptime interpreter refactor 2023-01-20 19:28:25 +01:00
Techatrix
b4ac6142cf correctly resolve primitive types 2023-01-20 19:20:42 +01:00
Techatrix
34b2643b33 add basic comptime interpreter tests 2023-01-20 17:06:16 +01:00
Techatrix
06fcfcb3db add internpool to test steps 2023-01-20 17:04:59 +01:00
Techatrix
4a8fe90d23 add coerceInMemoryAllowed integer & float tests 2023-01-20 15:34:49 +01:00
Techatrix
a145dbb616 remove panics from release builds 2023-01-20 15:26:00 +01:00
Techatrix
3d95b203f2 coerce in memory improvements 2023-01-20 15:08:52 +01:00
Techatrix
bdf143eaa6 implement onePossibleValue 2023-01-20 15:08:08 +01:00
Techatrix
666e3b0e7c add function pointer peer type tests 2023-01-19 21:08:04 +01:00
Techatrix
5c20650143 refactor pointer peer type tests 2023-01-19 19:50:19 +01:00
Techatrix
eca9fc2f20 add expectEqualTypes 2023-01-19 19:49:46 +01:00
Techatrix
ea608a47ea peer type resolution improvements 2023-01-19 19:16:19 +01:00
Techatrix
1e3d9579ca improve peer type resolution test failure message 2023-01-19 19:15:52 +01:00
Techatrix
fa5828496e
Generate data files in config_gen.zig (#903)
* generate data files in config_gen.zig

* remove trailing comma from config.json

* update README.md

* run zig build gen

* handle some unclosed tags

* update data file header

* generate new data files

* remove old data file generators
2023-01-19 01:46:42 -05:00
Techatrix
0c24f8e2a9 update pointer type tests 2023-01-17 20:49:11 +01:00
Techatrix
985cfb6d06 implement union values 2023-01-17 20:37:34 +01:00
Techatrix
30f919d854 optimize hashing and equality checks on structs 2023-01-17 20:36:33 +01:00
Techatrix
2ea97a050b improve Function memory layout 2023-01-17 20:35:42 +01:00
Techatrix
fb3a4238d7 update tests 2023-01-17 20:32:49 +01:00
Techatrix
407f921ef8 refactor type printing 2023-01-17 20:23:27 +01:00
Techatrix
9e74afada6
show better zig/zls version mismatch messages (#917)
* show better zig/zls version mismatch messages

* always show message if versions don't match

* ignore patch
2023-01-16 13:49:00 -05:00
Techatrix
af85a9550d
simplify formatting handler (#916) 2023-01-16 13:47:55 -05:00
Techatrix
4e4761b34c
fix use after free for builtin completions (#914) 2023-01-16 13:47:06 -05:00
Techatrix
8d53a5382d
resolve type of @typeInfo (#915) 2023-01-16 13:46:33 -05:00
Techarix
739bd08b7b fix storage of negative signed integer values 2023-01-16 12:38:35 +01:00
Techatrix
82e3ab9f2e more tests 2023-01-15 18:25:00 +01:00
Techatrix
45f03ca239 add bit_offset & host_size to Pointer 2023-01-15 15:41:54 +01:00
Techatrix
bdf207a821 small refactor on ComptimeInterpreter 2023-01-14 21:49:27 +01:00
Techatrix
d49979d002 remove arena from ComptimeInterpreter 2023-01-14 21:30:52 +01:00
Techatrix
969efdfba0 more tests 2023-01-14 21:27:55 +01:00
Techatrix
5dca172c31 small cleanup 2023-01-14 19:51:44 +01:00
Techatrix
1456bfa1c6 refactor InternPool KeyAdapter 2023-01-14 19:17:06 +01:00
Techatrix
04d281340c restructure ComptieInterpreter tests 2023-01-14 14:08:15 +01:00
Techatrix
98899ed0cf some ComptieInterpreter work 2023-01-14 14:07:52 +01:00
Alex Kladov
61fa98065f
fix use after free (#911) 2023-01-11 20:18:37 +00:00
Lee Cannon
20d29fd491
move log overrides into std_options (#902) 2023-01-10 16:52:03 -05:00
Techatrix
4423a5face
improve memory allocations (#889)
* improve memory allocations

* Update src/main.zig

Co-authored-by: erikarvstedt <36110478+erikarvstedt@users.noreply.github.com>

* add missing 0x21

Co-authored-by: erikarvstedt <36110478+erikarvstedt@users.noreply.github.com>
2023-01-09 11:09:36 -05:00
Auguste Rame
21b103c158
Fix build runner cwd causing relative @src (#898)
Co-authored-by: Nameless <truemedian@gmail.com>

Co-authored-by: Nameless <truemedian@gmail.com>
2023-01-08 23:13:20 -05:00
Techatrix
68790c73a7
return from main instead of calling exit (#894) 2023-01-08 23:13:02 -05:00
Techatrix
e9b364772d
fix returning freed memory in formattingHandler (#890) 2023-01-07 16:33:10 -05:00
Techatrix
54e7d1da8b
fix compile errors when targeting wasm (#886)
* fix compile errors when targeting wasm

* update known-folders
2023-01-07 15:21:20 -05:00
Techatrix
3f2700eaa5
improve completion on error and enums (#887) 2023-01-06 13:59:20 -05:00
Techatrix
27d91d100f more tests 2023-01-06 15:02:45 +01:00
Techatrix
909424cada error set type formatting 2023-01-06 15:01:48 +01:00
Techatrix
650eaeb66c implement anyframe->T 2023-01-06 14:38:28 +01:00
Techatrix
f0c888188a refactor and basic struct/union value implementation 2023-01-06 14:12:29 +01:00
mlugg
b163be51d3
Fix crash when using nvim-lspconfig (#884)
Apparently, nvim reports its code action kinds using both the actual
strings (e.g. "refactor.extract") and the enumeration names (e.g.
"RefactorExtract"). I don't know why this is done - possibly an attempt
at compatibility with non-compliant server implementations? Regardless,
this was causing a crash on init (when tres tried to parse an
initializaiton message), which is easily fixed by just supporting those
enumeration values.

Resolves: #867
2023-01-05 13:50:02 -05:00
Techatrix
8828ff117d more comptime interpreter work 2023-01-04 11:11:48 +01:00
Techatrix
651955399e remove namespace and decl from intern pool 2023-01-04 11:10:46 +01:00
Techatrix
5598ad032b partially implement peer type resolution for pointer types 2023-01-04 09:53:48 +01:00
Techatrix
475da58895 finish and test peer type resolution among integers and floats 2023-01-04 06:07:39 +01:00
Techatrix
d56a274c16 Merge branch 'master' into intern-pool 2023-01-04 04:42:06 +01:00
Auguste Rame
20baa592eb
Add error return trace (#882) 2023-01-03 15:37:59 +00:00
Techatrix
a574ac68ba
use more explicit error sets (#880) 2023-01-03 10:21:58 -05:00
Techatrix
c718e12d16
Autofix improvements (#879)
* improve autofix stability and client support

* run zig fmt
2023-01-02 14:59:01 -05:00
Techatrix
9badc745c5
remove setup wizard (#878)
* remove setup wizard

* add back findZig function
2023-01-02 13:54:13 -05:00
Techatrix
b95d5095af
enable all capabilities by default (#877) 2023-01-02 04:02:28 -05:00
Techatrix
3449269fd3
Add a replay feature to zls (#857)
* add config options for `zls --replay`

* implement `zls --replay`

* remove carriage return from zls replay files

* add missing arguments for Server.init in tests
2022-12-31 01:45:45 -05:00
Techatrix
417bf9bd0a
add vscode config generation to zig build gen (#862)
* add vscode config generation to `zig build gen`

* correctly handle removing configs in config_gen.zig

* update log messages in config_gen.zig
2022-12-30 18:45:31 -05:00
Techatrix
d86d05d969
fix ast-check with single error (#865) 2022-12-30 18:43:40 -05:00
Techatrix
94ec3a0a86
Debugging utilities (#860)
* add debug printing for Ast and DocumentScope

* add optional failing allocator
2022-12-30 18:42:53 -05:00
Techatrix
f473088b64
fix crashes found through fuzzing (#866) 2022-12-30 18:42:28 -05:00
Techatrix
c88562ca78
optimize build.zig discovery (#863) 2022-12-29 18:21:26 -05:00
Techatrix
978e41b8a5
always use scoped logs instead of default (#864) 2022-12-29 18:20:12 -05:00
Álan Crístoffer
c6d74dbca5
fix: tres not available in a nix environment. (#855) 2022-12-29 13:36:38 -05:00
Rekai Musuka
aabdb0c6ec
fix: update master.zig to reflect changes to builtins (#858) 2022-12-29 01:00:32 -05:00
Techatrix
ebe3ba1471
Memory lifetime fixes (#861)
* fix memory lifetime issues

* more memory lifetime issue fixes
2022-12-29 00:59:19 -05:00
Techatrix
61c0981294
Use zig-lsp-codegen (#850)
* add lsp.zig

* change references from types.zig to lsp.zig

* remove types.zig and requests.zig

* add tres as a submodule

* transition codebase from types.zig to lsp.zig

* update lsp.zig

* completely overhaul message handler

* fix memory errors

* partially transition tests to lsp.zig

* update lsp.zig

* more test fixes

* disable failing tests

* fix message handling bugs

* fix remaining tests

* access correct union in diff.applyTextEdits

* more message handler fixes

* run zig fmt

* update tres submodule

* fix memory access to freed memory

* simplify initialize_msg for testing

* check if publishDiagnostics is supported
2022-12-27 01:47:57 -05:00
Techatrix
941882371c
fix memory lifetime issues (#851) 2022-12-27 00:52:15 -05:00
travisstaloch
3139a787a1
fix another underflow in ast.zig#fullWhile() (#853) 2022-12-27 00:45:52 -05:00
Techatrix
6118686d00 fix remaining compiler errors 2022-12-27 03:02:07 +01:00
Techatrix
03e50066a1 Merge branch 'master' into intern-pool 2022-12-27 01:53:55 +01:00
Techarix
04448d1a7b more intern pool work 2022-12-27 02:46:57 +01:00
travisstaloch
faae689ff7
prevent underflow in ast.zig#fullWhile() (#848) 2022-12-25 17:44:25 -05:00
Ryan Liptak
f6c15ac10c
semantic_tokens: Fix handleComments not evaluating the last byte (#844)
Fixes #842
2022-12-22 22:27:38 -05:00
rimuspp
4d7b95e1e2
generated master data for new builtins (#845) 2022-12-22 22:26:29 -05:00
Eric Puentes
44b6c4dae4
fix: avoid finding references in the current file twice (#846) 2022-12-22 22:25:56 -05:00
Auguste Rame
c355a54dd1
Fix raw, responseless returns on willSaveWaitUntil (#833)
* Fix raw, responseless returns on willSaveWaitUntil

* Make this code pretty
2022-12-19 16:01:08 -05:00
Steven Kabbes
427620742a track builtin API changes from zig/master
see: https://github.com/ziglang/zig/pull/13930
In this PR, std.builtin.Type.field_type is renamed to type
And there is discussion that all Enum layouts are .Auto
2022-12-18 12:45:36 -07:00
Lee Cannon
e65d5c5c23
Merge pull request #834 from travisstaloch/fix-for-issues-754-832
analysis.zig getPositionContext() - check for null
2022-12-18 00:56:30 +00:00
Travis Staloch
e09c773005
analysis.zig getPositionContext() - check for null
closes #754 and #832

this pr just adds `.label => {}` to the switch as suggested by
@nullptrdevs, thereby preventing the null unwrap.  i checked that zls no
longer crashes when positioning the cursor on Server.zig:2287:41 which
is this line:
  `break :blk .{ .WorkspaceEdit = edits };`
                              ^ cursor here previously crashed zls
2022-12-17 15:37:49 -08:00
Techatrix
375daba743
improve behavior if zig_exe_path is not set (#830) 2022-12-17 03:03:05 -05:00
Techatrix
d679b19676
remove old stage1 code artifacts (#831) 2022-12-17 03:02:31 -05:00
Techatrix
5d6f23b5f1
fix integer underflow in ast.fullPtrType (#829) 2022-12-16 15:24:25 -05:00
Techatrix
e1973afafc
fix cimport duplicate messages & crash (#828) 2022-12-16 15:24:03 -05:00
Techatrix
68ac6f9f30
remove ast.tokenSlice() (#824) 2022-12-15 17:01:42 -05:00
Techatrix
c39a4eb2ab
simplify & refactor analysis code (#823) 2022-12-15 13:03:09 -05:00
nullptrdevs
3526f5fb84
Zig @call changes (#822)
First parameter is now a `std.builtin.CallModifier`.
2022-12-14 20:58:38 -05:00
Auguste Rame
d43329a9ee
Fix labels for real this time (#819) 2022-12-14 05:51:01 -05:00
Auguste Rame
0ab34abc0f
Bug stream fixes (#818)
* Fix glaring inlay hint issue; thanks for the report Nameless

* Fix label references; closes #728
2022-12-13 22:07:36 -05:00
Lee Cannon
878464ea72
Merge pull request #816 from alexnask/ascii-deprecated-removed
Use new versions of now removed std.ascii declarations
2022-12-12 00:18:23 +00:00
Lee Cannon
974bdff6b3
fix missed reference on windows 2022-12-12 00:13:13 +00:00
Techarix
748cd7d6a9 Merge remote-tracking branch 'origin/master' into intern-pool 2022-12-11 19:02:24 +01:00
Techatrix
1ae341850e
automatically generate config associated files (#813) 2022-12-11 13:10:48 +02:00
Alexandros Naskos
3cac23f8a1
Fix references to now removed, previously deprecated std.ascii declarations 2022-12-10 23:21:55 +02:00
Lee Cannon
9e658cdbb6
update TracyAllocator for new Allocator changes (#812)
* update TracyAllocator for new Allocator changes

* Add build with Tracy to CI to catch regressions

* disable Tracy CI step on macos
2022-12-08 14:32:50 -05:00
Joseph Stahl
887539ed1a
Allocator.resize() does not adjust size of string allocated for URI to file path conversion (#806)
* fix missing backslash

* fix: zls escaping colon to %3A on URIs

ZLS escapes a colon char ":" as "%3A" when encoding file paths to URIs
When decoding, need to make the target string 2 character shorter
to compensate for length decrease when replacing %3A with :

* add new failing test because of resize()

* revert changes to %3A handling - problem seems to be with allocator.resize

* switch to realloc

* Fix test failures, revert errdefer->defer

* platform-specific URI tests

URI parsing is highly platform-specific
run Unix-style (file:///home/main.zig) on non-Windows test runners,
run Windows-style (file://c%3A/main.zig) on Windows test runners
2022-12-04 16:44:22 -05:00
Auguste Rame
580469cd32
Fix rogue resize, bump minimum version (#805) 2022-12-03 21:35:51 -05:00
Alex Kladov
cfb0b023ad
fix #801, IOOB in foldingRanges (#802)
* Add smoke tests for folding ranges

* fix index out of bounds in foldingRanges

closes #801

For invalid syntax trees, zig's parser seems to return bogus data where
startToken > endToken, which then causes everything else to crash.

This seems like a deeper issue, which needs to be fixed "properly", but
let's just paper over it here.
2022-12-03 17:23:13 +02:00