-
Rainbow Bracket-Pair-Colorizer-2 VSCode는 타입스크립로 만듬ts 코드 by _ API usage could look like this:코딩Coding/TypeScript 2022. 9. 24. 00:04728x90
https://github.com/jpcastberg/Performant-Bracket-Pair-Colorizer-2
const doc = vscode.workspace.textDocuments[0]; // If a non-undefined value is returned, these tokens must be in sync with `doc`. // We intentionally don't return a promise here to avoid synchronization issues. // This API allows to compute tokens in batches to avoid freezing the extension host. const tokens: { isComputing: false, tokens: ILineToken[] } | { isComputing: true } = doc.getTokensForLine(myLine); vscode.workspace.onDidChangeTextDocumentTokens((e: { changedRanges: Range[] }) => { // Is fired immediately after the text document got changed or computation started/finished. // Calls to `getTokensForLine` can still return `{ isComputing: true }`. const tokens = doc.getTokensForLine(myLine); }); // Tokens itself could look like this: interface ILineToken { kind: TokenKind, languageId: string, // e.g. 'typescript' or 'html' startOffset: number, endOffset: number } // Only provide a very limited amount of token kinds so that // we don't expose too much textmate flavor. // We could easily provide the same token information with tree-sitter or monarch. enum TokenKind { default, string, comment, regex }
반응형'코딩Coding > TypeScript' 카테고리의 다른 글
3 Ways to Code a BuzzFeed Clone (JavaScript + TypeScript + JSONServer + Database + API + Node.js) (0) 2023.02.12 2023년에는 더 잘하는 타입스크립트 개발자가 되고 싶다면? 11가지 타입스크립트 팁! - 출처: 노마드 코더Nomad Noder (0) 2023.01.12 TS타입스크립트 쓰는 이유 & 필수 문법 10분 정리 (0) 2022.12.21 Learn TypeScript❤️– Full Tutorial 👍freeCodeCamp.org (0) 2022.11.23 TypeScript❤️Angular for Beginners Course [Full Front End Tutorial with TypeScript] (0) 2022.09.11 TypeScript ❤️Course for Beginners - Learn TypeScript from Scratch! (0) 2022.08.17 TS(TypeScript❤️코딩하는거VSCODE에서 디버그같이 바로 테스트해본다. 신기하다.❤️ (0) 2022.08.16 타입스크립트)@types/jquery설치하기 (0) 2022.08.16