December 5, 2018·4 min read·engineeringtypescripteditorscompletions

IntelliCode ranks TypeScript completions by their surrounding code

IntelliCode's experimental TypeScript and JavaScript support brings contextual ranking to VS Code completion lists. The change helps choose among suggestions while leaving program meaning and correctness to the developer and existing tools.

An alphabetical completion list makes a programmer search through available names even when the surrounding expression gives a reason to prefer a few of them. IntelliCode changes that order. Its TypeScript and JavaScript preview recommends completion items according to the context in which the programmer is editing.

The December 5 announcement brings this support through the IntelliCode extension for Visual Studio Code. Recommended entries appear with stars at the top of the completion list. The proposal is practical and specific, changing which choices receive attention while the developer writes an expression.

I am divided about TypeScript itself, but I value the quality of the web-development ecosystem around it. Editing support is part of that value. A completion system is useful when it helps locate an appropriate operation without making the source harder to understand or obscuring what the framework actually does.

The same value can receive different suggestions

The announcement illustrates the contextual distinction with a variable named map. Its completion recommendations differ when the variable appears in a condition or loop and when it appears inside the conditional body. The surrounding operation gives the recommendation system information beyond the variable's name.

This is a useful difference from a fixed list of globally popular methods. Code in a condition asks for an expression serving one role, while code in the body may be performing another operation. A completion system can rank candidates differently even though the programmer is accessing the same value.

The announcement describes the recommendations as learned from common practices across thousands of real projects. That establishes the stated basis for ranking. It does not say that every suggested operation is correct for the application, or that popularity supplies the missing knowledge of the application's requirements.

The distinction matters because two methods can both be available while only one suits the current purpose. A contextual rank is evidence about likely usage, not a proof of intent. The programmer still chooses the operation and remains responsible for the meaning of the resulting expression.

IntelliCode extends the existing completion interaction

The preview uses the existing completion list, with stars marking the promoted recommendations. A user installs the extension and edits a TypeScript or JavaScript file. The change therefore appears at an interaction programmers already use, rather than requiring a separate query language for asking about the code.

This design keeps the recommendation close to the point of choice. The user can compare the promoted names with the rest of the list and inspect the operation before accepting it. The announcement makes a claim about ordering and relevance, not about replacing the list with an automatically selected program statement.

It also identifies client libraries such as React, Angular and Vue alongside server development with Node.js and Express. The intended scope crosses common JavaScript application contexts. That does not establish identical recommendation quality for every library or every operation; it states where the team expects this assistance to apply.

For TypeScript users, this is distinct from adding another language construct. Existing programs do not gain a new runtime feature merely because their editor orders suggestions differently. The contribution is assistance during authoring, with the resulting source continuing to use the project's ordinary language and library APIs.

The earlier preview had a narrower language focus

Microsoft's May introduction of IntelliCode described an experimental Visual Studio extension then optimized for C#. It also described using local code context with a model trained on public codebases. December's TypeScript announcement extends the completion experience to another editor and language setting.

The distinction between the announcements prevents the broader product vision from being mistaken for the exact capability delivered today. The May post discussed several possible forms of assistance. December specifically offers TypeScript and JavaScript completion recommendations through the VS Code extension.

Nor does the earlier training description establish that the TypeScript preview uses an identical dataset or model. The December post supplies its own description of learning common practices across projects. Claims about its exact training contents or architecture would require additional evidence that this announcement does not provide.

Experimental status leaves recommendation quality open

The team calls the release an experimental preview and asks users to report issues through its repository or the announcement's comments. That status matters when interpreting the examples. They demonstrate the intended context sensitivity, rather than establishing a measured improvement for every programmer's code.

My judgement is that the useful test of this interaction is whether the promoted items match the operation the programmer is trying to express. A recommendation that requires checking is still useful when it reduces the effort needed to find the relevant API. Its role remains bounded, ranking likely choices in a completion list while the developer determines which choice belongs in the program.