microsoft / microsoft/TypeScript-Sublime-Plugin

Separate TS completion from Sublime completion

Open
#547 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.7k
Forks
236
Avg merge
21d 13h
Merged PRs (30d)
1

Description

I've been using Sublime/TextMate for many years, and am very accustomed to the way tab completion works in those editors. It will fuzzy search the symbol you're typing against every other symbol in the current document, and cycle through them when you hit <tab>.

For instance, consider that I have some symbol somewhere in the current document: arbitraryFunctionName. Here are some situations where I expect tab completion to work, but it doesn't:

importing

import afn<tab>
import arbitraryFunctionName from './afn<tab>

Commenting

/* This is some documentation for afn<tab>

Creating new objects

const something = {
  afn<tab>

In each of these cases, I'd expect hitting <tab> to replace afn with arbitraryFunctionName; however, when Sublime's syntax is set to TypeScript, it merely inserts spaces.

Is there a way to separate tab completion from TypeScript completion? Perhaps <tab> could work the same way Sublime does in other languages, but <return> could select the given option in TypeScript's suggestions menu, and <esc> could reject them. Or, perhaps TypeScript takes over <tab> and <esc> could adapt Sublime's default tab behavior. (<esc> is the key that TextMate used for this style of completion.)

Is there a way to differentiate between completion powered by TypeScript's language services and Sublime's default algorithm? If not, can there be?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Sublime's Tab key handling connects to TypeScript language-service completion and how Return and Escape are currently handled. Compare the requested behavior for imports, comments, and object properties against the existing completion flow. Done means the two completion behaviors are separated with clearly defined Tab, Return, and Escape results.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.