@@ -34,7 +34,6 @@ pub struct PluginLspAdapter {
fetch_latest_server_version: WasiFn<(), Option<String>>,
fetch_server_binary: WasiFn<(PathBuf, String), Result<PathBuf, String>>,
cached_server_binary: WasiFn<PathBuf, Option<PathBuf>>,
- // label_for_completion: WasiFn<String, Option<String>>,
initialization_options: WasiFn<(), String>,
executor: Arc<Background>,
runtime: Arc<Mutex<Plugin>>,
@@ -48,7 +47,6 @@ impl PluginLspAdapter {
fetch_latest_server_version: plugin.function("fetch_latest_server_version")?,
fetch_server_binary: plugin.function("fetch_server_binary")?,
cached_server_binary: plugin.function("cached_server_binary")?,
- // label_for_completion: plugin.function("label_for_completion")?,
initialization_options: plugin.function("initialization_options")?,
executor,
runtime: Arc::new(Mutex::new(plugin)),
@@ -133,25 +131,6 @@ impl LspAdapterTrait for PluginLspAdapter {
.await
}
- // fn label_for_completion(
- // &self,
- // item: &lsp::CompletionItem,
- // language: &language::Language,
- // ) -> Option<language::CodeLabel> {
- // // TODO: Push more of this method down into the plugin.
- // use lsp::CompletionItemKind as Kind;
- // let len = item.label.len();
- // let grammar = language.grammar()?;
- // let kind = format!("{:?}", item.kind?);
- // let name: String = call_block!(self, &self.label_for_completion, kind).log_err()??;
- // let highlight_id = grammar.highlight_id_for_name(&name)?;
- // Some(language::CodeLabel {
- // text: item.label.clone(),
- // runs: vec![(0..len, highlight_id)],
- // filter_range: 0..len,
- // })
- // }
-
async fn initialization_options(&self) -> Option<serde_json::Value> {
let string: String = self
.runtime
@@ -89,27 +89,6 @@ pub fn cached_server_binary(container_dir: PathBuf) -> Option<PathBuf> {
}
}
-// #[export]
-// pub fn label_for_completion(
-// item: &lsp::CompletionItem,
-// // language: &language::Language,
-// ) -> Option<language::CodeLabel> {
-// // TODO: Push more of this method down into the plugin.
-// use lsp::CompletionItemKind as Kind;
-// let len = item.label.len();
-// let grammar = language.grammar()?;
-// let kind = format!("{:?}", item.kind?);
-
-// // TODO: implementation
-
-// let highlight_id = grammar.highlight_id_for_name(&name)?;
-// Some(language::CodeLabel {
-// text: item.label.clone(),
-// runs: vec![(0..len, highlight_id)],
-// filter_range: 0..len,
-// })
-// }
-
#[export]
pub fn initialization_options() -> Option<String> {
Some("{ \"provideFormatter\": true }".to_string())