microsoft / microsoft/TypeScript-Sublime-Plugin
Auto-format after save doesn't work correctly on files opened after load
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 1.7k
- Fork
- 236
- Merge medio
- 21g 13h
- PR unite (30g)
- 1
Descrizione
I'm using Sublime build 4113, under linux (Lubuntu 18.04)
I've customized https://github.com/microsoft/TypeScript-Sublime-Plugin/blob/master/typescript/libs/editor_client.py#L110 by adding these options:
format_options = {
"tabSize": self.tab_size,
"indentSize": self.indent_size,
"convertTabsToSpaces": self.translate_tab_to_spaces,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": True,
"typescript.format.InsertSpaceAfterFunctionKeywordForAnonymousFunctions": True,
"javascript.format.InsertSpaceAfterFunctionKeywordForAnonymousFunctions": True
}
If I open a file modify it and save, the formatting works but doesn't respect these settings, so it'll format like this:
const fn = function(arg) { }
but then, if I close and reopen Sublime Text modify the file and save again, the formatting works correctly
const fn = function (arg) { }
Is there something I'm doing wrong? I know it's maybe hacky the way I modified my ~/.config/sublime-text-3/Packages/TypeScript/typescript/libs/editor_client.py setting directly
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da typescript/libs/editor_client.py intorno alla riga 110 e riproduci la differenza di formattazione tra un file appena aperto e uno riaperto dopo il riavvio di Sublime Text. Traccia quando le opzioni di formattazione vengono inizializzate o applicate e considera conclusa l’issue quando la spaziatura configurata viene rispettata al primo salvataggio senza riavviare l’editor.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, python, typescript
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100