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

add minimal data model to config so that palette param gets completions #162

Merged
merged 4 commits into from
Jan 15, 2025

Conversation

jameswalls
Copy link
Contributor

@jameswalls jameswalls commented Jan 6, 2025

Simplify the config experience of the on_highlight, on_palette, and after_palette config functions by adding code completion to the palette parameter.

Screenshot 2025-01-06 at 12 05 47 a m

@AlexvZyl AlexvZyl added the Enhancement New feature, request or suggestion label Jan 12, 2025
@AlexvZyl
Copy link
Owner

Thanks! That is nice. Are those generated or did you do them manually?

@jameswalls
Copy link
Contributor Author

Thanks! That is nice. Are those generated or did you do them manually?

The screenshot is real :) It’s the actual output of cmp through the lsp.

@5-pebbles
Copy link
Collaborator

Thanks! That is nice. Are those generated or did you do them manually?

The screenshot is real :) It’s the actual output of cmp through the lsp.

I think he meant is the types.lua file automatically generated in some way.

@jameswalls
Copy link
Contributor Author

I think he meant is the types.lua file automatically generated in some way.

Oh got it, it’s manual.

@5-pebbles
Copy link
Collaborator

Alright so there seems to be a better way of doing this... I am still figuring how it works but would it be alright if I push the change to this PR? You define the types above the values and the lsp will fill in all the fields it's self. I would just make a review suggestion but it takes a lot of small changes in different files.

Also thanks for pointing this out it will make configuring the extended palette and highlights much easier.

@5-pebbles
Copy link
Collaborator

And one other thing I can get it working when editing the nordic source code but I can't get anything when working in my config... It won't work for me when using your system or my new one, does it still work for you when you run it remotely:

    "jameswalls/nordic.nvim",
    branch = "palette_completions",

@jameswalls
Copy link
Contributor Author

jameswalls commented Jan 14, 2025

... would it be alright if I push the change to this PR?

sure! go for it.

does it still work for you when you run it remotely:

Yes it works for me:
image
Screenshot 2025-01-13 at 10 54 40 p m

Try commenting out all the config, then manually clean the plugin, and then install it again.

@5-pebbles
Copy link
Collaborator

I still can't get it working with my config, but I tried using yours, and it works like a charm!

I inlined the classes, and lua-ls should now automatically generate all the fields. When you have the time can you give it a test and if it's all working as expected I will get this merged.

@5-pebbles 5-pebbles self-assigned this Jan 14, 2025
@jameswalls
Copy link
Contributor Author

Very nice! All three work for me, including the highlights!
image
image
image
image

@AlexvZyl AlexvZyl requested review from AlexvZyl and removed request for AlexvZyl January 15, 2025 06:32
@5-pebbles 5-pebbles merged commit 78387ba into AlexvZyl:main Jan 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature, request or suggestion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants