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

Error from official languages.toml #4516

Closed
lcpichette opened this issue Oct 29, 2022 · 2 comments
Closed

Error from official languages.toml #4516

lcpichette opened this issue Oct 29, 2022 · 2 comments
Labels
C-bug Category: This is a bug

Comments

@lcpichette
Copy link

lcpichette commented Oct 29, 2022

Summary

Error:

Bad language config: invalid type: map, expected a string for key language.file-types

Configuring Helix for the first time; new user here.

Reproduction Steps

Potential point of error?

  • Where: 100th instance of file-types, line 1516
  • Why: Map instead of string
[[language]]
name = "sshclientconfig"
scope = "source.sshclientconfig"
file-types = [{ suffix = ".ssh/config" }, { suffix = "/etc/ssh/ssh_config" }]
roots = []

[[grammar]]
name = "sshclientconfig"
source = { git = "https://github.com/metio/tree-sitter-ssh-client-config", rev = "769d7a01a2e5493b4bb5a51096c6bf4be130b024" }

--

I tried this

  1. Installed LSPs:
    1. typescript-language-server
    2. vscode-css-language-server
    3. sourcekit-lsp
    4. vscode-json-language-server
    5. clangd
    6. vscode-html-language-server
  2. hx ~/.config/helix/languages.toml
  3. Paste Raw data from: https://github.com/helix-editor/helix/blob/master/languages.toml into languages.toml file.
  4. hx <non-important-file>
  5. See error. I'm able to press enter to continue to the editing process, but it doesn't recognize the language service in the buffer.

I expected this to happen

  1. I use helix as expected; I'm able to edit the file with helix commands and the support of the newly added LSPs for function definitions and autocomplete (if supported for that language).

Instead, this happened

  1. A warning pops up alerting me that Bad language config: invalid type: map, expected a string for key 'language.file-types'. I'm able to press enter to continue to the editing process.

Helix log

2022-10-29T00:08:23.286 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path } 2022-10-29T00:10:24.474 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path } 2022-10-29T00:10:57.574 helix_view::theme [WARN] Theme: malformed hexcode: highlight 2022-10-29T00:10:58.659 helix_view::theme [WARN] Theme: malformed hexcode: 123456 2022-10-29T00:11:00.622 helix_view::theme [WARN] Theme: malformed hexcode: indent 2022-10-29T00:11:03.706 helix_view::theme [WARN] Theme: malformed hexcode: highlight 2022-10-29T00:11:10.662 helix_view::theme [WARN] Theme: malformed hexcode: 123456 2022-10-29T00:11:11.359 helix_view::theme [WARN] Theme: malformed hexcode: 123456 2022-10-29T00:11:30.449 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path } 2022-10-29T00:16:33.169 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path } 2022-10-29T00:17:06.953 helix_view::theme [WARN] Theme: malformed hexcode: highlight 2022-10-29T00:17:31.121 helix_view::theme [WARN] Theme: malformed hexcode: indent 2022-10-29T00:35:15.910 helix_view::theme [WARN] Theme: malformed hexcode: prumary 2022-10-29T00:35:16.334 helix_view::theme [WARN] Theme: malformed hexcode: prumary 2022-10-29T00:39:54.893 helix_view::theme [WARN] Theme: malformed hexcode: #000 2022-10-29T00:39:55.375 helix_view::theme [WARN] Theme: malformed hexcode: #000 2022-10-29T00:50:48.297 helix_view::editor [ERROR] Failed to initialize the LSP for `source.js` { cannot find binary path } 2022-10-29T00:50:54.578 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path } 2022-10-29T00:51:10.929 helix_view::editor [ERROR] Failed to initialize the LSP for `source.js` { cannot find binary path } 2022-10-29T01:03:59.071 helix_lsp::transport [ERROR] <- InternalError: Request initialize failed with message: Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting. 2022-10-29T01:03:59.072 helix_lsp [ERROR] failed to initialize language server: protocol error: InternalError: Request initialize failed with message: Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting. 2022-10-29T01:04:30.890 helix_term::application [ERROR] Timed out waiting for language servers to shutdown 2022-10-29T01:04:43.237 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path } 2022-10-29T01:06:23.754 helix_lsp::transport [ERROR] <- InternalError: Request initialize failed with message: Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting. 2022-10-29T01:06:23.754 helix_lsp [ERROR] failed to initialize language server: protocol error: InternalError: Request initialize failed with message: Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting. 2022-10-29T01:06:30.128 helix_term::application [ERROR] Timed out waiting for language servers to shutdown 2022-10-29T01:06:37.081 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path } 2022-10-29T01:07:33.522 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path } 2022-10-29T10:19:13.424 helix_lsp::transport [ERROR] <- InternalError: Request initialize failed with message: Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting. 2022-10-29T10:19:13.425 helix_lsp [ERROR] failed to initialize language server: protocol error: InternalError: Request initialize failed with message: Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting. 2022-10-29T10:19:19.103 helix_term::application [ERROR] Timed out waiting for language servers to shutdown 2022-10-29T10:19:53.067 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path } 2022-10-29T10:20:14.935 helix_lsp::transport [ERROR] <- InternalError: Request initialize failed with message: Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting. 2022-10-29T10:20:14.935 helix_lsp [ERROR] failed to initialize language server: protocol error: InternalError: Request initialize failed with message: Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting. 2022-10-29T10:20:15.960 helix_term::application [ERROR] Timed out waiting for language servers to shutdown
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

Platform

MacOS

Terminal Emulator

iTerm 2 @latest (3.x.x)

Helix Version

helix 22.08.1 (66276ce)

@lcpichette lcpichette added the C-bug Category: This is a bug label Oct 29, 2022
@the-mikedavis
Copy link
Member

You're running the 22.08.1 release but using a languages.toml from master. In order to use that new syntax you will need to build from at least 17daf6a (#4414).

However you don't need to copy the languages.toml from this repository to ~/.config/helix/languages.toml: languages.toml from the repository root is built into the binary when compiling. You should delete the ~/.config/helix/languages.toml file.

@lcpichette
Copy link
Author

You're running the 22.08.1 release but using a languages.toml from master. In order to use that new syntax you will need to build from at least 17daf6a (#4414).

However you don't need to copy the languages.toml from this repository to ~/.config/helix/languages.toml: languages.toml from the repository root is built into the binary when compiling. You should delete the ~/.config/helix/languages.toml file.

Oh, I see! That seems to have resolved the error. It seems that the language buffer is a separate issue I'll have to look into. Thank you for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants