Compare commits

...

7 Commits

Author SHA1 Message Date
Egor Gladkih d4073979a8
Merge f61b72976e into 4281228da3 2025-07-24 14:36:52 -03:00
Valtteri Koskivuori 4281228da3
fix(queries): Fix filesystem permissions for snakemake (#14061) 2025-07-24 13:09:40 -04:00
GladkihEgor f61b72976e applay completion by `C-x`
If only one completion applay it by pressing completion hotkey
2025-07-21 19:45:40 +05:00
GladkihEgor 7afdd1cc94 reduce indentation level 2025-07-21 17:20:29 +05:00
GladkihEgor dacaef17ea feat: add config for disable autostart LSP 2025-07-21 17:20:29 +05:00
Michael Davis 0103cf526e Use KString as the small-string type for the WordIndex
It's already used in gix and tree-house so it does not introduce a new
dependency. It's a small-string type that fits into 16B (like a
`Box<str>`) meant to be primarily used as keys for large maps.
2025-07-21 17:20:29 +05:00
Michael Davis 451a427162 Complete words from open buffers 2025-07-21 17:20:29 +05:00
10 changed files with 18 additions and 1 deletions

View File

@ -155,6 +155,7 @@ The following statusline elements can be configured:
| Key | Description | Default | | Key | Description | Default |
| --- | ----------- | ------- | | --- | ----------- | ------- |
| `enable` | Enables LSP integration. Setting to false will completely disable language servers regardless of language settings.| `true` | | `enable` | Enables LSP integration. Setting to false will completely disable language servers regardless of language settings.| `true` |
| `autostart` | Enables LSP autostart on file opening. Setting to false will require running the `:lsp-restart` command to manually start the language server.| `true` |
| `display-messages` | Display LSP `window/showMessage` messages below statusline[^1] | `true` | | `display-messages` | Display LSP `window/showMessage` messages below statusline[^1] | `true` |
| `display-progress-messages` | Display LSP progress messages below statusline[^1] | `false` | | `display-progress-messages` | Display LSP progress messages below statusline[^1] | `false` |
| `auto-signature-help` | Enable automatic popup of signature help (parameter hints) | `true` | | `auto-signature-help` | Enable automatic popup of signature help (parameter hints) | `true` |

View File

@ -682,6 +682,7 @@ impl Registry {
doc_path: Option<&'a std::path::PathBuf>, doc_path: Option<&'a std::path::PathBuf>,
root_dirs: &'a [PathBuf], root_dirs: &'a [PathBuf],
enable_snippets: bool, enable_snippets: bool,
autostart: bool,
) -> impl Iterator<Item = (LanguageServerName, Result<Arc<Client>>)> + 'a { ) -> impl Iterator<Item = (LanguageServerName, Result<Arc<Client>>)> + 'a {
language_config.language_servers.iter().filter_map( language_config.language_servers.iter().filter_map(
move |LanguageServerFeatures { name, .. }| { move |LanguageServerFeatures { name, .. }| {
@ -703,6 +704,10 @@ impl Registry {
}) { }) {
return Some((name.to_owned(), Ok(client.clone()))); return Some((name.to_owned(), Ok(client.clone())));
} }
} else if !autostart {
// If autostart LSP turned off, do not automatically start a client for server
// Try emulate the empty clients list behavior for disable LSP
return None;
} }
match self.start_client( match self.start_client(
name.clone(), name.clone(),

View File

@ -169,6 +169,10 @@ impl<T: Item> Menu<T> {
} }
pub fn selection(&self) -> Option<&T> { pub fn selection(&self) -> Option<&T> {
if self.options.len() == 1 {
return Some(&self.options[0]);
}
self.cursor.and_then(|cursor| { self.cursor.and_then(|cursor| {
self.matches self.matches
.get(cursor) .get(cursor)
@ -177,6 +181,10 @@ impl<T: Item> Menu<T> {
} }
pub fn selection_mut(&mut self) -> Option<&mut T> { pub fn selection_mut(&mut self) -> Option<&mut T> {
if self.options.len() == 1 {
return Some(&mut self.options[0]);
}
self.cursor.and_then(|cursor| { self.cursor.and_then(|cursor| {
self.matches self.matches
.get(cursor) .get(cursor)

View File

@ -455,6 +455,8 @@ pub fn get_terminal_provider() -> Option<TerminalConfig> {
pub struct LspConfig { pub struct LspConfig {
/// Enables LSP /// Enables LSP
pub enable: bool, pub enable: bool,
/// Autostart LSP on open file
pub autostart: bool,
/// Display LSP messagess from $/progress below statusline /// Display LSP messagess from $/progress below statusline
pub display_progress_messages: bool, pub display_progress_messages: bool,
/// Display LSP messages from window/showMessage below statusline /// Display LSP messages from window/showMessage below statusline
@ -480,6 +482,7 @@ impl Default for LspConfig {
fn default() -> Self { fn default() -> Self {
Self { Self {
enable: true, enable: true,
autostart: true,
display_progress_messages: false, display_progress_messages: false,
display_messages: true, display_messages: true,
auto_signature_help: true, auto_signature_help: true,
@ -1547,7 +1550,7 @@ impl Editor {
// store only successfully started language servers // store only successfully started language servers
let language_servers = lang.as_ref().map_or_else(HashMap::default, |language| { let language_servers = lang.as_ref().map_or_else(HashMap::default, |language| {
self.language_servers self.language_servers
.get(language, path.as_ref(), root_dirs, config.lsp.snippets) .get(language, path.as_ref(), root_dirs, config.lsp.snippets, config.lsp.autostart)
.filter_map(|(lang, client)| match client { .filter_map(|(lang, client)| match client {
Ok(client) => Some((lang, client)), Ok(client) => Some((lang, client)),
Err(err) => { Err(err) => {

0
runtime/queries/snakemake/LICENSE 100755 → 100644
View File

View File

View File

View File

View File

View File