Skip to content
Open
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
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion crates/ark/src/lsp/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use aether_lsp_utils::proto::PositionEncoding;
use biome_line_index::WideEncoding;
use serde::Deserialize;
use serde::Serialize;
use serde_json::Value;
Expand Down Expand Up @@ -81,11 +83,27 @@ pub static DOCUMENT_SETTINGS: &[Setting<DocumentConfig>] = &[
];

/// Configuration of the LSP
#[derive(Clone, Default, Debug)]
#[derive(Clone, Debug)]
pub(crate) struct LspConfig {
pub(crate) diagnostics: DiagnosticsConfig,
pub(crate) symbols: SymbolsConfig,
pub(crate) workspace_symbols: WorkspaceSymbolsConfig,

/// Session-wide position encoding for offset <-> LSP-position conversion.
/// One value for the whole session, not per document. Hard-coded to UTF-16,
/// the encoding we advertise at `initialize`.
pub(crate) position_encoding: PositionEncoding,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I generally agree with this, but can we actually implement what it says?

i.e. go ahead and remove position_encoding from Document. It does not look too hard, as every usage of document.position_encoding seems very close to an LSP boundary where you have the WorldState available.

}

impl Default for LspConfig {
fn default() -> Self {
Self {
diagnostics: DiagnosticsConfig::default(),
symbols: SymbolsConfig::default(),
workspace_symbols: WorkspaceSymbolsConfig::default(),
position_encoding: PositionEncoding::Wide(WideEncoding::Utf16),
}
}
}

#[derive(Serialize, Deserialize, Clone, Debug, Default)]
Expand Down
Loading
Loading