Commit graph

409 commits

Author SHA1 Message Date
Tad Hardesty
64e7ffd995 Include commits since tag in langserver version number 2021-05-22 16:40:32 -07:00
Tad Hardesty
3d30bb6f81 Update copyright years to 2021 2021-05-22 16:07:10 -07:00
Tad Hardesty
4149da7c13 Bump versions for suite 1.7 2021-05-18 19:27:39 -07:00
Tad Hardesty
a47a7d2b02 Add debug-only VSC setting to use a different debug_server.dll 2021-05-17 23:21:43 -07:00
William Wallace
ced2a7f084
auxtools debug server: expression evaluation (#263)
The changes for the language server are minimal. This will require 
shipping version 2.0.0 of the debug server: use 
https://github.com/willox/auxtools/releases/tag/v2.2.0

There are plenty of compiler features missing on the debug server's 
end, but it is definitely more than usable so I want to get it 
published. I plan on going a lot further this all of this, maybe we'll 
even have hot loading one day.

Noticeable differences from actual BYOND are:
1. It only compiles expressions! This means no for loops, no if 
   statements, etc.
2. It lacks all static typing - the compiler has no access to type 
   definitions and will treat all `.` accesses as `:` accesses and 
   ignore the rules of const.
3. There are no implicit uses of `src`. This comes from the fact that 
   there is no static typing, so to access a field on `src` you have to 
   explicitly use `src.xyz` syntax.
4. Strings are lame. There is no interpolation support and the escape 
   sequences are super limited too.
5. Some built-in procs aren't supported, but most are. They'll 
   gracefully error if you try to use them.
6. No pre-processor.

For other limitations, just view the error list: 
9ba328ef8c/src/compiler.rs (L45-L76)

tl;dr: relatively well-working debug console eval, watch eval, and 
conditional breakpoints
2021-05-17 23:14:34 -07:00
William Wallace
9c756347de
Add support for L?[x] list access syntax (#262)
I renamed the current `IndexKind` enum to `PropertyAccessKind` purely 
based off of the fact that somewhere in the byond ref both procs and 
vars are referred to as a datum's "properties" and I had no better name 
ideas.

The checker treats conditional list accesses exactly the same as normal 
ones. I was going to add some linting stuff for them but their expected 
behaviour is completely up in the air at the moment.
2021-04-21 18:43:47 -07:00
William Wallace
ba09a43447
Add support for infinite for() loops (#259) 2021-04-21 17:59:41 -07:00
William Wallace
7c2b92189c
pipe_output no longer stops piping after encountering invalid utf-8 (#256)
This only becomes a problem when stuff we haven't got control over 
decides to output to stdin or stderr.

vgstation-coders/vgstation13#28789 shows (in the most recent responses) 
that they're using an internet explorer plugin which outputs some debug 
info to stderr and terminates it with some invalid utf-8 or something. 
I don't think the details on that side are too important, we just need 
to fix the next part: This makes the language server's pipe_output 
close the stream which then makes auxtools panic when it tries writing 
to said stream (because eprintln!() will panic in such a case.)

Auxtools could handle this better, but there's no reason for the 
debugger to just stop piping output because it sees some wacky bytes.
2021-03-19 17:14:53 -07:00
Tad Hardesty
d2b3f61032 Track disk I/O time separately from parse time 2021-03-11 19:24:14 -08:00
Tad Hardesty
591b404075 Show stdout/stderr of launched process in Debug Console 2021-01-21 20:42:36 -08:00
Tad Hardesty
8a07b193ae Set LD_LIBRARY_PATH in case of launching DreamDaemon 2021-01-21 20:09:22 -08:00
William Wallace
4ea806047c
Offload eval (disassemble/help commands) processing to auxtools (#238)
This requires an update to 
https://github.com/willox/auxtools/releases/tag/debug-v1.0.0. 

Basically, this'll let me add new debug console commands without having 
to touch SpacemanDMM. I'm gonna be adding some as I push my way through 
some DM bytecode related stuff so this'll save me a bunch of effort.

There's no new functionality here, it's still only `#help` and `#dis`.

The DLL is starting to get a bit big (it's still much smaller than a 
tiny example implementing maptick which for some reason comes out at 
2.5MB) so I'll try to get them smaller before making any new releases.
2021-01-21 20:09:15 -08:00
Tad Hardesty
23270e6aeb Use manually specified hash in langserver go-to-def 2020-12-13 16:24:18 -08:00
Tad Hardesty
9221beb291 Add missing #[allow(unused_mut)] 2020-12-12 21:11:49 -08:00
Tad Hardesty
bce6937a0d Fix warning when building in release mode 2020-12-10 20:19:02 -08:00
Tad Hardesty
395e1efe93 Fix auxtools bundle code 2020-12-10 20:18:52 -08:00
William Wallace
00edac18cb
Add #dis, wait-for-configure, other tweaks to Auxtools (#233)
This fulfils some auxtool debugger requests you had.

1) All connection modes except for `BACKGROUND` wait for the DAP client 
   to be configured before continuing.
2) stddef.dm contents are sent to the debug client
3) disassemble eval command works (with the added benefit of being able 
   to disassemble procs that aren't currently running)

The updated auxtools also does some other stuff you wanted:

1) src/usr moved to arguments
2) your PR https://github.com/willox/auxtools/pull/11
3) arguments with no formal parameter in a proc that is being debugged 
   should show up
2020-12-08 22:34:18 -08:00
Tad Hardesty
ba5dde55df Handle duplicate variable names (Auxtools) 2020-11-27 17:44:13 -08:00
Tad Hardesty
c93661f3d1 Move Locals before Arguments in the scopes list (Auxtools) 2020-11-27 17:44:05 -08:00
William Wallace
2737e5d352
Add Auxtools debugging support (#230)
This adds support for a debug server written in auxtools (currently 
located at https://github.com/willox/auxtools).

The dependency is similar to extools, where SpacemanDMM's 
`auxtools_types.rs` has to be up-to-date with the `server_types.rs` 
file located in whichever version of debug server is used. In the 
future this could change to be some shared dependency, or maybe the 
debug server could just be moved into SpacemanDMM.

There's a bunch of repeated code in `mod.rs` where there's match 
statements where one branch is for the extools client and one branch is 
for auxtools client. It's a bit iffy, but they all have minor 
differences and wouldn't be super easy to merge.

I accidentally ran a `cargo fmt` on the files I was working with at 
some point, so there's a few formatting changes about. I don't think 
it's too much to read over.

I haven't edited any documentation yet, so here's how it works:
In your DM project:
```dm
// Currently needed for auxtools' error reporting. TG code already has this defined.
/proc/stack_trace(msg)
	CRASH(msg)

/proc/enable_debugging(mode, port)
	CRASH("auxtools not loaded")

/world/New()
	var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
	if (debug_server)
		call(debug_server, "auxtools_init")()
		enable_debugging()
	. = ..()

/world/Del()
	var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
	if (debug_server)
		call(debug_server, "auxtools_shutdown")()
	. = ..()
```

In your project's SpacemanDMM.toml
```toml
[debugger]
engine = "auxtools"
```

The extension doesn't have a way to override the DLL being used (and I 
don't think it should), so if you're testing stuff I suggest you set 
the env vars to something like below and use the attach mode:
```
AUXTOOLS_DEBUG_DLL=path_to_your_build
AUXTOOLS_DEBUG_MODE=BLOCK
```
2020-11-27 17:34:52 -08:00
Tad Hardesty
f2dc9a4567 Bump versions for suite 1.6 2020-10-08 19:03:17 -07:00
Tad Hardesty
b9d8c0868b Add preserveFocusHint to thread StoppedEvents 2020-09-25 16:29:02 -07:00
Tad Hardesty
1fc5056b40 Show sleeping proc queue as threads in VSC 2020-09-24 19:39:13 -07:00
Tad Hardesty
1da4eb3246 Add scaffolding for multiple threads 2020-09-23 20:07:24 -07:00
Tad Hardesty
abd490789a Let extools handle line-stepping instead of looping w/ timeout 2020-09-22 20:36:12 -07:00
Tad Hardesty
b4594c2f4b Distinguish between Pause and Step Into 2020-09-22 19:59:45 -07:00
Tad Hardesty
cd9dccad8d Implement StepOut 2020-09-20 22:12:55 -07:00
Tad Hardesty
027089c130 Remove AST-walking local var name detection 2020-09-20 12:59:31 -07:00
Tad Hardesty
f91358cc64 Use extools-provided local and param names 2020-09-20 12:54:01 -07:00
Tad Hardesty
e064dff029 Include :1 column only on the top of the stack trace 2020-09-20 12:53:07 -07:00
Tad Hardesty
e4c0d84c6f Format proc offsets in disassembly as hex 2020-09-20 11:50:15 -07:00
Tad Hardesty
f1def794d0 Add document links for 'resource' expressions 2020-09-19 18:12:28 -07:00
Tad Hardesty
3a17944a66 Add document links for #include lines 2020-09-19 17:59:33 -07:00
Tad Hardesty
3930cfcffe Update lsp-types dependency to v0.80.0 2020-09-16 20:18:58 -07:00
Tad Hardesty
6a3c6860c7 Add debug disassembly output if a breakpoint fails to set 2020-09-16 20:02:13 -07:00
Tad Hardesty
7813cfac1e Exclude parent calls from references list 2020-09-07 10:57:01 -07:00
Tad Hardesty
cf3fac7ee0 Make type definitions count as an implementation rather than a reference 2020-09-07 10:56:26 -07:00
Bobbahbrown
985da485e2
Add documentation to hovers, add hovers for var uses and proc calls (#210)
- Added hover handling for ScopedVar, UnscopedVar, ScopedProc, 
  UnscopedProc
- Improved handling of existing hovers, adding dm lang blocks to the 
  hovers where appropriate
- Added documentation to all existing hovers when it is available
- Fixed bug with annotating Variables, which would lead to excessive 
  whitespace being consumed
2020-09-05 21:57:51 -07:00
Tad Hardesty
6bef4545f4 Compensate for VSC wanting unique variable names 2020-09-05 21:33:24 -07:00
Tad Hardesty
e809989d3d Rearrange variable sections so Locals is open by default instead of Globals 2020-09-05 21:13:07 -07:00
Tad Hardesty
ac037752c9 Bump versions for suite 1.5 2020-07-11 14:06:42 -07:00
Tad Hardesty
2ee51dc0c3 Upgrade to lsp-types v0.75.0 2020-07-11 13:01:03 -07:00
Tad Hardesty
00c82e6346 Add the word 'on' to var/proc completion details 2020-07-03 17:38:09 -07:00
Tad Hardesty
b3f77df6f6 Show full #define body in completion details 2020-07-03 17:24:54 -07:00
Tad Hardesty
ea6966018e Add expression and statement keywords to completion list
Fixes #76.
2020-07-03 17:03:47 -07:00
Tad Hardesty
ee73b109f3 Make some functions in completion module private 2020-07-03 16:49:48 -07:00
Tad Hardesty
6666f117ff Skip dreamchecker lints if parser fatal errored 2020-06-07 11:20:55 -07:00
Tad Hardesty
4c8171acec Avoid spamming errors on files outside workspace 2020-05-23 15:22:32 -07:00
Tad Hardesty
78175f891f Add 'environment' configuration key for langserver to use 2020-05-15 12:46:47 -07:00
Tad Hardesty
8c6034f5fe Add more detail to langserver parse timings
Also tweak when/where other debug messages appear.
2020-05-10 12:50:12 -07:00