Commit Graph
11069 Commits
Author SHA1 Message Date
JuliaandKirill Bulatov 529adb95a1 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
Kirill BulatovandJulia Risley 7e5735c8f1 Reap overly long LSP requests with a 2m timeout
Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-30 18:41:41 +03:00
Julia e3a0252b04 Make multi-server completion requests not serial 2023-08-29 20:42:13 -04:00
Julia 0e6c91818f Woooooops, don't notify the language server until initialized 2023-08-29 15:37:51 -04:00
JuliaandAntonio Scandurra 15628af04b Style language server name in completion menu
Omit in buffers with one or zero running language servers with the
capability to provide completions

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-08-29 11:21:02 -04:00
Julia 35b7787e02 Add Tailwind server to TSX 2023-08-28 15:19:16 -04:00
JuliaandKirill Bulatov ded6decb29 Initial unstyled language server short name in completions
Co-Authored-By: Kirill Bulatov <kirill@zed.dev>
2023-08-28 11:27:45 -04:00
JuliaandMax Brunsfeld fc457d45f5 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
Julia a394aaa524 Add Tailwind server to JS/TS 2023-08-23 00:11:15 -04:00
Julia 68408f3838 Add VSCode CSS language server & add Tailwind to .css files 2023-08-22 23:50:40 -04:00
Julia affb73d651 Only generate workspace/configuration for relevant adapter 2023-08-22 23:36:04 -04:00
Kirill Bulatov 814896de3f Reenable html, remove emmet due to the lack of the code 2023-08-22 12:51:14 +03:00
Kirill Bulatov a35b3f39c5 Expand word characters for html and css 2023-08-22 12:41:59 +03:00
Piotr OsiewiczandJulia Risley 007d1b09ac Z 2819 (#2872)
This PR adds new config option to language config called
`word_boundaries` that controls which characters should be recognised as
word boundary for a given language. This will improve our UX for
languages such as PHP and Tailwind.

Release Notes:

- Improved completions for PHP
[#1820](https://github.com/zed-industries/community/issues/1820)

---------

Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-22 12:23:30 +03:00
Julia c842e87079 Use updated lsp-types fork branch 2023-08-18 11:57:19 -04:00
Julia a979e32127 Utilize LSP completion itemDefaults a bit
Tailwind likes to throw a lot of completion data at us, this gets it to
send less. Previously it would respond to a completion with 2.5 MB JSON
blob, now it is more like 0.8 MB.

Relies on a local copy of lsp-types with the `itemDefaults` field added.
I don't have write perms to push to our fork of the crate atm, sorry :)
2023-08-17 21:57:39 -04:00
Kirill Bulatov 4f0fa21c04 Provide more data to tailwind langserver
Tailwind needs user languages and language-to-language-id mappings to
start providing completions for those languages.
And also it has emmet completions disabled by default, enable them.
2023-08-17 16:14:55 +03:00
Julia e54f16f372 Register initial request handlers before launching server 2023-08-16 21:25:17 -04:00
Julia 8839b07a25 Add broken Tailwind language server 2023-08-16 11:53:05 -04:00
Julia 40ce099780 Use originating language server to resolve additional completion edits 2023-08-15 16:34:15 -04:00
Julia 7a67ec5743 Add support for querying multiple language servers for completions 2023-08-15 12:48:30 -04:00
Conrad Irwin 404b1aa65a Fix vim selection to include entire range (#2787)
Update vim mode to have vim selection and editor selections match.
Before this we had to adjust between vim selections and real selections
when making changes; now we have to adjust when making selections.

Release Notes:

- vim: Ensure editor selection matches the vim selection
([#1796](https://github.com/zed-industries/community/issues/1796)).
- vim: Fix `s` in visual line mode
- vim: Add `o` and `shift-o` to toggle direction of visual selection
- vim: Fix `v` and `shift-v` to toggle back to normal mode
- vim: Fix block selections like `vi}` to contain correct whitespace
2023-08-15 08:36:17 -06:00
Conrad Irwin 1e3f468fc7 Fix vim escape in normal mode (#2844)
Fixes: zed-industries/community#1857

- vim: Fix escape in normal mode
([#1857](https://github.com/zed-industries/community/issues/1857)).
2023-08-15 08:35:49 -06:00
Mikayla Maki 22da42fc69 Add components example (#2846)
This PR is a continuation of the components UI exploration I've been
doing. It adds an example to the GPUI examples page and totally
restructures the generics on our MouseEventHandler.

Release Note:
- N/A
2023-08-15 03:17:50 -07:00
Mikayla e5eed29c72 Add components example
Re-arrange generics on mouse event handler
Add TypeTag struct for dynamically tagged components
2023-08-15 03:06:43 -07:00
Conrad Irwin 1af7425059 Fix vim escape in normal mode
Fixes: zed-industries/community#1857
2023-08-14 16:05:41 -06:00
Conrad Irwin fb90eada70 Merge branch 'main' into vim-visual-selection 2023-08-14 15:29:33 -06:00
Conrad Irwin 5b37cdcb04 Better tests 2023-08-14 15:03:16 -06:00
Kirill Bulatov 64c2043913 Query less inlay hints (#2842)
Part of
https://linear.app/zed-industries/issue/Z-2750/investigate-performance-of-collaborating-on-large-files-with-inlay

Instead of querying the entire file for hints, query visible editor(s)
range + the areas above and below, of the same height.
Non-invalidating future queries (e.g. scrolling) query only missing
parts of the ranges.

Release Notes:

- Improved LSP resource usage by querying less hints for big files
2023-08-14 23:06:30 +03:00
Kirill Bulatov 54bcef9420 Strip off inlay hint data that should be resolved (#2843)
Part of
https://linear.app/zed-industries/issue/Z-2750/investigate-performance-of-collaborating-on-large-files-with-inlay

* Declares client capabilities for hint resolution, marking both fields
available for resolution (`textEdits` and `tooltop`) as resolvable.
We do not use these fields anymore, hence can omit resolving them for
now, but LSP servers can omit them during general hint requests.

* Removes `tooltip` and replaces complex `label` with its simple string
counterpart for clients' hint responses from host: both should be
resolved through host later

Release Notes:

- Reduces collab mode clients' inlay hint footprint by enabling hint
data resolution
2023-08-14 23:06:19 +03:00
Kirill Bulatov 27bf01c3a8 Strip off inlay hints data that should be resolved 2023-08-14 22:50:55 +03:00
Kirill Bulatov e0d011e354 Better assert multibuffer edit test results 2023-08-14 20:12:35 +03:00
Kirill Bulatov 4b3273182a Do not filter out hints to be removed 2023-08-14 19:20:20 +03:00
Kirill Bulatov 336fbb3392 Clip offsets in inlay hint queries 2023-08-14 18:39:30 +03:00
Kirill Bulatov 558367dc8b Optimize query ranges tracking 2023-08-14 16:19:44 +03:00
Kirill Bulatov 87e6651ecb Fix hint tests, add a char boundary bug test 2023-08-14 16:01:02 +03:00
Kirill Bulatov 449c009639 Properly generate ranges to query 2023-08-14 11:25:02 +03:00
Kirill Bulatov 56f89739f8 Do not add duplicate hints to the cache 2023-08-14 11:25:02 +03:00
Kirill Bulatov 0e2a1fc149 Query inlay hints for parts of the file 2023-08-14 11:25:02 +03:00
Kirill Bulatov 708409e06d Query hints on every scroll 2023-08-14 11:25:02 +03:00
Kirill Bulatov 5d2750e0d4 Hide inlay cache fields 2023-08-14 11:25:02 +03:00
Mikayla Maki 5ce7ccac32 Allow individual corner radii on containers, images, and drop shadows (#2841)
Here's an example in `crates/gpui/examples/corner_radii.rs`

![CleanShot 2023-08-12 at 11 06
09@2x](https://github.com/zed-industries/zed/assets/1789/1b5992ac-f7ef-45d8-b8c2-f0e677b07dd9)

@iamnbutler, in the themes, anywhere we have a container style can now
take either a `corner_radius` or a `corner_radii` field, both of these
fields can either have 1 number (for all 4 corners) or a an object like:

```
{
  top_left?: number,
  top_right?: number,
  bottom_left?: number, 
  bottom_right?:number 
} 
```

Fields that are not included in this second representation default to 0
corner radius.
2023-08-12 12:36:05 -07:00
Mikayla 29a85635ea Make each setting optional 2023-08-12 12:23:46 -07:00
Mikayla 563b25f26f Add deserialization helper 2023-08-12 12:21:44 -07:00
Nathan Sobo fa7ebd0825 Include drop shadows with different corner radii in the example 2023-08-12 11:08:58 -06:00
Nathan Sobo 65123e6eed Allow individual corner radii on drop shadows 2023-08-12 10:58:08 -06:00
Nathan Sobo 40f478937e Allow distinct corner radii for images 2023-08-12 10:50:04 -06:00
Nathan Sobo 84dc4090bd Wire up per corner radii for quad
Still need to expose this in the styling layer and allow images
to have per corner radii.
2023-08-12 10:40:23 -06:00
Mikayla Maki 1911f537b4 Add a compile test for the element derive (#2840)
Tried to use this the new element derive on a branch and ran into some
bugs, this fixes those.

Release Notes:

- N/A
2023-08-11 18:08:13 -07:00
Mikayla 7970406694 Add a compile test for the element derive 2023-08-11 18:00:12 -07:00