Skip to content

Commit

Permalink
Auto generate docs for language support
Browse files Browse the repository at this point in the history
  • Loading branch information
sudormrfbin authored and archseer committed Dec 8, 2021
1 parent 71292f9 commit a78b789
Show file tree
Hide file tree
Showing 11 changed files with 311 additions and 22 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [Usage](./usage.md)
- [Keymap](./keymap.md)
- [Commands](./commands.md)
- [Language Support](./lang-support.md)
- [Migrating from Vim](./from-vim.md)
- [Configuration](./configuration.md)
- [Themes](./themes.md)
Expand Down
41 changes: 41 additions & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
| Language | Syntax Highlighting | Treesitter Textobjects | Auto Indent | Default LSP |
| --- | --- | --- | --- | --- |
| Bash || | | `bash-language-server` |
| C || | | `clangd` |
| C# || | | |
| CMake || | | `cmake-language-server` |
| C++ || | | `clangd` |
| CSS || | | |
| Elixir || | | `elixir-ls` |
| GLSL || || |
| Go |||| `gopls` |
| HTML || | | |
| Java || | | |
| JavaScript || || |
| JSON || || |
| Julia || | | `julia` |
| LaTeX || | | |
| Ledger || | | |
| LLVM || | | |
| Lua || || |
| Mint | | | | `mint` |
| Nix || || `rnix-lsp` |
| OCaml || || |
| OCaml-Interface || | | |
| Perl ||| | |
| PHP || || |
| Prolog | | | | `swipl` |
| Protobuf || || |
| Python |||| `pylsp` |
| Racket | | | | `racket` |
| Ruby || | | `solargraph` |
| Rust |||| `rust-analyzer` |
| Svelte || || `svelteserver` |
| TOML || | | |
| TSQ || | | |
| TSX || | | `typescript-language-server` |
| TypeScript || || `typescript-language-server` |
| Vue || | | |
| WGSL || | | |
| YAML || || |
| Zig || || `zls` |
2 changes: 1 addition & 1 deletion book/src/generated/typable-cmd.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
| Name | Description |
| --- | --- |
| --- | --- |
| `:quit`, `:q` | Close the current view. |
| `:quit!`, `:q!` | Close the current view forcefully (ignoring unsaved changes). |
| `:open`, `:o` | Open a file from disk into the current view. |
Expand Down
10 changes: 10 additions & 0 deletions book/src/lang-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Language Support

For more information like arguments passed to default LSP server,
extensions assosciated with a filetype, custom LSP settings, filetype
specific indent settings, etc see the default
[`languages.toml`][languages.toml] file.

{{#include ./generated/lang-support.md}}

[languages.toml]: https://github.com/helix-editor/helix/blob/master/languages.toml
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ like the list of `:commands` and supported languages. To generate these
files, run

```shell
cargo xtask bookgen
cargo xtask docgen
```

inside the project. We use [xtask][xtask] as an ad-hoc task runner and
Expand Down
1 change: 1 addition & 0 deletions helix-core/src/indent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ where
file_types: vec!["rs".to_string()],
shebangs: vec![],
language_id: "Rust".to_string(),
display_name: "Rust".to_string(),
highlight_config: OnceCell::new(),
config: None,
//
Expand Down
3 changes: 2 additions & 1 deletion helix-core/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ pub struct Configuration {
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
pub struct LanguageConfiguration {
#[serde(rename = "name")]
pub language_id: String,
pub language_id: String, // c-sharp, rust
pub display_name: String, // C#, Rust
pub scope: String, // source.rust
pub file_types: Vec<String>, // filename ends_with? <Gemfile, rb, etc>
#[serde(default)]
Expand Down
Loading

0 comments on commit a78b789

Please sign in to comment.