jaredly / jaredly/example-reason-codemod

Detect a function of a given module?

Abierto
#1 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
OCaml
Estrellas
3
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Thanks for creating these codemod utils and example! 🙂 Really cool.

I'm exploring if I could use this codemod for the migrations of BuckleScript `Js` modules proposed in https://github.com/BuckleScript/bucklescript/issues/2975. I wonder how I could approach the detection of usages of some specific functions in `Js.X` modules:

If I use syntactic analysis (e.g. use `Pexp_ident` to match against the function names) it might not be effective in all cases, for example the function can be called with `Js.Array.map` or just `map` if the `Js.Array` module has been opened before.

There is `getExprType` which is awesome but it just works at the type level, so I wouldn't know which function has been called, only the type of the expression.

Is there an approach that I'm missing to do this kind of detection in an accurate way?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Revisa las utilidades de codemod y el ejemplo; después, investiga cómo Pexp_ident y getExprType manejan llamadas como Js.Array.map y un map de un módulo abierto. Compara si la información de sintaxis y tipos disponible puede identificar con precisión la función llamada. Se considera terminado cuando se documente un enfoque de detección fiable o la limitación que lo impide.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
ocaml
Área
tooling
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.