Commit Graph
369 Commits
Author SHA1 Message Date
Max Brunsfeld d9de9f4afa In most languages, use prev non-empty line as basis for preserving indent 2022-06-28 12:21:54 -07:00
Max Brunsfeld 7610a6a72d Add new indentation features to support Python 2022-06-27 22:34:14 -07:00
Max Brunsfeld 3527013928 Add python outline and bracket queries 2022-06-22 16:28:09 -07:00
Max BrunsfeldandAntonio Scandurra c47abf1d47 Add failing test for replication of lsp statuses
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-21 11:27:08 -07:00
Antonio Scandurra 18631fd3d0 Merge pull request #1204 from zed-industries/accurate-is-dirty
Determine `Buffer::is_dirty` based on the rope's fingerprint
2022-06-17 16:08:07 +02:00
Antonio Scandurra 42064f76b0 Don't compute fingerprint for every text summary 2022-06-17 15:15:27 +02:00
Antonio Scandurra 5ad9e9e6c8 Determine Buffer::is_dirty based on the rope's fingerprint 2022-06-17 12:38:25 +02:00
Max Brunsfeld 54abc9864a Disable auto-indent entirely for markdown 2022-06-16 14:20:09 -07:00
Antonio Scandurra 306b76e782 Use word boundaries instead of syntax to infer completion edit ranges 2022-06-16 11:27:22 +02:00
Antonio Scandurra 7fbfa16b68 Open a buffer for every language server error when clicking on status 2022-06-16 10:00:29 +02:00
Keith Simmons 2232ebf584 Add hover test and tweak dismiss logic 2022-06-09 17:03:45 -07:00
Max Brunsfeld 2e11995a75 Merge pull request #1155 from zed-industries/golang
Add Go support
2022-06-09 14:18:37 -07:00
Max Brunsfeld 01aca3b128 Add tests and fix bugs for editor indent/outdent commands w/ hard tabs 2022-06-09 10:26:09 -07:00
Max Brunsfeld 1c9d3d551d Add buffer test for autoindent with hard tabs 2022-06-09 09:05:07 -07:00
Antonio Scandurra be274c940e Start/stop language servers when enable_language_server changes 2022-06-09 10:08:11 +02:00
Max Brunsfeld 60335c5d1c Add support for hard tabs
* Add a `hard_tabs` setting that causes indentation to be performed
  using a tab instead of multiple spaces.
* Change Buffer's indentation-related APIs to return an `IndentSize`
  struct with a length and a kind, instead of just a single u32.
* Use hard tabs by default in Go.
2022-06-08 18:30:10 -07:00
Antonio Scandurra 96602c79bc Render a "Jump to Buffer" icon on all excerpt headers 2022-06-08 15:31:29 +02:00
Antonio Scandurra 19047bd204 Snapshot file instead of path when creating a buffer snapshot 2022-06-08 14:29:14 +02:00
Max Brunsfeld 13f3799374 Start work on installing gopls 2022-06-07 18:38:37 -07:00
Keith Simmons 2a50811651 Syntax highlighting working. Getting started on markdown support 2022-06-07 11:54:33 -07:00
Antonio Scandurra bb4609d280 Handle out-of-order edits coming from LSP 2022-06-06 16:15:11 +02:00
Antonio Scandurra dc056176f2 Make Buffer::edit and MultiBuffer::edit resilient to inverted ranges
Previously, we would accept edits containing out-of-order ranges. When
generating such ranges in our randomized tests, many invariants started
breaking causing e.g. undo/redo to misbehave and operation application
to panic.

In theory, we should never pass inverted ranges, but this commit changes
the above functions to swap the start and the end when that occurs to avoid
breaking the entire system and panicking.
2022-06-06 15:22:36 +02:00
Antonio Scandurra e94678ce2e Make LspAdapter::process_diagnostics optional 2022-06-03 10:56:26 +02:00
Keith Simmons be8bfa9592 WIP line mode operations 2022-05-26 17:02:05 -07:00
Antonio Scandurra b58d493319 Upgrade tree-sitter to v0.20.6
This commit also adds a regression test to verify that with this new
version we don't mistakenly compute a different suggestion on Rust
buffer where the only change is leading whitespace.
2022-05-24 14:13:11 +02:00
Max BrunsfeldandNathan Sobo c9d9e90b95 Avoid panic when language server is dropped before being initialized in tests
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-09 18:05:10 -07:00
Keith Simmons 94b6f4beb5 Merge pull request #929 from zed-industries/non-uniform-batched-edits
Allow batched edits where each range is associated with different insertion text
2022-04-29 16:14:38 -07:00
Keith Simmons 47d4f42467 Consolidate edit and edit_batched functions 2022-04-28 16:52:04 -07:00
Keith Simmons 5f9259719d Removed unnecessary debug statements 2022-04-28 09:20:56 -07:00
Antonio Scandurra fa7796a9e8 Fix randomized collaboration tests in language 2022-04-28 10:12:10 +02:00
Max BrunsfeldandKeith Simmons 76e4c4d0f1 Remove Option from Buffer edit APIs
Previously, buffer edits represented empty strings as None
variants of an Option. Now, the edit logic just explicitly
checks for empty strings.

Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-27 18:00:13 -07:00
Keith Simmons 5051769dd3 Building, but failing test WIP 2022-04-27 17:25:38 -07:00
Antonio ScandurraandNathan Sobo e22b136a50 Clip scroll_top_row before navigating back to it
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-27 16:25:26 +02:00
Max Brunsfeld a43d10518d Infer completions old ranges based on the syntax tree 2022-04-25 13:14:05 -07:00
Max Brunsfeld ff91709997 Merge pull request #894 from zed-industries/typescript-outline-fixes
Fix missing TypeScript outline entries and breadcrumbs
2022-04-22 14:21:46 -07:00
Max Brunsfeld 6b73d44d65 Fix missing TypeScript outline entries and breadcrumbs 2022-04-22 13:49:03 -07:00
Max Brunsfeld 7c3fe041d8 Avoid spurious highlight runs in Language::highlight_text 2022-04-22 13:13:54 -07:00
Max Brunsfeld fee4a096ff Use the 'jsonc' language id for all JSON files
This way, comments are allowed by the language server.
2022-04-21 12:08:16 -07:00
Antonio Scandurra a51b05d3ff Fix divergence bug when peer reconnects reusing a prior replica id
We forgot to observe the footprint of the reconnecting replica's prior
undos into the local clock. This could cause the replica to generate
edits with a version strictly smaller than what other peers may have
observed. As such, those peers would think they had already seen those
edits and skip them.
2022-04-11 13:17:47 +02:00
Keith Simmons 55f328e6a8 dynamically inject theme names and language properties into schema 2022-04-07 18:15:02 -07:00
Max BrunsfeldandKeith Simmons e7039c123d 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 ScandurraandNathan Sobo 948542005f 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 91a2fe2d5e 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 a8a42e4b1f Merge branch 'main' into prompt-on-close 2022-04-01 15:29:23 -07:00
Max Brunsfeld c190735d28 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 340874ce76 Allow explicit reload of buffers via Project::reload_buffers 2022-04-01 14:01:56 +02:00
Antonio Scandurra 91c003ee59 Merge pull request #705 from zed-industries/breadcrumbs
Introduce breadcrumbs
2022-04-01 11:02:54 +02:00
Max Brunsfeld df45c44872 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 SimmonsandMax Brunsfeld 0468cc5952 Provide diagnostic context to codeAction
Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-03-31 15:39:52 -07:00
Max BrunsfeldandKeith Simmons e5bb803ebb 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