eclipse-platform / eclipse-platform/eclipse.platform
The ContentType implementation of IContentType.isAssociatedWith is case insensitive and I find no case sensitive alternative
- Lenguaje dominante
- Java
- Estrellas
- 165
- Forks
- 174
- Merge medio
- 2 d 8 h
- PR fusionados (30 d)
- 22
Descripción
The ContentType implementation of IContentType.isAssociatedWith is case insensitive which means that if your content type contains .c and the presented file is a .C file ContentType.isAssociatedWith will return true.
There are 2 locations where ContentType.isAssociatedWith uses equalsIgnoreCase
https://github.com/eclipse-platform/eclipse.platform/blob/f385650ab42fb7275ab164643fe2d1db5040750e/runtime/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/FileSpec.java#L53
and
https://github.com/eclipse-platform/eclipse.platform/blob/f385650ab42fb7275ab164643fe2d1db5040750e/runtime/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentType.java#L385
Unfortunately for me .c files are associated with c compilers and .C files are associated with C++ compilers which means CDT can not use ContentType.isAssociatedWith and chose to implemented a private method to provide the functionality.
https://github.com/eclipse-cdt/cdt/blob/7c8bb9f00ef0d5e3ff493bc0c944519a3e476da2/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CContentTypes.java#L130
As I need a case sensitive implementation of IContentType.isAssociatedWith I have the option to make the private method of CDT public or have a solution in (I)ContentType.
I'd prefer the second.
Note 1) I did not find any documentation that says the comparison is case insensitive.
Note 2) I think file name comparison is case insensitive as well.
Note 3) I can create a PR but I need some guidance on what the change should look like.
Guía de contribución
Línea de trabajo
Comienza leyendo los usos de equalsIgnoreCase en runtime/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/FileSpec.java y ContentType.java; después compara la lógica sensible a mayúsculas y minúsculas en CContentTypes.java de CDT. Se considera terminado cuando la API de tipos de contenido proporciona una ruta de asociación documentada y sensible a mayúsculas y minúsculas sin requerir la solución alternativa privada de CDT.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 30/100