Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support version constraints (~>, >=, etc) #404

Open
mrcjkb opened this issue Jun 22, 2024 Discussed in #403 · 4 comments
Open

[Feature] Support version constraints (~>, >=, etc) #404

mrcjkb opened this issue Jun 22, 2024 Discussed in #403 · 4 comments
Labels
enhancement New feature or request needs-triage

Comments

@mrcjkb
Copy link
Member

mrcjkb commented Jun 22, 2024

Discussed in #403

Originally posted by rktjmp June 22, 2024
Does rocks.nvim support semver constraints? I assumed it would be delegated to luarocks, which does appear to support constraints (under dependencies) but norg = "~> 7" (and variations) fails with a "version number '~> 7' could not be parsed" error during a Rocks sync.

Is it a planned feature?

Blocked by luarocks/luarocks#1684

@mrcjkb mrcjkb added needs-triage enhancement New feature or request labels Jun 22, 2024
@mrcjkb
Copy link
Member Author

mrcjkb commented Jun 22, 2024

Some potential downsides:

  • Higher complexity for Rocks sync?
    • Maybe a non-issue since we could simply run luarocks install for any rock that has a version constraint, without checking if it's outdated.
  • Like scm rocks, such rocks cannot be locked.

We could also add a separate (not to be edited) installed_version field for any rock where the version is a constraint.
This would solve both problems, but could lead to undefined behaviour if users modify it.

@rktjmp
Copy link

rktjmp commented Jun 22, 2024

To add some complexity to the request, a Rocks outdated feature is useful with this, so you can see when your constraint is potentially outdated, eg the "latest" column below:

image

@mrcjkb
Copy link
Member Author

mrcjkb commented Jun 22, 2024

To add some complexity to the request, a Rocks outdated feature is useful with this, so you can see when your constraint is potentially outdated, eg the "latest" column below:

image

I've been thinking of writing a small language server for rocks.toml that provides diagnostics and code actions.

@vhyrro
Copy link
Collaborator

vhyrro commented Jun 26, 2024

I don't even think a language server is needed, just some smart adaptors to the vim.lsp protocol, unless that's what you meant. I do agree that an LSP interface for rocks.toml would be incredible for general UX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-triage
Projects
None yet
Development

No branches or pull requests

3 participants