microsoft / microsoft/TypeScript
Function's attached JSDoc is not preserved when using OmitThisParameter
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.4k
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 117
Descripción
Bug Report
🔎 Search Terms
JSDoc, types with docs, preserve docs, OmitThisParameter, bind, inherit description
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about "Something to do with
this" and "Strong typing ofFunctionmemberscall/bind/apply"
⏯ Playground Link
Playground link with relevant code
💻 Code
/**
* This description is lost
*
* @param p As well as this decription
*/
function func(this: {}, p: string): void {}
const f = func as OmitThisParameter<typeof func>;
const g = func.bind({});
🙁 Actual behavior
Hovering over f (or g) shows the type but not the descriptions that were attached to func.
🙂 Expected behavior
f and g to inherit the descriptions of func.
Clarification
The problem mainly lies with OmitThisParameter as bind's declaration uses it.
I'm also not sure if this is considered a bug or a missing feature, so I apologize in advance if this is not the right way to report it.
Might be related to #50715
Guía de contribución
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 la reproducción proporcionada en Playground e inspecciona cómo se declara y aplica OmitThisParameter a func, incluida la declaración de bind que lo utiliza. El issue estará terminado cuando, al pasar el cursor sobre f y g, se conserven la descripción de func y la documentación de @param, con el comportamiento existente comprobado frente a la discusión relacionada #50715.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- compilers
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100