Commit Graph

1136 Commits

Author SHA1 Message Date
SuperAuguste
73c3e87a37 fix errors 2020-05-14 15:57:31 -04:00
Auguste Rame
8468207da3
Merge pull request #23 from Vexu/err
Implement completion for error sets
2020-05-14 13:46:15 -04:00
Vexu
a739bf6499
implement completion for error sets 2020-05-14 20:45:26 +03:00
SuperAuguste
86a1edf9c7 Remove more redundant code, rename function 2020-05-14 12:23:26 -04:00
SuperAuguste
58015dcd64 Remove dead code 2020-05-14 12:16:06 -04:00
SuperAuguste
40235cbdbb fix field access type 2020-05-14 12:14:35 -04:00
Vexu
db6407ea3b
implement getDocComments for rest of named nodes with docs 2020-05-14 19:08:00 +03:00
SuperAuguste
353c9b3261 undo 2020-05-14 10:11:59 -04:00
SuperAuguste
9609aee6a9 test ci 2020-05-14 10:11:32 -04:00
Auguste Rame
bdf7bad51d
Merge pull request #19 from alexnask/imports
Basic import support
2020-05-14 08:53:52 -04:00
Alexandros Naskos
197ba84a82 Finished DocumentStore.deinit() 2020-05-14 15:26:10 +03:00
Alexandros Naskos
ca0bc205e4 Fixed crash with enum fields 2020-05-14 15:15:27 +03:00
Alexandros Naskos
942b617865 Updated README, config.zig doc comment 2020-05-14 15:09:27 +03:00
Alexandros Naskos
f5e4586c76 Detect import removal and decrement document referece count 2020-05-14 14:51:07 +03:00
Alexandros Naskos
112d38e7fa Fixed crash in snippet generation of varargs functions 2020-05-14 13:57:55 +03:00
Alexandros Naskos
6db3c74550 Renamed import context to analysis context, added arena for temporary allocations while analyzing 2020-05-14 12:23:20 +03:00
Alexandros Naskos
7a8a4e1ec5 Fixed crash when completing import with dot access 2020-05-14 12:12:04 +03:00
Alexandros Naskos
76e9a079a3 Avoid unnecessary copy of document text when opening new imports 2020-05-14 11:51:49 +03:00
Alexandros Naskos
60ffc5f551 Fixed crash while closing document (uri double free) 2020-05-14 11:40:17 +03:00
Alexandros Naskos
95b6e6cd6a Fixed relative URI code, get latest tree in analysis 2020-05-14 05:14:37 +03:00
Alexandros Naskos
86d264f488 1 level deep imports now work but we crash when adding levels 2020-05-14 05:00:00 +03:00
Alexandros Naskos
31f1d2fa3e First draft of imports 2020-05-14 04:54:05 +03:00
SuperAuguste
18c026372b fix empty comments 2020-05-13 19:43:09 -04:00
SuperAuguste
bc597025e7 revert fix 2020-05-13 19:41:08 -04:00
SuperAuguste
1a2f83d84b Fix empty comments 2020-05-13 19:40:34 -04:00
SuperAuguste
b182eec37f quick removal of debug 2020-05-13 19:36:51 -04:00
Alexandros Naskos
307dceb703 Preparation for imports, abstracted document hashmap into a document storage type 2020-05-14 02:10:41 +03:00
Alexandros Naskos
be95849a15 Added pointer type resolution 2020-05-13 22:35:14 +03:00
Alexandros Naskos
0e0789b2d5 Unified completions into a function, small snippet improvement 2020-05-13 20:30:57 +03:00
SuperAuguste
20afe9ef3c Doc comments, function completion in structs 2020-05-13 12:19:10 -04:00
SuperAuguste
e9b5bf433e Add function completion, fix function snippet generation 2020-05-13 11:59:44 -04:00
SuperAuguste
7c388812c7 remove debug 2020-05-13 11:45:32 -04:00
Auguste Rame
adbcaefe26
Merge pull request #14 from SuperAuguste/completion
Start implementing completion
2020-05-13 11:44:07 -04:00
SuperAuguste
dc292e74ee null bug fixes 2020-05-13 11:43:28 -04:00
SuperAuguste
9ae912efdd super basic completion, tons of things to iron out 2020-05-13 10:10:20 -04:00
SuperAuguste
a3067f88b1 Add new analysis engine 2020-05-13 09:03:33 -04:00
Alexandros Naskos
4f2828f9cb Removed debug log 2020-05-12 20:02:22 +03:00
Alexandros Naskos
aacad999c4 Made function snippet generation better. 2020-05-12 19:59:16 +03:00
SuperAuguste
d0837ffc51 Start implementing completion 2020-05-11 08:28:08 -04:00
SuperAuguste
a2f314301c quick fix of asset 2020-05-09 15:42:35 -04:00
Alexandros Naskos
86fbf5fe7e Global completions now check config for snippet support, modified readme to reflect changes. 2020-05-09 21:45:13 +03:00
Alexandros Naskos
25cc662bcc Merge branch 'master' of https://github.com/SuperAuguste/zls into read_config 2020-05-09 21:38:20 +03:00
Alexandros Naskos
35b4913b3e Removed no_snippets build option.
Instead, we now read a configuration file, zls.json in the same folder as the executable.
Options are defined in the struct config.zig and must have default values.
The only option right now is enable_snippets and it defaults to true.
2020-05-09 16:43:51 +03:00
Alexandros Naskos
f25dade27d Removed comments 2020-05-09 05:43:17 +03:00
Alexandros Naskos
e46135cb68 Added snippet completion for global functions, fixed no snipper completion. 2020-05-09 05:38:08 +03:00
Alexandros Naskos
922559c83a Use error iterator instead of manual looping in diagnostic generation 2020-05-09 04:02:29 +03:00
SuperAuguste
01b2c2e328 fix bug with latest pr 2020-05-08 13:02:46 -04:00
Auguste Rame
b939b9cefa
Merge pull request #11 from alexnask/PascalCase
Detect type functions and require PascalCase, require camelCase for the rest
2020-05-08 12:20:34 -04:00
Alexandros Naskos
d8457c96a1 is_type_function is const 2020-05-08 18:07:14 +03:00
Alexandros Naskos
29b0045bc7 Detect type functions and require PascalCase, require camelCase for the rest 2020-05-08 18:01:34 +03:00
Alexandros Naskos
bd7675e5b7 Fixed typo 2020-05-08 17:25:22 +03:00
Alexandros Naskos
09cd91690c Renamed documentContext to documentPositionContext and added multiline string literal to it. 2020-05-08 17:24:29 +03:00
SuperAuguste
ffcdb886d9 fix crash with documentContext 2020-05-08 09:17:32 -04:00
Alexandros Naskos
aca7db3e88 Reset context to other when trying to find field/var access and don't get alphanumerical or @"..." 2020-05-08 15:09:31 +03:00
Alexandros Naskos
0b5eb4b9d2 Fixed field_access check 2020-05-08 15:07:14 +03:00
Alexandros Naskos
0149f11c7c Switched Context to PositionContext 2020-05-08 14:36:54 +03:00
Alexandros Naskos
982a39f868 Added context detection from document and position for builtins, variable accesses, field accesses, string literals and comments. 2020-05-08 13:50:21 +03:00
SuperAuguste
fb9f50d606 fix builtin completion 2020-05-07 23:05:17 -04:00
SuperAuguste
84837dfe58 fix pub functions 2020-05-07 22:27:42 -04:00
Alexandros Naskos
02e57f5d59 Renamed leak_alloction build option to allocation_info
Switched to readAll and writeAll stream functions
Disabled logs on non-debug builds
Created freeDocument(doc), closeDocument(uri), called at appropriate sites
Removed _ = expr; for void values
Added and clarified some logging messages
Simplified builtin_completion generation
The JSON parser is now reused but reset after parsing a RPC
Fix memory leak when closing a document (last mem. leak)
Renamed leak_alloc to debug_alloc
Removed catch return statements from main(), rely on try to also get stacktraces instead
2020-05-08 02:53:00 +03:00
SuperAuguste
01ff89eea3 Add no_snippets 2020-05-07 13:16:04 -04:00
Alexandros Naskos
6ed45a1f23 Also free the sane text when releasing a document 2020-05-07 20:02:54 +03:00
Alexandros Naskos
6ac068a3c5 Merge branch 'master' of https://github.com/SuperAuguste/zls into separate_text_mem 2020-05-07 19:54:11 +03:00
SuperAuguste
447d52dd1c fix init error 2020-05-07 12:47:39 -04:00
SuperAuguste
6b099f8c6d fix 2020-05-07 12:25:37 -04:00
Alexandros Naskos
4d5f833226 Merge branch 'master' of https://github.com/SuperAuguste/zls into separate_text_mem 2020-05-07 18:43:56 +03:00
SuperAuguste
1725278be1 add master data, add data selection 2020-05-07 11:29:40 -04:00
Alexandros Naskos
ee594a1b2f Separate document text and memory.
Text is now a substring of memory, starting at index 0.
We now realloc memory when needed and only copy the existing data around
    instead of allocating a new string, copying all the data and freeing
    the old string.
This leads to possibly less allocation calls, depending on the allocator
    and less copying necesssary.
2020-05-07 17:58:31 +03:00
Alexandros Naskos
04abb3a5ff Fix merge conflicts 2020-05-07 16:23:13 +03:00
Alexandros Naskos
5c602745fd Use the page allocator as our base allocator for now. 2020-05-07 16:20:45 +03:00
Alexandros Naskos
cea1222b79 Free the old document text after rebuilding the new one, this was a use after free since before, after point into the old memory 2020-05-07 16:04:57 +03:00
Alexandros Naskos
eaf0c1f3e5 Switched struct and enum literals to use the anonymous form where possible.
Added trailing commas to fields of struct literals that are followed by newline.
2020-05-07 15:29:53 +03:00
Alexandros Naskos
a0addc040d Fixed a bug in publishDiagnostics where message data on the stack could be corrupted before being sent 2020-05-07 15:01:16 +03:00
Alexandros Naskos
c5d3d7902e Free json parser state, compute builtin completions at comptime 2020-05-07 14:36:40 +03:00
Alexandros Naskos
a7e4d0b5e3 Use a local arena to free all memory with one call. 2020-05-07 14:10:58 +03:00
Alexandros Naskos
e9d9c57ff4 Fixed some additional memory leaks. 2020-05-07 13:56:08 +03:00
Alexandros Naskos
3fa5ef4b96 Fixed a couple of typos 2020-05-07 12:58:35 +03:00
Alexandros Naskos
0283222e3a Added build option to enable the leak counting allocator.
Log the allocation count to the client at the end of the main loop.
Fixed two memory leaks in analysis.zig
2020-05-07 12:50:25 +03:00
SuperAuguste
5bd790f416 basic stylistic linter 2020-05-03 22:17:19 -04:00
SuperAuguste
b0e21bf82c hotfix 2020-05-03 17:27:37 -04:00
SuperAuguste
738a9be0cc added function comments and signature 2020-05-03 17:27:08 -04:00
SuperAuguste
88814b9589 better builtin completion, versioning 2020-05-02 12:43:26 -04:00
SuperAuguste
999a365f3c fixes 2020-04-28 09:31:41 -04:00
SuperAuguste
def89a90f5 Better builtin completion 2020-04-27 22:59:28 -04:00
SuperAuguste
ce443ba1dd Completion of global values, and some reformatting 2020-04-27 16:38:35 -04:00
SuperAuguste
a0ff26cc8f init 2020-04-24 18:19:03 -04:00