pub struct GoLanguageService { /* private fields */ }Expand description
Go 语言服务
Implementations§
Trait Implementations§
Source§impl LanguageService for GoLanguageService
impl LanguageService for GoLanguageService
type Lang = GoLanguage
type Vfs = MemoryVfs
Source§fn workspace(&self) -> &WorkspaceManager
fn workspace(&self) -> &WorkspaceManager
Get the workspace manager.
Source§fn get_root(
&self,
_uri: &str,
) -> impl Future<Output = Option<RedNode<'_, Self::Lang>>> + Send + '_
fn get_root( &self, _uri: &str, ) -> impl Future<Output = Option<RedNode<'_, Self::Lang>>> + Send + '_
Helper to get the root red node of a file.
Implementations should override this to provide actual parsing/caching.
Source§fn get_source(&self, uri: &str) -> Option<<Self::Vfs as Vfs>::Source>
fn get_source(&self, uri: &str) -> Option<<Self::Vfs as Vfs>::Source>
Helper to get source from VFS.
Source§fn with_root<'a, R, F>(
&'a self,
uri: &'a str,
f: F,
) -> impl Future<Output = Option<R>> + Send + 'a
fn with_root<'a, R, F>( &'a self, uri: &'a str, f: F, ) -> impl Future<Output = Option<R>> + Send + 'a
Helper to run logic with the root node.
Source§fn with_roots<'a, R, F>(
&'a self,
uris: Vec<String>,
f: F,
) -> impl Future<Output = Vec<R>> + Send + 'a
fn with_roots<'a, R, F>( &'a self, uris: Vec<String>, f: F, ) -> impl Future<Output = Vec<R>> + Send + 'a
Helper to run logic with multiple root nodes in parallel.
Source§fn hover(
&self,
_uri: &str,
_range: Range<usize>,
) -> impl Future<Output = Option<Hover>> + Send
fn hover( &self, _uri: &str, _range: Range<usize>, ) -> impl Future<Output = Option<Hover>> + Send
Provide hover information. Defaults to None.
Source§fn folding_ranges(
&self,
_uri: &str,
) -> impl Future<Output = Vec<FoldingRange>> + Send
fn folding_ranges( &self, _uri: &str, ) -> impl Future<Output = Vec<FoldingRange>> + Send
Provide folding ranges. Defaults to empty.
Source§fn document_symbols<'a>(
&'a self,
uri: &'a str,
) -> impl Future<Output = Vec<StructureItem>> + Send + 'a
fn document_symbols<'a>( &'a self, uri: &'a str, ) -> impl Future<Output = Vec<StructureItem>> + Send + 'a
Provide document symbols. Defaults to empty.
Source§fn workspace_symbols<'a>(
&'a self,
query: String,
) -> impl Future<Output = Vec<WorkspaceSymbol>> + Send + 'a
fn workspace_symbols<'a>( &'a self, query: String, ) -> impl Future<Output = Vec<WorkspaceSymbol>> + Send + 'a
Provide workspace symbols.
Source§fn list_all_files(
&self,
root_uri: &str,
) -> impl Future<Output = Vec<String>> + Send
fn list_all_files( &self, root_uri: &str, ) -> impl Future<Output = Vec<String>> + Send
Helper to list all files recursively.
Source§fn definition<'a>(
&'a self,
uri: &'a str,
range: Range<usize>,
) -> impl Future<Output = Vec<LocationRange>> + Send + 'a
fn definition<'a>( &'a self, uri: &'a str, range: Range<usize>, ) -> impl Future<Output = Vec<LocationRange>> + Send + 'a
Find definition. Defaults to empty.
Source§fn references<'a>(
&'a self,
_uri: &'a str,
_range: Range<usize>,
) -> impl Future<Output = Vec<LocationRange>> + Send + 'a
fn references<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<LocationRange>> + Send + 'a
Find references. Defaults to empty.
Source§fn type_definition<'a>(
&'a self,
_uri: &'a str,
_range: Range<usize>,
) -> impl Future<Output = Vec<LocationRange>> + Send + 'a
fn type_definition<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<LocationRange>> + Send + 'a
Find type definition. Defaults to empty.
Source§fn implementation<'a>(
&'a self,
_uri: &'a str,
_range: Range<usize>,
) -> impl Future<Output = Vec<LocationRange>> + Send + 'a
fn implementation<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<LocationRange>> + Send + 'a
Find implementation. Defaults to empty.
Source§fn document_highlights<'a>(
&'a self,
_uri: &'a str,
_range: Range<usize>,
) -> impl Future<Output = Vec<DocumentHighlight>> + Send + 'a
fn document_highlights<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<DocumentHighlight>> + Send + 'a
Provide document highlights. Defaults to empty.
Source§fn rename<'a>(
&'a self,
_uri: &'a str,
_range: Range<usize>,
_new_name: String,
) -> impl Future<Output = Option<WorkspaceEdit>> + Send + 'a
fn rename<'a>( &'a self, _uri: &'a str, _range: Range<usize>, _new_name: String, ) -> impl Future<Output = Option<WorkspaceEdit>> + Send + 'a
Rename a symbol.
Source§fn completion<'a>(
&'a self,
_uri: &'a str,
_position: usize,
) -> impl Future<Output = Vec<CompletionItem>> + Send + 'a
fn completion<'a>( &'a self, _uri: &'a str, _position: usize, ) -> impl Future<Output = Vec<CompletionItem>> + Send + 'a
Provide completion items. Defaults to empty.
Source§fn diagnostics<'a>(
&'a self,
_uri: &'a str,
) -> impl Future<Output = Vec<Diagnostic>> + Send + 'a
fn diagnostics<'a>( &'a self, _uri: &'a str, ) -> impl Future<Output = Vec<Diagnostic>> + Send + 'a
Provide diagnostics for a file. Defaults to empty.
Source§fn semantic_tokens<'a>(
&'a self,
_uri: &'a str,
) -> impl Future<Output = Option<SemanticTokens>> + Send + 'a
fn semantic_tokens<'a>( &'a self, _uri: &'a str, ) -> impl Future<Output = Option<SemanticTokens>> + Send + 'a
Provide semantic tokens for a file. Defaults to None.
Source§fn semantic_tokens_range<'a>(
&'a self,
_uri: &'a str,
_range: Range<usize>,
) -> impl Future<Output = Option<SemanticTokens>> + Send + 'a
fn semantic_tokens_range<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Option<SemanticTokens>> + Send + 'a
Provide semantic tokens for a range. Defaults to None.
Source§fn selection_ranges<'a>(
&'a self,
_uri: &'a str,
_ranges: Vec<usize>,
) -> impl Future<Output = Vec<SelectionRange>> + Send + 'a
fn selection_ranges<'a>( &'a self, _uri: &'a str, _ranges: Vec<usize>, ) -> impl Future<Output = Vec<SelectionRange>> + Send + 'a
Provide selection ranges for a file. Defaults to empty.
Source§fn signature_help<'a>(
&'a self,
_uri: &'a str,
_position: usize,
) -> impl Future<Output = Option<SignatureHelp>> + Send + 'a
fn signature_help<'a>( &'a self, _uri: &'a str, _position: usize, ) -> impl Future<Output = Option<SignatureHelp>> + Send + 'a
Provide signature help at a position. Defaults to None.
Source§fn inlay_hints<'a>(
&'a self,
_uri: &'a str,
) -> impl Future<Output = Vec<InlayHint>> + Send + 'a
fn inlay_hints<'a>( &'a self, _uri: &'a str, ) -> impl Future<Output = Vec<InlayHint>> + Send + 'a
Provide inlay hints for a file. Defaults to empty.
Source§fn formatting<'a>(
&'a self,
_uri: &'a str,
) -> impl Future<Output = Vec<TextEdit>> + Send + 'a
fn formatting<'a>( &'a self, _uri: &'a str, ) -> impl Future<Output = Vec<TextEdit>> + Send + 'a
Provide document formatting. Defaults to empty.
Source§fn code_actions<'a>(
&'a self,
_uri: &'a str,
_range: Range<usize>,
) -> impl Future<Output = Vec<CodeAction>> + Send + 'a
fn code_actions<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<CodeAction>> + Send + 'a
Provide code actions for a file. Defaults to empty.
Source§fn initialize<'a>(
&'a self,
_params: InitializeParams,
) -> impl Future<Output = ()> + Send + 'a
fn initialize<'a>( &'a self, _params: InitializeParams, ) -> impl Future<Output = ()> + Send + 'a
Called when the language server is initialized.
Source§fn initialized<'a>(&'a self) -> impl Future<Output = ()> + Send + 'a
fn initialized<'a>(&'a self) -> impl Future<Output = ()> + Send + 'a
Called when the language server is initialized (notification).
Source§fn shutdown<'a>(&'a self) -> impl Future<Output = ()> + Send + 'a
fn shutdown<'a>(&'a self) -> impl Future<Output = ()> + Send + 'a
Called when the language server is shut down.
Auto Trait Implementations§
impl !Freeze for GoLanguageService
impl !RefUnwindSafe for GoLanguageService
impl Send for GoLanguageService
impl Sync for GoLanguageService
impl Unpin for GoLanguageService
impl UnwindSafe for GoLanguageService
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