Apple Metal Shading Language
Publisher: Jakub JirakThemes in package: 1
Language support for Apple Metal Shading Language 4
Language support for Apple Metal Shading Language 4
Full workbench mockup using this variant's colors and tokenColors.
Loading...
Workbench UI color keys from the theme JSON colors map.
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| comment, punctuation.definition.comment | #6A9955 | italic |
| keyword.metal.function, keyword.control.metal | #C586C0 | — |
| keyword.metal.address-space, keyword.metal.access | #4FC1FF | — |
| support.type.metal.scalar, support.type.metal.vector, support.type.metal.matrix, storage.type.metal | #4EC9B0 | — |
| support.type.metal.texture, support.type.metal.sampler | #FFD700 | — |
| support.function.metal.math, support.function.metal.geometric, support.function.metal.texture, support.function.metal.thread, support.function.metal.atomic | #DCDCAA | — |
| support.other.attribute.metal | #9CDCFE | — |
| constant.numeric.metal, constant.numeric.metal.float, constant.numeric.metal.hex, constant.numeric.metal.integer | #B5CEA8 | — |
| constant.language.metal | #569CD6 | — |
| string.quoted.double.metal, string.quoted.single.metal | #CE9178 | — |
| keyword.operator.arithmetic.metal, keyword.operator.comparison.metal, keyword.operator.logical.metal, keyword.operator.assignment.metal | #D4D4D4 | — |
| meta.preprocessor.metal, keyword.control.directive.metal | #9B9B9B | — |
export interface User {
id: string;
name: string;
role: "admin" | "member";
tags: string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser(id: string): Promise<User | null> {
if (!id) {
return null;
}
const response = await fetch(`/api/users/${id}`, {
method: "GET",
headers: { Accept: "application/json" },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return (await response.json()) as User;
}
function greet(user: User): string {
// Simple greeting function that uses the user's name
return `Hello, ${user.name}!`;
}