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

not assuming settings.ltex exist #13

Merged
merged 1 commit into from
Jan 7, 2023
Merged

not assuming settings.ltex exist #13

merged 1 commit into from
Jan 7, 2023

Conversation

chomosuke
Copy link
Contributor

Sometimes I don't have any settings to pass into lspconfig.ltex.setup {}. Hence client.config.settings.ltex ended up being nil. This causes exceptions.

I did some refactoring so that every time settings.ltex would be initialized to {} before it's indexed.

@barreiroleo
Copy link
Owner

Hi @chomosuke! Thanks for your PR, I missed the notification, sorry for the late reply...
Thanks for the refactor, I wanted to make this extract a long time ago.

In theory, ~.setting.ltex should contain at least the default settings for the server. So I don't know if it's better to do an initialization to {} or notify the users that they don't have a config. I have to test it but, am I missing something?

@chomosuke
Copy link
Contributor Author

Hey @barreiroleo, in my experience, if I don't write out

{
   settings = {
        ltex = {},
    },
}

Then ~.settings.ltex would be nil. And I don't have any setting to put into ltex so i'd rather not write that out. I'm using nvim 7.2 btw :).

@barreiroleo barreiroleo merged commit 3827468 into barreiroleo:master Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants