Add copyright headers to all files

This commit is contained in:
Leonard Hecker 2025-05-17 01:27:34 +02:00
parent 0c14eb58fb
commit d17cf66c7c
46 changed files with 138 additions and 0 deletions

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::hint::black_box; use std::hint::black_box;
use std::mem; use std::mem;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
fn main() { fn main() {
#[cfg(windows)] #[cfg(windows)]
if std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default() == "windows" { if std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default() == "windows" {

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Provides a transparent error type for edit. //! Provides a transparent error type for edit.
use std::{io, result}; use std::{io, result};

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(clippy::missing_safety_doc, clippy::mut_from_ref)] #![allow(clippy::missing_safety_doc, clippy::mut_from_ref)]
use std::alloc::{AllocError, Allocator, Layout}; use std::alloc::{AllocError, Allocator, Layout};

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Arena allocators. Small and fast. //! Arena allocators. Small and fast.
#[cfg(debug_assertions)] #[cfg(debug_assertions)]

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(clippy::mut_from_ref)] #![allow(clippy::mut_from_ref)]
use std::alloc::{AllocError, Allocator, Layout}; use std::alloc::{AllocError, Allocator, Layout};

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::ops::Deref; use std::ops::Deref;
#[cfg(debug_assertions)] #[cfg(debug_assertions)]

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::fmt; use std::fmt;
use std::ops::{Bound, Deref, DerefMut, RangeBounds}; use std::ops::{Bound, Deref, DerefMut, RangeBounds};

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Base64 facilities. //! Base64 facilities.
use crate::arena::ArenaString; use crate::arena::ArenaString;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::collections::LinkedList; use std::collections::LinkedList;
use std::ffi::OsStr; use std::ffi::OsStr;
use std::fs::File; use std::fs::File;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use edit::framebuffer::IndexedColor; use edit::framebuffer::IndexedColor;
use edit::helpers::*; use edit::helpers::*;
use edit::icu; use edit::icu;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::cmp::Ordering; use std::cmp::Ordering;
use std::fs; use std::fs;
use std::path::PathBuf; use std::path::PathBuf;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use edit::arena_format; use edit::arena_format;
use edit::helpers::*; use edit::helpers::*;
use edit::input::{kbmod, vk}; use edit::input::{kbmod, vk};

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use edit::framebuffer::{Attributes, IndexedColor}; use edit::framebuffer::{Attributes, IndexedColor};
use edit::helpers::*; use edit::helpers::*;
use edit::input::vk; use edit::input::vk;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use edit::arena::scratch_arena; use edit::arena::scratch_arena;
use edit::sys; use edit::sys;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![feature(let_chains, linked_list_cursors, os_string_truncate, string_from_utf8_lossy_owned)] #![feature(let_chains, linked_list_cursors, os_string_truncate, string_from_utf8_lossy_owned)]
mod documents; mod documents;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::borrow::Cow; use std::borrow::Cow;
use std::ffi::{OsStr, OsString}; use std::ffi::{OsStr, OsString};
use std::mem; use std::mem;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::ops::Range; use std::ops::Range;
use std::ptr::{self, NonNull}; use std::ptr::{self, NonNull};
use std::slice; use std::slice;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! A text buffer for a text editor. //! A text buffer for a text editor.
//! //!
//! Implements a Unicode-aware, layout-aware text buffer for terminals. //! Implements a Unicode-aware, layout-aware text buffer for terminals.

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::ops::Range; use std::ops::Range;
use crate::document::ReadableDocument; use crate::document::ReadableDocument;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! [`std::cell::RefCell`], but without runtime checks in release builds. //! [`std::cell::RefCell`], but without runtime checks in release builds.
#[cfg(debug_assertions)] #[cfg(debug_assertions)]

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Abstractions over reading/writing arbitrary text containers. //! Abstractions over reading/writing arbitrary text containers.
use std::ffi::OsString; use std::ffi::OsString;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! A shoddy framebuffer for terminal applications. //! A shoddy framebuffer for terminal applications.
use std::cell::Cell; use std::cell::Cell;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Fuzzy search algorithm based on the one used in VS Code (`/src/vs/base/common/fuzzyScorer.ts`). //! Fuzzy search algorithm based on the one used in VS Code (`/src/vs/base/common/fuzzyScorer.ts`).
//! Other algorithms exist, such as Sublime Text's, or the one used in `fzf`, //! Other algorithms exist, such as Sublime Text's, or the one used in `fzf`,
//! but I figured that this one is what lots of people may be familiar with. //! but I figured that this one is what lots of people may be familiar with.

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Provides fast, non-cryptographic hash functions. //! Provides fast, non-cryptographic hash functions.
/// The venerable wyhash hash function. /// The venerable wyhash hash function.

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Random assortment of helpers I didn't know where to put. //! Random assortment of helpers I didn't know where to put.
use std::alloc::Allocator; use std::alloc::Allocator;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Bindings to the ICU library. //! Bindings to the ICU library.
use std::cmp::Ordering; use std::cmp::Ordering;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Parses VT sequences into input events. //! Parses VT sequences into input events.
//! //!
//! In the future this allows us to take apart the application and //! In the future this allows us to take apart the application and

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![feature( #![feature(
allocator_api, allocator_api,
breakpoint, breakpoint,

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Oklab colorspace conversions. //! Oklab colorspace conversions.
//! //!
//! Implements Oklab as defined at: <https://bottosson.github.io/posts/oklab/> //! Implements Oklab as defined at: <https://bottosson.github.io/posts/oklab/>

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Path related helpers. //! Path related helpers.
use std::ffi::OsStr; use std::ffi::OsStr;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! `memchr`, but with two needles. //! `memchr`, but with two needles.
use std::ptr; use std::ptr;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! `memchr`, but with two needles. //! `memchr`, but with two needles.
use std::ptr; use std::ptr;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! `memchr` for arbitrary sizes (1/2/4/8 bytes). //! `memchr` for arbitrary sizes (1/2/4/8 bytes).
//! //!
//! Clang calls the C `memset` function only for byte-sized types (or 0 fills). //! Clang calls the C `memset` function only for byte-sized types (or 0 fills).

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Provides various high-throughput utilities. //! Provides various high-throughput utilities.
mod memchr2; mod memchr2;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Platform abstractions. //! Platform abstractions.
use std::fs::File; use std::fs::File;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Unix-specific platform code. //! Unix-specific platform code.
//! //!
//! Read the `windows` module for reference. //! Read the `windows` module for reference.

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::ffi::{CStr, OsString, c_void}; use std::ffi::{CStr, OsString, c_void};
use std::fmt::Write as _; use std::fmt::Write as _;
use std::fs::{self, File}; use std::fs::{self, File};

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! An immediate mode UI framework for terminals. //! An immediate mode UI framework for terminals.
//! //!
//! # Why immediate mode? //! # Why immediate mode?

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::hint::cold_path; use std::hint::cold_path;
use super::Utf8Chars; use super::Utf8Chars;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Everything related to Unicode lives here. //! Everything related to Unicode lives here.
mod measurement; mod measurement;

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// BEGIN: Generated by grapheme-table-gen on 2025-03-31T16:50:08Z, from Unicode 16.0.0, with --lang=rust --extended --no-ambiguous --line-breaks, 16950 bytes // BEGIN: Generated by grapheme-table-gen on 2025-03-31T16:50:08Z, from Unicode 16.0.0, with --lang=rust --extended --no-ambiguous --line-breaks, 16950 bytes
#[rustfmt::skip] #[rustfmt::skip]
const STAGE0: [u16; 544] = [ const STAGE0: [u16; 544] = [

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::{hint, iter}; use std::{hint, iter};
/// An iterator over UTF-8 encoded characters. /// An iterator over UTF-8 encoded characters.

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Our VT parser. //! Our VT parser.
use std::{mem, time}; use std::{mem, time};

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
mod rules; mod rules;
use crate::rules::{JOIN_RULES_GRAPHEME_CLUSTER, JOIN_RULES_LINE_BREAK}; use crate::rules::{JOIN_RULES_GRAPHEME_CLUSTER, JOIN_RULES_LINE_BREAK};

View File

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// Used as an indicator in our rules for ÷ ("does not join"). // Used as an indicator in our rules for ÷ ("does not join").
// Underscore is one of the few characters that are permitted as an identifier, // Underscore is one of the few characters that are permitted as an identifier,
// are monospace in most fonts and also visually distinct from the digits. // are monospace in most fonts and also visually distinct from the digits.