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 editorconfig language server #2407

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add editorconfig language server #2407

wants to merge 2 commits into from

Conversation

Lilja
Copy link

@Lilja Lilja commented Jan 18, 2023

Hi!

I have made a WIP language server for editorconfig.

Can this server configuration be added upsteam?

@glepnir
Copy link
Member

glepnir commented Jan 18, 2023

it only works for .editorconfig file right?

@Lilja
Copy link
Author

Lilja commented Jan 18, 2023

@glepnir Correct

@glepnir
Copy link
Member

glepnir commented Jan 18, 2023

so why we need .git ? and does it not support single file mode ?

@Lilja
Copy link
Author

Lilja commented Jan 18, 2023

so why we need .git

A copy paste artefact. I'll remove it.

does it not support single file mode ?

What do you mean with single file mode?

@glepnir
Copy link
Member

glepnir commented Jan 18, 2023

single_file_support option that mean this server can work with a single file without root dir. in rpc protocol is the rootUri is current dir workspaceFolders nil . send to server

@Lilja
Copy link
Author

Lilja commented Jan 18, 2023

I tried to read what the :h lspconfig-single-file-support said about this and I couldn't fully understand it. It's a regular LS with workspace/root dir support. Editorconfig files can be nested, so I would argue that it would need to know its workspace directory.

@glepnir
Copy link
Member

glepnir commented Jan 18, 2023

add single_file_support . it will use cwd as root send to your server. does your server can accept this ?
like open nvim in home dir the cwd is home. and open ~/project/.editorconfig . the root actual is project but we send cwd.

@@ -0,0 +1,24 @@
local util = require 'lspconfig.util'

local root_files = { '.editorconfig' }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
local root_files = { '.editorconfig' }

return {
default_config = {
cmd = { 'ecls', '--stdio' },
filetypes = { 'editorconfig' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
filetypes = { 'editorconfig' },
filetypes = { 'editorconfig' },
root_files = { '.editorconfig' },

@Lilja
Copy link
Author

Lilja commented Jan 18, 2023

I tried your suggestions locally and it didn't work for my server. Nothing in :LspLog either: img

@glepnir
Copy link
Member

glepnir commented Jan 19, 2023

well. I think it would be better support that. because it only work for .editorconfig it just a config file

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.

None yet

3 participants