Giter Club home page Giter Club logo

Comments (30)

MinerSebas avatar MinerSebas commented on August 11, 2024 3

As a compromise, you could check what the version of vscode on the current (un-)stable channel, to use as a lower-bound for inclusion.

from nix-vscode-extensions.

cathaysia avatar cathaysia commented on August 11, 2024 3

I've just removed the hardcoded data from the code and implemented a very basic prototype (so haven't even added a README yet), but it should be enough to illustrate some of my thinking. I left a config.toml in the repository, just run cargo run -- -f config.toml to see the generated nix expressions printed to the console.

https://github.com/cathaysia/nix4vscode

from nix-vscode-extensions.

AmeerTaweel avatar AmeerTaweel commented on August 11, 2024 1

Another idea regarding this: For each extension. Store the latest version compatible with a specific VSCode version.

Example: Assume an extension has the following versions:

  • Version u. Compatible with VSCode version a.
  • Version v. Compatible with VSCode version a.
  • Version w. Compatible with VSCode version b.
  • Version x. Compatible with VSCode version c.
  • Version y. Compatible with VSCode version c.
  • Version z. Compatible with VSCode version c.

For such an extension, we only keep versions v, w, and z.

I think this combined with the idea of @MinerSebas can be a viable solution. Defining a reasonable lower-bound limits the number of versions. And we (at most, probably will be much less) store one version per extension per VSCode version from that lower-bound.

from nix-vscode-extensions.

yangm97 avatar yangm97 commented on August 11, 2024 1

So the idea would be to store the cache header for each request somewhere (ideally the CI cache but could be on the repo if it makes implementation easier, those headers are short anyway). The first run would probably take a long time but as extensions don't get frequently updated all at once, subsequent runs would be much faster as the HEAD requests could be parallelized without straining the API.

from nix-vscode-extensions.

deemp avatar deemp commented on August 11, 2024

No, we don't provide such functionality.

Every revision (state of the repository at a commit) of nix-vscode-extensions contains a set of the latest versions and a set of the release versions of extensions.

Additionally, we provide the forVSCodeVersion function. You can use an older revision of nix-vscode-extensions and check that it provides extensions compatible with your version of VS Code.

UPD: you can find all extension versions via a script in haskell/requests.sh.

UPD1: @cathaysia makes nix4vscode that allows to fetch extensions listed in a config and compatible with a given version of VS Code

from nix-vscode-extensions.

cathaysia avatar cathaysia commented on August 11, 2024

All right. Is it possible to provide similar functionality in future?

from nix-vscode-extensions.

deemp avatar deemp commented on August 11, 2024

Yes, maybe via a CLI

from nix-vscode-extensions.

cathaysia avatar cathaysia commented on August 11, 2024

The CLI sounds more like a middle-of-the-road solution. Is it possible to automatically select a suitable version for the specified vscode version? Is this part of the functionality missing because of a limitation caused by nix itself or is it just that there is no plan/motivation to do it at the moment?

from nix-vscode-extensions.

deemp avatar deemp commented on August 11, 2024

Selecting a compatible version of an extension requires the following information that should be stored in this repo.

  • All versions of that extension.
  • engine (compatible VS Code version) of each extension version.

"all versions" will definitely bloat this repo and make fetching it slower.

from nix-vscode-extensions.

cathaysia avatar cathaysia commented on August 11, 2024

Yes, fetching all versions will undoubtedly result in a very large repository. In this case, I will close this issue first, and please feel free to open it later if you have better ideas

from nix-vscode-extensions.

cathaysia avatar cathaysia commented on August 11, 2024

I want to think about it from another angle.

Is it possible to calculate the minimum required version of vscode in the current commit. Then tag this commit by vscode's version. If tag is existed, just update it to the lastest commit.

This will cause many extensions to be unable to use the latest version, but avoids breaking changes. The only concern is whether this function will be completely ineffective due to outdated extensions.

from nix-vscode-extensions.

AmeerTaweel avatar AmeerTaweel commented on August 11, 2024

@cathaysia Correct me if I'm wrong. But (I assume that) some older extensions will not be compatible with newer versions of VSCode. In that case, even if you have a version of VSCode more recent than the "minimum required", you might get incompatible extensions.

from nix-vscode-extensions.

cathaysia avatar cathaysia commented on August 11, 2024

Yes, but if we specify the upper and lower bounds of the vscode version at the same time, the chances of conflict between the two boundaries will be high. So we can only assume that the low version extension is compatible with the high version vscode. In other words, the upgrade of vscode will not break compatibility.

What we need may not be a tag that works perfectly, but a tag that works in most cases. This stems from a compromise on warehouse size.

In fact, it might be better to be able to query the extended compatible version at "runtime". But it will introduce impure

from nix-vscode-extensions.

deemp avatar deemp commented on August 11, 2024

I'm in favor of @AmeerTaweel 's idea (#41 (comment)).

Currently, we fetch latest and release extensions separately. API responses for latest extensions are small. API responses for release versions are large as they contain all extension versions.

If we're to get compatible versions for all extensions:

Cons:

  • GH Action run time may increase for many responses will be large.
  • Repo size will grow.

Pros:

  • Maybe repo size won't grow dramatically as some extensions like rust-analyzer update VS Code version infrequently.
  • The release and the latest extension versions will be in the same response. No need to manually list in a config extensions that need release versions.

Requests for the latest and release extensions are available in haskell/requests.sh (permalink).

P.S. closed the issue incidentally when typing on my phone.

from nix-vscode-extensions.

AmeerTaweel avatar AmeerTaweel commented on August 11, 2024

By the way, do you think this will be approved? Because if that is the case, we can keep only the extension versions compatible with whatever version of VSCode is in nixpkgs. That way we only have one version per extension, and we always have compatible versions. However, this depends on being able to merge with nixpkgs.

from nix-vscode-extensions.

arjan-s avatar arjan-s commented on August 11, 2024

Sorry for this "me too" like answer, but I'm running into this issue too. Currently vscode is at version 1.81.1, while the latest pre-release ms-python.python requires 1.82.0 or higher. This cannot be solved currently, because:

  • vscode 1.82.0 is not yet available in nixpkgs
  • ms-python.python is not available in the extensions.x86_64-linux.vscode-marketplace-release set
  • ms-python.python is not available in the (extensions.x86_64-linux.forVSCodeVersion "1.81.1").vscode-marketplace set

Can you think of a way to get this to work?

from nix-vscode-extensions.

deemp avatar deemp commented on August 11, 2024

Sorry for silence. Started a new semester.

@AmeerTaweel

we can keep only the extension versions compatible with whatever version of VSCode is in nixpkgs

This option still implies that we process large responses. To see large responses, run haskell/requests.sh

from nix-vscode-extensions.

deemp avatar deemp commented on August 11, 2024

@arjan-s

Can you think of a way to get this to work?

If the latest release version of ms-python.python is compatible with vscode 1.81.1, you can add ms-python.python to the config (README). Then, the release version of ms-python.python will be fetched.

from nix-vscode-extensions.

yangm97 avatar yangm97 commented on August 11, 2024

@deemp but only a set of very specific extensions are available on the -release closure =/

from nix-vscode-extensions.

AmeerTaweel avatar AmeerTaweel commented on August 11, 2024

@yangm97 I think that @deemp meant that you fork the repo and add the extension you want until we figure something out.

from nix-vscode-extensions.

AmeerTaweel avatar AmeerTaweel commented on August 11, 2024

To see large responses, run haskell/requests.sh

@deemp I will run it and see...

from nix-vscode-extensions.

AmeerTaweel avatar AmeerTaweel commented on August 11, 2024

@deemp maybe a better work to describe the response was "huge" lol.

image

The GitHub action takes around 20 minutes to finish. The proposed idea will make it 20 hours. We should find a way to tell the API to send shorter responses.

from nix-vscode-extensions.

AmeerTaweel avatar AmeerTaweel commented on August 11, 2024

I found an open issue about this.

from nix-vscode-extensions.

cathaysia avatar cathaysia commented on August 11, 2024

I'm currently working on a node2nix-like software. It reads the vscode version and extension list from toml and then generates nix expressions. If all goes well, it should be open in the next week or so. If this tool is written, nix-extensions may no longer be needed to make changes.

from nix-vscode-extensions.

deemp avatar deemp commented on August 11, 2024

@cathaysia, cool idea!

from nix-vscode-extensions.

yangm97 avatar yangm97 commented on August 11, 2024

@deemp maybe a better work to describe the response was "huge" lol.

image

The GitHub action takes around 20 minutes to finish. The proposed idea will make it 20 hours. We should find a way to tell the API to send shorter responses.

Sorry if I'm being captain obvious but does the API provide any sort of caching header? Like. etag or last-modified? Wouldn't it be possible to cache these and make use of HEAD requests before attempting a full GET?

from nix-vscode-extensions.

deemp avatar deemp commented on August 11, 2024

IDK. How would you use it? We need to get all extensions to get an extension version per a VS Code version.

from nix-vscode-extensions.

cathaysia avatar cathaysia commented on August 11, 2024

I just updated the nix4vscode's README. Anyone interested?

talk about nix4vscode here is not a good idea, so I just don't mention it then.

from nix-vscode-extensions.

deemp avatar deemp commented on August 11, 2024

I added a link to nix4vscode to your first message in this issue. Anyone interested can continue discussing it in your repo.

from nix-vscode-extensions.

cathaysia avatar cathaysia commented on August 11, 2024

from nix-vscode-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.