mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
tree-wide: make rustdoc links spiky so they are clickable
This commit is contained in:
parent
660a89620f
commit
20b325c7d5
32 changed files with 37 additions and 37 deletions
|
@ -1,6 +1,6 @@
|
||||||
//! The condition expression used in `#[cfg(..)]` attributes.
|
//! The condition expression used in `#[cfg(..)]` attributes.
|
||||||
//!
|
//!
|
||||||
//! See: https://doc.rust-lang.org/reference/conditional-compilation.html#conditional-compilation
|
//! See: <https://doc.rust-lang.org/reference/conditional-compilation.html#conditional-compilation>
|
||||||
|
|
||||||
use std::{fmt, slice::Iter as SliceIter};
|
use std::{fmt, slice::Iter as SliceIter};
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ pub use dnf::DnfExpr;
|
||||||
/// `foo` and `bar` are both enabled. And here, we store key-value options as a set of tuple
|
/// `foo` and `bar` are both enabled. And here, we store key-value options as a set of tuple
|
||||||
/// of key and value in `key_values`.
|
/// of key and value in `key_values`.
|
||||||
///
|
///
|
||||||
/// See: https://doc.rust-lang.org/reference/conditional-compilation.html#set-configuration-options
|
/// See: <https://doc.rust-lang.org/reference/conditional-compilation.html#set-configuration-options>
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Default)]
|
#[derive(Debug, Clone, PartialEq, Eq, Default)]
|
||||||
pub struct CfgOptions {
|
pub struct CfgOptions {
|
||||||
enabled: FxHashSet<CfgAtom>,
|
enabled: FxHashSet<CfgAtom>,
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
//!
|
//!
|
||||||
//! `hir` is what insulates the "we don't know how to actually write an incremental compiler"
|
//! `hir` is what insulates the "we don't know how to actually write an incremental compiler"
|
||||||
//! from the ide with completions, hovers, etc. It is a (soft, internal) boundary:
|
//! from the ide with completions, hovers, etc. It is a (soft, internal) boundary:
|
||||||
//! https://www.tedinski.com/2018/02/06/system-boundaries.html.
|
//! <https://www.tedinski.com/2018/02/06/system-boundaries.html>.
|
||||||
|
|
||||||
#![recursion_limit = "512"]
|
#![recursion_limit = "512"]
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
//! > and we need to live with it because it's available on stable and widely relied upon.
|
//! > and we need to live with it because it's available on stable and widely relied upon.
|
||||||
//!
|
//!
|
||||||
//!
|
//!
|
||||||
//! See the full discussion : https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Eager.20expansion.20of.20built-in.20macros
|
//! See the full discussion : <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Eager.20expansion.20of.20built-in.20macros>
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
ast::{self, AstNode},
|
ast::{self, AstNode},
|
||||||
|
|
|
@ -53,7 +53,7 @@ mod test_db;
|
||||||
/// this is a recursive definition! However, the size_of of `HirFileId` is
|
/// this is a recursive definition! However, the size_of of `HirFileId` is
|
||||||
/// finite (because everything bottoms out at the real `FileId`) and small
|
/// finite (because everything bottoms out at the real `FileId`) and small
|
||||||
/// (`MacroCallId` uses the location interning. You can check details here:
|
/// (`MacroCallId` uses the location interning. You can check details here:
|
||||||
/// https://en.wikipedia.org/wiki/String_interning).
|
/// <https://en.wikipedia.org/wiki/String_interning>).
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
pub struct HirFileId(HirFileIdRepr);
|
pub struct HirFileId(HirFileIdRepr);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//! Based on rust-lang/rust 1.52.0-nightly (25c15cdbe 2021-04-22)
|
//! Based on rust-lang/rust 1.52.0-nightly (25c15cdbe 2021-04-22)
|
||||||
//! https://github.com/rust-lang/rust/blob/25c15cdbe/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
|
//! <https://github.com/rust-lang/rust/blob/25c15cdbe/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs>
|
||||||
//!
|
//!
|
||||||
//! -----
|
//! -----
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -80,7 +80,7 @@ enum ExprOrPatId {
|
||||||
impl_from!(ExprId, PatId for ExprOrPatId);
|
impl_from!(ExprId, PatId for ExprOrPatId);
|
||||||
|
|
||||||
/// Binding modes inferred for patterns.
|
/// Binding modes inferred for patterns.
|
||||||
/// https://doc.rust-lang.org/reference/patterns.html#binding-modes
|
/// <https://doc.rust-lang.org/reference/patterns.html#binding-modes>
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
enum BindingMode {
|
enum BindingMode {
|
||||||
Move,
|
Move,
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//! happen in certain places, e.g. weakening `&mut` to `&` or deref coercions
|
//! happen in certain places, e.g. weakening `&mut` to `&` or deref coercions
|
||||||
//! like going from `&Vec<T>` to `&[T]`.
|
//! like going from `&Vec<T>` to `&[T]`.
|
||||||
//!
|
//!
|
||||||
//! See https://doc.rust-lang.org/nomicon/coercions.html and
|
//! See <https://doc.rust-lang.org/nomicon/coercions.html> and
|
||||||
//! librustc_typeck/check/coercion.rs.
|
//! `librustc_typeck/check/coercion.rs`.
|
||||||
|
|
||||||
use chalk_ir::{cast::Cast, Mutability, TyVariableKind};
|
use chalk_ir::{cast::Cast, Mutability, TyVariableKind};
|
||||||
use hir_def::{expr::ExprId, lang_item::LangItemTarget};
|
use hir_def::{expr::ExprId, lang_item::LangItemTarget};
|
||||||
|
@ -331,7 +331,7 @@ impl<'a> InferenceContext<'a> {
|
||||||
|
|
||||||
/// Coerce a type using `from_ty: CoerceUnsized<ty_ty>`
|
/// Coerce a type using `from_ty: CoerceUnsized<ty_ty>`
|
||||||
///
|
///
|
||||||
/// See: https://doc.rust-lang.org/nightly/std/marker/trait.CoerceUnsized.html
|
/// See: <https://doc.rust-lang.org/nightly/std/marker/trait.CoerceUnsized.html>
|
||||||
fn try_coerce_unsized(&mut self, from_ty: &Ty, to_ty: &Ty) -> InferResult {
|
fn try_coerce_unsized(&mut self, from_ty: &Ty, to_ty: &Ty) -> InferResult {
|
||||||
// These 'if' statements require some explanation.
|
// These 'if' statements require some explanation.
|
||||||
// The `CoerceUnsized` trait is special - it is only
|
// The `CoerceUnsized` trait is special - it is only
|
||||||
|
|
|
@ -957,7 +957,7 @@ pub(crate) fn field_types_query(
|
||||||
/// like `T::Item`.
|
/// like `T::Item`.
|
||||||
///
|
///
|
||||||
/// See the analogous query in rustc and its comment:
|
/// See the analogous query in rustc and its comment:
|
||||||
/// https://github.com/rust-lang/rust/blob/9150f844e2624eb013ec78ca08c1d416e6644026/src/librustc_typeck/astconv.rs#L46
|
/// <https://github.com/rust-lang/rust/blob/9150f844e2624eb013ec78ca08c1d416e6644026/src/librustc_typeck/astconv.rs#L46>
|
||||||
/// This is a query mostly to handle cycles somewhat gracefully; e.g. the
|
/// This is a query mostly to handle cycles somewhat gracefully; e.g. the
|
||||||
/// following bounds are disallowed: `T: Foo<U::Item>, U: Foo<T::Item>`, but
|
/// following bounds are disallowed: `T: Foo<U::Item>, U: Foo<T::Item>`, but
|
||||||
/// these are fine: `T: Foo<U::Item>, U: Foo<()>`.
|
/// these are fine: `T: Foo<U::Item>, U: Foo<()>`.
|
||||||
|
|
|
@ -219,7 +219,7 @@ static KIND_TO_ATTRIBUTES: Lazy<FxHashMap<SyntaxKind, &[&str]>> = Lazy::new(|| {
|
||||||
});
|
});
|
||||||
const EXPR_ATTRIBUTES: &[&str] = attrs!();
|
const EXPR_ATTRIBUTES: &[&str] = attrs!();
|
||||||
|
|
||||||
/// https://doc.rust-lang.org/reference/attributes.html#built-in-attributes-index
|
/// <https://doc.rust-lang.org/reference/attributes.html#built-in-attributes-index>
|
||||||
// Keep these sorted for the binary search!
|
// Keep these sorted for the binary search!
|
||||||
const ATTRIBUTES: &[AttrCompletion] = &[
|
const ATTRIBUTES: &[AttrCompletion] = &[
|
||||||
attr("allow(…)", Some("allow"), Some("allow(${0:lint})")),
|
attr("allow(…)", Some("allow"), Some("allow(${0:lint})")),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! An NFA-based parser, which is porting from rustc mbe parsing code
|
//! An NFA-based parser, which is porting from rustc mbe parsing code
|
||||||
//!
|
//!
|
||||||
//! See https://github.com/rust-lang/rust/blob/70b18bc2cbac4712020019f5bf57c00905373205/compiler/rustc_expand/src/mbe/macro_parser.rs
|
//! See <https://github.com/rust-lang/rust/blob/70b18bc2cbac4712020019f5bf57c00905373205/compiler/rustc_expand/src/mbe/macro_parser.rs>
|
||||||
//! Here is a quick intro to how the parser works, copied from rustc:
|
//! Here is a quick intro to how the parser works, copied from rustc:
|
||||||
//!
|
//!
|
||||||
//! A 'position' is a dot in the middle of a matcher, usually represented as a
|
//! A 'position' is a dot in the middle of a matcher, usually represented as a
|
||||||
|
|
|
@ -208,7 +208,7 @@ struct Restrictions {
|
||||||
|
|
||||||
/// Binding powers of operators for a Pratt parser.
|
/// Binding powers of operators for a Pratt parser.
|
||||||
///
|
///
|
||||||
/// See https://www.oilshell.org/blog/2016/11/03.html
|
/// See <https://www.oilshell.org/blog/2016/11/03.html>
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
fn current_op(p: &Parser) -> (u8, SyntaxKind) {
|
fn current_op(p: &Parser) -> (u8, SyntaxKind) {
|
||||||
const NOT_AN_OP: (u8, SyntaxKind) = (0, T![@]);
|
const NOT_AN_OP: (u8, SyntaxKind) = (0, T![@]);
|
||||||
|
|
|
@ -244,7 +244,7 @@ impl RelPath {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Taken from https://github.com/rust-lang/cargo/blob/79c769c3d7b4c2cf6a93781575b7f592ef974255/src/cargo/util/paths.rs#L60-L85
|
/// Taken from <https://github.com/rust-lang/cargo/blob/79c769c3d7b4c2cf6a93781575b7f592ef974255/src/cargo/util/paths.rs#L60-L85>
|
||||||
fn normalize_path(path: &Path) -> PathBuf {
|
fn normalize_path(path: &Path) -> PathBuf {
|
||||||
let mut components = path.components().peekable();
|
let mut components = path.components().peekable();
|
||||||
let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() {
|
let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() {
|
||||||
|
|
|
@ -95,7 +95,7 @@ fn read_section<'a>(dylib_binary: &'a [u8], section_name: &str) -> io::Result<&'
|
||||||
/// * [version string bytes encoded in utf8] <- GET THIS BOI
|
/// * [version string bytes encoded in utf8] <- GET THIS BOI
|
||||||
/// * [some more bytes that we don really care but still there] :-)
|
/// * [some more bytes that we don really care but still there] :-)
|
||||||
/// Check this issue for more about the bytes layout:
|
/// Check this issue for more about the bytes layout:
|
||||||
/// https://github.com/rust-analyzer/rust-analyzer/issues/6174
|
/// <https://github.com/rust-analyzer/rust-analyzer/issues/6174>
|
||||||
fn read_version(dylib_path: &Path) -> io::Result<String> {
|
fn read_version(dylib_path: &Path) -> io::Result<String> {
|
||||||
let dylib_file = File::open(dylib_path)?;
|
let dylib_file = File::open(dylib_path)?;
|
||||||
let dylib_mmaped = unsafe { Mmap::map(&dylib_file) }?;
|
let dylib_mmaped = unsafe { Mmap::map(&dylib_file) }?;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! RA Proc Macro Server
|
//! RA Proc Macro Server
|
||||||
//!
|
//!
|
||||||
//! This library is able to call compiled Rust custom derive dynamic libraries on arbitrary code.
|
//! This library is able to call compiled Rust custom derive dynamic libraries on arbitrary code.
|
||||||
//! The general idea here is based on https://github.com/fedochet/rust-proc-macro-expander.
|
//! The general idea here is based on <https://github.com/fedochet/rust-proc-macro-expander>.
|
||||||
//!
|
//!
|
||||||
//! But we adapt it to better fit RA needs:
|
//! But we adapt it to better fit RA needs:
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! lib-proc-macro Buffer management for same-process client<->server communication.
|
//! lib-proc-macro Buffer management for same-process client<->server communication.
|
||||||
//!
|
//!
|
||||||
//! Copy from https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/buffer.rs
|
//! Copy from <https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/buffer.rs>
|
||||||
//! augmented with removing unstable features
|
//! augmented with removing unstable features
|
||||||
|
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! lib-proc-macro Client-side types.
|
//! lib-proc-macro Client-side types.
|
||||||
//!
|
//!
|
||||||
//! Copy from https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/client.rs
|
//! Copy from <https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/client.rs>
|
||||||
//! augmented with removing unstable features
|
//! augmented with removing unstable features
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! lib-proc-macro Closure type (equivalent to `&mut dyn FnMut(A) -> R`) that's `repr(C)`.
|
//! lib-proc-macro Closure type (equivalent to `&mut dyn FnMut(A) -> R`) that's `repr(C)`.
|
||||||
//!
|
//!
|
||||||
//! Copy from https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/closure.rs#
|
//! Copy from <https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/closure.rs>
|
||||||
//! augmented with removing unstable features
|
//! augmented with removing unstable features
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! lib-proc-macro Server-side handles and storage for per-handle data.
|
//! lib-proc-macro Server-side handles and storage for per-handle data.
|
||||||
//!
|
//!
|
||||||
//! Copy from https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/handle.rs
|
//! Copy from <https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/handle.rs>
|
||||||
//! augmented with removing unstable features
|
//! augmented with removing unstable features
|
||||||
|
|
||||||
use std::collections::{BTreeMap, HashMap};
|
use std::collections::{BTreeMap, HashMap};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! lib-proc-macro Internal interface for communicating between a `proc_macro` client
|
//! lib-proc-macro Internal interface for communicating between a `proc_macro` client
|
||||||
//!
|
//!
|
||||||
//! Copy from https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/mod.rs
|
//! Copy from <https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/mod.rs>
|
||||||
//! augmented with removing unstable features
|
//! augmented with removing unstable features
|
||||||
//!
|
//!
|
||||||
//! Internal interface for communicating between a `proc_macro` client
|
//! Internal interface for communicating between a `proc_macro` client
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! lib-proc-macro Serialization for client-server communication.
|
//! lib-proc-macro Serialization for client-server communication.
|
||||||
//!
|
//!
|
||||||
//! Copy from https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/rpc.rs
|
//! Copy from <https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/rpc.rs>
|
||||||
//! augmented with removing unstable features
|
//! augmented with removing unstable features
|
||||||
//!
|
//!
|
||||||
//! Serialization for client-server communication.
|
//! Serialization for client-server communication.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! lib-proc-macro `Cell` variant for (scoped) existential lifetimes.
|
//! lib-proc-macro `Cell` variant for (scoped) existential lifetimes.
|
||||||
//!
|
//!
|
||||||
//! Copy from https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/scoped_cell.rs#L1
|
//! Copy from <https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/scoped_cell.rs#L1>
|
||||||
//! augmented with removing unstable features
|
//! augmented with removing unstable features
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! lib-proc-macro server-side traits
|
//! lib-proc-macro server-side traits
|
||||||
//!
|
//!
|
||||||
//! Copy from https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/server.rs
|
//! Copy from <https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/bridge/server.rs>
|
||||||
//! augmented with removing unstable features
|
//! augmented with removing unstable features
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! lib-proc-macro diagnostic
|
//! lib-proc-macro diagnostic
|
||||||
//!
|
//!
|
||||||
//! Copy from https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/diagnostic.rs
|
//! Copy from <https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/diagnostic.rs>
|
||||||
//! augmented with removing unstable features
|
//! augmented with removing unstable features
|
||||||
|
|
||||||
use crate::proc_macro::Span;
|
use crate::proc_macro::Span;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! lib-proc-macro main module
|
//! lib-proc-macro main module
|
||||||
//!
|
//!
|
||||||
//! Copy from https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/lib.rs
|
//! Copy from <https://github.com/rust-lang/rust/blob/6050e523bae6de61de4e060facc43dc512adaccd/src/libproc_macro/lib.rs>
|
||||||
//! augmented with removing unstable features
|
//! augmented with removing unstable features
|
||||||
|
|
||||||
// NOTE(@edwin0cheng):
|
// NOTE(@edwin0cheng):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! Rustc proc-macro server implementation with tt
|
//! Rustc proc-macro server implementation with tt
|
||||||
//!
|
//!
|
||||||
//! Based on idea from https://github.com/fedochet/rust-proc-macro-expander
|
//! Based on idea from <https://github.com/fedochet/rust-proc-macro-expander>
|
||||||
//! The lib-proc-macro server backend is `TokenStream`-agnostic, such that
|
//! The lib-proc-macro server backend is `TokenStream`-agnostic, such that
|
||||||
//! we could provide any TokenStream implementation.
|
//! we could provide any TokenStream implementation.
|
||||||
//! The original idea from fedochet is using proc-macro2 as backend,
|
//! The original idea from fedochet is using proc-macro2 as backend,
|
||||||
|
|
|
@ -50,10 +50,10 @@ impl Drop for Scope {
|
||||||
/// A wrapper around google_cpu_profiler.
|
/// A wrapper around google_cpu_profiler.
|
||||||
///
|
///
|
||||||
/// Usage:
|
/// Usage:
|
||||||
/// 1. Install gpref_tools (https://github.com/gperftools/gperftools), probably packaged with your Linux distro.
|
/// 1. Install gpref_tools (<https://github.com/gperftools/gperftools>), probably packaged with your Linux distro.
|
||||||
/// 2. Build with `cpu_profiler` feature.
|
/// 2. Build with `cpu_profiler` feature.
|
||||||
/// 3. Run the code, the *raw* output would be in the `./out.profile` file.
|
/// 3. Run the code, the *raw* output would be in the `./out.profile` file.
|
||||||
/// 4. Install pprof for visualization (https://github.com/google/pprof).
|
/// 4. Install pprof for visualization (<https://github.com/google/pprof>).
|
||||||
/// 5. Bump sampling frequency to once per ms: `export CPUPROFILE_FREQUENCY=1000`
|
/// 5. Bump sampling frequency to once per ms: `export CPUPROFILE_FREQUENCY=1000`
|
||||||
/// 6. Use something like `pprof -svg target/release/rust-analyzer ./out.profile` to see the results.
|
/// 6. Use something like `pprof -svg target/release/rust-analyzer ./out.profile` to see the results.
|
||||||
///
|
///
|
||||||
|
@ -75,7 +75,7 @@ impl Drop for Scope {
|
||||||
///
|
///
|
||||||
/// See this diff for how to profile completions:
|
/// See this diff for how to profile completions:
|
||||||
///
|
///
|
||||||
/// https://github.com/rust-analyzer/rust-analyzer/pull/5306
|
/// <https://github.com/rust-analyzer/rust-analyzer/pull/5306>
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct CpuSpan {
|
pub struct CpuSpan {
|
||||||
_private: (),
|
_private: (),
|
||||||
|
|
|
@ -112,7 +112,7 @@ impl ops::BitOrAssign<SemanticTokenModifier> for ModifierSet {
|
||||||
|
|
||||||
/// Tokens are encoded relative to each other.
|
/// Tokens are encoded relative to each other.
|
||||||
///
|
///
|
||||||
/// This is a direct port of https://github.com/microsoft/vscode-languageserver-node/blob/f425af9de46a0187adb78ec8a46b9b2ce80c5412/server/src/sematicTokens.proposed.ts#L45
|
/// This is a direct port of <https://github.com/microsoft/vscode-languageserver-node/blob/f425af9de46a0187adb78ec8a46b9b2ce80c5412/server/src/sematicTokens.proposed.ts#L45>
|
||||||
pub(crate) struct SemanticTokensBuilder {
|
pub(crate) struct SemanticTokensBuilder {
|
||||||
id: String,
|
id: String,
|
||||||
prev_line: u32,
|
prev_line: u32,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! A micro-crate to enhance panic messages with context info.
|
//! A micro-crate to enhance panic messages with context info.
|
||||||
//!
|
//!
|
||||||
//! FIXME: upstream to https://github.com/kriomant/panic-context ?
|
//! FIXME: upstream to <https://github.com/kriomant/panic-context> ?
|
||||||
|
|
||||||
use std::{cell::RefCell, panic, sync::Once};
|
use std::{cell::RefCell, panic, sync::Once};
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Read both stdout and stderr of child without deadlocks.
|
//! Read both stdout and stderr of child without deadlocks.
|
||||||
//!
|
//!
|
||||||
//! https://github.com/rust-lang/cargo/blob/905af549966f23a9288e9993a85d1249a5436556/crates/cargo-util/src/read2.rs
|
//! <https://github.com/rust-lang/cargo/blob/905af549966f23a9288e9993a85d1249a5436556/crates/cargo-util/src/read2.rs>
|
||||||
//! https://github.com/rust-lang/cargo/blob/58a961314437258065e23cb6316dfc121d96fb71/crates/cargo-util/src/process_builder.rs#L231
|
//! <https://github.com/rust-lang/cargo/blob/58a961314437258065e23cb6316dfc121d96fb71/crates/cargo-util/src/process_builder.rs#L231>
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
io,
|
io,
|
||||||
|
|
|
@ -133,7 +133,7 @@ impl<'a> TokenTreeRef<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A safe version of `Cursor` from `syn` crate https://github.com/dtolnay/syn/blob/6533607f91686545cb034d2838beea338d9d0742/src/buffer.rs#L125
|
/// A safe version of `Cursor` from `syn` crate <https://github.com/dtolnay/syn/blob/6533607f91686545cb034d2838beea338d9d0742/src/buffer.rs#L125>
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct Cursor<'a> {
|
pub struct Cursor<'a> {
|
||||||
buffer: &'a TokenBuffer<'a>,
|
buffer: &'a TokenBuffer<'a>,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! See https://github.com/matklad/cargo-xtask/.
|
//! See <https://github.com/matklad/cargo-xtask/>.
|
||||||
//!
|
//!
|
||||||
//! This binary defines various auxiliary build commands, which are not
|
//! This binary defines various auxiliary build commands, which are not
|
||||||
//! expressible with just `cargo`. Notably, it provides tests via `cargo test -p xtask`
|
//! expressible with just `cargo`. Notably, it provides tests via `cargo test -p xtask`
|
||||||
|
|
Loading…
Reference in a new issue