repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/configuration/parse/json/json_configuration.rs | crates/rome_service/src/configuration/parse/json/json_configuration.rs | use crate::configuration::json::{JsonConfiguration, JsonParser};
use rome_deserialize::json::{has_only_known_keys, VisitJsonNode};
use rome_deserialize::{DeserializationDiagnostic, VisitNode};
use rome_json_syntax::{JsonLanguage, JsonSyntaxNode};
use rome_rowan::SyntaxNode;
impl VisitJsonNode for JsonConfiguration {}... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/configuration/parse/json/vcs.rs | crates/rome_service/src/configuration/parse/json/vcs.rs | use crate::configuration::vcs::{VcsClientKind, VcsConfiguration};
use rome_console::markup;
use rome_deserialize::json::{has_only_known_keys, with_only_known_variants, VisitJsonNode};
use rome_deserialize::{DeserializationDiagnostic, VisitNode};
use rome_json_syntax::{AnyJsonValue, JsonLanguage};
use rome_rowan::{AstNo... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/configuration/parse/json/organize_imports.rs | crates/rome_service/src/configuration/parse/json/organize_imports.rs | use crate::configuration::organize_imports::OrganizeImports;
use rome_deserialize::json::{has_only_known_keys, VisitJsonNode};
use rome_deserialize::{DeserializationDiagnostic, StringSet, VisitNode};
use rome_json_syntax::{JsonLanguage, JsonSyntaxNode};
use rome_rowan::SyntaxNode;
impl VisitJsonNode for OrganizeImport... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/configuration/parse/json/mod.rs | crates/rome_service/src/configuration/parse/json/mod.rs | //! This module is responsible to parse the configuration from a JSON format
//!
mod configuration;
mod files;
mod formatter;
mod javascript;
mod json_configuration;
mod linter;
mod organize_imports;
mod rules;
mod vcs;
use crate::Configuration;
use rome_deserialize::json::{JsonDeserialize, VisitJsonNode};
use rome_d... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/configuration/parse/json/files.rs | crates/rome_service/src/configuration/parse/json/files.rs | use crate::configuration::FilesConfiguration;
use rome_deserialize::json::{has_only_known_keys, VisitJsonNode};
use rome_deserialize::{DeserializationDiagnostic, StringSet, VisitNode};
use rome_json_syntax::JsonLanguage;
use rome_rowan::SyntaxNode;
use std::num::NonZeroU64;
impl VisitJsonNode for FilesConfiguration {}... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/configuration/parse/json/rules.rs | crates/rome_service/src/configuration/parse/json/rules.rs | //! Generated file, do not edit by hand, see `xtask/codegen`
use crate::configuration::linter::*;
use crate::configuration::parse::json::linter::are_recommended_and_all_correct;
use crate::Rules;
use rome_deserialize::json::{has_only_known_keys, VisitJsonNode};
use rome_deserialize::{DeserializationDiagnostic, VisitNo... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | true |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/configuration/parse/json/formatter.rs | crates/rome_service/src/configuration/parse/json/formatter.rs | use crate::configuration::{FormatterConfiguration, PlainIndentStyle};
use rome_console::markup;
use rome_deserialize::json::{has_only_known_keys, with_only_known_variants, VisitJsonNode};
use rome_deserialize::{DeserializationDiagnostic, StringSet, VisitNode};
use rome_formatter::LineWidth;
use rome_json_syntax::{JsonL... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/configuration/linter/mod.rs | crates/rome_service/src/configuration/linter/mod.rs | #[rustfmt::skip]
mod rules;
pub use crate::configuration::linter::rules::{rules, Rules};
use crate::configuration::merge::MergeWith;
use crate::settings::LinterSettings;
use crate::{ConfigurationDiagnostic, MatchOptions, Matcher, WorkspaceError};
use bpaf::Bpaf;
use rome_deserialize::StringSet;
use rome_diagnostics::S... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/configuration/linter/rules.rs | crates/rome_service/src/configuration/linter/rules.rs | //! Generated file, do not edit by hand, see `xtask/codegen`
use crate::RuleConfiguration;
use bpaf::Bpaf;
use indexmap::IndexSet;
use rome_analyze::RuleFilter;
use rome_diagnostics::{Category, Severity};
#[cfg(feature = "schema")]
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Se... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | true |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/file_handlers/javascript.rs | crates/rome_service/src/file_handlers/javascript.rs | use super::{
AnalyzerCapabilities, DebugCapabilities, ExtensionHandler, FormatterCapabilities, LintParams,
LintResults, Mime, ParserCapabilities,
};
use crate::configuration::to_analyzer_configuration;
use crate::file_handlers::{is_diagnostic_error, Features, FixAllParams, Language as LanguageId};
use crate::wo... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/file_handlers/unknown.rs | crates/rome_service/src/file_handlers/unknown.rs | use super::ExtensionHandler;
#[derive(Debug, Default, PartialEq, Eq)]
pub(crate) struct UnknownFileHandler {}
impl ExtensionHandler for UnknownFileHandler {
fn language(&self) -> super::Language {
super::Language::Unknown
}
fn mime(&self) -> super::Mime {
super::Mime::Text
}
fn m... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/file_handlers/json.rs | crates/rome_service/src/file_handlers/json.rs | use super::{ExtensionHandler, Mime};
use crate::configuration::to_analyzer_configuration;
use crate::file_handlers::javascript::JsonParserSettings;
use crate::file_handlers::{
AnalyzerCapabilities, Capabilities, FixAllParams, FormatterCapabilities, LintParams,
LintResults, ParserCapabilities,
};
use crate::file... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/src/file_handlers/mod.rs | crates/rome_service/src/file_handlers/mod.rs | use self::{javascript::JsFileHandler, json::JsonFileHandler, unknown::UnknownFileHandler};
use crate::workspace::{FixFileMode, OrganizeImportsResult};
use crate::{
settings::SettingsHandle,
workspace::{FixFileResult, GetSyntaxTreeResult, PullActionsResult, RenameResult},
Rules, WorkspaceError,
};
pub use ja... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/tests/workspace.rs | crates/rome_service/tests/workspace.rs | use rome_fs::RomePath;
use rome_js_syntax::TextSize;
use rome_service::workspace::{server, FileGuard, Language, OpenFileParams};
#[test]
fn debug_control_flow() {
const SOURCE: &str = "function test () { return; }";
const GRAPH: &str = "flowchart TB
block_0[\"<b>block_0</b><br/>Return(JS_RETURN_STATEMENT 1... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_service/tests/spec_tests.rs | crates/rome_service/tests/spec_tests.rs | use rome_deserialize::json::deserialize_from_json_str;
use rome_diagnostics::{print_diagnostic_to_string, DiagnosticExt};
use rome_json_parser::JsonParserOptions;
use rome_service::Configuration;
use std::ffi::OsStr;
use std::fs::read_to_string;
use std::path::Path;
tests_macros::gen_tests! {"tests/invalid/*.{json}", c... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/shared_traits.rs | crates/rome_formatter/shared_traits.rs | // Code that must be included in every language specific formatter crate. Redefining these types
// in every formatter crate is necessary because of Rust's orphan rule that prohibits implementing
// unowned traits (traits defined in this file) on unowned types (node types)
/// Used to get an object that knows how to f... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/source_map.rs | crates/rome_formatter/src/source_map.rs | use crate::{Printed, SourceMarker, TextRange};
use rome_rowan::TextLen;
use rome_rowan::{Language, SyntaxNode, TextSize};
use rustc_hash::FxHashMap;
use std::cmp::Ordering;
use std::iter::FusedIterator;
/// A source map for mapping positions of a pre-processed tree back to the locations in the source tree.
///
/// Thi... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/diagnostics.rs | crates/rome_formatter/src/diagnostics.rs | use crate::prelude::TagKind;
use rome_console::fmt::Formatter;
use rome_console::markup;
use rome_diagnostics::{category, Category, Diagnostic, DiagnosticTags, Location, Severity};
use rome_rowan::{SyntaxError, TextRange};
use std::error::Error;
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
#[cfg_attr(feature = "serde"... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/prelude.rs | crates/rome_formatter/src/prelude.rs | pub use crate::builders::*;
pub use crate::format_element::*;
pub use crate::format_extensions::{MemoizeFormat, Memoized};
pub use crate::formatter::Formatter;
pub use crate::printer::PrinterOptions;
pub use crate::trivia::{
format_dangling_comments, format_leading_comments, format_only_if_breaks, format_removed,
... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/lib.rs | crates/rome_formatter/src/lib.rs | //! Infrastructure for code formatting
//!
//! This module defines [FormatElement], an IR to format code documents and provides a mean to print
//! such a document to a string. Objects that know how to format themselves implement the [Format] trait.
//!
//! ## Formatting Traits
//!
//! * [Format]: Implemented by object... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | true |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/comments.rs | crates/rome_formatter/src/comments.rs | //! Types for extracting and representing comments of a syntax tree.
//!
//! Most programming languages support comments allowing programmers to document their programs. Comments are different from other syntaxes because programming languages allow comments in almost any position, giving programmers great flexibility ... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | true |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/format_extensions.rs | crates/rome_formatter/src/format_extensions.rs | use crate::prelude::*;
use std::cell::RefCell;
use std::marker::PhantomData;
use std::ops::Deref;
use crate::Buffer;
/// Utility trait that allows memorizing the output of a [Format].
/// Useful to avoid re-formatting the same object twice.
pub trait MemoizeFormat<Context> {
/// Returns a formattable object that ... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/arguments.rs | crates/rome_formatter/src/arguments.rs | use super::{Buffer, Format, Formatter};
use crate::FormatResult;
use std::ffi::c_void;
use std::marker::PhantomData;
/// Mono-morphed type to format an object. Used by the [crate::format!], [crate::format_args!], and
/// [crate::write!] macros.
///
/// This struct is similar to a dynamic dispatch (using `dyn Format`) ... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/trivia.rs | crates/rome_formatter/src/trivia.rs | //! Provides builders for comments and skipped token trivia.
use crate::format_element::tag::VerbatimKind;
use crate::prelude::*;
use crate::{
comments::{CommentKind, CommentStyle},
write, Argument, Arguments, CstFormatContext, FormatRefWithRule, GroupId, SourceComment,
TextRange,
};
use rome_rowan::{Langu... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/builders.rs | crates/rome_formatter/src/builders.rs | use crate::format_element::tag::{Condition, Tag};
use crate::prelude::tag::{DedentMode, GroupMode, LabelId};
use crate::prelude::*;
use crate::{format_element, write, Argument, Arguments, GroupId, TextRange, TextSize};
use crate::{Buffer, VecBuffer};
use rome_rowan::{Language, SyntaxNode, SyntaxToken, TextLen, TokenTex... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | true |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/macros.rs | crates/rome_formatter/src/macros.rs | /// Constructs the parameters for other formatting macros.
///
/// This macro functions by taking a list of objects implementing [crate::Format]. It canonicalize the
/// arguments into a single type.
///
/// This macro produces a value of type [crate::Arguments]. This value can be passed to
/// the macros within [crate... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/group_id.rs | crates/rome_formatter/src/group_id.rs | use std::num::NonZeroU32;
use std::sync::atomic::{AtomicU32, Ordering};
#[derive(Clone, Copy, Eq, PartialEq, Hash)]
pub struct DebugGroupId {
value: NonZeroU32,
name: &'static str,
}
impl DebugGroupId {
#[allow(unused)]
fn new(value: NonZeroU32, debug_name: &'static str) -> Self {
Self {
... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/verbatim.rs | crates/rome_formatter/src/verbatim.rs | use crate::format_element::tag::VerbatimKind;
use crate::prelude::*;
use crate::trivia::{FormatLeadingComments, FormatTrailingComments};
use crate::{write, CstFormatContext, FormatWithRule};
use rome_rowan::{AstNode, Direction, Language, SyntaxElement, SyntaxNode, TextRange};
/// "Formats" a node according to its orig... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/buffer.rs | crates/rome_formatter/src/buffer.rs | use super::{write, Arguments, FormatElement};
use crate::format_element::Interned;
use crate::prelude::LineMode;
use crate::{Format, FormatResult, FormatState};
use rustc_hash::FxHashMap;
use std::any::{Any, TypeId};
use std::fmt::Debug;
use std::ops::{Deref, DerefMut};
/// A trait for writing or formatting into [Form... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/formatter.rs | crates/rome_formatter/src/formatter.rs | use crate::buffer::BufferSnapshot;
use crate::builders::{FillBuilder, JoinBuilder, JoinNodesBuilder, Line};
use crate::prelude::*;
use crate::{
Arguments, Buffer, Comments, CstFormatContext, FormatContext, FormatState, FormatStateSnapshot,
GroupId, VecBuffer,
};
/// Handles the formatting of a CST and stores t... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/format_element.rs | crates/rome_formatter/src/format_element.rs | pub mod document;
pub mod tag;
use crate::format_element::tag::{LabelId, Tag};
use std::borrow::Cow;
use crate::{TagKind, TextSize};
#[cfg(target_pointer_width = "64")]
use rome_rowan::static_assert;
use rome_rowan::TokenText;
use std::hash::{Hash, Hasher};
use std::ops::Deref;
use std::rc::Rc;
/// Language agnostic... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/printed_tokens.rs | crates/rome_formatter/src/printed_tokens.rs | use indexmap::IndexSet;
use rome_rowan::{Direction, Language, SyntaxNode, SyntaxToken, TextSize};
/// Tracks the ranges of the formatted (including replaced or tokens formatted as verbatim) tokens.
///
/// This implementation uses the fact that no two tokens can have an overlapping range to avoid the need for an inter... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/separated.rs | crates/rome_formatter/src/separated.rs | use crate::prelude::*;
use crate::{write, CstFormatContext, GroupId};
use rome_rowan::{AstNode, AstSeparatedElement, SyntaxResult, SyntaxToken};
pub trait FormatSeparatedElementRule<N>
where
N: AstNode,
{
type Context;
type FormatNode<'a>: Format<Self::Context>
where
N: 'a;
type FormatSepar... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/comments/builder.rs | crates/rome_formatter/src/comments/builder.rs | use super::{
map::CommentsMap, CommentPlacement, CommentStyle, CommentTextPosition, DecoratedComment,
SourceComment, TransformSourceMap,
};
use crate::source_map::{DeletedRangeEntry, DeletedRanges};
use crate::{TextRange, TextSize};
use rome_rowan::syntax::SyntaxElementKey;
use rome_rowan::{
Direction, Lang... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | true |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/comments/map.rs | crates/rome_formatter/src/comments/map.rs | use countme::Count;
use rustc_hash::FxHashMap;
use std::fmt::{Debug, Formatter};
use std::iter::FusedIterator;
use std::num::NonZeroU32;
use std::ops::Range;
/// An optimized multi-map implementation for storing leading, dangling, and trailing parts for a key.
///
/// A naive implementation using three multimaps, one ... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/token/number.rs | crates/rome_formatter/src/token/number.rs | use crate::token::string::ToAsciiLowercaseCow;
use rome_rowan::{Language, SyntaxToken};
use std::borrow::Cow;
use std::num::NonZeroUsize;
use crate::prelude::*;
use crate::{CstFormatContext, Format};
pub fn format_number_token<L>(token: &SyntaxToken<L>) -> CleanedNumberLiteralText<L>
where
L: Language,
{
Clea... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/token/string.rs | crates/rome_formatter/src/token/string.rs | use std::borrow::Cow;
pub trait ToAsciiLowercaseCow {
/// Returns the same value as String::to_lowercase. The only difference
/// is that this functions returns ```Cow``` and does not allocate
/// if the string is already in lowercase.
fn to_ascii_lowercase_cow(&self) -> Cow<str>;
}
impl ToAsciiLowerc... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/token/mod.rs | crates/rome_formatter/src/token/mod.rs | pub mod number;
pub mod string;
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/format_element/document.rs | crates/rome_formatter/src/format_element/document.rs | use super::tag::Tag;
use crate::format_element::tag::DedentMode;
use crate::prelude::tag::GroupMode;
use crate::prelude::*;
use crate::printer::LineEnding;
use crate::{format, write};
use crate::{
BufferExtensions, Format, FormatContext, FormatElement, FormatOptions, FormatResult, Formatter,
IndentStyle, LineWi... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/format_element/tag.rs | crates/rome_formatter/src/format_element/tag.rs | use crate::format_element::PrintMode;
use crate::{GroupId, TextSize};
use std::cell::Cell;
use std::num::NonZeroU8;
/// A Tag marking the start and end of some content to which some special formatting should be applied.
///
/// Tags always come in pairs of a start and an end tag and the styling defined by this tag
///... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/printer/line_suffixes.rs | crates/rome_formatter/src/printer/line_suffixes.rs | use crate::printer::call_stack::PrintElementArgs;
use crate::FormatElement;
/// Stores the queued line suffixes.
#[derive(Debug, Default)]
pub(super) struct LineSuffixes<'a> {
suffixes: Vec<LineSuffixEntry<'a>>,
}
impl<'a> LineSuffixes<'a> {
/// Extends the line suffixes with `elements`, storing their call st... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/printer/call_stack.rs | crates/rome_formatter/src/printer/call_stack.rs | use crate::format_element::tag::TagKind;
use crate::format_element::PrintMode;
use crate::printer::stack::{Stack, StackedStack};
use crate::printer::Indention;
use crate::{IndentStyle, InvalidDocumentError, PrintError, PrintResult};
use std::fmt::Debug;
use std::num::NonZeroU8;
#[derive(Copy, Clone, Eq, PartialEq, Deb... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/printer/mod.rs | crates/rome_formatter/src/printer/mod.rs | mod call_stack;
mod line_suffixes;
mod printer_options;
mod queue;
mod stack;
pub use printer_options::*;
use crate::format_element::{BestFittingElement, LineMode, PrintMode};
use crate::{
ActualStart, FormatElement, GroupId, IndentStyle, InvalidDocumentError, PrintError,
PrintResult, Printed, SourceMarker, T... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | true |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/printer/stack.rs | crates/rome_formatter/src/printer/stack.rs | /// A school book stack. Allows adding, removing, and inspecting elements at the back.
pub(super) trait Stack<T> {
/// Removes the last element if any and returns it
fn pop(&mut self) -> Option<T>;
/// Pushes a new element at the back
fn push(&mut self, value: T);
/// Returns the last element if a... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/printer/queue.rs | crates/rome_formatter/src/printer/queue.rs | use crate::format_element::tag::TagKind;
use crate::prelude::Tag;
use crate::printer::stack::{Stack, StackedStack};
use crate::printer::{invalid_end_tag, invalid_start_tag};
use crate::{FormatElement, PrintResult};
use std::fmt::Debug;
use std::iter::FusedIterator;
use std::marker::PhantomData;
/// Queue of [FormatEle... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_formatter/src/printer/printer_options/mod.rs | crates/rome_formatter/src/printer/printer_options/mod.rs | use crate::{FormatOptions, IndentStyle, LineWidth};
/// Options that affect how the [crate::Printer] prints the format tokens
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct PrinterOptions {
/// Width of a single tab character (does it equal 2, 4, ... spaces?)
pub tab_width: u8,
/// What's the max width... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_js_transform/src/lib.rs | crates/rome_js_transform/src/lib.rs | mod declare_transformation;
mod registry;
mod transformers;
use crate::registry::visit_transformation_registry;
use rome_analyze::{
AnalysisFilter, Analyzer, AnalyzerContext, AnalyzerOptions, AnalyzerSignal, ControlFlow,
InspectMatcher, LanguageRoot, MatchQueryParams, MetadataRegistry, RuleRegistry,
};
use rom... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_js_transform/src/declare_transformation.rs | crates/rome_js_transform/src/declare_transformation.rs | #[macro_export]
macro_rules! declare_transformation {
( $( #[doc = $doc:literal] )+ $vis:vis $id:ident {
version: $version:literal,
name: $name:tt,
$( $key:ident: $value:expr, )*
} ) => {
$( #[doc = $doc] )*
$vis enum $id {}
impl ::rome_analyze::RuleMeta for $id ... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_js_transform/src/registry.rs | crates/rome_js_transform/src/registry.rs | use crate::transformers::ts_enum::TsEnum;
use rome_analyze::{GroupCategory, RegistryVisitor, RuleCategory, RuleGroup};
use rome_js_syntax::JsLanguage;
pub(crate) struct TransformationGroup;
pub(crate) struct TransformationCategory;
impl GroupCategory for TransformationCategory {
type Language = JsLanguage;
co... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_js_transform/src/transformers/mod.rs | crates/rome_js_transform/src/transformers/mod.rs | pub(crate) mod ts_enum;
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_js_transform/src/transformers/ts_enum.rs | crates/rome_js_transform/src/transformers/ts_enum.rs | use crate::{declare_transformation, JsBatchMutation};
use rome_analyze::context::RuleContext;
use rome_analyze::{Ast, Rule};
use rome_js_factory::make::{
ident, js_assignment_expression, js_call_argument_list, js_call_arguments, js_call_expression,
js_computed_member_assignment, js_decorator_list, js_directive_... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_js_transform/tests/spec_tests.rs | crates/rome_js_transform/tests/spec_tests.rs | use rome_analyze::{AnalysisFilter, AnalyzerTransformation, ControlFlow, Never, RuleFilter};
use rome_js_formatter::context::JsFormatOptions;
use rome_js_formatter::format_node;
use rome_js_parser::{parse, JsParserOptions};
use rome_js_syntax::{JsFileSource, JsLanguage};
use rome_rowan::AstNode;
use rome_test_utils::{
... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/tree_sink.rs | crates/rome_parser/src/tree_sink.rs | use crate::prelude::*;
use crate::token_source::Trivia;
use rome_rowan::{
Language, NodeCache, SyntaxFactory, SyntaxKind, SyntaxNode, TextRange, TextSize, TreeBuilder,
TriviaPiece,
};
/// An abstraction for syntax tree implementations
pub trait TreeSink {
type Kind: SyntaxKind;
/// Adds new token to t... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/event.rs | crates/rome_parser/src/event.rs | //! Events emitted by the Parser which are then constructed into a syntax tree
use std::mem;
use std::num::NonZeroU32;
use crate::diagnostic::ParseDiagnostic;
use crate::tree_sink::TreeSink;
use rome_rowan::{SyntaxKind, TextSize};
/// Events emitted by the Parser, these events are later
/// made into a syntax tree w... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/prelude.rs | crates/rome_parser/src/prelude.rs | pub use crate::diagnostic::{ParseDiagnostic, ToDiagnostic};
pub use crate::marker::{CompletedMarker, Marker};
pub use crate::parsed_syntax::ParsedSyntax;
pub use crate::token_source::{BumpWithContext, NthToken, TokenSource};
pub use crate::{token_set, TokenSet};
pub use crate::{Parser, SyntaxFeature};
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/lib.rs | crates/rome_parser/src/lib.rs | //! # Authoring Parse Rules
//!
//! This is a short, or not so short, guide to implement parse rules using the Rome parser infrastructure.
//!
//! ## Naming
//! The convention is to prefix your parse rule with `parse_` and then use the name defined in the grammar file.
//!
//! For example, `parse_for_statement` or `par... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/token_set.rs | crates/rome_parser/src/token_set.rs | use rome_rowan::SyntaxKind;
use std::marker::PhantomData;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct TokenSet<K: SyntaxKind>([u128; 2], PhantomData<K>);
impl<K: SyntaxKind> TokenSet<K> {
pub const EMPTY: TokenSet<K> = TokenSet([0; 2], PhantomData);
pub fn singleton(kind: K) -> Self {
uns... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/token_source.rs | crates/rome_parser/src/token_source.rs | use crate::diagnostic::ParseDiagnostic;
use rome_rowan::{SyntaxKind, TextRange, TextSize, TriviaPieceKind};
/// A comment or a whitespace trivia in the source code.
#[derive(Debug, Copy, Clone)]
pub struct Trivia {
/// The kind of the trivia token.
kind: TriviaPieceKind,
/// The range of the trivia in the... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/parse_lists.rs | crates/rome_parser/src/parse_lists.rs | //! A set of traits useful to parse various types of lists
use crate::parse_recovery::RecoveryResult;
use crate::prelude::*;
use crate::ParserProgress;
use rome_rowan::SyntaxKind;
/// Use this trait to parse simple lists that don't have particular requirements.
///
/// ```rust,ignore
/// use rome_js_parser::{ParseSep... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/parse_recovery.rs | crates/rome_parser/src/parse_recovery.rs | use crate::prelude::*;
use rome_rowan::SyntaxKind;
use std::error::Error;
use std::fmt::{Display, Formatter};
#[derive(Debug, Eq, PartialEq)]
pub enum RecoveryError {
/// Recovery failed because the parser reached the end of file
Eof,
/// Recovery failed because it didn't eat any tokens. Meaning, the pars... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/parsed_syntax.rs | crates/rome_parser/src/parsed_syntax.rs | use crate::parse_recovery::{ParseRecovery, RecoveryResult};
use crate::parsed_syntax::ParsedSyntax::{Absent, Present};
use crate::prelude::*;
use rome_rowan::TextRange;
/// Syntax that is either present in the source tree or absent.
///
/// This type is commonly used as the return type of parse functions with the foll... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/diagnostic.rs | crates/rome_parser/src/diagnostic.rs | use crate::token_source::TokenSource;
use crate::Parser;
use rome_diagnostics::console::fmt::Display;
use rome_diagnostics::console::{markup, MarkupBuf};
use rome_diagnostics::location::AsSpan;
use rome_diagnostics::{Advices, Diagnostic, Location, LogCategory, MessageAndDescription, Visit};
use rome_rowan::{SyntaxKind,... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_parser/src/marker.rs | crates/rome_parser/src/marker.rs | use crate::event::Event;
use crate::event::Event::Token;
use crate::token_source::TokenSource;
use crate::Parser;
use drop_bomb::DebugDropBomb;
use rome_rowan::{SyntaxKind, TextRange, TextSize};
use std::num::NonZeroU32;
/// A structure signifying the start of parsing of a syntax tree node
#[derive(Debug)]
#[must_use... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/adapters.rs | crates/rome_diagnostics/src/adapters.rs | //! This modules exposes a number of "adapter diagnostics" that wrap error types
//! such as [std::error::Error] or [std::io::Error] in newtypes implementing the
//! [Diagnostic] trait
use std::io;
use rome_console::{fmt, markup};
use crate::{category, Category, Diagnostic, DiagnosticTags};
/// Implements [Diagnost... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/serde.rs | crates/rome_diagnostics/src/serde.rs | use std::io;
use rome_console::{fmt, markup, MarkupBuf};
use rome_text_edit::TextEdit;
use rome_text_size::TextRange;
use serde::{
de::{self, SeqAccess},
Deserialize, Deserializer, Serialize, Serializer,
};
use crate::{
diagnostic::internal::AsDiagnostic, diagnostic::DiagnosticTag, Advices as _, Backtrace... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/lib.rs | crates/rome_diagnostics/src/lib.rs | #![deny(rust_2018_idioms)]
use ::serde::{Deserialize, Serialize};
pub mod adapters;
pub mod advice;
pub mod context;
pub mod diagnostic;
pub mod display;
pub mod error;
pub mod location;
pub mod panic;
pub mod serde;
mod suggestion;
pub use self::suggestion::{Applicability, CodeSuggestion};
pub use termcolor;
#[do... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/panic.rs | crates/rome_diagnostics/src/panic.rs | use std::panic::UnwindSafe;
#[derive(Default, Debug)]
pub struct PanicError {
pub info: String,
pub backtrace: Option<std::backtrace::Backtrace>,
}
thread_local! {
static LAST_PANIC: std::cell::Cell<Option<PanicError>> = std::cell::Cell::new(None);
}
impl std::fmt::Display for PanicError {
fn fmt(&se... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/error.rs | crates/rome_diagnostics/src/error.rs | //! The `error` module contains the implementation of [Error], a dynamic
//! container struct for any type implementing [Diagnostic].
//!
//! We reduce the size of `Error` by using `Box<Box<dyn Diagnostic>>` (a thin
//! pointer to a fat pointer) rather than `Box<dyn Diagnostic>` (a fat
//! pointer), in order to make re... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/display.rs | crates/rome_diagnostics/src/display.rs | use std::{io, iter};
use rome_console::{fmt, markup, HorizontalLine, Markup, MarkupBuf, MarkupElement, MarkupNode};
use rome_text_edit::TextEdit;
use unicode_width::UnicodeWidthStr;
mod backtrace;
mod diff;
mod frame;
mod message;
use crate::display::frame::SourceFile;
use crate::{
diagnostic::internal::AsDiagno... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/advice.rs | crates/rome_diagnostics/src/advice.rs | use crate::Applicability;
use crate::{
display::Backtrace,
location::{AsResource, AsSourceCode, AsSpan},
Location,
};
use rome_console::fmt::{self, Display};
use rome_console::markup;
use rome_text_edit::TextEdit;
use serde::{Deserialize, Serialize};
use std::io;
/// Trait implemented by types that support... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/location.rs | crates/rome_diagnostics/src/location.rs | use rome_text_size::{TextRange, TextSize};
use serde::{Deserialize, Serialize};
use std::fmt::Debug;
use std::ops::Range;
use std::{borrow::Borrow, ops::Deref};
/// Represents the location of a diagnostic in a resource.
#[derive(Debug, Clone, Copy)]
pub struct Location<'a> {
/// The resource this diagnostic is ass... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/context.rs | crates/rome_diagnostics/src/context.rs | use rome_console::fmt;
use crate::context::internal::{SeverityDiagnostic, TagsDiagnostic};
use crate::{
diagnostic::internal::AsDiagnostic,
location::{AsResource, AsSourceCode, AsSpan},
Category, DiagnosticTags, Error, Resource, Severity, SourceCode,
};
/// This trait is implemented for all types implemen... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/suggestion.rs | crates/rome_diagnostics/src/suggestion.rs | use ::serde::{Deserialize, Serialize};
use rome_console::MarkupBuf;
use rome_rowan::TextRange;
use rome_text_edit::TextEdit;
/// Indicates how a tool should manage this suggestion.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
p... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/diagnostic.rs | crates/rome_diagnostics/src/diagnostic.rs | use std::{convert::Infallible, fmt::Debug, io};
use bitflags::bitflags;
use serde::{Deserialize, Serialize};
use rome_console::fmt;
use crate::{Category, Location, Visit};
/// The `Diagnostic` trait defines the metadata that can be exposed by error
/// types in order to print details diagnostics in the console of t... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/display/diff.rs | crates/rome_diagnostics/src/display/diff.rs | use std::{
collections::{BTreeMap, BTreeSet},
io, slice,
};
use rome_console::{fmt, markup, MarkupElement};
use rome_text_edit::{ChangeTag, CompressedOp, TextEdit};
use super::frame::{
calculate_print_width, print_invisibles, text_width, IntoIter, OneIndexed,
PrintInvisiblesOptions, CODE_FRAME_CONTEXT... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | true |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/display/frame.rs | crates/rome_diagnostics/src/display/frame.rs | use std::{
borrow::Cow,
io,
iter::FusedIterator,
num::NonZeroUsize,
ops::{Bound, RangeBounds},
};
use rome_console::{fmt, markup};
use rome_text_size::{TextLen, TextRange, TextSize};
use unicode_width::UnicodeWidthChar;
use crate::{
location::{BorrowedSourceCode, LineIndex},
LineIndexBuf, ... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/display/backtrace.rs | crates/rome_diagnostics/src/display/backtrace.rs | use std::{borrow::Cow, path::PathBuf};
use std::{cell::Cell, fmt::Write as _, io, os::raw::c_void, path::Path, slice};
use rome_console::{fmt, markup};
use serde::{Deserialize, Serialize};
use super::IndentWriter;
/// The [Backtrace] type can be used to capture a native Rust stack trace, to
/// be displayed a diagno... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/src/display/message.rs | crates/rome_diagnostics/src/display/message.rs | use rome_console::fmt::{Formatter, Termcolor};
use rome_console::{markup, MarkupBuf};
use serde::{Deserialize, Serialize};
use termcolor::NoColor;
/// Convenient type that can be used when message and descriptions match, and they need to be
/// displayed using different formatters
///
/// ## Examples
///
/// ```
/// u... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros.rs | crates/rome_diagnostics/tests/macros.rs | #[test]
fn test_macros() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/macros/*.rs");
}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/location_eq.rs | crates/rome_diagnostics/tests/macros/location_eq.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
struct TestDiagnostic {
#[location = Identifier]
location: (),
}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/category_ident.rs | crates/rome_diagnostics/tests/macros/category_ident.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(category = Identifier)]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/severity_lit_str.rs | crates/rome_diagnostics/tests/macros/severity_lit_str.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(severity = "Error")]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/unknown_message_attr.rs | crates/rome_diagnostics/tests/macros/unknown_message_attr.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(message(unknown))]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/unknown_container_attr.rs | crates/rome_diagnostics/tests/macros/unknown_container_attr.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(unknown_attr)]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/unknown_location_attr.rs | crates/rome_diagnostics/tests/macros/unknown_location_attr.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
struct TestDiagnostic {
#[location(unknown)]
location: (),
}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/description_syntax_error.rs | crates/rome_diagnostics/tests/macros/description_syntax_error.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(message(description = "text {unclosed"))]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/category_paren.rs | crates/rome_diagnostics/tests/macros/category_paren.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(message(description = Ident))]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/severity_paren.rs | crates/rome_diagnostics/tests/macros/severity_paren.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(severity(Error))]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/error_enum.rs | crates/rome_diagnostics/tests/macros/error_enum.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
enum ErrorEnum {
Int(u32),
Float(f32),
}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/description_paren.rs | crates/rome_diagnostics/tests/macros/description_paren.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(message(description("description")))]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/tags_comma.rs | crates/rome_diagnostics/tests/macros/tags_comma.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(tags(Identifier, Identifier))]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/error_union.rs | crates/rome_diagnostics/tests/macros/error_union.rs | use rome_diagnostics::Diagnostic;
#[derive(Diagnostic)]
union ErrorUnion {
int: u32,
float: f32,
}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/unknown_field_attr.rs | crates/rome_diagnostics/tests/macros/unknown_field_attr.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
struct TestDiagnostic {
#[unknown_attr]
field: bool,
}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/description_ident.rs | crates/rome_diagnostics/tests/macros/description_ident.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(category = Identifier)]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/tests/macros/tags_eq.rs | crates/rome_diagnostics/tests/macros/tags_eq.rs | use rome_diagnostics::Diagnostic;
#[derive(Debug, Diagnostic)]
#[diagnostic(tags = Identifier)]
struct TestDiagnostic {}
fn main() {}
| rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/examples/serde.rs | crates/rome_diagnostics/examples/serde.rs | use rome_console::{markup, ConsoleExt, EnvConsole};
use rome_diagnostics::{Diagnostic, LineIndexBuf, PrintDiagnostic, Resource, Result, SourceCode};
use rome_rowan::{TextRange, TextSize};
use serde_json::Error;
#[derive(Debug, Diagnostic)]
#[diagnostic(category = "internalError/io", tags(INTERNAL))]
struct SerdeDiagno... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/examples/fs.rs | crates/rome_diagnostics/examples/fs.rs | use std::io;
use rome_console::{fmt, markup, ConsoleExt, EnvConsole};
use rome_diagnostics::{
Advices, Diagnostic, Location, LogCategory, PrintDiagnostic, Resource, SourceCode, Visit,
};
use rome_rowan::{TextRange, TextSize};
#[derive(Debug, Diagnostic)]
#[diagnostic(category = "args/fileNotFound", message = "No ... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/examples/cli.rs | crates/rome_diagnostics/examples/cli.rs | use std::io;
use rome_console::{markup, ConsoleExt, EnvConsole};
use rome_diagnostics::{Advices, Diagnostic, LogCategory, PrintDiagnostic, Resource, Visit};
use rome_rowan::{TextRange, TextSize};
#[derive(Debug, Diagnostic)]
#[diagnostic(
category = "flags/invalid",
message(
description = "Unknown com... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/crates/rome_diagnostics/examples/lint.rs | crates/rome_diagnostics/examples/lint.rs | use std::io;
use rome_console::{markup, ConsoleExt, EnvConsole};
use rome_diagnostics::{
Advices, Diagnostic, Location, LogCategory, PrintDiagnostic, Resource, SourceCode, Visit,
};
use rome_rowan::{TextRange, TextSize};
use rome_text_edit::TextEdit;
#[derive(Debug, Diagnostic)]
#[diagnostic(
category = "lint... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
rome/tools | https://github.com/rome/tools/blob/392d188a49d70e495f13b1bb08cd7d9c43690f9b/xtask/libs_bench/bins/contains_iai.rs | xtask/libs_bench/bins/contains_iai.rs | use regex::Regex;
use std::{collections::HashMap, process::Command};
fn main() {
let result = Command::new("cargo")
.args(["bench", "-p", "xtask_libs_bench"])
.output();
let re = Regex::new(r#"(?P<NAME>\w*?)\s*Instructions:\s*(?P<INST>\d*).*\n\s*L1 Accesses:\s*(?P<L1>\d*).*\n\s*L2 Accesses:\s*(... | rust | MIT | 392d188a49d70e495f13b1bb08cd7d9c43690f9b | 2026-01-04T15:38:12.578592Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.