Struct lsp2::LanguageServer
source · pub struct LanguageServer { /* private fields */ }
Implementations§
source§impl LanguageServer
impl LanguageServer
pub fn new( stderr_capture: Arc<Mutex<Option<String>>>, server_id: LanguageServerId, binary: LanguageServerBinary, root_path: &Path, code_action_kinds: Option<Vec<CodeActionKind>>, cx: AsyncAppContext ) -> Result<Self>
pub fn code_action_kinds(&self) -> Option<Vec<CodeActionKind>>
sourcepub async fn initialize(self, options: Option<Value>) -> Result<Arc<Self>>
pub async fn initialize(self, options: Option<Value>) -> Result<Arc<Self>>
Initializes a language server.
Note that options
is used directly to construct InitializeParams
,
which is why it is owned.
pub fn shutdown( &self ) -> Option<impl 'static + Send + Future<Output = Option<()>>>
pub fn on_notification<T, F>(&self, f: F) -> Subscriptionwhere T: Notification, F: 'static + Send + FnMut(T::Params, AsyncAppContext),
pub fn on_request<T, F, Fut>(&self, f: F) -> Subscriptionwhere T: Request, T::Params: 'static + Send, F: 'static + FnMut(T::Params, AsyncAppContext) -> Fut + Send, Fut: 'static + Future<Output = Result<T::Result>>,
pub fn on_io<F>(&self, f: F) -> Subscriptionwhere F: 'static + Send + FnMut(IoKind, &str),
pub fn remove_request_handler<T: Request>(&self)
pub fn remove_notification_handler<T: Notification>(&self)
pub fn has_notification_handler<T: Notification>(&self) -> bool
pub fn on_custom_notification<Params, F>( &self, method: &'static str, f: F ) -> Subscriptionwhere F: 'static + FnMut(Params, AsyncAppContext) + Send, Params: DeserializeOwned,
pub fn on_custom_request<Params, Res, Fut, F>( &self, method: &'static str, f: F ) -> Subscriptionwhere F: 'static + FnMut(Params, AsyncAppContext) -> Fut + Send, Fut: 'static + Future<Output = Result<Res>>, Params: DeserializeOwned + Send + 'static, Res: Serialize,
pub fn name(&self) -> &str
pub fn capabilities(&self) -> &ServerCapabilities
pub fn server_id(&self) -> LanguageServerId
pub fn root_path(&self) -> &PathBuf
pub fn request<T: Request>( &self, params: T::Params ) -> impl Future<Output = Result<T::Result>>where T::Result: 'static + Send,
pub fn notify<T: Notification>(&self, params: T::Params) -> Result<()>
Trait Implementations§
source§impl Debug for LanguageServer
impl Debug for LanguageServer
Auto Trait Implementations§
impl !RefUnwindSafe for LanguageServer
impl Send for LanguageServer
impl Sync for LanguageServer
impl Unpin for LanguageServer
impl !UnwindSafe for LanguageServer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more