Skip to content

Commit

Permalink
Document positional encoding fallback in LSP server initialization
Browse files Browse the repository at this point in the history
Reviewed By: captbaritone

Differential Revision: D63918136

fbshipit-source-id: d8daf5cbcabe861d0b4ba37bb0c58e939d4c7335
  • Loading branch information
gordyf authored and facebook-github-bot committed Oct 4, 2024
1 parent 266af92 commit cfcd3bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/crates/relay-lsp/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ pub use crate::LSPExtraDataProvider;
/// Initializes an LSP connection, handling the `initialize` message and `initialized` notification
/// handshake.
pub fn initialize(connection: &Connection) -> LSPProcessResult<InitializeParams> {
// We don't currently negotiate character encoding in the Relay LSP.
// This means we fall back to the LSP default of UTF-16, but we make no effort to
// ensure that the LSP positions we emit are actually representing the source text as UTF-16.
// This is a possible source of positioning issues, but in lieu of having a reproducible bug,
// we're leaving it how it is for now.

let server_capabilities = ServerCapabilities {
// Enable text document syncing so we can know when files are opened/changed/saved/closed
text_document_sync: Some(TextDocumentSyncCapability::Kind(TextDocumentSyncKind::FULL)),
Expand Down

0 comments on commit cfcd3bb

Please sign in to comment.