microsoft / microsoft/TypeScript-Sublime-Plugin

Separate TS completion from Sublime completion

Aperta
#547 4 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
JavaScript
Stelle
1.7k
Fork
236
Merge medio
21g 13h
PR unite (30g)
1

Descrizione

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?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia tracciando come la gestione del tasto Tab di Sublime si collega al completamento di TypeScript language-service e come vengono attualmente gestiti Return ed Escape. Confronta il comportamento richiesto per import, commenti e proprietà degli oggetti con il flusso di completamento esistente. Il lavoro è completato quando i due comportamenti di completamento sono separati, con risultati chiaramente definiti per Tab, Return ed Escape.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, typescript
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.