ts-morph vs IntelliCode
Side-by-side comparison to help you choose.
| Feature | ts-morph | IntelliCode |
|---|---|---|
| Type | Repository | Extension |
| UnfragileRank | 48/100 | 40/100 |
| Adoption | 1 | 1 |
| Quality | 0 | 0 |
| Ecosystem |
| 1 |
| 0 |
| Match Graph | 0 | 0 |
| Pricing | Free | Free |
| Capabilities | 13 decomposed | 6 decomposed |
| Times Matched | 0 | 0 |
Wraps TypeScript Compiler API objects to provide an object-oriented interface for navigating and modifying Abstract Syntax Trees while maintaining all changes in memory until explicitly saved to disk. Uses a Node-based wrapper system that maps compiler API nodes to higher-level abstractions, enabling safe mutations without immediate file I/O. Changes accumulate in memory and are flushed to the file system only when saveSourceFile() or saveSourceFiles() is called, allowing batch operations and rollback scenarios.
Unique: Implements a wrapper-based abstraction over TypeScript Compiler API that decouples AST mutations from file I/O, allowing in-memory accumulation of changes across multiple files before batch persistence. This differs from direct Compiler API usage which requires managing file writes manually.
vs alternatives: Provides safer, more ergonomic in-memory code mutation than raw TypeScript Compiler API while maintaining full fidelity to the compiler's AST model, unlike higher-level tools like Babel which use their own AST representation.
Provides a comprehensive object-oriented API for traversing AST nodes with semantic awareness through the TypeChecker interface, enabling queries like 'find all usages of this symbol' and 'get the type of this expression'. Navigation methods include getParent(), getChildren(), forEachChild(), and specialized accessors for declaration kinds (getClass(), getFunction(), getInterface()). The system wraps compiler API's SyntaxKind and TypeFlags enums into strongly-typed Node subclasses, making traversal type-safe and IDE-friendly with autocomplete.
Unique: Wraps TypeScript's TypeChecker to provide semantic-aware navigation through a strongly-typed Node hierarchy, where each SyntaxKind maps to a specific TypeScript class (ClassDeclaration, FunctionDeclaration, etc.). This enables IDE-like autocomplete and type safety for AST traversal, unlike raw Compiler API which requires manual SyntaxKind checking.
vs alternatives: Combines syntactic AST traversal with semantic type information in a single unified API, whereas alternatives like Babel require separate passes for syntax and type analysis, or tools like ESLint use a different AST model entirely.
Provides APIs for querying and manipulating whitespace, formatting, and syntax details through methods like getLeadingTrivia(), getTrailingTrivia(), and getFullText(). Preserves existing formatting when modifying code, allowing surgical edits that don't reformat the entire file. Supports querying line and column positions, getting source text with or without trivia, and understanding the syntactic structure including comments and whitespace.
Unique: Provides explicit APIs for accessing and manipulating trivia (comments, whitespace) separately from syntax nodes, enabling surgical edits that preserve formatting. This is more sophisticated than tools that treat trivia as part of the node, which can lose formatting information.
vs alternatives: Preserves formatting and comments during code modifications, whereas raw Compiler API loses trivia information, and template-based generators require reformatting after generation.
Provides comprehensive support for TypeScript-specific type features through specialized node classes and type introspection APIs. Handles generics with type parameters and type arguments, union and intersection types, conditional types, mapped types, and type queries. Enables querying and modifying these features through methods like getTypeArguments(), getConstraint(), and getTypeParameters() on relevant node types.
Unique: Provides dedicated node classes and APIs for TypeScript-specific type features (generics, unions, intersections, conditional types, mapped types), enabling type-aware code generation and analysis. This level of support is unique to TypeScript-focused tools.
vs alternatives: Handles advanced TypeScript type features that generic AST tools cannot, making it suitable for sophisticated type-aware code generation and analysis that requires understanding of the full TypeScript type system.
Implements caching and incremental compilation strategies to optimize performance when working with large projects. Caches parsed ASTs and type information to avoid re-parsing unchanged files, and supports incremental updates when source files are modified. The Project class manages this caching internally, reusing compiler state across multiple operations to reduce redundant work.
Unique: Implements automatic caching and incremental compilation within the Project class, reusing compiler state across operations to avoid redundant parsing and type checking. This is transparent to the user but significantly improves performance for multi-operation workflows.
vs alternatives: Provides automatic performance optimization without requiring manual cache management, whereas raw Compiler API requires creating new compiler instances for each operation, leading to redundant work.
Provides specialized APIs for creating and modifying TypeScript declarations (classes, interfaces, functions, imports) through a structure-based system that abstracts away low-level AST node creation. Uses a StructurePrinterFactory pattern to convert high-level structure objects (ClassDeclarationStructure, FunctionDeclarationStructure, etc.) into AST nodes, enabling developers to add methods to classes, create new interfaces, or modify function signatures without manually constructing SyntaxNodes. Supports JSDoc generation, decorators, access modifiers, and type annotations through the structure API.
Unique: Implements a StructurePrinterFactory pattern that converts high-level structure objects into AST nodes, abstracting away the complexity of manually constructing SyntaxNodes. This enables declarative code generation where developers describe 'what' (a class with these methods) rather than 'how' (create ClassDeclaration node, add MethodDeclaration children, etc.).
vs alternatives: Provides a more ergonomic and type-safe API for code generation than raw Compiler API, and maintains full TypeScript semantic fidelity unlike template-based generators which produce strings that must be parsed separately.
Provides specialized APIs for analyzing and modifying import/export declarations through dedicated classes (ImportDeclaration, ExportDeclaration, ExportSpecifier) that abstract away the complexity of managing module specifiers, named imports, default imports, and re-exports. Supports operations like addImportDeclaration(), removeImportDeclaration(), and getImportDeclarations() with filtering by module name. Handles both ES6 module syntax and CommonJS require patterns, and can automatically organize imports or detect circular dependencies.
Unique: Provides dedicated ImportDeclaration and ExportDeclaration classes that wrap the compiler API's import/export node types, offering high-level methods like addImportDeclaration() that handle the complexity of managing module specifiers, named bindings, and default exports. Abstracts away the need to manually construct ImportSpecifier and ExportSpecifier nodes.
vs alternatives: Simpler and more ergonomic than raw Compiler API for import/export manipulation, and handles both ES6 and CommonJS patterns in a unified API, whereas alternatives like jscodeshift require separate handling for each module system.
Exposes TypeScript's type system through a wrapper API that allows querying type information for expressions, declarations, and symbols. Provides methods like getType(), getTypeAtLocation(), and getSymbolAtLocation() that return Type and Symbol objects with properties for checking type kinds (isStringLiteral(), isUnion(), isIntersection()), accessing type arguments, and resolving symbol definitions. Integrates with TypeChecker to enable semantic analysis without requiring developers to interact with the low-level Compiler API directly.
Unique: Wraps TypeScript's TypeChecker and Type/Symbol APIs to provide a more ergonomic interface for type introspection, with helper methods for common type checks (isStringLiteral(), isUnion()) and type traversal. Abstracts away the complexity of working with TypeScript's internal type representation.
vs alternatives: Provides direct access to TypeScript's actual type system (not an approximation), making it more accurate than tools like Babel or ESLint which use simplified type models, while being more ergonomic than raw Compiler API.
+5 more capabilities
Provides AI-ranked code completion suggestions with star ratings based on statistical patterns mined from thousands of open-source repositories. Uses machine learning models trained on public code to predict the most contextually relevant completions and surfaces them first in the IntelliSense dropdown, reducing cognitive load by filtering low-probability suggestions.
Unique: Uses statistical ranking trained on thousands of public repositories to surface the most contextually probable completions first, rather than relying on syntax-only or recency-based ordering. The star-rating visualization explicitly communicates confidence derived from aggregate community usage patterns.
vs alternatives: Ranks completions by real-world usage frequency across open-source projects rather than generic language models, making suggestions more aligned with idiomatic patterns than generic code-LLM completions.
Extends IntelliSense completion across Python, TypeScript, JavaScript, and Java by analyzing the semantic context of the current file (variable types, function signatures, imported modules) and using language-specific AST parsing to understand scope and type information. Completions are contextualized to the current scope and type constraints, not just string-matching.
Unique: Combines language-specific semantic analysis (via language servers) with ML-based ranking to provide completions that are both type-correct and statistically likely based on open-source patterns. The architecture bridges static type checking with probabilistic ranking.
vs alternatives: More accurate than generic LLM completions for typed languages because it enforces type constraints before ranking, and more discoverable than bare language servers because it surfaces the most idiomatic suggestions first.
ts-morph scores higher at 48/100 vs IntelliCode at 40/100. ts-morph leads on quality and ecosystem, while IntelliCode is stronger on adoption.
Need something different?
Search the match graph →© 2026 Unfragile. Stronger through disorder.
Trains machine learning models on a curated corpus of thousands of open-source repositories to learn statistical patterns about code structure, naming conventions, and API usage. These patterns are encoded into the ranking model that powers starred recommendations, allowing the system to suggest code that aligns with community best practices without requiring explicit rule definition.
Unique: Leverages a proprietary corpus of thousands of open-source repositories to train ranking models that capture statistical patterns in code structure and API usage. The approach is corpus-driven rather than rule-based, allowing patterns to emerge from data rather than being hand-coded.
vs alternatives: More aligned with real-world usage than rule-based linters or generic language models because it learns from actual open-source code at scale, but less customizable than local pattern definitions.
Executes machine learning model inference on Microsoft's cloud infrastructure to rank completion suggestions in real-time. The architecture sends code context (current file, surrounding lines, cursor position) to a remote inference service, which applies pre-trained ranking models and returns scored suggestions. This cloud-based approach enables complex model computation without requiring local GPU resources.
Unique: Centralizes ML inference on Microsoft's cloud infrastructure rather than running models locally, enabling use of large, complex models without local GPU requirements. The architecture trades latency for model sophistication and automatic updates.
vs alternatives: Enables more sophisticated ranking than local models without requiring developer hardware investment, but introduces network latency and privacy concerns compared to fully local alternatives like Copilot's local fallback.
Displays star ratings (1-5 stars) next to each completion suggestion in the IntelliSense dropdown to communicate the confidence level derived from the ML ranking model. Stars are a visual encoding of the statistical likelihood that a suggestion is idiomatic and correct based on open-source patterns, making the ranking decision transparent to the developer.
Unique: Uses a simple, intuitive star-rating visualization to communicate ML confidence levels directly in the editor UI, making the ranking decision visible without requiring developers to understand the underlying model.
vs alternatives: More transparent than hidden ranking (like generic Copilot suggestions) but less informative than detailed explanations of why a suggestion was ranked.
Integrates with VS Code's native IntelliSense API to inject ranked suggestions into the standard completion dropdown. The extension hooks into the completion provider interface, intercepts suggestions from language servers, re-ranks them using the ML model, and returns the sorted list to VS Code's UI. This architecture preserves the native IntelliSense UX while augmenting the ranking logic.
Unique: Integrates as a completion provider in VS Code's IntelliSense pipeline, intercepting and re-ranking suggestions from language servers rather than replacing them entirely. This architecture preserves compatibility with existing language extensions and UX.
vs alternatives: More seamless integration with VS Code than standalone tools, but less powerful than language-server-level modifications because it can only re-rank existing suggestions, not generate new ones.