microsoft / microsoft/TypeScript-Sublime-Plugin
Auto-format after save doesn't work correctly on files opened after load
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.7k
- Forks
- 236
- Merge medio
- 21 d 13 h
- PR fusionados (30 d)
- 1
Descripción
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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con typescript/libs/editor_client.py alrededor de la línea 110 y reproduce la diferencia de formato entre un archivo recién abierto y uno que se vuelve a abrir después de reiniciar Sublime Text. Rastrea cuándo se inicializan o aplican las opciones de formato, y considera resuelto el issue cuando el espaciado configurado se respete en el primer guardado sin reiniciar el editor.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, python, typescript
- Área
- devtools
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100