Commit Graph

372 Commits

Author SHA1 Message Date
Lee Cannon
4f04f7dac0
std.ChildProcess.init cannot error 2022-05-29 18:18:57 +01:00
David Gonzalez Martin
a1f72d46e3 Fix ZLS config not found crash #410 2022-02-07 22:14:31 -06:00
Sebastian Keller
472104c0e1 Fix build on zig master (0.10.0-dev.500+66cf011aa)
std.process.args() has a slightly different api now, breaking the build
on zig master.
2022-02-01 21:52:15 +01:00
Auguste Rame
08f2638d6a
Merge pull request #445 from nektro/autocomplete-builtin
add a default option for `@import(builtin)`
2022-01-01 16:57:39 -05:00
Meghan Denny
09d51af161 handle AccessDenied when making 'builtin.zig' fill-in 2021-12-29 22:53:30 -08:00
Meghan Denny
3fdab6c2fa add a default option for import(builtin) 2021-12-29 19:35:16 -08:00
Meghan Denny
49cbbd1ebb add builtin data for 0.9.0 2021-12-29 22:24:34 -05:00
Auguste Rame
18569926a3 Fix compilation on latest Zig 2021-12-23 14:00:07 -05:00
Marten Ringwelski
abe82f6069
build_runner: Require some paths to be given (#369)
We now require the following to ge given in the cli args:
- zig_exe
- build_root
- cache_root
- global_cache_root

This fixes the path for packages that use one or more from the above to place
their files.
2021-12-11 12:42:18 -05:00
Matt Knight
f9133ffdec allocgate defeated 2021-12-03 08:00:22 -05:00
MineBill
e469d8171f Fixes errors that are caused by using deprecated functions 2021-11-30 16:24:37 -05:00
Omar Alhammadi
12cda9b031 Change notification method in log
Currently in the log function in main, the notification method used to send logs to the client is "window/showMessage". This creates an a notification on the UI on VSCode that can cause slow downs. I propose a change to use the  "window/logMessage" method instead, which is intended to be used for logging.
2021-11-04 19:35:49 -04:00
Omar Alhammadi
d4b6b97c01 temporary fix to issue #413 with #412 not building on release-safe. 2021-11-03 07:03:17 -04:00
Omar Alhammadi
3531237afe Added build option log_level to allow the user to set the default log level for release builds. 2021-11-02 22:13:53 -04:00
antlilja
80f09831bc Remove use of notice log level
Removes the use of the notice log level.
Cleans up resulting code, the if else statement with nested switches was
converted into a single switch statement with the same behaviour, but
without relying on the enumToInt builtin.
2021-10-26 17:01:06 -04:00
Meghan Denny
04edc7a2d5 remove all use of usingnamespace 2021-10-19 19:26:57 -07:00
Meghan Denny
e18003ff86 rename another top level fields file 2021-10-19 19:26:57 -07:00
Meghan Denny
737a9dc008 remove some dead code 2021-10-19 19:26:57 -07:00
Meghan Denny
aae82d29bd fix capitalization of top level fields structs 2021-10-19 19:26:57 -07:00
Meghan Denny
8d46ceff07 use an enum for zig version 2021-10-19 19:26:57 -07:00
Lee Cannon
90f8109639 Update to use @import("builtin") where required 2021-10-07 12:53:31 +01:00
Meghan Denny
b63339e350 remove Tree when it was the same as Ast 2021-09-30 18:57:45 -07:00
Meghan Denny
3c1152a536 use empty string for empty []const u8 2021-09-30 18:47:48 -07:00
Meghan Denny
4bc8b92e19 collapse more fn signatures 2021-09-30 18:45:45 -07:00
Meghan Denny
9e0f201283 finish rename of usage of std.zig.Ast 2021-09-30 18:44:06 -07:00
Meghan Denny
dc8affe122 add builtin data for 0.8.0 and 0.8.1 2021-09-30 17:53:14 -07:00
Meghan Denny
7c209a8404 condese small expanded things 2021-09-30 17:52:36 -07:00
Meghan Denny
ad8d75b613 use single line method signatures 2021-09-30 17:51:51 -07:00
Meghan Denny
f482950f5f fix imports to use ./ for relative usage 2021-09-30 17:48:40 -07:00
Sashiri
fed1c4c2c6 usingnamespace semantics update
+ Ast changes adjustments
2021-09-04 21:25:35 +02:00
Alexandros Naskos
bba069526c
Fix build for zig master by inserting null terminators when tokenizing and resetting them when needed 2021-07-10 19:58:37 +03:00
Lee Cannon
ac4b198869 Update to zig master
Redundant comptime, unused locals, unused function params, unused captures

As issue with @"type" resolving to the keyword type
2021-06-24 11:38:01 +01:00
Frank Denis
df9560db51 Update for -master
fn_proto.extern_export_token -> fn_proto.extern_export_inline_token

And update the data by the way.
2021-05-23 18:01:03 +02:00
Alexandros Naskos
14dc9d1b51
Don't use the build runner path as the build runner cache path if present >.> 2021-05-08 18:48:36 +03:00
Alexandros Naskos
937471d27b
Added --config-path option 2021-05-03 16:07:53 +03:00
Alexandros Naskos
91643c04c9
Fixed integer overflow in semantic_tokens.Builder.handleComments 2021-05-03 15:36:29 +03:00
Jonathan Hähne
807bd6a571 Simplify semantic_tokens, fix off-by-one error in identifierFromPosition 2021-05-02 19:59:17 +02:00
Ryan Roden-Corrent
ec34db0618
Fix small typo in comment. 2021-04-23 06:50:13 -04:00
Jonathan Hähne
b90c9b49ac Fix inclusion of toplevel doc comments, remove @async recursion in
writeNodeTokens, add a few regression tests
2021-04-15 11:07:43 +02:00
Jonathan Hähne
0e4f4c1e04 Improve testing infrastructure
It should now be a bit easier to set up a test and see how it failed.
2021-04-07 15:10:18 +02:00
Alexandros Naskos
cc3c146749
Correctly handle skipping self parameters in signature help requests
as well as completion requests.
2021-04-03 18:54:26 +03:00
Alexandros Naskos
7f432d8715
Implemented the signature help request.
Refreshes builtin data, added 0.7.1 builtins
2021-04-02 20:49:01 +03:00
Alexandros Naskos
9cc8085699
Started signature help implementation 2021-04-01 14:20:37 +03:00
Tau
df22d2490b
Update zinput, known-folders and enable global configuration (#277) 2021-03-31 17:54:27 +03:00
Alexandros Naskos
5e8e14fc08
Correctly pass zig_exe_path to document_store initialization 2021-03-31 16:26:55 +03:00
Alexandros Naskos
cfae9b4d13
If the local configuration directory cannot be opened, zls config will now
fallback to opening the executable directory instead.
Added better error handling in zls config.
2021-03-31 14:46:56 +03:00
Alexandros Naskos
8cf6029f1a
Before documentPositionContext returns .empty, check if an identifier
immediately follows the cursor and return .var_access if it does
  instead.
This allows hover and go to definition to work when the cursor is
  immediately before an identifier.
2021-03-31 02:25:49 +03:00
Jonathan Hähne
2fc9506fdc Refactor config wizard
Deduplicated zig finder and added `zls config` subcommand
2021-03-30 23:52:25 +02:00
Alexandros Naskos
6edd686668
Yet more import resolution fixes 2021-03-30 21:41:04 +03:00
Alexandros Naskos
2415e7ca6d
Removed all zig.ast.Tree methods that call lastToken with our own versions 2021-03-30 20:59:58 +03:00
Alexandros Naskos
5a88f26980
Fixed dereference resolution of Type.data.pointer values 2021-03-30 16:45:49 +03:00
Alexandros Naskos
f382a1b22d
Better import handling 2021-03-30 15:41:59 +03:00
Jonathan Hähne
11a5d99c93 No stack frame capture for non-debug modes 2021-03-30 12:38:07 +02:00
Jonathan Hähne
b7cbb10610 Fix memory leaks
Closes #262.
2021-03-30 12:33:31 +02:00
Austin Clements
ec7ed30e65 Add check for semantic tokens client capability 2021-03-29 19:04:55 -05:00
Jonathan Hähne
9a2695ecdb Improve refreshDocument algorithm
Do not use an arena, orderedRemove or bool array.

Also, rudimentary tests suggest the config parser does not account for
a substantial amount of the compile time.
2021-03-29 14:08:37 +02:00
Alexandros Naskos
48b5ca5385
Always send an insertText field in completion items 2021-03-28 17:02:48 +03:00
Jonathan Hähne
b33e26612a Add option to truncate long completions
The detail entries for big structs such as std.zig.CrossTarget were
bricking the preview window in Sublime Text.
2021-03-27 20:37:51 +01:00
Alexandros Naskos
06518778c1
Removed comment preprocessing code from the semantic tokens gap highlighter,
Fixed various comment semantic highlighting issues.
Refactored some minor parts of the analysis code.
2021-03-26 21:04:51 +02:00
Jonathan Hähne
a2620d7f69 Add option for builtin completion insert text 2021-03-26 10:20:20 +01:00
Alexandros Naskos
eb0a31d282
Reversed builtin completion insert text 2021-03-26 09:23:40 +02:00
Jonathan Hähne
8d34232c7a Fix completion of builtins and a piece of slightly overcomplicated logic 2021-03-24 22:40:15 +01:00
rhysd
6057d290b4 Fix falsy value for filterText and insertText
'filterText' and 'insertText' fields of 'CompletionItem' can only have
"" or undefined as falsy value.

https://github.com/microsoft/language-server-protocol/issues/1222
2021-03-15 20:20:38 +09:00
Auguste Rame
d5c46aef26
Merge pull request #245 from rhysd/error-msg-newlines
Add missing \n in error message output to stderr
2021-03-12 14:21:25 -05:00
Luuk de Gram
ef1b3c95f1
Completion fixes:
- Fixes namespace completions. Uses pointers instead of indices to ensure they are unique
- Adds .ptr completion to slices and `*` to many pointer
2021-03-11 13:59:09 +01:00
rhysd
addecb3a37 Add missing \n in error message output to stderr 2021-03-10 20:24:43 +09:00
Luuk de Gram
3ac6c82b9a
Completion for index label in for loops and fix for function snippets 2021-03-09 19:53:59 +01:00
Luuk de Gram
858f3cb282
Completion of unions in switches and its tags 2021-03-09 12:35:56 +01:00
Luuk de Gram
43ebfc7300
Work on completion for unwrapped slices/optionals in loops/ifs 2021-03-08 19:46:23 +01:00
Luuk de Gram
fd6b94bcc9
Fixes multiple small bugs:
- Correct completion based on scope
 - Semantic tokens for while/if/else/for keywords
 - Fix crash on import path
2021-03-07 21:54:54 +01:00
Luuk de Gram
53c37765c0
Fix inferred error set return types 2021-03-07 18:45:37 +01:00
Luuk de Gram
e2f4bbf2f3
Implement semantic tokens for regular comments 2021-03-07 14:51:47 +01:00
Luuk de Gram
ac8a00342e
All functionalities implemented. Also implemented ability to skip searching for references through std 2021-03-06 20:55:59 +01:00
Luuk de Gram
3d8a9732fc
Calculate correct token locations and ensure all semantic highlighting matches 2021-03-05 22:38:42 +01:00
Luuk de Gram
a699dab2f7
Referencing fixes and more 2021-03-03 16:34:24 +01:00
Luuk de Gram
92adeb8826
Completion fixes 2021-03-02 22:01:13 +01:00
Luuk de Gram
1dd39914ec
Hovering fixes 2021-03-02 15:32:38 +01:00
Luuk de Gram
c8a2467fac
Compiles without errors. Still needs improvement 2021-03-01 22:18:38 +01:00
Luuk de Gram
e82ea30e6f
Last fixes in src/analysis.zig 2021-03-01 16:30:43 +01:00
Luuk de Gram
4645638434
Fixes and completions 2021-03-01 16:02:24 +01:00
Luuk de Gram
1c9da7053c
More type resolving 2021-03-01 14:32:19 +01:00
Luuk de Gram
0133f0d863
First set of changes to work with new std's ast 2021-02-26 21:26:52 +01:00
Alexandros Naskos
e7f8a8dcd9
zls will now run the package extraction build runner without copying it
in the destination folder. Instead, it will use a specific cache folder
  and run from the default cwd it was run from.
Added build_runner_cache_path to the configuration file.
2021-01-12 13:10:51 +02:00
Vesim
b2e456404c fix inStream/outStream removal 2021-01-10 08:12:11 +01:00
Alexandros Naskos
eefee4759c
Fixed compilation for latest zig master 2021-01-07 10:35:36 +02:00
Lee Cannon
2a9edf243d Fixed string printing with {s} format specifier 2021-01-04 17:51:26 +00:00
g-w1
5b50d98353 make sure exe exists 2020-12-19 21:01:16 -05:00
Alexandros Naskos
78e74743e1
Use zig env to find zig lib path instead of assuming the executable comes from a distribution tarball 2020-11-15 21:32:27 +02:00
Alexandros Naskos
892847d939
Removed workspace specific zls.json support 2020-11-15 20:51:56 +02:00
Alexandros Naskos
0d15ea754e
Added --debug-log flag for release mode binaries 2020-11-08 13:40:16 +02:00
Alexandros Naskos
bf7f6cd5e9
Corrected semantic token server provider struct 2020-11-06 15:55:00 +02:00
Alexandros Naskos
8e0dc3da19
Fixed incremental document updates 2020-11-06 12:32:21 +02:00
Alexandros Naskos
f7eff6632e
Cleaned up LSP types, add InitializeResult, no longer use a hardcoded string 2020-11-06 10:08:20 +02:00
Alexandros Naskos
996deb45fe
Added builtin hover handler 2020-11-05 00:54:47 +02:00
Alexandros Naskos
560b39d359
Better builtin data format and script 2020-11-05 00:39:24 +02:00
data-man
fdcb7c264f Increase eval branch quota 2020-10-18 14:18:11 +05:00
Alexandros Naskos
27f9f14ab3 Removed DebugAllocator, use std.heap.GeneralPurposeAllocator 2020-10-10 12:44:37 +03:00
Alexandros Naskos
162f1b2fbe Opaque type support 2020-10-10 12:25:50 +03:00
Alexandros Naskos
a2265afce0 Added keywordLiteral token type for null, true, false, undefined, unreachable, fixed all pointer type semantic token generation 2020-10-04 13:10:48 +03:00
Tadeo Kondrak
b52817cd8f
Update to LSP version 3.16 semantic tokens protocol 2020-09-25 15:31:54 -06:00