You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix/helix-term/src
Michael Davis 5f043dde56
Derive Document language name from languages.toml name key (#3338)
* Derive Document language name from `languages.toml` `name` key

This changes switches from deriving the language name from the
`languages.toml` `scope` key to `name` (`language_id` in the
`LanguageConfiguration` type). For the most part it works to derive the
language name from scope by chopping off `source.` or `rsplit_once` on
`.` but for some languages we have now like html (`text.html.basic`),
it doesn't. This also should be a more accurate fallback for the
`language_id` method which is used in LSP and currently uses the
`rsplit_once` strategy.

Here we expose the language's name as `language_name` on `Document` and
replace ad-hoc calculations of the language name with the new method.

This is most impactful for the `file-type` statusline element which is
using `language_id`.

* Use `Document::language_name` for the `file-type` statusline element

The `file-type` indicator element in the statusline was using
`Document::language_id` which is meant to be used to for telling
Language Servers what language we're using. That works for languages
with `language-server` configurations in `languages.toml` but shows
text otherwise. The new `Document::language_name` method from the
parent commit is a more accurate way to determine the language.
2 years ago
..
commands Derive Document language name from languages.toml name key (#3338) 2 years ago
keymap let extend-line respect range direction (#3046) 2 years ago
ui Derive Document language name from languages.toml name key (#3338) 2 years ago
application.rs Add bracketed paste (#3233) 2 years ago
args.rs add a CLI flag for specifying config file location (#2666) 2 years ago
commands.rs let extend-line respect range direction (#3046) 2 years ago
compositor.rs Add bracketed paste (#3233) 2 years ago
config.rs Move top level lsp config to editor.lsp (#1868) 3 years ago
health.rs Reduce health tick width 2 years ago
job.rs fix(command): write-quit: do not quit if write fails 2 years ago
keymap.rs Reuse menu::Item trait in picker (#2814) 2 years ago
lib.rs Add refresh-config and open-config command (#1803) 3 years ago
main.rs add a CLI flag for specifying config file location (#2666) 2 years ago