-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat: add support for sourcery #1495
Conversation
I am already using the service if you`d like a tester. |
Any updates regarding this PR? |
@Uzaaft, I was waiting for your tests results 😅 |
Huston, we had a little miscommunication here. xD I'll test it ASAP. Hopefully within 12h. |
@kylo252 The sourcery token is often located in the path: |
Other than that, it works beautifully <3 |
init_options = { | ||
editor_version = 'vim', | ||
extension_version = 'vim.lsp', | ||
token = '<YOUR_TOKEN>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should a remove the token section, and instead require that people use the auth.yaml
file in the ~/.config/sourcery/auth.yaml
file. Sourcery even gives the user the command: sourcery login
to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it not work with a local auth.yaml
? otherwise, where's the path for Windows? I can't find that info on their site, could you please share the link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, I guess it can. But from what I see, I can't understand where the token is used, besides the variable assignment
token = "<YOUR_TOKEN>"
Unless I am wrong, and it is used inside the mechanics of lspconfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The best docs I found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was specifically asking about the docs where they mention ~/.config/sourcery/auth.yaml
since I couldn't find it anywhere, because for Windows it would have to be something like ~/AppData/Local/sourcery/..
I guess the local file would be .sourcery.yaml
? but I can't find if it has anything to do with storing the auth token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. I'll have to look around. But why use the path? Once it is setup(i.e i am logged in), I dont have to use the Path again. Sourcery fetches the token and saves it for future usage. I.e the LSP works everything after the initial setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay. Turns out there are no docs on this...Which is a bad thing. Opened an issue regarding this.
If you need another tester, I can help :) |
It is easy to test. If you are using packer, just change the repository from which you pull the source code of nvim-lspconfig to the one in the PR, and setup the lspconfig with the right token. |
There is a typo Is there any progress being made on this PR? I agree the |
c45b656
to
ac7dfb5
Compare
Thanks for catching that, fixed!
Basically waiting on #1495 (comment), unless you guys have some suggestions for auth handling. |
Auth.yaml hasn't been added to the docs. I've been stalking the docs for a few weeks now. |
Sent sourcery.ai an email since their maintainer on GitHub didn't answer. |
@kylo252 I think what you have currently is good enough for usage, despite |
}, | ||
on_new_config = function(new_config, _) | ||
if not new_config.init_options.token then | ||
vim.notify_once('The authentication token must be provided in config.init_options', vim.log.levels.ERROR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefix all lspconfig notifications with [lspconfig], and you should mention what the notification is for, whatever the server name is. Check the capitalization on lspconfig in the other notification (on mobile). Also I think we added notify once after 0.6.1 was backported so fallback to notify if not available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, the server would throw an error message. That's why I hadn't originally added the handling for it.
15f53a6
to
b1655a3
Compare
Description
Add support for https://github.com/sourcery-ai/sourcery
Related discussions: LunarVim/LunarVim#850 and sourcery-ai/sourcery#43
TODO