Commit Graph
31406 Commits
Author SHA1 Message Date
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
Conrad Irwin e29325168c Fix merge-conflict 2023-08-25 11:59:16 -06:00
Conrad Irwin 7bd7a4728a Fix relative line numbers in vim visual mode
In visual mode when your selection ends with a newline we show the
cursor at the end of the previous line (not the start of the current
line). We had only been accounting for this if the cursor was on-screen.
2023-08-25 11:50:41 -06:00
Conrad Irwin 9604cbd934 Fix relative line numbers when newest cursor offscreen 2023-08-25 11:50:41 -06:00
Conrad Irwinand af7c4ea748 Add relative_line_mode
Co-Authored-By: joseph@zed.dev
2023-08-25 11:50:41 -06:00
Conrad Irwin c591a6b231 Fix zed-industries/community#1950 2023-08-25 11:34:07 -06: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
Antonio Scandurra ac2951109f Remove warning 2023-08-25 17:35:14 +02:00
Antonio Scandurra 015f532b4b Add placeholder text for inline assistant prompts 2023-08-25 17:24:26 +02:00
Kirill Bulatov 75dda334bb Properly invalidate the hint cache 2023-08-25 17:33:17 +03:00
Antonio Scandurra 5bb30bddb8 Cancel last inline assist when escaping from the editor 2023-08-25 15:54:52 +02:00
Antonio Scandurra fb63016bb2 Ensure the inline assistant works with gpt-3.5 2023-08-25 15:39:10 +02:00
Kirill Bulatov 778c3a1bb5 Fix the tests 2023-08-25 16:25:43 +03:00
Kirill Bulatov 07c8ade871 Only invalidate when doing first, visible range query 2023-08-25 15:16:55 +03:00
Kirill Bulatov f277151d26 Defer querying inlay hints for invisible editor ranges
This way, only the visible part gets frequently queried on typing (and
hint /refresh requests that follow), with queries for invisible ranges
cancelled eagerly.
2023-08-25 15:16:55 +03:00
Kirill Bulatov bee25d93e0 Use stricter inlay range checks to avoid stuck highlights
Often, hint ranges are separated by a single '<` char as in
`Option<Vec<u32>>`. When moving the caret from left to right, avoid
inclusive ranges to faster update the matching hint underline.
2023-08-25 14:46:39 +03:00
Antonio Scandurra 6eb450178e Merge remote-tracking branch 'origin/main' into ai-refactoring 2023-08-25 13:37:32 +02:00
Antonio Scandurra def8c31c64 💄 2023-08-25 13:36:52 +02:00
Kirill Bulatov ec6c6ab815 Rebase fixes 2023-08-25 14:30:07 +03:00
Kirill Bulatov 02560f7a1a Add hover tests 2023-08-25 14:26:17 +03:00
Kirill Bulatov efb47adc94 Add link_go_to_definition test for inlays 2023-08-25 14:26:17 +03:00
Kirill Bulatov f6ae590f9a Properly binary search cached inlay hints 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 f1eaa9e4cd Use inlay highlights in randomized tests 2023-08-25 14:26:17 +03:00
Kirill Bulatov 5261180929 Simplify and restore client resolve capabilities 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 bca725ef71 Prepare background highlights for inlay highlights 2023-08-25 14:26:17 +03:00
Kirill Bulatov 9aa19291bb Unify text and inlay highlights 2023-08-25 14:26:17 +03:00
Kirill Bulatov a4bf016b0c Prepare for inlay and text highlight unification 2023-08-25 14:26:17 +03:00
Kirill BulatovandAntonio 46253415c2 Highlight inlay hint parts on cmd-hover
Co-Authored-By: Antonio <antonio@zed.dev>
2023-08-25 14:26:17 +03:00
Kirill Bulatov 92ceaeaa9d Attempt to highlight inlays 2023-08-25 14:26:17 +03:00
Kirill Bulatov a950eb41dd Pass inlay highlight information 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 502c866e1c Pass inlay go to definition data 2023-08-25 14:26:17 +03:00
Kirill Bulatov 672edc6007 Prepare for hover functionality refactoring 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
Kirill Bulatov aa00b37941 Properly detect hovered inlay hint label part 2023-08-25 14:26:17 +03:00
Kirill Bulatov b048fa1820 Draft inlay hint part hover detection 2023-08-25 14:26:17 +03:00
Antonio Scandurra 49c0c841c2 Improve background highlighting of inline assists 2023-08-25 12:35:36 +02:00
Antonio Scandurra 817dd0e370 Use a left bias for the prompt editor 2023-08-25 12:25:43 +02:00
Antonio Scandurra eae4fdd053 Allow generating code without editing it 2023-08-25 12:16:28 +02:00
Antonio Scandurra c549cdb9b2 Rework inline assistant 2023-08-25 11:39:27 +02:00
Kyle Caverly 7c7abfda35 Eager Semantic Indexing Queue (#2886)
Optimization to the Semantic Indexing Engine.

We've transitioned from a framework in which the entire project tree is
walked at each index command, to an eager queuing method, in which an
initial queue of outstanding indexing work is initialized upon workspace
creation, and then subscriptions are leveraged for file change events to
continually keep an updated view on outstanding work.

This optimization contributes towards quicker user feedback, when
initializing or using Semantic Search functionality. It also opens the
doors towards better transparency across the system on outstanding
indexing work.

Release Notes:

- Refactored index operation queue to an eager queuing framework.
- Moved semantic search initialization to workspace creation.
- Adjusted rate limiting strategy on api delays to reduce time spent
waiting for rate limits.
2023-08-25 11:03:05 +02:00
KCaverly 0f2cb8b95a cleaned up warnings 2023-08-25 10:38:01 +02:00
Joseph T. Lyons a17c436619 Automatically enable project search filters when using Search Inside 2023-08-25 02:21:07 -04:00