From ff9f1ebcc9a13e494aeccda7e983f78852bde276 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 27 Jan 2025 15:18:43 -0500 Subject: [PATCH] Add more keywords for typescript and css --- src/common/filetype/css.ts | 763 +++++++++++++++++++----------- src/common/filetype/javascript.ts | 2 + 2 files changed, 489 insertions(+), 276 deletions(-) diff --git a/src/common/filetype/css.ts b/src/common/filetype/css.ts index 4ca52f3..d940369 100644 --- a/src/common/filetype/css.ts +++ b/src/common/filetype/css.ts @@ -88,303 +88,514 @@ export class CSSFile extends AbstractFileType { '@view-transition', ]; public override readonly keywords2 = [ - 'animation-range-end', - 'animation-range-start', - 'accent-color', - 'animation-timeline', - 'animation', - 'animation-timing-function', - 'animation-composition', - 'animation-delay', - 'animation-direction', - 'appearance', - 'align-content', - 'animation-duration', - 'align-items', - 'animation-fill-mode', - 'align-self', - 'animation-iteration-count', - 'aspect-ratio', - 'align-tracks', - 'animation-name', - 'all', - 'animation-play-state', - 'animation-name', - 'anchor-name', - 'border-block-start-color', - 'border-inline-style', - 'backdrop-filter', - 'border-block-start-style', - 'border-inline-width', - 'backface-visibility', - 'border-block-start-width', - 'border-left', - 'background', - 'border-block-style', - 'border-left-color', - 'background-attachment', - 'border-block-width', - 'border-left-style', - 'background-blend-mode', - 'border-bottom', - 'border-left-width', - 'background-clip', - 'border-bottom-color', - 'border-radius', - 'background-color', - 'border-bottom-left-radius', - 'border-right', - 'background-image', - 'border-bottom-right-radius', - 'border-right-color', - 'background-origin', - 'border-bottom-style', - 'border-right-style', - 'background-position', - 'border-bottom-width', - 'border-right-width', - 'background-position-x', - 'border-collapse', - 'border-spacing', - 'background-position-y', - 'border-color', - 'border-start-end-radius', - 'background-repeat', - 'border-end-end-radius', - 'border-start-start-radius', - 'background-size', - 'border-end-start-radius', - 'border-style', - 'border-image', - 'border-top', - 'border-image-outset', - 'border-top-color', - 'border-image-repeat', - 'border-top-left-radius', - 'border-image-slice', - 'border-top-right-radius', - 'border-image-source', - 'border-top-style', - 'border-image-width', - 'border-top-width', - 'border-inline', - 'border-width', - 'block-size', - 'border-inline-color', - 'bottom', - 'border-inline-end', - 'border', - 'border-inline-end-color', - 'box-decoration-break', - 'border-block', - 'border-inline-end-style', - 'box-shadow', - 'border-block-color', - 'border-inline-end-width', - 'box-sizing', - 'border-block-end', - 'border-inline-start', - 'break-after', - 'border-block-end-color', - 'border-inline-start-color', - 'break-before', - 'border-block-end-style', - 'border-inline-start-style', - 'break-inside', - 'border-block-end-width', - 'border-inline-start-width', - 'border-block-start', - 'column-rule', - 'content-visibility', - 'caption-side', - 'column-rule-color', - 'column-rule-style', - 'caret-color', - 'column-rule-width', - 'column-span', - 'counter-increment', - 'column-width', - 'counter-reset', - 'columns', - 'counter-set', - 'contain', - 'contain-intrinsic-block-size', - 'clear', - 'contain-intrinsic-height', - 'clip', 'contain-intrinsic-inline-size', - 'clip-path', - 'color', - 'contain-intrinsic-width', - 'cursor', - 'color-scheme', - 'container', - 'column-count', - 'container-name', - 'column-fill', - 'container-type', - 'column-gap', - 'content', - 'direction', - 'display', - 'empty-cells', - 'font-synthesis-position', - 'field-sizing', - 'font', + 'contain-intrinsic-block-size', + 'scroll-padding-inline-start', + 'border-bottom-right-radius', + 'overscroll-behavior-inline', + 'scroll-margin-inline-start', + 'scroll-padding-block-start', + 'transition-timing-function', + 'animation-iteration-count', + 'animation-timing-function', + 'border-bottom-left-radius', + 'border-inline-start-color', + 'border-inline-start-style', + 'border-inline-start-width', + 'border-start-start-radius', 'font-synthesis-small-caps', - 'filter', - 'font-synthesis-style', - 'font-synthesis-weight', - 'font-family', - 'font-variant', + 'overscroll-behavior-block', + 'repeating-linear-gradient', + 'repeating-radial-gradient', + 'scroll-margin-block-start', + 'scroll-padding-inline-end', + 'text-decoration-thickness', + 'border-block-start-color', + 'border-block-start-style', + 'border-block-start-width', + 'contain-intrinsic-height', + 'repeating-conic-gradient', + 'scroll-margin-inline-end', + 'scroll-padding-block-end', + 'text-decoration-skip-ink', + 'border-end-start-radius', + 'border-inline-end-color', + 'border-inline-end-style', + 'border-inline-end-width', + 'border-start-end-radius', + 'border-top-right-radius', + 'contain-intrinsic-width', + 'font-synthesis-position', 'font-variant-alternates', - 'font-variant-caps', - 'font-feature-settings', 'font-variant-east-asian', - 'font-variant-emoji', - 'font-variant-ligatures', - 'font-variant-numeric', - 'font-variant-position', - 'flex', - 'font-kerning', 'font-variation-settings', - 'flex-basis', + 'scroll-margin-block-end', + 'text-underline-position', + 'border-block-end-color', + 'border-block-end-style', + 'border-block-end-width', + 'border-top-left-radius', 'font-language-override', - 'flex-direction', - 'font-optical-sizing', - 'flex-flow', - 'font-palette', - 'font-weight', - 'flex-grow', - 'flex-shrink', - 'font-size', - 'forced-color-adjust', - 'flex-wrap', - 'font-size-adjust', - 'font-stretch', - 'float', - 'font-style', - 'font-synthesis', - 'grid-auto-columns', - 'grid-row-end', - 'gap', - 'grid-auto-flow', - 'grid-row-start', - 'grid-auto-rows', - 'grid-template', - 'grid-column', - 'grid-template-areas', - 'grid-column-end', + 'font-variant-ligatures', + 'position-try-fallbacks', + 'text-emphasis-position', + 'animation-composition', + 'animation-range-start', + 'background-attachment', + 'background-blend-mode', + 'background-position-x', + 'background-position-y', + 'border-end-end-radius', + 'font-feature-settings', + 'font-synthesis-weight', + 'font-variant-position', 'grid-template-columns', - 'grid', - 'grid-column-start', - 'grid-template-rows', - 'grid-area', - 'grid-row', + 'hyphenate-limit-chars', + 'overscroll-behavior-x', + 'overscroll-behavior-y', + 'scroll-padding-bottom', + 'scroll-padding-inline', + 'shape-image-threshold', + 'text-decoration-color', + 'text-decoration-style', + 'text-underline-offset', + 'animation-play-state', + 'box-decoration-break', + 'font-synthesis-style', + 'font-variant-numeric', + 'overflow-clip-margin', + 'padding-inline-start', + 'scroll-margin-bottom', + 'scroll-margin-inline', + 'scroll-padding-block', + 'scroll-padding-right', + 'scroll-timeline-axis', + 'scroll-timeline-name', + 'text-combine-upright', + 'text-decoration-line', + 'text-decoration-skip', + 'view-transition-name', + 'white-space-collapse', + 'animation-direction', + 'animation-fill-mode', + 'animation-range-end', + 'backface-visibility', + 'background-position', + 'border-bottom-color', + 'border-bottom-style', + 'border-bottom-width', + 'border-image-outset', + 'border-image-repeat', + 'border-image-source', + 'border-inline-color', + 'border-inline-start', + 'border-inline-style', + 'border-inline-width', + 'font-optical-sizing', + 'forced-color-adjust', + 'grid-template-areas', 'hanging-punctuation', 'hyphenate-character', - 'hyphenate-limit-chars', - 'height', - 'hyphens', - 'initial', - 'inset-inline', - 'initial-letter', - 'inset-inline-end', + 'list-style-position', + 'margin-inline-start', + 'overscroll-behavior', + 'padding-block-start', + 'position-visibility', + 'scroll-margin-block', + 'scroll-margin-right', + 'scroll-padding-left', + 'text-emphasis-color', + 'text-emphasis-style', + 'transition-behavior', + 'transition-duration', + 'transition-property', + 'view-timeline-inset', + 'animation-duration', + 'animation-timeline', + 'border-block-color', + 'border-block-start', + 'border-block-style', + 'border-block-width', + 'border-image-slice', + 'border-image-width', + 'border-right-color', + 'border-right-style', + 'border-right-width', + 'content-visibility', + 'font-variant-emoji', + 'grid-template-rows', + 'margin-block-start', + 'mask-border-outset', + 'mask-border-repeat', + 'mask-border-source', + 'padding-inline-end', + 'perspective-origin', + 'position-try-order', + 'print-color-adjust', + 'scroll-margin-left', + 'scroll-padding-top', + 'view-timeline-axis', + 'view-timeline-name', + 'background-origin', + 'background-repeat', + 'border-inline-end', + 'border-left-color', + 'border-left-style', + 'border-left-width', + 'column-rule-color', + 'column-rule-style', + 'column-rule-width', + 'counter-increment', + 'font-variant-caps', + 'grid-auto-columns', + 'grid-column-start', 'image-orientation', - 'image-rendering', - 'inline-size', - 'image-resolution', - 'inset', - 'isolation', - 'inset-area', - 'inset-block', - 'inherit', - 'inset-block-end', 'inset-block-start', + 'margin-inline-end', + 'mask-border-slice', + 'mask-border-width', + 'masonry-auto-flow', + 'padding-block-end', + 'page-break-before', + 'scroll-margin-top', + 'scroll-snap-align', + 'stroke-dashoffset', + 'stroke-miterlimit', + 'text-spacing-trim', + 'background-color', + 'background-image', + 'border-block-end', + 'border-top-color', + 'border-top-style', + 'border-top-width', + 'font-size-adjust', + 'image-resolution', + 'inset-inline-end', + 'line-height-step', + 'list-style-image', + 'margin-block-end', + 'mask-border-mode', + 'page-break-after', + 'page-brak-inside', + 'page-orientation', + 'scroll-snap-stop', + 'scroll-snap-type', + 'scrollbar-gutter', + 'stroke-dasharray', + 'text-orientation', + 'text-size-adjust', + 'transform-origin', + 'transition-delay', + 'animation-delay', + 'backdrop-filter', + 'background-clip', + 'background-size', + 'border-collapse', + 'grid-column-end', + 'image-rendering', + 'inset-block-end', 'justify-content', - 'justify-self', - 'justify-items', + 'list-style-type', + 'max-inline-size', + 'min-inline-size', + 'object-position', + 'offset-distance', + 'offset-position', + 'overflow-anchor', + 'overflow-inline', + 'override-colors', + 'position-anchor', + 'radial-gradient', + 'scroll-behavior', + 'scroll-timeline', + 'scrollbar-color', + 'scrollbar-width', + 'shape-rendering', + 'stroke-linejoin', + 'text-align-last', + 'text-decoration', + 'text-wrap-style', + 'transform-style', + 'animation-name', + 'animation-name', + 'border-spacing', + 'container-name', + 'container-type', + 'flex-direction', + 'font-synthesis', + 'grid-auto-flow', + 'grid-auto-rows', + 'grid-row-start', + 'initial-letter', 'justify-tracks', 'letter-spacing', - 'list-style', - 'list-style-image', - 'line-break', - 'list-style-position', - 'line-clamp', - 'list-style-type', - 'line-height', - 'left', - 'line-height-step', - 'mask-border-outset', - 'margin', - 'mask-border-repeat', - 'margin-block', - 'mask-border-slice', - 'margin-block-end', - 'mask-border-source', - 'margin-block-start', - 'mask-border-width', - 'max-height', - 'margin-bottom', - 'mask-clip', - 'max-inline-size', - 'margin-inline', 'mask-composite', - 'margin-inline-end', - 'mask-image', - 'max-width', - 'margin-inline-start', - 'mask-mode', - 'margin-left', - 'mask-origin', - 'margin-right', - 'mask-position', 'min-block-size', - 'margin-top', - 'mask-repeat', - 'min-height', - 'margin-trim', - 'mask-size', - 'min-inline-size', - 'mask-type', - 'min-width', - 'masonry-auto-flow', - 'mask', - 'math-depth', 'mix-blend-mode', - 'mask-border', - 'math-shift', - 'mask-border-mode', - 'math-style', - 'object-fit', - 'order', - 'overflow-inline', - 'object-position', - 'overflow-wrap', - 'offset', - 'orphans', - 'overflow-x', + 'outline-offset', + 'overflow-block', + 'padding-bottom', + 'padding-inline', + 'pointer-events', + 'scroll-padding', + 'stroke-linecap', + 'stroke-opacity', + 'text-rendering', + 'text-transform', + 'text-wrap-mode', + 'timeline-scope', + 'vertical-align', + 'align-content', + 'border-bottom', + 'border-inline', + 'border-radius', + 'counter-reset', + 'grid-template', + 'justify-items', + 'margin-bottom', + 'margin-inline', + 'mask-position', 'offset-anchor', + 'offset-rotate', + 'outline-color', + 'outline-style', + 'outline-width', + 'overflow-wrap', + 'padding-block', + 'padding-right', + 'place-content', + 'position-area', + 'ruby-position', + 'scroll-margin', + 'shape-outside', + 'text-emphasis', + 'text-overflow', + 'transform-box', + 'unicode-range', + 'vector-effect', + 'view-timeline', + 'accent-color', + 'align-tracks', + 'aspect-ratio', + 'border-block', + 'border-color', + 'border-image', + 'border-right', + 'border-style', + 'border-width', + 'break-before', + 'break-inside', + 'caption-side', + 'color-scheme', + 'column-count', + 'column-width', + 'field-sizing', + 'font-kerning', + 'font-palette', + 'font-stretch', + 'font-variant', + 'grid-row-end', + 'inset-inline', + 'justify-self', + 'margin-block', + 'margin-right', + 'padding-left', + 'position-try', + 'shape-margin', + 'stop-opacity', + 'stroke-width', + 'table-layout', + 'text-justify', + 'text-shaddow', + 'touch-action', + 'unicode-bidi', + 'word-spacing', + 'writing-mode', + 'align-items', + 'anchor-name', + 'border-left', + 'break-after', + 'caret-color', + 'column-fill', + 'column-rule', + 'column-span', + 'counter-set', + 'empty-cells', + 'flex-shrink', + 'font-family', + 'font-weight', + 'grid-column', + 'inline-size', + 'inset-block', + 'line-height', + 'margin-left', + 'margin-trim', + 'mask-border', + 'mask-origin', + 'mask-repeat', + 'offset-path', + 'paddint-top', + 'paint-order', + 'perspective', + 'place-items', + 'size-adjust', + 'text-anchor', + 'text-indent', + 'translate3d', + 'user-select', + 'white-space', + 'will-change', + 'align-self', + 'appearance', + 'background', + 'block-size', + 'border-top', + 'box-shadow', + 'box-sizing', + 'column-gap', + 'flex-basis', + 'font-style', + 'inset-area', + 'line-break', + 'line-clamp', + 'list-style', + 'margin-top', + 'mask-image', + 'math-depth', + 'math-shift', + 'math-style', + 'max-height', + 'min-height', + 'object-fit', + 'overflow-x', 'overflow-y', - 'offset-distance', + 'place-self', + 'ruby-align', + 'stop-color', + 'text-align', + 'transition', + 'translateX', + 'translateY', + 'translateZ', + 'visibility', + 'word-break', + 'animation', + 'clip-path', + 'container', + 'direction', + 'flex-flow', + 'flex-grow', + 'flex-wrap', + 'font-size', + 'grid-area', + 'isolation', + 'mask-clip', + 'mask-mode', + 'mask-size', + 'mask-type', + 'max-width', + 'min-width', + 'text-wrap', + 'transform', + 'translate', + 'word-wrap', + 'work-wrap', + 'grid-row', + 'position', + 'rotate3d', + 'saturate', + 'speak-as', + 'tab-size', + 'columns', + 'contain', + 'content', + 'display', + 'hyphens', + 'inherit', + 'initial', + 'opacity', + 'orphans', 'outline', 'overlay', - 'offset-path', - 'outline-color', - 'offset-position', - 'outline-offset', - 'offset-rotate', - 'outline-style', - 'overscroll-behavior', - 'outline-width', - 'overscroll-behavior-block', - 'overscroll-behavior-inline', - 'opacity', - 'overflow-anchor', - 'overscroll-behavior-x', - 'overflow-block', - 'overscroll-behavior-y', - 'overflow-clip-margin', + 'padding', + 'polygon', + 'rotateX', + 'rotateY', + 'rotateZ', + 'row-gap', + 'scale3d', + 'symbols', + 'z-index', + 'border', + 'bottom', + 'cursor', + 'filter', + 'height', + 'margin', + 'offset', + 'quotes', + 'repeat', + 'resize', + 'revert', + 'rotate', + 'scaleX', + 'scaleY', + 'scaleZ', + 'scroll', + 'stroke', + 'suffix', + 'syntax', + 'system', + 'widows', + 'clear', + 'color', + 'float', + 'inset', + 'order', + 'paint', + 'range', + 'right', + 'round', + 'scale', + 'sepia', + 'skewX', + 'skewY', + 'steps', + 'unset', + 'width', + 'width', + 'clip', + 'flex', + 'font', + 'grid', + 'left', + 'mask', + 'page', + 'path', + 'rect', + 'sign', + 'size', + 'skew', + 'sqrt', + 'view', + 'zoom', + 'all', + 'gap', + 'pow', + 'ray', + 'rem', + 'rgb', + 'sin', + 'src', + 'tan', + 'top', + 'url', + 'var', + 'rx', + 'ry', + 'r', + 'x', + 'y', ]; public override readonly operators = ['::', ':', ',', '+', '>', '~', '-']; public override readonly hlOptions: HighlightingOptions = { diff --git a/src/common/filetype/javascript.ts b/src/common/filetype/javascript.ts index d0b1312..b8da24c 100644 --- a/src/common/filetype/javascript.ts +++ b/src/common/filetype/javascript.ts @@ -142,9 +142,11 @@ export class TypeScriptFile extends JavaScriptFile { 'interface', 'keyof', 'number', + 'override', 'private', 'protected', 'public', + 'readonly', 'string', 'type', 'unknown',