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 |
|---|---|---|---|---|---|---|---|---|
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/crates/biome_json_analyze/src/lint/nursery/use_required_scripts.rs | crates/biome_json_analyze/src/lint/nursery/use_required_scripts.rs | use biome_analyze::{Ast, Rule, RuleDiagnostic, context::RuleContext, declare_lint_rule};
use biome_console::markup;
use biome_json_syntax::{JsonRoot, TextRange};
use biome_rowan::{AstNode, AstSeparatedList};
use biome_rule_options::use_required_scripts::UseRequiredScriptsOptions;
use crate::utils::is_package_json;
//... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/crates/biome_json_analyze/src/assist/source.rs | crates/biome_json_analyze/src/assist/source.rs | //! Generated file, do not edit by hand, see `xtask/codegen`
//! Generated file, do not edit by hand, see `xtask/codegen`
use biome_analyze::declare_assist_group;
pub mod use_sorted_keys;
declare_assist_group! { pub Source { name : "source" , rules : [self :: use_sorted_keys :: UseSortedKeys ,] } }
| rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/crates/biome_json_analyze/src/assist/source/use_sorted_keys.rs | crates/biome_json_analyze/src/assist/source/use_sorted_keys.rs | use crate::JsonRuleAction;
use biome_analyze::utils::{is_separated_list_sorted_by, sorted_separated_list_by};
use biome_analyze::{
Ast, FixKind, Rule, RuleAction, RuleDiagnostic, context::RuleContext, declare_source_rule,
};
use biome_console::markup;
use biome_diagnostics::category;
use biome_json_factory::make;
u... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/crates/biome_json_analyze/tests/spec_tests.rs | crates/biome_json_analyze/tests/spec_tests.rs | use biome_analyze::{AnalysisFilter, AnalyzerAction, ControlFlow, Never, RuleFilter};
use biome_configuration::{ConfigurationSource, ExtendedConfigurations};
use biome_diagnostics::advice::CodeSuggestionAdvice;
use biome_json_analyze::{ExtendedConfigurationProvider, JsonAnalyzeServices};
use biome_json_parser::{JsonPars... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/crates/biome_json_analyze/benches/json_analyzer.rs | crates/biome_json_analyze/benches/json_analyzer.rs | use biome_analyze::options::JsxRuntime;
use biome_analyze::{
AnalysisFilter, AnalyzerConfiguration, AnalyzerOptions, ControlFlow, Never,
RuleCategoriesBuilder,
};
use biome_json_analyze::JsonAnalyzeServices;
use biome_json_parser::{JsonParserOptions, parse_json};
use biome_json_syntax::JsonFileSource;
use biome... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/language_kind.rs | xtask/codegen/src/language_kind.rs | use std::str::FromStr;
use crate::css_kinds_src::CSS_KINDS_SRC;
use crate::graphql_kind_src::GRAPHQL_KINDS_SRC;
use crate::grit_kinds_src::GRIT_KINDS_SRC;
use crate::html_kinds_src::HTML_KINDS_SRC;
use crate::js_kinds_src::JS_KINDS_SRC;
use crate::json_kinds_src::JSON_KINDS_SRC;
use crate::kind_src::KindsSrc;
use crat... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_new_analyzer_rule.rs | xtask/codegen/src/generate_new_analyzer_rule.rs | use biome_string_case::Case;
use bpaf::Bpaf;
use std::str::FromStr;
use xtask_glue::project_root;
#[derive(Debug, Clone, Bpaf)]
pub enum LanguageKind {
Js,
Json,
Css,
Graphql,
Html,
HtmlVue,
}
impl LanguageKind {
fn as_str(&self) -> &str {
match self {
Self::Js => "js",... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/ast.rs | xtask/codegen/src/ast.rs | //! Generate SyntaxKind definitions as well as typed AST definitions for nodes and tokens.
//! This is derived from rust-analyzer/xtask/codegen
use std::collections::{HashMap, HashSet, VecDeque};
use std::vec;
use super::{
Mode,
js_kinds_src::{AstSrc, Field},
};
use crate::generate_grit_mappings;
use crate::g... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_license.rs | xtask/codegen/src/generate_license.rs | use proc_macro2::{Literal, TokenStream};
use quote::quote;
use serde::{Deserialize, Serialize};
use std::io;
use ureq::get;
use xtask_codegen::update;
use xtask_glue::*;
use xtask_glue::{Mode, project_root};
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct LicenseList {
licens... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_configuration.rs | xtask/codegen/src/generate_configuration.rs | use biome_analyze::{
GroupCategory, Queryable, RegistryVisitor, Rule, RuleCategory, RuleGroup, RuleMetadata,
};
use biome_css_syntax::CssLanguage;
use biome_graphql_syntax::GraphqlLanguage;
use biome_html_syntax::HtmlLanguage;
use biome_js_syntax::JsLanguage;
use biome_json_syntax::JsonLanguage;
use biome_string_ca... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | true |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/lib.rs | xtask/codegen/src/lib.rs | //! Codegen tools for generating Syntax and AST definitions. Derived from Rust analyzer's codegen
//!
mod ast;
mod css_kinds_src;
mod formatter;
mod generate_analyzer;
pub mod generate_analyzer_rule_options;
mod generate_grit_mappings;
mod generate_macros;
pub mod generate_new_analyzer_rule;
mod generate_node_factory;
... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/html_kinds_src.rs | xtask/codegen/src/html_kinds_src.rs | use crate::kind_src::KindsSrc;
pub const HTML_KINDS_SRC: KindsSrc = KindsSrc {
punct: &[
("<", "L_ANGLE"),
(">", "R_ANGLE"),
("/", "SLASH"),
("=", "EQ"),
("!", "BANG"),
("-", "MINUS"),
("<![CDATA[", "CDATA_START"),
("]]>", "CDATA_END"),
("---"... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_schema.rs | xtask/codegen/src/generate_schema.rs | use crate::update;
use biome_configuration::Configuration;
use biome_json_formatter::context::JsonFormatOptions;
use biome_json_parser::{JsonParserOptions, parse_json};
use schemars::{Schema, schema_for};
use serde_json::{Map, Value, to_string};
use xtask_glue::*;
/// Returns the configuration schema as a string
pub f... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_analyzer_rule_options.rs | xtask/codegen/src/generate_analyzer_rule_options.rs | use crate::update;
use biome_string_case::Case;
use proc_macro2::{Ident, Span};
use quote::quote;
use std::path::PathBuf;
use xtask_glue::*;
/// The path to the analyzer rule options directory.
pub fn get_analyzer_rule_options_path() -> PathBuf {
project_root().join("crates/biome_rule_options/src/")
}
/// Generat... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_migrate_eslint.rs | xtask/codegen/src/generate_migrate_eslint.rs | use biome_analyze::{
GroupCategory, Queryable, RegistryVisitor, Rule, RuleCategory, RuleGroup, RuleMetadata,
RuleSourceKind, RuleSourceWithKind,
};
use biome_rowan::syntax::Language;
use biome_string_case::Case;
use quote::{format_ident, quote};
use std::collections::BTreeMap;
use xtask_codegen::update;
use xta... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_bindings.rs | xtask/codegen/src/generate_bindings.rs | use biome_js_factory::make;
use biome_js_formatter::{context::JsFormatOptions, format_node};
use biome_js_syntax::{
AnyJsBinding, AnyJsBindingPattern, AnyJsCallArgument, AnyJsDeclaration, AnyJsDeclarationClause,
AnyJsExportClause, AnyJsExpression, AnyJsFormalParameter, AnyJsImportClause,
AnyJsLiteralExpress... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_analyzer.rs | xtask/codegen/src/generate_analyzer.rs | use anyhow::{Context, Ok, Result};
use biome_string_case::Case;
use proc_macro2::TokenStream;
use quote::{format_ident, quote};
use std::{collections::BTreeMap, path::Path};
use xtask_glue::{glue::fs2, project_root, reformat};
pub fn generate_analyzer() -> Result<()> {
generate_js_analyzer()?;
generate_json_an... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/kind_src.rs | xtask/codegen/src/kind_src.rs | pub struct KindsSrc<'a> {
/// Special characters of the language. Usually these are parenthesis, dots, commas, etc.
pub punct: &'a [(&'a str, &'a str)],
/// Reserved keywords of the language
pub keywords: &'a [&'a str],
/// Literals are special nodes that holds some **values** inside the language, f... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_nodes.rs | xtask/codegen/src/generate_nodes.rs | use crate::js_kinds_src::{AstNodeSrc, AstSrc, Field, TokenKind};
use crate::language_kind::LanguageKind;
use biome_string_case::Case;
use proc_macro2::{Literal, TokenStream};
use quote::{format_ident, quote};
use std::collections::HashMap;
use xtask_glue::Result;
pub fn generate_nodes(ast: &AstSrc, language_kind: Lang... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | true |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/js_kinds_src.rs | xtask/codegen/src/js_kinds_src.rs | //! Definitions for the ECMAScript AST used for codegen
//! Based on the rust analyzer parser and ast definitions
use crate::kind_src::KindsSrc;
use crate::language_kind::{LANGUAGE_PREFIXES, LanguageKind};
use quote::format_ident;
use std::collections::BTreeMap;
pub const JS_KINDS_SRC: KindsSrc = KindsSrc {
punct... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_node_factory.rs | xtask/codegen/src/generate_node_factory.rs | use super::js_kinds_src::AstSrc;
use crate::js_kinds_src::Field;
use crate::language_kind::LanguageKind;
use biome_string_case::Case;
use quote::{format_ident, quote};
use xtask_glue::Result;
pub fn generate_node_factory(ast: &AstSrc, language_kind: LanguageKind) -> Result<String> {
let syntax_crate = language_kin... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/json_kinds_src.rs | xtask/codegen/src/json_kinds_src.rs | use crate::kind_src::KindsSrc;
pub const JSON_KINDS_SRC: KindsSrc = KindsSrc {
punct: &[
(":", "COLON"),
(",", "COMMA"),
("(", "L_PAREN"),
(")", "R_PAREN"),
("{", "L_CURLY"),
("}", "R_CURLY"),
("[", "L_BRACK"),
("]", "R_BRACK"),
],
keywords: &... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_syntax_factory.rs | xtask/codegen/src/generate_syntax_factory.rs | use super::js_kinds_src::AstSrc;
use crate::generate_nodes::{get_field_predicate, group_fields_for_ordering, token_kind_to_code};
use crate::language_kind::LanguageKind;
use biome_string_case::Case;
use proc_macro2::TokenStream;
use quote::{format_ident, quote};
use xtask_glue::Result;
pub fn generate_syntax_factory(a... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_syntax_kinds.rs | xtask/codegen/src/generate_syntax_kinds.rs | use crate::Result;
use crate::language_kind::LanguageKind;
use crate::{generate_nodes::should_token_be_quoted, kind_src::KindsSrc};
use biome_string_case::Case;
use proc_macro2::{Literal, Punct, Spacing};
use quote::{format_ident, quote};
pub fn generate_syntax_kinds(grammar: KindsSrc, language_kind: LanguageKind) -> ... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/tailwind_kinds_src.rs | xtask/codegen/src/tailwind_kinds_src.rs | use crate::kind_src::KindsSrc;
pub const TAILWIND_KINDS_SRC: KindsSrc = KindsSrc {
punct: &[
("/", "SLASH"),
("!", "BANG"),
("-", "DASH"),
(":", "COLON"),
("[", "L_BRACKET"),
("]", "R_BRACKET"),
("(", "L_PAREN"),
(")", "R_PAREN"),
(" ", "WHITE... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_nodes_mut.rs | xtask/codegen/src/generate_nodes_mut.rs | use crate::js_kinds_src::{AstSrc, Field};
use crate::language_kind::LanguageKind;
use quote::{format_ident, quote};
use xtask_glue::Result;
pub fn generate_nodes_mut(ast: &AstSrc, language_kind: LanguageKind) -> Result<String> {
let node_boilerplate_impls: Vec<_> = ast
.nodes
.iter()
.map(|... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/css_kinds_src.rs | xtask/codegen/src/css_kinds_src.rs | use crate::kind_src::KindsSrc;
pub const CSS_KINDS_SRC: KindsSrc = KindsSrc {
punct: &[
(";", "SEMICOLON"),
(",", "COMMA"),
("(", "L_PAREN"),
(")", "R_PAREN"),
("{", "L_CURLY"),
("}", "R_CURLY"),
("[", "L_BRACK"),
("]", "R_BRACK"),
("<", "L_AN... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/move_rule.rs | xtask/codegen/src/move_rule.rs | use biome_string_case::Case;
use std::env;
use std::fs;
use std::path::Path;
const KNOWN_CATEGORIES: &[&str] = &["lint", "assist", "syntax"];
const KNOWN_GROUPS: &[&str] = &[
// any
"nursery",
// lint group
"a11y",
"complexity",
"correctness",
"performance",
"security",
"style",
... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/markdown_kinds_src.rs | xtask/codegen/src/markdown_kinds_src.rs | use crate::kind_src::KindsSrc;
pub const MARKDOWN_KINDS_SRC: KindsSrc = KindsSrc {
punct: &[
("<", "L_ANGLE"),
(">", "R_ANGLE"),
("(", "L_PAREN"),
(")", "R_PAREN"),
("[", "L_BRACK"),
("]", "R_BRACK"),
("/", "SLASH"),
("=", "EQ"),
("!", "BANG")... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_grit_mappings.rs | xtask/codegen/src/generate_grit_mappings.rs | use crate::{js_kinds_src::AstSrc, language_kind::LanguageKind};
use xtask_glue::Result;
pub fn generate_grit_mappings(ast: &AstSrc, language_kind: LanguageKind) -> Result<String> {
let lang = LanguageConfig::new(language_kind);
let legacy_patterns = lang.legacy_patterns;
let native_patterns = ast
... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/grit_kinds_src.rs | xtask/codegen/src/grit_kinds_src.rs | //! Definitions for the ECMAScript AST used for codegen
//! Based on the rust analyzer parser and ast definitions
use crate::kind_src::KindsSrc;
pub const GRIT_KINDS_SRC: KindsSrc = KindsSrc {
punct: &[
("...", "DOT3"),
("$_", "DOLLAR_UNDERSCORE"),
("<:", "MATCH"),
(";", "SEMICOLON... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/graphql_kind_src.rs | xtask/codegen/src/graphql_kind_src.rs | use crate::kind_src::KindsSrc;
pub const GRAPHQL_KINDS_SRC: KindsSrc = KindsSrc {
punct: &[
("!", "BANG"),
("$", "DOLLAR"),
("&", "AMP"),
("(", "L_PAREN"),
(")", "R_PAREN"),
("...", "DOT3"),
(":", "COLON"),
("=", "EQ"),
("@", "AT"),
("... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/unicode.rs | xtask/codegen/src/unicode.rs | use std::path::PathBuf;
use anyhow::{Context, Ok, Result};
use quote::quote;
mod paths {
pub const DERIVED_CORE_PROPERTIES: &str = "target/DerivedCoreProperties.txt";
pub const TABLES: &str = "crates/biome_unicode_table/src/tables.rs";
}
pub fn generate_tables() -> Result<()> {
let properties = Propertie... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/main.rs | xtask/codegen/src/main.rs | #[cfg(feature = "schema")]
mod generate_bindings;
#[cfg(feature = "configuration")]
mod generate_configuration;
#[cfg(feature = "license")]
mod generate_license;
#[cfg(feature = "configuration")]
mod generate_migrate_eslint;
mod move_rule;
use xtask_glue::{Result, project_root, pushd};
#[cfg(feature = "schema")]
use c... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/formatter.rs | xtask/codegen/src/formatter.rs | use std::{
collections::{BTreeMap, BTreeSet, HashSet, VecDeque},
env,
fs::{File, create_dir_all, read_dir, remove_file},
io::Write,
path::{Path, PathBuf},
};
use crate::ast::load_ast;
use crate::language_kind::{ALL_LANGUAGE_KIND, LanguageKind};
use git2::{Repository, Status, StatusOptions};
use pro... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_target_language_constants.rs | xtask/codegen/src/generate_target_language_constants.rs | use crate::{
js_kinds_src::{AstSrc, Field},
language_kind::LanguageKind,
};
use biome_string_case::Case;
use xtask_glue::Result;
pub fn generate_target_language_constants(
ast: &AstSrc,
language_kind: LanguageKind,
) -> Result<String> {
let disregarded_slots: Vec<String> = ast
.nodes
... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/generate_macros.rs | xtask/codegen/src/generate_macros.rs | use super::js_kinds_src::AstSrc;
use crate::Result;
use crate::language_kind::LanguageKind;
use biome_string_case::Case;
use quote::{format_ident, quote};
pub fn generate_macros(ast: &AstSrc, language_kind: LanguageKind) -> Result<String> {
let syntax_kind = language_kind.syntax_kind();
let syntax_node = langu... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/termcolorful.rs | xtask/codegen/src/termcolorful.rs | #[derive(Copy, Clone, Debug)]
#[expect(dead_code)]
pub(crate) enum Color {
Red,
Green,
Black,
Yellow,
Blue,
Purple,
Cyan,
White,
}
impl std::fmt::Display for Color {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match *self {
Self::Black => ... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/codegen/src/yaml_kinds_src.rs | xtask/codegen/src/yaml_kinds_src.rs | use crate::kind_src::KindsSrc;
pub const YAML_KINDS_SRC: KindsSrc = KindsSrc {
punct: &[
(":", "COLON"),
(",", "COMMA"),
("{", "L_CURLY"),
("}", "R_CURLY"),
("[", "L_BRACK"),
("]", "R_BRACK"),
("?", "QUESTION"),
("-", "DASH"),
("|", "PIPE"),
... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/rules_check/src/lib.rs | xtask/rules_check/src/lib.rs | //! This module is in charge of checking if the documentation and tests cases inside the Analyzer rules are correct.
//!
//!
use std::collections::{BTreeMap, HashMap};
use std::fmt::{Display, Formatter, Write};
use std::str::FromStr;
use std::{mem, slice};
use anyhow::bail;
use biome_analyze::{
AnalysisFilter, Con... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | true |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/rules_check/src/main.rs | xtask/rules_check/src/main.rs | use rules_check::check_rules;
fn main() -> anyhow::Result<()> {
check_rules()
}
| rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/lib.rs | xtask/coverage/src/lib.rs | pub mod compare;
pub mod js;
pub mod jsx;
mod reporters;
pub mod results;
mod runner;
pub mod symbols;
pub mod ts;
mod util;
pub use crate::reporters::SummaryDetailLevel;
use crate::js::test262::Test262TestSuite;
use crate::reporters::{
DefaultReporter, JsonReporter, MulticastTestReporter, OutputTarget, SummaryRe... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/runner.rs | xtask/coverage/src/runner.rs | use super::*;
use crate::reporters::TestReporter;
use biome_diagnostics::Error;
use biome_diagnostics::PrintDiagnostic;
use biome_diagnostics::console::fmt::{Formatter, Termcolor};
use biome_diagnostics::console::markup;
use biome_diagnostics::termcolor::Buffer;
use biome_js_parser::{JsParserOptions, Parse, parse};
use... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/results.rs | xtask/coverage/src/results.rs | use ascii_table::{Align, AsciiTable};
use std::collections::{HashMap, HashSet};
use crate::{Outcome, TestResult, TestResults};
pub fn emit_compare(
base_results: &TestResults,
new_results: &TestResults,
test_suite: &str,
markdown: bool,
) {
let base_total = base_results.summary.tests_ran as isize;... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/util.rs | xtask/coverage/src/util.rs | use std::borrow::Cow;
use std::char::{DecodeUtf16Error, decode_utf16};
pub(crate) fn decode_maybe_utf16_string(
mut content: &[u8],
) -> Result<Cow<'_, str>, DecodeUtf16Error> {
enum FileEncoding {
Unknown,
Utf8,
Utf16Le,
Utf16Be,
}
let mut encoding = FileEncoding::Unkn... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/main.rs | xtask/coverage/src/main.rs | use pico_args::Arguments;
use xtask_glue::{Result, project_root, pushd};
use xtask_coverage::{SummaryDetailLevel, compare::coverage_compare, run};
fn main() -> Result<()> {
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.with_writer(std::io::stderr)
... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/reporters.rs | xtask/coverage/src/reporters.rs | use crate::runner::{TestCaseFiles, TestRunOutcome, TestRunResult, TestSuite, TestSuiteInstance};
use crate::{Summary, TestResults};
use ascii_table::{Align, AsciiTable};
use biome_diagnostics::termcolor::Buffer;
use biome_diagnostics::{DiagnosticExt, Error};
use colored::Colorize;
use indicatif::ProgressBar;
use serde_... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/compare.rs | xtask/coverage/src/compare.rs | use std::collections::HashMap;
use std::fs;
use std::path::{Path, PathBuf};
use xtask_glue::project_root;
use crate::TestResults;
use crate::results::emit_compare;
use crate::util::decode_maybe_utf16_string;
// this is the filename of the results coming from `main` branch
const BASE_RESULT_FILE: &str = "base_results.... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/jsx/jsx_babel.rs | xtask/coverage/src/jsx/jsx_babel.rs | use crate::runner::create_bogus_node_in_tree_diagnostic;
use crate::{
check_file_encoding,
runner::{TestCase, TestCaseFiles, TestRunOutcome, TestSuite},
};
use biome_js_parser::{JsParserOptions, parse};
use biome_js_syntax::{JsFileSource, ModuleKind};
use biome_rowan::SyntaxKind;
use std::io;
use std::path::Pat... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/jsx/mod.rs | xtask/coverage/src/jsx/mod.rs | pub mod jsx_babel;
| rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/js/mod.rs | xtask/coverage/src/js/mod.rs | pub mod test262;
| rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/js/test262.rs | xtask/coverage/src/js/test262.rs | use crate::runner::{
TestCase, TestCaseFiles, TestRunOutcome, TestSuite, create_bogus_node_in_tree_diagnostic,
};
use biome_js_parser::{JsParserOptions, parse};
use biome_js_syntax::JsFileSource;
use biome_rowan::AstNode;
use biome_rowan::syntax::SyntaxKind;
use regex::Regex;
use serde::Deserialize;
use std::io;
us... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/symbols/utils.rs | xtask/coverage/src/symbols/utils.rs | pub fn parse_str<'a>(input: &'a str, s: &'a str) -> Option<(&'a str, &'a str)> {
input
.strip_prefix(s)
.map(|stripped| (stripped, &input[0..s.len()]))
}
pub fn parse_until_chr(input: &'_ str, f: impl Fn(char) -> bool) -> Option<(&'_ str, &'_ str)> {
let mut qty = 0;
for chr in input.chars... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/symbols/mod.rs | xtask/coverage/src/symbols/mod.rs | pub mod msts;
mod utils;
| rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/symbols/msts.rs | xtask/coverage/src/symbols/msts.rs | use biome_js_semantic::SemanticEvent;
use biome_js_syntax::JsFileSource;
use biome_rowan::TextSize;
use super::utils::{parse_separated_list, parse_str, parse_until_chr, parse_whitespace0};
use crate::check_file_encoding;
use crate::runner::{TestCase, TestCaseFiles, TestRunOutcome, TestSuite};
use biome_js_parser::JsPa... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/ts/ts_microsoft.rs | xtask/coverage/src/ts/ts_microsoft.rs | use crate::check_file_encoding;
use crate::runner::{
TestCase, TestCaseFiles, TestRunOutcome, TestSuite, create_bogus_node_in_tree_diagnostic,
};
use biome_js_parser::JsParserOptions;
use biome_js_syntax::{JsFileSource, ModuleKind};
use biome_rowan::{AstNode, SyntaxKind};
use biome_string_case::StrOnlyExtension;
us... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/ts/ts_babel.rs | xtask/coverage/src/ts/ts_babel.rs | use crate::runner::create_bogus_node_in_tree_diagnostic;
use crate::{
check_file_encoding,
runner::{TestCase, TestCaseFiles, TestRunOutcome, TestSuite},
};
use biome_js_parser::JsParserOptions;
use biome_js_syntax::{JsFileSource, LanguageVariant};
use biome_rowan::SyntaxKind;
use std::io;
use std::path::Path;
u... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/coverage/src/ts/mod.rs | xtask/coverage/src/ts/mod.rs | pub mod ts_babel;
pub mod ts_microsoft;
| rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/glue/src/lib.rs | xtask/glue/src/lib.rs | //! Codegen tools mostly used to generate ast and syntax definitions. Adapted from rust analyzer's codegen
pub mod glue;
use std::{
env,
fmt::Display,
path::{Path, PathBuf},
sync::OnceLock,
};
pub use crate::glue::{pushd, pushenv};
pub use anyhow::{Context as _, Error, Result, anyhow, bail, ensure};... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
biomejs/biome | https://github.com/biomejs/biome/blob/499594b74475be0ae81ce50858e76c9c97b8c48f/xtask/glue/src/glue.rs | xtask/glue/src/glue.rs | //! A shell but bad, some cross platform glue code
use std::{
cell::RefCell,
env,
ffi::OsString,
io::Write,
path::{Path, PathBuf},
process::{Command, Stdio},
};
use anyhow::{Context, Result, bail};
pub mod fs2 {
use std::{fs, path::Path};
use anyhow::{Context, Result};
pub fn re... | rust | Apache-2.0 | 499594b74475be0ae81ce50858e76c9c97b8c48f | 2026-01-04T15:39:05.365085Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/publish.rs | publish.rs | //! Helper script to publish the wasm-bindgen suite of crates
//!
//! Usage:
//!
//! * First, compile this script
//! * Next, set cwd to the root of the wasm-bindgen repository
//! * Execute `./publish bump` to bump versions
//! * Send a PR
//! * Merge when green
//! * Execute `./publish publish` to publish crates
use... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/build.rs | build.rs | // Required so that `[package] links = ...` works in `Cargo.toml`.
use rustversion_compat as rustversion;
use std::env;
macro_rules! deprecated_crate_feature {
($name:literal) => {
#[cfg(feature = $name)]
{
println!("cargo:warning=The `{}` feature is deprecated and will be removed in t... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/benchmarks/src/lib.rs | benchmarks/src/lib.rs | extern crate wasm_bindgen;
extern crate web_sys;
use wasm_bindgen::prelude::*;
use web_sys::Node;
#[wasm_bindgen(raw_module = "../globals.js")]
extern "C" {
#[wasm_bindgen(js_name = jsthunk)]
fn js_thunk();
#[wasm_bindgen(js_name = add)]
fn js_add(a: i32, b: i32) -> i32;
#[wasm_bindgen(js_name = ... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/benchmarks/wcodspeed/src/codspeed.rs | benchmarks/wcodspeed/src/codspeed.rs | use serde::{Deserialize, Serialize};
use statrs::statistics::{Data, Distribution, Max, Min, OrderStatistics};
const IQR_OUTLIER_FACTOR: f64 = 1.5;
const STDEV_OUTLIER_FACTOR: f64 = 3.0;
#[derive(Debug, Serialize, Deserialize)]
pub struct BenchmarkMetadata {
pub name: String,
pub uri: String,
}
#[derive(Debug... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/benchmarks/wcodspeed/src/main.rs | benchmarks/wcodspeed/src/main.rs | //! Collects walltime and converts it into codspeed results,
//! based on `codspeed-rust` 4.1.0.
mod codspeed;
use std::{
collections::HashMap,
io::Write,
path::{Path, PathBuf},
};
use anyhow::{Context, Result};
use serde::Deserialize;
use crate::codspeed::{WalltimeBenchmark, WalltimeResults};
#[derive... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/link.rs | src/link.rs | // see comment in module above this in `link_mem_intrinsics`
#[inline(never)]
#[cfg_attr(wasm_bindgen_unstable_test_coverage, coverage(off))]
pub fn link_intrinsics() {}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/lib.rs | src/lib.rs | //! Runtime support for the `wasm-bindgen` tool
//!
//! This crate contains the runtime support necessary for `wasm-bindgen` the
//! attribute and tool. Crates pull in the `#[wasm_bindgen]` attribute through
//! this crate and this crate also provides JS bindings through the `JsValue`
//! interface.
//!
//! ## Features... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | true |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/closure.rs | src/closure.rs | //! Support for long-lived closures in `wasm-bindgen`
//!
//! This module defines the `Closure` type which is used to pass "owned
//! closures" from Rust to JS. Some more details can be found on the `Closure`
//! type itself.
#![allow(clippy::fn_to_numeric_cast)]
use alloc::boxed::Box;
use alloc::string::String;
use ... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/describe.rs | src/describe.rs | //! This is an internal module, no stability guarantees are provided. Use at
//! your own risk.
#![doc(hidden)]
use alloc::boxed::Box;
use alloc::string::String;
use alloc::vec::Vec;
use core::{mem::MaybeUninit, ptr::NonNull};
use crate::{Clamped, JsCast, JsError, JsValue};
use cfg_if::cfg_if;
pub use wasm_bindgen_... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/externref.rs | src/externref.rs | use crate::JsValue;
use crate::__rt;
use alloc::slice;
use alloc::vec::Vec;
use core::cell::RefCell;
use core::cmp::max;
externs! {
#[link(wasm_import_module = "__wbindgen_externref_xform__")]
extern "C" {
fn __wbindgen_externref_table_grow(delta: usize) -> i32;
fn __wbindgen_externref_table_s... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/cast.rs | src/cast.rs | use crate::{convert::TryFromJsValue, JsValue};
/// A trait for checked and unchecked casting between JS types.
///
/// Specified [in an RFC][rfc] this trait is intended to provide support for
/// casting JS values between different types of one another. In JS there aren't
/// many static types but we've ascribed JS va... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/cache/mod.rs | src/cache/mod.rs | pub mod intern;
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/cache/intern.rs | src/cache/intern.rs | use cfg_if::cfg_if;
cfg_if! {
if #[cfg(feature = "enable-interning")] {
use std::thread_local;
use std::string::String;
use std::borrow::ToOwned;
use std::cell::RefCell;
use std::collections::HashMap;
use crate::JsValue;
struct Cache {
entries: R... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/rt/mod.rs | src/rt/mod.rs | use crate::convert::{FromWasmAbi, IntoWasmAbi, WasmAbi, WasmRet};
use crate::describe::inform;
use crate::JsValue;
use core::borrow::{Borrow, BorrowMut};
use core::cell::{Cell, UnsafeCell};
use core::convert::Infallible;
use core::ops::{Deref, DerefMut};
#[cfg(target_feature = "atomics")]
use core::sync::atomic::{Atomi... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/rt/marker.rs | src/rt/marker.rs | /// Marker trait for types that support `#[wasm_bindgen(constructor)]`.
#[cfg_attr(
wbg_diagnostic,
diagnostic::on_unimplemented(
message = "JavaScript constructors are not supported for `{Self}`",
label = "this function cannot be the constructor of `{Self}`",
note = "`#[wasm_bindgen(con... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/convert/slices.rs | src/convert/slices.rs | use alloc::boxed::Box;
use alloc::string::String;
use alloc::vec::Vec;
use core::mem::{self, MaybeUninit};
use core::ops::{Deref, DerefMut};
use core::str;
use crate::convert::{js_value_vector_from_abi, js_value_vector_into_abi};
use crate::convert::{
FromWasmAbi, IntoWasmAbi, LongRefFromWasmAbi, OptionFromWasmAbi... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/convert/closures.rs | src/convert/closures.rs | use alloc::boxed::Box;
use core::mem;
use crate::closure::{Closure, IntoWasmClosure, WasmClosure, WasmClosureFnOnce};
use crate::convert::slices::WasmSlice;
use crate::convert::RefFromWasmAbi;
use crate::convert::{FromWasmAbi, IntoWasmAbi, ReturnWasmAbi, WasmAbi, WasmRet};
use crate::describe::{inform, WasmDescribe, F... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/convert/mod.rs | src/convert/mod.rs | //! # ⚠️ Unstable
//!
//! This is an internal module, no stability guarantees are provided. Use at
//! your own risk.
#![allow(clippy::missing_safety_doc)]
mod closures;
mod impls;
mod slices;
mod traits;
pub use self::impls::*;
pub use self::slices::WasmSlice;
pub use self::traits::*;
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/convert/impls.rs | src/convert/impls.rs | use alloc::boxed::Box;
use alloc::vec::Vec;
use core::char;
use core::mem::{self, ManuallyDrop};
use core::ptr::NonNull;
use crate::convert::traits::{WasmAbi, WasmPrimitive};
use crate::convert::TryFromJsValue;
use crate::convert::{FromWasmAbi, IntoWasmAbi, LongRefFromWasmAbi, RefFromWasmAbi};
use crate::convert::{Opt... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/src/convert/traits.rs | src/convert/traits.rs | use core::borrow::Borrow;
use core::ops::{Deref, DerefMut};
use crate::describe::*;
use crate::JsValue;
/// A trait for anything that can be converted into a type that can cross the
/// Wasm ABI directly, eg `u32` or `f64`.
///
/// This is the opposite operation as `FromWasmAbi` and `Ref[Mut]FromWasmAbi`.
///
/// # ⚠... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/unwrap_throw.rs | tests/unwrap_throw.rs | extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[test]
fn unwrap_throw_ok() {
assert_eq!(Some(42).unwrap_throw(), 42);
let x: Result<i32, ()> = Ok(42);
assert_eq!(x.unwrap_throw(), 42);
}
#[test]
#[should_panic]
fn unwrap_throw_none() {
let x: Option<i32> = None;
x.unwrap_throw();
}
#[t... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/resolve_core_module.rs | tests/resolve_core_module.rs | mod core {}
#[wasm_bindgen_macro::wasm_bindgen]
extern "C" {
type Foo;
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/no_infinite_recursion.rs | tests/no_infinite_recursion.rs | //! https://github.com/wasm-bindgen/wasm-bindgen/issues/4597
use wasm_bindgen::prelude::wasm_bindgen;
mod foo {
use crate::wasm_bindgen;
#[wasm_bindgen]
struct Foo;
}
mod bar {
use crate::wasm_bindgen;
#[wasm_bindgen]
struct Bar;
}
#[allow(unused)]
use bar::*;
#[allow(unused)]
use foo::*;
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/no_interpret.rs | tests/no_interpret.rs | const _: () = {
unsafe extern "C" fn __ctor() {
let _ = 1 + 1;
}
#[unsafe(link_section = ".init_array")]
static __CTOR: unsafe extern "C" fn() = __ctor;
};
#[cfg(test)]
#[wasm_bindgen_test::wasm_bindgen_test]
fn it_works() {}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/std-crate-no-std-dep.rs | tests/std-crate-no-std-dep.rs | //! This is a test that we can define items in a `#![no_std]` crate when
//! `wasm-bindgen` is compiled itself with the `std` feature and everything
//! works out just fine.
#![no_std]
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
fn test(a: &str);
type Js;
#[was... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/non_wasm_test.rs | tests/non_wasm_test.rs | #![cfg(not(target_family = "wasm"))]
use std::sync::{Arc, Condvar, Mutex};
use once_cell::sync::Lazy;
use wasm_bindgen_test::wasm_bindgen_test;
static TEST: Lazy<Arc<(Mutex<bool>, Condvar)>> =
Lazy::new(|| Arc::new((Mutex::new(false), Condvar::new())));
#[wasm_bindgen_test(unsupported = test)]
fn test_success()... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/non_wasm.rs | tests/non_wasm.rs | extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub struct A {
x: u32,
}
#[wasm_bindgen]
impl A {
pub fn new() -> A {
A { x: 3 }
}
pub fn foo(&self) {
assert_eq!(self.x, 3);
}
}
#[wasm_bindgen]
pub fn foo(x: bool) {
A::new().foo();
if x {
... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/must_use.rs | tests/must_use.rs | //! This test validates that the generated bindings don't cause linting warnings
//! when used with structs annotated with `#[must_use]`.
#![deny(unused)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[must_use]
pub struct MustUse {}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/worker/modules.rs | tests/worker/modules.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
#[wasm_bindgen(raw_module = "./tests/worker/modules.js")]
extern "C" {
fn get_five() -> u32;
}
#[wasm_bindgen_test]
fn test_get_five() {
assert_eq!(get_five(), 5);
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/worker/service.rs | tests/worker/service.rs | #![cfg(target_arch = "wasm32")]
extern crate js_sys;
extern crate wasm_bindgen;
extern crate wasm_bindgen_test;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::wasm_bindgen_test_configure;
wasm_bindgen_test_configure!(run_in_service_worker);
pub mod modules;
// should not be executed
#[wasm_bindgen(start)]
fn... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/worker/dedicated.rs | tests/worker/dedicated.rs | #![cfg(target_arch = "wasm32")]
extern crate js_sys;
extern crate wasm_bindgen;
extern crate wasm_bindgen_test;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::wasm_bindgen_test_configure;
wasm_bindgen_test_configure!(run_in_dedicated_worker);
pub mod modules;
// should not be executed
#[wasm_bindgen(start)]
... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/worker/shared.rs | tests/worker/shared.rs | #![cfg(target_arch = "wasm32")]
extern crate js_sys;
extern crate wasm_bindgen;
extern crate wasm_bindgen_test;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::wasm_bindgen_test_configure;
wasm_bindgen_test_configure!(run_in_shared_worker);
pub mod modules;
// should not be executed
#[wasm_bindgen(start)]
fn ... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/headless/snippets.rs | tests/headless/snippets.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
#[wasm_bindgen(module = "/tests/headless/snippets1.js")]
extern "C" {
fn get_two() -> u32;
#[wasm_bindgen(js_name = get_stateful)]
fn get_stateful1() -> u32;
}
#[wasm_bindgen(module = "/tests/headless/snippets1.js")]
extern "C" {
#[wasm_bindgen(j... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/headless/modules.rs | tests/headless/modules.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
#[wasm_bindgen(raw_module = "./tests/headless/modules.js")]
extern "C" {
fn get_five() -> u32;
}
#[wasm_bindgen_test]
fn test_get_five() {
assert_eq!(get_five(), 5);
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/headless/strings.rs | tests/headless/strings.rs | use js_sys::JsString;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
#[wasm_bindgen(module = "/tests/headless/strings.js")]
extern "C" {
fn test_string_roundtrip(c: &Closure<dyn Fn(String) -> String>);
fn identity(s: &str) -> String;
}
#[wasm_bindgen_test]
fn string_roundtrip() {
test_string_rou... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/headless/main.rs | tests/headless/main.rs | #![cfg(target_arch = "wasm32")]
extern crate wasm_bindgen;
extern crate wasm_bindgen_test;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
#[wasm_bindgen]
pub struct ConsumeRetString;
#[wasm_bindgen]
impl ConsumeRetString {
// https://github.com/wasm-bindge... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/headless/externref_heap_live_count.rs | tests/headless/externref_heap_live_count.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
// This test is in the headless suite so that we can test the `externref` table
// implementation of `externref_heap_live_count` (as opposed to the JS `heap`
// implementation) in Firefox.
#[wasm_bindgen_test]
fn test_externref_heap_live_count() {
let initial... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/no-std/src/lib.rs | tests/no-std/src/lib.rs | //! This is a test that we compile `wasm-bindgen` itself in `no_std` mode and we
//! can export/import various items.
//!
//! This doesn't actually run any tests, it's mostly a compile-time verification
//! that things work.
#![no_std]
#![allow(dead_code)]
extern crate std as _some_other_name;
extern crate wasm_bindg... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/wasm/truthy_falsy.rs | tests/wasm/truthy_falsy.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn test_is_truthy() {
assert!(!JsValue::from(0).is_truthy());
assert!(!JsValue::from("".to_string()).is_truthy());
assert!(!JsValue::from(false).is_truthy());
assert!(!JsValue::NULL.is_truthy());
assert!(!JsValue::UNDEFINE... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/tests/wasm/macro_rules.rs | tests/wasm/macro_rules.rs | //! This tests that the `wasm_bindgen` macro produces code that compiles for this use case.
//! `cargo test --target wasm32-unknown-unknown` will not run if this test breaks.
use wasm_bindgen::prelude::*;
macro_rules! my_export {
($i: ident, $s: ty) => {
#[wasm_bindgen]
pub fn $i(_: $s) {}
};
}... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.