Commit Graph
1173 Commits
Author SHA1 Message Date
Kirill Bulatov f023ff308a Fix another place where Copilot may panic 2023-09-26 10:51:13 +03:00
Mikayla Maki 9c3518e8fc Add support for the experimental Next LS for Elixir (#3024)
This is a PR I built for a friend of a friend at StrangeLoop, who is
making a much better LSP for elixir that elixir folks want to experiment
with. This PR also improves the our debug log viewer to handle LSP
restarts.

TODO:
- [ ] Make sure NextLS binary loading works.

Release Notes:

- Added support for the experimental Next LS for Elxir, to enable it add
the following field to your settings to enable:

```json
"elixir": {
    "next": "on"
}
```
2023-09-25 12:52:56 -05:00
Mikayla 5ffeae5bdb Add local next LSP adapter 2023-09-21 18:09:02 -07:00
Piotr Osiewicz 1da3ed5c4c [WIP] Replace in project (#2984)
Targeting Preview of 09.27.
This is still pending several touchups/clearups:
- We should watch multibuffer for changes and rescan the excerpts. This
should also update match count.
- Closing editor while multibuffer with 100's of changed files is open
leads to us prompting for save once per each file in the multibuffer.
One could in theory save in multibuffer before closing it (thus avoiding
unnecessary prompts), but it'd be cool to be able to "Save all"/"Discard
All".

Release Notes:

- Added "Replace in project" functionality
2023-09-21 16:27:58 +02:00
Kirill Bulatov 70b0f10ef9 Properly re-add Copilot LSP server 2023-09-21 11:02:03 +03:00
Kirill Bulatov 4d2f4d0e1a Fix RPC logs not being displayed for supplementary servers 2023-09-21 11:00:05 +03:00
Conrad Irwin 66226ea84f vim fixes for find&replace (#2995)
* allow replacing with the empty string to delete
* fix <enter> for ReplaceNext (in vim mode)

Release Notes:

- allow replacement to be empty
2023-09-20 16:42:39 -06:00
Kirill Bulatov 96555828cb Show Copilot logs right after its LSP server start 2023-09-20 12:08:32 +03:00
Conrad Irwin 76bba1b8c1 vim fixes for find&replace
* allow replacing with the empty string to delete
* fix <enter> for ReplaceNext
2023-09-19 20:48:01 -06:00
Kirill Bulatov 975d1c8a3e Send copilot log messages into the log panel 2023-09-19 23:41:55 +03:00
Kirill Bulatov c976ae2fc5 Show supplementary language servers in the logs panel 2023-09-19 22:29:27 +03:00
Kirill Bulatov ad18a85e3e Send and receive Copilot events 2023-09-19 21:53:31 +03:00
Kirill Bulatov c9413551d0 Add Copilot server to LSP logs panel 2023-09-19 16:25:09 +03:00
Kirill Bulatov c28097b5af Automatically subscribe for lsp logs of every server added
Avoid re-adding the server on new logs events.
2023-09-19 11:52:21 +03:00
Piotr Osiewicz 5fe12ec616 chore: Use aho-corasick 1.1 in direct dependencies (#2983)
Nothing too fancy, we've depended indirectly on 1.0/1.1 already, so this
is essentially bookkeeping.

Release Notes:
- N/A
2023-09-18 17:01:08 +02:00
Antonio Scandurra 6aa128353c WIP 2023-09-14 17:42:30 +02:00
Piotr Osiewicz c4e0bcb99e Z 1200/replace in buffer (#2922)
This is still WIP, mostly pending styling. I added a pretty rudimentary
text field and no buttons whatsoever other than that. I am targeting a
Preview of 09.13, as I am gonna be on PTO for the next week.

I dislike the current implementation slightly because of `regex`'s crate
syntax and lack of support of backreferences. What strikes me as odd wrt
to syntax is that it will just replace a capture name with empty string
if that capture is missing from the regex. While this is perfectly fine
behaviour for conditionally-matched capture groups (e.g. `(foo)?`), I
think it should still error out if there's no group with a given name
(conditional or not).
Release Notes:

- Added "Replace" functionality to buffer search.
2023-09-12 18:46:54 +02:00
Max Brunsfeld 977b734848 Start work on rejoining channel buffers 2023-09-01 16:52:12 -07:00
Kirill Bulatov fa9a9b4955 Route completion requests through remote protocol, if needed 2023-08-31 15:22:13 +03:00
Kirill Bulatov 9993adc3bd Ensure all client LSP queries are forwarded via collab 2023-08-31 14:29:37 +03:00
Kirill Bulatov f5e0c28971 Fix project tests 2023-08-31 13:01:53 +03:00
Julia 3faabbe91a Merge branch 'main' into multi-server-completions-tailwind 2023-08-30 22:58:37 -04:00
JuliaandKirill Bulatov 6414d0eae1 Scope Tailwind in JS/TS to within string
In some situations outside JSX elements Tailwind will never
respond to a completion request, holding up the tsserver completions.

Only submit the request to Tailwind when we wouldn't get tsserver
completions anyway and don't submit to Tailwind when we know we won't
get Tailwind completions

Co-Authored-By: Kirill Bulatov <kirill@zed.dev>
2023-08-30 21:14:39 -04:00
da054bfbb5 Avoid accidental gpui transitive dependency in collab
* Make Fs depend on Text, not vise versa

Co-authored-by: Joseph <joseph@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-30 13:16:01 -07:00
Julia e31fdeebc6 Make multi-server completion requests not serial 2023-08-29 20:42:13 -04:00
Julia 84a7aae52d Woooooops, don't notify the language server until initialized 2023-08-29 15:37:51 -04:00
Piotr Osiewicz 0818c0d178 language: Make Buffer::new take an explicit ID (#2900)
See Linear description for the full explanation of the issue. This PR is
mostly a mechanical change, except for the one case where we do pass in
an explicit `next_id` instead of `model_id` in project.rs.

Release Notes:
- Fixed a bug where some results were not reported in project search in
presence of unnamed buffers.
2023-08-28 11:51:50 +02:00
Kirill Bulatov 302d90f819 Do not convert lsp::Location of hint labels before resolve 2023-08-26 02:45:08 +03:00
Piotr OsiewiczandJulia Risley f5c0e79be1 Un serialize project search (#2857)
This is the first batch of improvements to current project search. There
are few things we can do better still, but I want to get this out in
next Preview.
Most of the slowness at this point seems to stem from updating UI too
often.

Release Notes:
- Improved project search by making it report results sooner.

---------

Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-26 01:31:52 +02:00
JuliaandMax Brunsfeld 1d63cf0ca0 Add word_characters to language overrides & use for more things
Use word_characters to feed completion trigger characters as well and
also recognize kebab as a potential sub-word splitter. This is fine for
non-kebab-case languages because we'd only ever attempt to split a word
with a kebab in it in language scopes which are kebab-cased

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-08-25 18:46:30 -04:00
Joseph T. Lyons b5dc58887d Add setting to automatically enable virtual environment (#2882)
This isn't ready to go - I'm opening a PR to ask for some advice. When
activating a python virtual environment, the typical command used is
`source path_to_venv/bin/activate`. The problem is, the activatate
script isn't portable to all shells, so some additional scripts are
bundled in the env, for example, `activate.fish`. We don't have a good
way of knowing what shell we are in, in order to know what script to
run.

Julia gave the alternative of simply activating the virtual environment
while in the zsh context, before the user's custom shell is launched,
which I think does work, but because we activate the virtual environment
before we launch the custom shell, the shell isn't really aware that we
are in the virtual environment and it fails to display the information
in the prompt that is typically shown after activating.

Is there a clean way for us to know for a fact what shell is being ran,
so we know what script to run?

Check out the code comments below for more context.

---


https://github.com/zed-industries/zed/assets/19867440/ddb76aaa-152b-4c93-a513-3cd580b7c40f

I've used Zed to write Python scripts, but working on an actual project
has really magnified where Python dev is falling short. A huge
quality-of-life thing we can do is provide a setting to automaticaly
search for and activate virtual environments when found, when terminals
are created. Manually starting these up in every terminal instance is
such a drag.

A few quirks:
- We don't have a way of knowing if the prompt is ready before we try
run the command, which means we see the text inserted at the top of the
terminal and on the prompt - I dont think this should be a blocker
though.
- If a user has multiple python projects with mutliple virtual
environments, we only detect and activate the first one, since can't
really make any assumptions about which one to activate. I dont think
this should be a blocker either, as I think most users will have a
single project open in Zed.

Release Notes:

- Added a `detect_venv` setting for the terminal. When configured, the
Zed terminal will automatically activate Python virtual environments on
terminal creation.
2023-08-25 15:14:24 -04:00
Joseph T. LyonsandMikayla Maki 4218484d0f WIP
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
2023-08-25 15:06:31 -04:00
Max Brunsfeld cf311455ba Fix rust 1.72 warnings about shadowed glob re-exports 2023-08-25 10:25:21 -07:00
Max Brunsfeld 0596c2f103 Format let-else statements 2023-08-25 10:11:32 -07:00
Kirill Bulatov 02560f7a1a Add hover tests 2023-08-25 14:26:17 +03:00
Kirill Bulatov 595c32b583 Be more lenient with hint resolution, always return some hint 2023-08-25 14:26:17 +03:00
Kirill Bulatov 6b7c2f1dc0 Fix resolve status conversion 2023-08-25 14:26:17 +03:00
Kirill Bulatov 05b8754d9f Propagate inlay background highlights to data storage 2023-08-25 14:26:17 +03:00
Kirill Bulatov a2a60c6d84 Properly resolve inlay label parts' locations and buffers 2023-08-25 14:26:17 +03:00
Kirill Bulatov de60646f8f Send inlay hint resolve requests 2023-08-25 14:26:17 +03:00
Kirill Bulatov 64aaa33e08 Store inlay hint resolve data 2023-08-25 14:26:17 +03:00
Kirill Bulatov e4f42bd33d Revert "Strip off inlay hints data that should be resolved"
Without holding all hints in host's cache, this is impossile.
Currenly, we keep hint caches separate and isolated, so this will not
work when we actually resolve.
2023-08-25 14:26:17 +03:00
Joseph T. Lyons 94ab92968d Merge branch 'main' into add-setting-to-automatically-enable-virtual-environment 2023-08-25 01:50:57 -04:00
Joseph T. Lyons 708cdd345f WIP 2023-08-25 01:50:54 -04:00
Max BrunsfeldandMikayla d5b7254ce0 Ensure collaborators cursor colors are the same in channel buffers as in projects
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-24 11:31:41 -07:00
Max BrunsfeldandMikayla bc402040ce Start work on showing consistent replica ids for channel buffers
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-23 18:37:01 -07:00
Joseph T. Lyons 8026edceb7 Shorten setting name 2023-08-23 04:07:10 -04:00
Joseph T. Lyons dfa179521c WIP 2023-08-23 04:04:36 -04:00
Julia 228326d9ec Only generate workspace/configuration for relevant adapter 2023-08-22 23:36:04 -04:00
Joseph T. LyonsandJulia da4fd139ca WIP
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-08-22 15:29:25 -04:00