├── .github ├── FUNDING.yml └── workflows │ ├── release.yml │ └── ci.yml ├── .npmrc ├── pnpm-workspace.yaml ├── res └── icon.png ├── .vscode ├── extensions.json ├── launch.json ├── tasks.json └── settings.json ├── eslint.config.mjs ├── src ├── utils.ts ├── config.ts └── index.ts ├── .gitignore ├── test └── index.test.ts ├── tsup.config.ts ├── tsconfig.json ├── LICENSE.md ├── README.md └── package.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [antfu] 2 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | ignore-workspace-root-check=true 2 | node-linker=hoisted 3 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - playground 3 | - examples/* 4 | -------------------------------------------------------------------------------- /res/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu/vscode-array-index-inlay/HEAD/res/icon.png -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "amodio.tsl-problem-matcher", 4 | "emeraldwalk.runonsave" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import antfu from '@antfu/eslint-config' 3 | 4 | export default antfu( 5 | { 6 | formatters: true, 7 | }, 8 | ) 9 | -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- 1 | import { useLogger } from 'reactive-vscode' 2 | import { displayName } from './generated/meta' 3 | 4 | export const logger = useLogger(displayName) 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .cache 2 | .DS_Store 3 | .idea 4 | *.log 5 | *.tgz 6 | *.vsix 7 | coverage 8 | dist 9 | lib-cov 10 | logs 11 | node_modules 12 | temp 13 | src/generated 14 | -------------------------------------------------------------------------------- /test/index.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from 'vitest' 2 | 3 | describe('should', () => { 4 | it('exported', () => { 5 | expect(1).toEqual(1) 6 | }) 7 | }) 8 | -------------------------------------------------------------------------------- /src/config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfigObject } from 'reactive-vscode' 2 | import * as Meta from './generated/meta' 3 | 4 | export const config = defineConfigObject( 5 | Meta.scopedConfigs.scope, 6 | Meta.scopedConfigs.defaults, 7 | ) 8 | -------------------------------------------------------------------------------- /tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup' 2 | 3 | export default defineConfig({ 4 | entry: [ 5 | 'src/index.ts', 6 | ], 7 | format: ['cjs'], 8 | shims: false, 9 | dts: false, 10 | external: [ 11 | 'vscode', 12 | ], 13 | }) 14 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2017", 4 | "lib": ["esnext"], 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "resolveJsonModule": true, 8 | "strict": true, 9 | "strictNullChecks": true, 10 | "esModuleInterop": true, 11 | "skipDefaultLibCheck": true, 12 | "skipLibCheck": true 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Extension", 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "runtimeExecutable": "${execPath}", 9 | "args": [ 10 | "--extensionDevelopmentPath=${workspaceFolder}" 11 | ], 12 | "outFiles": [ 13 | "${workspaceFolder}/dist/**/*.js" 14 | ], 15 | "preLaunchTask": "npm: dev" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | permissions: 4 | contents: write 5 | 6 | on: 7 | push: 8 | tags: 9 | - 'v*' 10 | 11 | jobs: 12 | release: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v3 16 | with: 17 | fetch-depth: 0 18 | 19 | - uses: actions/setup-node@v4 20 | with: 21 | node-version: lts/* 22 | 23 | - run: npx changelogithub 24 | env: 25 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 26 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "dev", 9 | "isBackground": true, 10 | "presentation": { 11 | "reveal": "never" 12 | }, 13 | "problemMatcher": [ 14 | { 15 | "base": "$ts-webpack-watch", 16 | "background": { 17 | "activeOnStart": true, 18 | "beginsPattern": "Build start", 19 | "endsPattern": "Build success" 20 | } 21 | } 22 | ], 23 | "group": "build" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Anthony Fu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | // Auto generate metadata 3 | "emeraldwalk.runonsave": { 4 | "commands": [ 5 | { 6 | "match": "package.json", 7 | "isAsync": true, 8 | "cmd": "npm run update" 9 | } 10 | ] 11 | }, 12 | 13 | // Disable the default formatter, use eslint instead 14 | "prettier.enable": false, 15 | "editor.formatOnSave": false, 16 | 17 | // Auto fix 18 | "editor.codeActionsOnSave": { 19 | "source.fixAll.eslint": "explicit", 20 | "source.organizeImports": "never" 21 | }, 22 | 23 | // Silent the stylistic rules in you IDE, but still auto fix them 24 | "eslint.rules.customizations": [ 25 | { "rule": "style/*", "severity": "off" }, 26 | { "rule": "*-indent", "severity": "off" }, 27 | { "rule": "*-spacing", "severity": "off" }, 28 | { "rule": "*-spaces", "severity": "off" }, 29 | { "rule": "*-order", "severity": "off" }, 30 | { "rule": "*-dangle", "severity": "off" }, 31 | { "rule": "*-newline", "severity": "off" }, 32 | { "rule": "*quotes", "severity": "off" }, 33 | { "rule": "*semi", "severity": "off" } 34 | ], 35 | 36 | // Enable eslint for all supported languages 37 | "eslint.validate": [ 38 | "javascript", 39 | "javascriptreact", 40 | "typescript", 41 | "typescriptreact", 42 | "vue", 43 | "html", 44 | "markdown", 45 | "json", 46 | "jsonc", 47 | "yaml" 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | pull_request: 9 | branches: 10 | - main 11 | 12 | jobs: 13 | lint: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | 18 | - name: Install pnpm 19 | uses: pnpm/action-setup@v2 20 | 21 | - name: Set node 22 | uses: actions/setup-node@v3 23 | with: 24 | node-version: lts/* 25 | cache: pnpm 26 | 27 | - name: Setup 28 | run: npm i -g @antfu/ni 29 | 30 | - name: Install 31 | run: nci 32 | 33 | - name: Lint 34 | run: nr lint 35 | 36 | typecheck: 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v3 40 | 41 | - name: Install pnpm 42 | uses: pnpm/action-setup@v2 43 | 44 | - name: Set node 45 | uses: actions/setup-node@v3 46 | with: 47 | node-version: lts/* 48 | cache: pnpm 49 | 50 | - name: Setup 51 | run: npm i -g @antfu/ni 52 | 53 | - name: Install 54 | run: nci 55 | 56 | - name: Typecheck 57 | run: nr typecheck 58 | 59 | test: 60 | runs-on: ${{ matrix.os }} 61 | 62 | strategy: 63 | matrix: 64 | node: [lts/*] 65 | os: [ubuntu-latest, windows-latest, macos-latest] 66 | fail-fast: false 67 | 68 | steps: 69 | - uses: actions/checkout@v3 70 | 71 | - name: Install pnpm 72 | uses: pnpm/action-setup@v2 73 | 74 | - name: Set node version to ${{ matrix.node }} 75 | uses: actions/setup-node@v3 76 | with: 77 | node-version: ${{ matrix.node }} 78 | cache: pnpm 79 | 80 | - name: Setup 81 | run: npm i -g @antfu/ni 82 | 83 | - name: Install 84 | run: nci 85 | 86 | - name: Build 87 | run: nr build 88 | 89 | - name: Test 90 | run: nr test 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 |

Array Index Inlay VS Code

6 | 7 |

8 | Visual Studio Marketplace Version 9 | Made with reactive-vscode 10 |

11 | 12 |

13 | Show array index inlay hints for large arrays.
14 |

15 | 16 |

17 | Screenshot 18 |

19 | 20 | ## Configs 21 | 22 | 23 | 24 | | Key | Description | Type | Default | 25 | | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ---------------- | 26 | | `arrayIndexInlay.enabled` | Enable inlay hints | `boolean` | `true` | 27 | | `arrayIndexInlay.minLength` | Minimum length of array to show inlay hints | `number` | `15` | 28 | | `arrayIndexInlay.minLines` | Minimum lines of array to show inlay hints | `number` | `30` | 29 | | `arrayIndexInlay.startIndex` | Start index of the array, default to 0 | `number` | `0` | 30 | | `arrayIndexInlay.allowSpread` | Show inlay hints even there are spread operators in the array | `boolean` | `false` | 31 | | `arrayIndexInlay.colorizeDepth` | Colorize the inlay hints based on the depth of the array. Colors can be customized with `arrayIndexInlay.depthColors` | `boolean` | `false` | 32 | | `arrayIndexInlay.depthColors` | Custom colors for each level of the array. Supports CSS color formats. Select an equal number of colors to your bracket colors to get the best results. | `array` | See package.json | 33 | 34 | 35 | 36 | ## Supported Languages 37 | 38 | - JavaScript 39 | - TypeScript 40 | - JSX 41 | - TSX 42 | - JSON / JSONC / JSON5 43 | - Vue 44 | - Svelte 45 | - Astro 46 | 47 | ## Sponsors 48 | 49 |

50 | 51 | 52 | 53 |

54 | 55 | ## License 56 | 57 | [MIT](./LICENSE) License © 2022 [Anthony Fu](https://github.com/antfu) 58 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "publisher": "antfu", 3 | "name": "array-index-inlay", 4 | "displayName": "Array Index Inlay", 5 | "version": "0.4.2", 6 | "private": true, 7 | "packageManager": "pnpm@9.15.2", 8 | "description": "Inlay hints for index of large arrays", 9 | "author": "Anthony Fu ", 10 | "license": "MIT", 11 | "funding": "https://github.com/sponsors/antfu", 12 | "homepage": "https://github.com/antfu/vscode-array-index-inlay#readme", 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/antfu/vscode-array-index-inlay" 16 | }, 17 | "bugs": { 18 | "url": "https://github.com/antfu/vscode-array-index-inlay/issues" 19 | }, 20 | "sponsor": { 21 | "url": "https://github.com/sponsors/antfu" 22 | }, 23 | "categories": [ 24 | "Other" 25 | ], 26 | "main": "./dist/index.js", 27 | "icon": "res/icon.png", 28 | "files": [ 29 | "LICENSE.md", 30 | "dist/*", 31 | "res/*" 32 | ], 33 | "engines": { 34 | "vscode": "^1.90.0" 35 | }, 36 | "activationEvents": [ 37 | "onStartupFinished" 38 | ], 39 | "contributes": { 40 | "commands": [ 41 | { 42 | "category": "Array Index Inlay", 43 | "title": "Toggle", 44 | "command": "arrayIndexInlay.toggle" 45 | } 46 | ], 47 | "configuration": { 48 | "type": "object", 49 | "properties": { 50 | "arrayIndexInlay.enabled": { 51 | "type": "boolean", 52 | "default": true, 53 | "description": "Enable inlay hints" 54 | }, 55 | "arrayIndexInlay.minLength": { 56 | "type": "number", 57 | "default": 15, 58 | "description": "Minimum length of array to show inlay hints" 59 | }, 60 | "arrayIndexInlay.minLines": { 61 | "type": "number", 62 | "default": 30, 63 | "description": "Minimum lines of array to show inlay hints" 64 | }, 65 | "arrayIndexInlay.startIndex": { 66 | "type": "number", 67 | "default": 0, 68 | "description": "Start index of the array, default to 0" 69 | }, 70 | "arrayIndexInlay.allowSpread": { 71 | "type": "boolean", 72 | "default": false, 73 | "description": "Show inlay hints even there are spread operators in the array" 74 | }, 75 | "arrayIndexInlay.colorizeDepth": { 76 | "type": "boolean", 77 | "default": false, 78 | "description": "Colorize the inlay hints based on the depth of the array. Colors can be customized with `arrayIndexInlay.depthColors`" 79 | }, 80 | "arrayIndexInlay.depthColors": { 81 | "type": "array", 82 | "default": [ 83 | "var(--vscode-editorBracketHighlight-foreground1)", 84 | "var(--vscode-editorBracketHighlight-foreground2)", 85 | "var(--vscode-editorBracketHighlight-foreground3)", 86 | "var(--vscode-editorBracketHighlight-foreground4)", 87 | "var(--vscode-editorBracketHighlight-foreground5)", 88 | "var(--vscode-editorBracketHighlight-foreground6)" 89 | ], 90 | "description": "Custom colors for each level of the array. Supports CSS color formats. Select an equal number of colors to your bracket colors to get the best results.", 91 | "items": { 92 | "type": "string" 93 | } 94 | } 95 | } 96 | } 97 | }, 98 | "scripts": { 99 | "build": "tsup src/index.ts --external vscode", 100 | "dev": "nr build --watch", 101 | "prepare": "nr update", 102 | "update": "vscode-ext-gen --output src/generated/meta.ts --scope arrayIndexInlay", 103 | "lint": "eslint .", 104 | "vscode:prepublish": "nr build", 105 | "publish": "vsce publish --no-dependencies", 106 | "pack": "vsce package --no-dependencies", 107 | "test": "vitest", 108 | "typecheck": "tsc --noEmit", 109 | "release": "bumpp && nr publish" 110 | }, 111 | "devDependencies": { 112 | "@antfu/eslint-config": "^3.12.1", 113 | "@antfu/ni": "^0.23.2", 114 | "@babel/core": "^7.26.0", 115 | "@babel/plugin-syntax-decorators": "^7.25.9", 116 | "@babel/preset-react": "^7.26.3", 117 | "@babel/preset-typescript": "^7.26.0", 118 | "@babel/traverse": "^7.26.4", 119 | "@types/babel-plugin-syntax-jsx": "^6.18.2", 120 | "@types/babel__core": "^7.20.5", 121 | "@types/node": "^22.10.2", 122 | "@types/vscode": "1.90.0", 123 | "@vscode/vsce": "^3.2.1", 124 | "acorn": "^8.14.0", 125 | "acorn-loose": "^8.4.0", 126 | "acorn-walk": "^8.3.4", 127 | "bumpp": "^9.9.2", 128 | "eslint": "^9.17.0", 129 | "eslint-plugin-format": "^0.1.3", 130 | "esno": "^4.8.0", 131 | "pnpm": "^9.15.2", 132 | "reactive-vscode": "^0.2.9", 133 | "tsup": "^8.3.5", 134 | "typescript": "^5.7.2", 135 | "vite": "^6.0.6", 136 | "vitest": "^2.1.8", 137 | "vscode-ext-gen": "^0.5.5" 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import type { DecorationOptions } from 'vscode' 2 | import { parseSync } from '@babel/core' 3 | // @ts-expect-error missing types 4 | import pluginDecorators from '@babel/plugin-syntax-decorators' 5 | // @ts-expect-error missing types 6 | import presetJsx from '@babel/preset-react' 7 | // @ts-expect-error missing types 8 | import presetTs from '@babel/preset-typescript' 9 | import traverse from '@babel/traverse' 10 | import { defineExtension, useActiveTextEditor, useCommand, useEditorDecorations, useStatusBarItem } from 'reactive-vscode' 11 | import { ConfigurationTarget, Range, StatusBarAlignment } from 'vscode' 12 | import { config } from './config' 13 | import { commands, name } from './generated/meta' 14 | import { logger } from './utils' 15 | 16 | const SupportedLanguages = [ 17 | 'javascript', 18 | 'typescript', 19 | 'javascriptreact', 20 | 'typescriptreact', 21 | 'json', 22 | 'jsonc', 23 | 'json5', 24 | 'vue', 25 | 'svelte', 26 | 'astro', 27 | // TODO: more languages 28 | ] 29 | 30 | const { activate, deactivate } = defineExtension(() => { 31 | const editor = useActiveTextEditor() 32 | 33 | useEditorDecorations( 34 | editor, 35 | { 36 | opacity: '1; position: relative;', 37 | before: { 38 | margin: [ 39 | 'auto 0;', 40 | 'position: relative;', 41 | 'bottom: 10%;', 42 | 'width: max-content;', 43 | 'text-align: right;', 44 | 'border-radius: 0.2em;', 45 | 'padding: 0 0.3em;', 46 | 'color: var(--vscode-editorInlayHint-foreground, #888);', 47 | 'background: var(--vscode-editorInlayHint-background, #8885);', 48 | 'font-size: 0.7em;', 49 | 'transform: translate(calc(-100% - 0.05em), -50%);', 50 | 'line-height: 1.5em;', 51 | ].join(' '), 52 | }, 53 | }, 54 | (editor): DecorationOptions[] => { 55 | if (!config.enabled) 56 | return [] 57 | if (!SupportedLanguages.includes(editor.document.languageId)) 58 | return [] 59 | 60 | const items: DecorationOptions[] = [] 61 | 62 | try { 63 | let text = editor.document.getText() 64 | let offset = 0 65 | 66 | if (['json', 'jsonc', 'json5'].includes(editor.document.languageId)) { 67 | const prefix = 'const x = ' 68 | text = prefix + text 69 | offset = -prefix.length 70 | } 71 | else if (['vue', 'svelte'].includes(editor.document.languageId)) { 72 | const match = /(]*>)([\s\S]*?)<\/script>/.exec(text) 73 | 74 | if (match) { 75 | const scriptContent = match[2] 76 | offset = match.index + match[1].length 77 | text = scriptContent 78 | } 79 | } 80 | else if (['astro'].includes(editor.document.languageId)) { 81 | const match = /(---)([\s\S]*?)---/.exec(text) 82 | 83 | if (match) { 84 | const scriptContent = match[2] 85 | offset = match.index + match[1].length 86 | text = scriptContent 87 | } 88 | } 89 | 90 | const ast = parseSync( 91 | text, 92 | { 93 | filename: editor.document.uri.fsPath, 94 | presets: [presetTs, presetJsx], 95 | babelrc: false, 96 | plugins: [[pluginDecorators, { decoratorsBeforeExport: true }]], 97 | }, 98 | ) 99 | 100 | if (!ast) { 101 | return [] 102 | } 103 | 104 | const indexBase = config.startIndex 105 | const minLength = config.minLength 106 | const minLines = config.minLines 107 | const colorizeDepth = config.colorizeDepth 108 | 109 | const depthColors = config.depthColors.map(c => c.trim()).filter(c => c !== '') 110 | const depthBackgroundColors = depthColors.map(color => `color-mix(in srgb, ${color} 10%, transparent)`) 111 | 112 | let depth = 0 113 | const trackDepth = { 114 | enter: () => { depth++ }, 115 | exit: () => { depth-- }, 116 | } 117 | 118 | traverse(ast, { 119 | ObjectExpression: trackDepth, 120 | BlockStatement: trackDepth, 121 | ArrowFunctionExpression: trackDepth, 122 | NewExpression: trackDepth, 123 | ArrayExpression: { 124 | enter() { 125 | depth++ 126 | }, 127 | exit: (path) => { 128 | depth-- 129 | 130 | if (path.node.elements.length < minLength && (path.node.loc!.end.line - path.node.loc!.start.line) < minLines) { 131 | return 132 | } 133 | if (!config.allowSpread && path.node.elements.some(el => el?.type === 'SpreadElement')) { 134 | return 135 | } 136 | 137 | const colorIndex = depth % depthColors.length 138 | const colors = colorizeDepth 139 | ? { 140 | color: depthColors[colorIndex], 141 | backgroundColor: depthBackgroundColors[colorIndex], 142 | } 143 | : {} 144 | const digits = path.node.elements.length.toString().length 145 | let hasSpread = false 146 | path.node.elements.forEach((el, index) => { 147 | if (!el) { 148 | return 149 | } 150 | const pos = editor.document.positionAt(el.start! + offset) 151 | items.push({ 152 | range: new Range(pos, pos), 153 | renderOptions: { 154 | before: { 155 | ...colors, 156 | contentText: `${hasSpread ? '?' : ''}#${index + indexBase}`.padStart(digits + 1, ' '), 157 | }, 158 | }, 159 | }) 160 | if (el.type === 'SpreadElement') { 161 | hasSpread = true 162 | } 163 | }) 164 | }, 165 | }, 166 | }) 167 | } 168 | catch (error) { 169 | logger.error(error) 170 | } 171 | 172 | return items 173 | }, 174 | ) 175 | 176 | useCommand( 177 | commands.toggle, 178 | () => config.$update('enabled', !config.enabled, ConfigurationTarget.Global), 179 | ) 180 | 181 | useStatusBarItem({ 182 | alignment: StatusBarAlignment.Right, 183 | priority: 100, 184 | id: name, 185 | text: () => config.enabled ? '[#23]' : '[ ]', 186 | tooltip: () => `${config.enabled ? 'Disable' : 'Enable'} array index inlay hints`, 187 | command: commands.toggle, 188 | }).show() 189 | }) 190 | 191 | export { activate, deactivate } 192 | --------------------------------------------------------------------------------