diff options
| author | Kitson Kelly <me@kitsonkelly.com> | 2021-02-08 21:45:10 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-08 21:45:10 +1100 |
| commit | e368c5d0f9d69e69438cb0a8a8deb49d7b02901a (patch) | |
| tree | b4375b56374f3aad19089e0f1016b1b892dc972c /cli/lsp/config.rs | |
| parent | 09b79463d71f3b144a0cfd878108a012c87464ca (diff) | |
feat(lsp): add implementations code lens (#9441)
Diffstat (limited to 'cli/lsp/config.rs')
| -rw-r--r-- | cli/lsp/config.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index 47285a01e..cb814d0fd 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -18,7 +18,10 @@ pub struct ClientCapabilities { #[derive(Debug, Default, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CodeLensSettings { - /// Flag for providing reference code lens. + /// Flag for providing implementation code lenses. + #[serde(default)] + pub implementations: bool, + /// Flag for providing reference code lenses. #[serde(default)] pub references: bool, /// Flag for providing reference code lens on all functions. For this to have @@ -47,7 +50,15 @@ impl WorkspaceSettings { pub fn enabled_code_lens(&self) -> bool { if let Some(code_lens) = &self.code_lens { // This should contain all the "top level" code lens references - code_lens.references + code_lens.implementations || code_lens.references + } else { + false + } + } + + pub fn enabled_code_lens_implementations(&self) -> bool { + if let Some(code_lens) = &self.code_lens { + code_lens.implementations } else { false } |
