Skip to content

Commit

Permalink
document offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad committed Feb 14, 2021
1 parent bdddf4d commit 796e64d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env_logger = { version = "0.8.1", default-features = false }
itertools = "0.10.0"
jod-thread = "0.1.0"
log = "0.4.8"
lsp-types = { git = "https://github.com/matklad/lsp-types", features = ["proposed"], branch = "offset-encoding" }
lsp-types = { version = "0.87", features = ["proposed"] }
parking_lot = "0.11.0"
pico-args = "0.4.0"
oorandom = "11.1.2"
Expand Down
2 changes: 2 additions & 0 deletions crates/rust-analyzer/src/caps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ pub fn server_capabilities(client_caps: &ClientCapabilities) -> ServerCapabiliti
resolve_provider: completions_resolve_provider(client_caps),
trigger_characters: Some(vec![":".to_string(), ".".to_string()]),
work_done_progress_options: WorkDoneProgressOptions { work_done_progress: None },
all_commit_characters: None,
completion_item: None,
}),
signature_help_provider: Some(SignatureHelpOptions {
trigger_characters: Some(vec!["(".to_string(), ",".to_string()]),
Expand Down
8 changes: 7 additions & 1 deletion docs/dev/lsp-extensions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
lsp_ext.rs hash: 34aec6bfeaeb97a
lsp_ext.rs hash: d279d971d4f62cd7
If you need to change the above hash to make the test pass, please check if you
need to adjust this doc as well and ping this issue:
Expand All @@ -19,6 +19,12 @@ Requests, which are likely to always remain specific to `rust-analyzer` are unde

If you want to be notified about the changes to this document, subscribe to [#4604](https://github.com/rust-analyzer/rust-analyzer/issues/4604).

## UTF-8 offsets

rust-analyzer supports clangd's extension for opting into UTF-8 as the coordinate space for offsets (by default, LSP uses UTF-16 offsets).

https://clangd.llvm.org/extensions.html#utf-8-offsets

## `initializationOptions`

For `initializationOptions`, `rust-analyzer` expects `"rust-analyzer"` section of the configuration.
Expand Down

0 comments on commit 796e64d

Please sign in to comment.