Search TypeScript SYMBOLS (functions, types, classes) - NOT text. Use Glob to find files, Grep for text search, LSP for symbol search. Provides type-aware results that understand imports, exports, and relationships.
Search TypeScript SYMBOLS (functions, types, classes) - NOT text. Use Glob to find files, Grep for text search, LSP for symbol search. Provides type-aware results that understand imports, exports, and relationships.
license
ISC
compatibility
Requires bun
allowed-tools
Bash, Read, Glob, Grep
metadata
{"file-triggers":"*.ts,*.tsx,*.js,*.jsx"}
TypeScript LSP Skill
Purpose
This skill provides TypeScript Language Server Protocol integration for exploring and understanding TypeScript/JavaScript codebases.
IMPORTANT: Prefer LSP tools over Grep/Glob when working with *.ts, *.tsx, *.js, *.jsx files. LSP provides type-aware results that understand imports, exports, and symbol relationships.
Find references - Type-aware search across the entire codebase (better than grep for symbols)
Understand types - Get full type signatures, generics, and documentation
Verify before editing - Check all usages before modifying or deleting exports
Navigate code - Jump to definitions, find implementations
When to Use Each Tool
Tool
LSP Method
Purpose
Glob
—
Find files by pattern
Grep
—
Search text content
workspace/symbol
symbol search
Find a TypeScript symbol by name across the workspace
textDocument/hover
hover
Get type signature + TSDoc at a position
textDocument/references
references
Find all usages of a symbol
textDocument/documentSymbol
doc symbols
List all symbols in a file
LSP vs Grep/Glob
Task
Use LSP
Use Grep/Glob
Find all usages of a function/type
✅ textDocument/references
❌ Misses re-exports, aliases
Search for a symbol by name
✅ workspace/symbol
❌ Matches strings, comments
Get type signature + TSDoc
✅ textDocument/hover
❌ Not possible
List all symbols in a file
✅ textDocument/documentSymbol
❌ Doesn't resolve re-exports
Find files by pattern
❌
✅ Glob
Search non-TS files (md, json)
❌
✅ Grep
Search for text in comments/strings
❌
✅ Grep
When to Use
Exploring code (prefer LSP):
workspace/symbol to search for a symbol by name across the workspace
textDocument/documentSymbol to get an overview of all symbols in a file
textDocument/hover to get the exact type signature at a position
Before editing code:
textDocument/references to find all usages of a symbol you plan to modify
textDocument/hover to verify current type signatures
Before writing code:
workspace/symbol to find similar patterns or related symbols
textDocument/hover on APIs you plan to use
Server Invocation
The TypeScript Language Server is available locally and started via:
bun typescript-language-server --stdio
This launches the LSP server communicating over stdin/stdout using the Language Server Protocol — JSON-RPC messages with a Content-Length header followed by a newline-separated JSON body.
textDocument/hover at positions of interest for type signatures
Before modifying an export
textDocument/hover to confirm the current type signature
textDocument/references to find every call site
Review the response locations before making changes
Finding a symbol across the workspace
Initialize with project root (tsconfig resolution depends on this)
workspace/symbol with the symbol name as the query
Performance
A single bun typescript-language-server --stdio process handles the full session. Start it once, send all requests, then shutdown. Starting a new process per query costs ~300–500ms for server init each time.
Related Skills
code-documentation: TSDoc standards for documentation