Commit Graph

334 Commits

Author SHA1 Message Date
Nathan Sobo
7e5a3f9f6b Introduce structured logging
We're enabling the log crate feature everywhere, but only using it on the server for now.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-08 10:06:51 -06:00
Max Brunsfeld
664f17f92b Avoid maintaining indent size as state on buffers
Indent size is still hard-coded, but it's now controlled by the
editor and not the buffer.

Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-06 10:22:29 -07:00
Antonio Scandurra
7e3cc67e0a Don't reuse old syntax tree when resetting a buffer's language
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-05 16:01:05 +02:00
Antonio Scandurra
c62a3ea672
Merge pull request #687 from zed-industries/vim-word-and-line-movement
Add word and line movement in vim normal mode
2022-04-04 14:42:27 +02:00
Max Brunsfeld
fe27a27cb6 Merge branch 'main' into prompt-on-close 2022-04-01 15:29:23 -07:00
Max Brunsfeld
79bd8642e6
Merge pull request #702 from zed-industries/typescript
Add support for JS/Typescript/TSX, allow language servers to support multiple languages
2022-04-01 15:24:58 -07:00
Antonio Scandurra
65048760b2 Allow explicit reload of buffers via Project::reload_buffers 2022-04-01 14:01:56 +02:00
Antonio Scandurra
bdd95a82d7
Merge pull request #705 from zed-industries/breadcrumbs
Introduce breadcrumbs
2022-04-01 11:02:54 +02:00
Max Brunsfeld
e987a8ba63 Let fake and real LanguageServer access AsyncAppContext in handler callbacks
Also, reimplement FakeLanguageServer by wrapping LanguageServer, instead of
duplicating its functionality differently.
2022-03-31 21:57:00 -07:00
Keith Simmons
564225c401 Provide diagnostic context to codeAction
Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-03-31 15:39:52 -07:00
Max Brunsfeld
cf9efd7005 Improve installation of npm-based language servers
* Use --prefix flag to guarantee that they are installed in .zed
* Use the @latest tag when available
* Extract helper functions

Co-authored-by: Keith Simmons <keith@zed.dev>
2022-03-30 16:48:59 -07:00
Max Brunsfeld
4805cfe48c Merge branch 'main' into typescript 2022-03-30 14:44:07 -07:00
Max Brunsfeld
3b4cab9094 Move all configuration of individual LSP servers to LspAdapter 2022-03-29 18:14:30 -07:00
Max Brunsfeld
ebc711f9f5 Restructure fake language server setup
Replace FakeLanguageServerConfig with FakeLanguageServerAdapter
2022-03-29 17:55:57 -07:00
Keith Simmons
6d91fd078c Add restart-lsp keybinding 2022-03-29 17:24:23 -07:00
Max Brunsfeld
158d987965 Start work on allowing language servers to support multiple languages 2022-03-29 16:57:18 -07:00
Keith Simmons
0e1d371a67 Add typescript language server
Currently not tested for tsx files

Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-03-29 13:42:21 -07:00
Antonio Scandurra
bfa5dd52dd Don't underflow when calling symbols_containing_offset(0) 2022-03-29 15:08:37 +02:00
Antonio Scandurra
a86118cfe2 Avoid matching duplicate impl outline items in tests 2022-03-29 11:59:52 +02:00
Antonio Scandurra
d7026c2228 Merge branch 'main' into breadcrumbs 2022-03-29 10:05:05 +02:00
Max Brunsfeld
a8600e76a3 Make language's language server config non-optional 2022-03-28 18:14:49 -07:00
Max Brunsfeld
4d456d3847 Remove duplication in build_language_registry 2022-03-28 18:01:29 -07:00
Keith Simmons
a7a52ef3f7 Add word and line movement in vim normal mode
Add jump to start and end of the document
Move vim tests to relevant vim files
Rename VimTestAppContext to VimTestContext for brevity
Improve VimTestContext assertions to pretty print locations when selection position assertion panics
2022-03-27 17:58:28 -07:00
Nathan Sobo
ccc276da7a
Merge pull request #672 from zed-industries/fix-unfollowing-on-edit
Automatically unfollow leader only for edits that originate from the follower editor
2022-03-24 13:26:28 -06:00
Keith Simmons
8f75520ade
Merge pull request #676 from zed-industries/highlighted-text-fix
Highlighted text fix
2022-03-24 11:52:06 -07:00
Keith Simmons
92c7b5d6ef Remove result from anchor cmp functions
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-24 11:48:31 -07:00
Keith Simmons
ab631cf6c3 Change language::min() to a constant
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-24 10:41:33 -07:00
Keith Simmons
f6805eb802 Make rename highlights work across multibuffer excerpts
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-24 10:22:47 -07:00
Antonio Scandurra
a739c362d9 Rename editor::Event::Edited to editor::Event::BufferEdited
This is to distinguish it from a new event we're about to add which
represent edits originating from that specific editor.
2022-03-24 08:55:46 +01:00
Max Brunsfeld
22148a3639 Fix extending selections starting at ends of other nodes
Fixes #478
2022-03-23 15:38:23 -07:00
Antonio Scandurra
004f98cc6d
Merge pull request #661 from zed-industries/follow
Introduce basic following experience
2022-03-23 15:17:44 +01:00
Antonio Scandurra
3117554568 Automatically unfollow when editing, scrolling or changing selections 2022-03-22 09:17:01 +01:00
Nathan Sobo
210fa4c443 Remove CharKind::Newline
This is just a character, and so it seems clearer to refer to it specifically when we want to know if a character is a newline. There was only one case where we relied on Newline being different from Whitespace, and we special-cased that instance. Changing this actually makes us match the behavior of VS Code when double-clicking runs of multiple newlines.

/cc @as-cii

Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-21 15:17:32 -06:00
Max Brunsfeld
06cd9ac664 Match the leader's last selection when unfollowing
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-21 14:04:55 -07:00
Max Brunsfeld
d02ab9bd06 Start work on updating editors's scroll positions when following
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-18 12:56:20 -07:00
Antonio Scandurra
f0b7bd6e17 Serialize initial follow state in leader and reflect it in follower 2022-03-18 10:22:13 +01:00
Max Brunsfeld
257601b3c1 Add buffer method for getting the symbols containing a position 2022-03-15 14:04:58 -07:00
Antonio Scandurra
7155dabf5b Fade out unnecessary code
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:51:59 +01:00
Antonio Scandurra
021699e51c Implement shift-f8 to go to previous diagnostic
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:13:23 +01:00
Antonio Scandurra
a6d0caf557 Don't seek FilterCursor upon creation
This lets us use `next` or `prev` to decide whether to park the cursor
at the first or last filtered item.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:13:23 +01:00
Max Brunsfeld
325e6c31ae Autoclose brackets before a language-specific set of characters
Fixes #588
2022-03-14 15:17:40 -07:00
Max Brunsfeld
b33a049958 Merge branch 'main' into settings-file 2022-03-13 10:43:23 -07:00
Nathan Sobo
33bcd6d904 Merge remote-tracking branch 'origin/main' into select-on-rename 2022-03-12 10:10:23 -07:00
Max Brunsfeld
20fed599b2 Start work on relaying settings to language servers 2022-03-11 17:36:27 -08:00
Nathan Sobo
951fd1ab36 Merge branch 'main' into select-on-rename 2022-03-11 15:30:07 -07:00
Max Brunsfeld
7a68b2d371 Provide JSON language server with settings schema 2022-03-11 11:46:22 -08:00
Nathan Sobo
134496ce8f Remove dead code
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-11 08:24:42 -07:00
Antonio Scandurra
ee6d7fc6d5 Delete till previous tabstop when backspacing within indent column 2022-03-10 10:28:24 +01:00
Nathan Sobo
ac1eb19f83 Start on text highlight support 2022-03-09 20:51:35 -07:00
Antonio Scandurra
7546ede288 Split language server initialization from construction
This gives clients a chance to register to notifications.
2022-03-09 12:31:21 +01:00