Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Issue with language settings #7099

Closed
bq-wrongway opened this issue May 21, 2023 · 5 comments
Closed

Issue with language settings #7099

bq-wrongway opened this issue May 21, 2023 · 5 comments

Comments

@bq-wrongway
Copy link

After update from 23.03 to 23.05, i get always warning when trying to run helix :

Error parsing user language config: unknown field `config`, expected one of `name`, `language-id`, `scope`, `file-types`, `shebangs`, `roots`, `comment-token`, `text-width`, `soft-wrap`, `auto-format`, `formatter`, `diagnostic-severity`, `grammar`, `injection-regex`, `language-servers`, `indent`, `debugger`, `auto-pairs`, `rulers`, `workspace-lsp-roots`
in `language`

Using default language config
Configured language server: rust-analyzer
Binary for language server: /usr/local/bin/rust-analyzer
Configured debug adapter: lldb-vscode
Binary for debug adapter: 'lldb-vscode' not found in $PATH
Highlight queries: ✓
Textobject queries: ✓
Indent queries: ✓

And here is language. toml file settings
https://pastebin.com/bx592Ugk

@gabydd
Copy link
Member

gabydd commented May 21, 2023

Looks like you are running from master, #2507 was recently merged which changes language server config to be per language server instead of per language, so you would need something like:

[language-server.rust-analyzer]
config = {}

See https://docs.helix-editor.com/master/languages.html#language-server-configuration

@bq-wrongway
Copy link
Author

I managed to get most of it working , but i dont know how (or where to add)

[language.config.check]
command = "clippy"

when i enable this it complains right away
here is new pastebin link https://pastebin.com/wqCQLAy9

@gabydd
Copy link
Member

gabydd commented May 21, 2023

It should be

[language-server.rust-analyser.config.check]
command = "clippy"

(Switched analyzer to analyser cause that's what your config used)

@chkilel
Copy link

chkilel commented May 21, 2023

Hello, I need some help please 🙏🏻.
I'm running master to try out multiple language servers, I converted the config that I had for Vue - Volar to the new one format but I didn't manage to make it work, here are my old and new languages.toml configuration:

  • Old
[[language]]
name = "vue"
file-types = ["vue"]
language-server = { command = "vue-language-server", args = ["--stdio"] }
formatter = { command = "prettier", args = ["--parser", "vue"] }
scope = "text.html.vue"
roots = ["package.json"]
injection-regex = "vue"
auto-format = true

[language.config.typescript]
tsdk = "/opt/homebrew/lib/node_modules/typescript/lib"

[language.config.languageFeatures]
semanticTokens = true
references = true
definition = true
typeDefinition = true
callHierarchy = true
hover = true
rename = true
renameFileRefactoring = true
signatureHelp = true
codeAction = true
completion = { defaultTagNameCase = 'both', defaultAttrNameCase = 'kebabCase' }
schemaRequestService = true
documentHighlight = true
documentLink = true
codeLens = true
diagnostics = true

[language.config.documentFeatures]
documentColor = false
selectionRange = true
foldingRange = true
linkedEditingRange = true
documentSymbol = true
documentFormatting = { defaultPrintWidth = 100 }
  • New
[[language]]
name = "vue"
scope = "text.html.vue"
injection-regex = "vue"
file-types = ["vue"]
auto-format = true
roots = ["package.json"]
formatter = { command = "prettier", args = ["--parser", "vue"] }
language-servers = ["vue-language-server"]

# Language Server configuration
[language-server.vue-language-server]
command = "vue-language-server"
args = ["--stdio"]

[language-server.vue-language-server.config]
typescript = { tsdk = "/opt/homebrew/lib/node_modules/typescript/lib" }

[language-server.vue-language-server.config.languageFeatures]
semanticTokens = true
references = true
definition = true
typeDefinition = true
callHierarchy = true
hover = true
rename = true
renameFileRefactoring = true
signatureHelp = true
codeAction = true
completion = { defaultTagNameCase = 'both', defaultAttrNameCase = 'kebabCase' }
schemaRequestService = true
documentHighlight = true
documentLink = true
codeLens = true
diagnostics = true

[language-server.vue-language-server.config.documentFeatures]
documentColor = false
selectionRange = true
foldingRange = true
linkedEditingRange = true
documentSymbol = true
documentFormatting = { defaultPrintWidth = 100 }

I appreciate your help.

@gabydd
Copy link
Member

gabydd commented May 22, 2023

Try putting the [[language]] table at the bottom of your languages.toml also check what :log-open shows

@kirawi kirawi converted this issue into discussion #7101 May 22, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants