zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.46k stars 3.02k forks source link

Caching/Import Javascript/CSS in HTML for Workspace for intellisense/search/autocomplete use. #7718

Open eznix86 opened 8 months ago

eznix86 commented 8 months ago

Check for existing issues

Describe the feature

Imagine you imported a library as a CDN. For example Jquery 4.0/Alpine. It would be nice if the script on the html is predownloaded and cache and used for autocompletion or intellisense. It is applicable to all JS or CSS within the style/script tags.

Go to definition will apply there also.

If applicable, add mockups / screenshots to help present your vision of the feature

Imagine you have:

Inside of your html. You can start to write Alp for Alpine and it autocompletes/intellisense what you expect and if you do Alpine. it should proposes all functions that Alpine gives.

If you have

it should be able to pick up the classes from the file.

When hovering on the script tag url or the function from the script tag should allow us to go to the definition. Same for stylesheet. When hovering on the class.

d1y commented 8 months ago

Just my opinion, I think this type of caching is not secure 🤡

Are you looking for it?(look for @types/*)

npm i --save-dev @types/jquery @types/alpinejs
eznix86 commented 8 months ago

Just my opinion, I think this type of caching is not secure 🤡

Are you looking for it?(look for @types/*)

npm i --save-dev @types/jquery @types/alpinejs

Well this is not what I talking about. It is more like if you include something in your HTML. That link in your CDN should be autocompleted.

Imagine you have add this in your twig, blade, jinja, or pure html.

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

on the editor, if you start to write

<script>
Swal.fi
</script>

//it should propose/complete with a
Swal.fire({})

I am talking about the caching, because IntelliJ does that, when you include a CDN, it is saved in a jetbrains folder, where you get the benefit of the editor without going to the docs.