Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: do some doc clean up, fix typo and clippy warning #256

Merged
merged 2 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/call_hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ use crate::{

pub type CallHierarchyClientCapabilities = DynamicRegistrationClientCapabilities;

#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize, Copy)]
#[serde(rename_all = "camelCase")]
pub struct CallHierarchyOptions {
#[serde(flatten)]
pub work_done_progress_options: WorkDoneProgressOptions,
}

#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize, Copy)]
#[serde(untagged)]
pub enum CallHierarchyServerCapability {
Simple(bool),
Expand Down Expand Up @@ -72,7 +72,7 @@ pub struct CallHierarchyItem {
/// Must be contained by the [`range`](#CallHierarchyItem.range).
pub selection_range: Range,

/// A data entry field that is preserved between a call hierarchy prepare and incloming calls or outgoing calls requests.
/// A data entry field that is preserved between a call hierarchy prepare and incoming calls or outgoing calls requests.
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<Value>,
}
Expand Down
26 changes: 13 additions & 13 deletions src/code_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,28 @@ pub struct CodeActionClientCapabilities {

/// Whether code action supports the `isPreferred` property.
///
/// since 3.15.0
/// @since 3.15.0
#[serde(skip_serializing_if = "Option::is_none")]
pub is_preferred_support: Option<bool>,

/// Whether code action supports the `disabled` property.
///
/// since 3.16.0
/// @since 3.16.0
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled_support: Option<bool>,

/// Whether code action supports the `data` property which is
/// preserved between a `textDocument/codeAction` and a
/// `codeAction/resolve` request.
///
/// since 3.16.0
/// @since 3.16.0
#[serde(skip_serializing_if = "Option::is_none")]
pub data_support: Option<bool>,

/// Whether the client supports resolving additional code action
/// properties via a separate `codeAction/resolve` request.
///
/// since 3.16.0
/// @since 3.16.0
#[serde(skip_serializing_if = "Option::is_none")]
pub resolve_support: Option<CodeActionCapabilityResolveSupport>,

Expand All @@ -79,9 +79,9 @@ pub struct CodeActionClientCapabilities {
}

/// Whether the client supports resolving additional code action
/// properties via a separate `codeAction/resolve` request.
/// properties via a separate `codeAction/resolve` request.
///
/// since 3.16.0
/// @since 3.16.0
#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeActionCapabilityResolveSupport {
Expand Down Expand Up @@ -137,8 +137,8 @@ pub enum CodeActionOrCommand {
}

impl From<Command> for CodeActionOrCommand {
fn from(comand: Command) -> Self {
CodeActionOrCommand::Command(comand)
fn from(command: Command) -> Self {
CodeActionOrCommand::Command(command)
}
}

Expand Down Expand Up @@ -263,7 +263,7 @@ pub struct CodeAction {
/// A quick fix should be marked preferred if it properly addresses the underlying error.
/// A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
///
/// since 3.15.0
/// @since 3.15.0
#[serde(skip_serializing_if = "Option::is_none")]
pub is_preferred: Option<bool>,

Expand All @@ -282,14 +282,14 @@ pub struct CodeAction {
/// actions are returned, the client should show the user an error message with `reason`
/// in the editor.
///
/// since 3.16.0
/// @since 3.16.0
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled: Option<CodeActionDisabled>,

/// A data entry field that is preserved on a code action between
/// a `textDocument/codeAction` and a `codeAction/resolve` request.
///
/// since 3.16.0
/// @since 3.16.0
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<Value>,
}
Expand Down Expand Up @@ -344,7 +344,7 @@ pub struct CodeActionContext {
pub trigger_kind: Option<CodeActionTriggerKind>,
}

#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CodeActionOptions {
/// CodeActionKinds that this server may return.
Expand All @@ -360,7 +360,7 @@ pub struct CodeActionOptions {
/// The server provides support to resolve additional
/// information for a code action.
///
/// since 3.16.0
/// @since 3.16.0
#[serde(skip_serializing_if = "Option::is_none")]
pub resolve_provider: Option<bool>,
}
Expand Down
2 changes: 1 addition & 1 deletion src/code_lens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
pub type CodeLensClientCapabilities = DynamicRegistrationClientCapabilities;

/// Code Lens options.
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize, Copy)]
#[serde(rename_all = "camelCase")]
pub struct CodeLensOptions {
/// Code lens has a resolve provider as well.
Expand Down
2 changes: 1 addition & 1 deletion src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub struct ColorInformation {
pub color: Color,
}

#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize, Copy)]
#[serde(rename_all = "camelCase")]
pub struct Color {
/// The red component of this color in the range [0-1].
Expand Down
2 changes: 1 addition & 1 deletion src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ pub struct CompletionClientCapabilities {
pub completion_item_kind: Option<CompletionItemKindCapability>,

/// The client supports to send additional context information for a
/// `textDocument/completion` requestion.
/// `textDocument/completion` request.
#[serde(skip_serializing_if = "Option::is_none")]
pub context_support: Option<bool>,

Expand Down
2 changes: 1 addition & 1 deletion src/document_highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct DocumentHighlight {
pub struct DocumentHighlightKind(i32);
lsp_enum! {
impl DocumentHighlightKind {
/// A textual occurrance.
/// A textual occurrence.
pub const TEXT: DocumentHighlightKind = DocumentHighlightKind(1);

/// Read-access of a symbol, like reading a variable.
Expand Down
6 changes: 4 additions & 2 deletions src/document_symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ pub struct DocumentSymbol {
/// The kind of this symbol.
pub kind: SymbolKind,
/// Tags for this completion item.
/// since 3.16.0
///
/// @since 3.15.0
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<SymbolTag>>,
/// Indicates if this symbol is deprecated.
Expand Down Expand Up @@ -114,7 +115,8 @@ pub struct SymbolInformation {
pub kind: SymbolKind,

/// Tags for this completion item.
/// since 3.16.0
///
/// @since 3.16.0
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<SymbolTag>>,

Expand Down
8 changes: 4 additions & 4 deletions src/file_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ pub struct FileOperationFilter {
}

/// A pattern kind describing if a glob pattern matches a file a folder or
/// both.
/// both.
///
/// @since 3.16.0
/// @since 3.16.0
#[derive(Debug, Eq, PartialEq, Deserialize, Serialize, Clone)]
#[serde(rename_all = "lowercase")]
pub enum FileOperationPatternKind {
Expand Down Expand Up @@ -147,9 +147,9 @@ pub struct FileOperationPattern {
}

/// The parameters sent in notifications/requests for user-initiated creation
/// of files.
/// of files.
///
/// @since 3.16.0
/// @since 3.16.0
#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CreateFilesParams {
Expand Down
1 change: 1 addition & 0 deletions src/folding_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ pub struct FoldingRangeClientCapabilities {
pub folding_range_kind: Option<FoldingRangeKindCapability>,

/// Specific options for the folding range.
///
/// @since 3.17.0
#[serde(skip_serializing_if = "Option::is_none")]
pub folding_range: Option<FoldingRangeCapability>,
Expand Down
2 changes: 1 addition & 1 deletion src/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct FormattingOptions {
#[serde(flatten)]
pub properties: HashMap<String, FormattingProperty>,

/// Trim trailing whitespaces on a line.
/// Trim trailing whitespace on a line.
#[serde(skip_serializing_if = "Option::is_none")]
pub trim_trailing_whitespace: Option<bool>,

Expand Down
Loading