eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
32 stars 79 forks source link

snippet javadoc is not showing type parameters #1496

Closed jjohnstn closed 1 week ago

jjohnstn commented 1 week ago

The following example:

public class Param {
    /**
     * <p>
     * <b>Usage examples</b> Suppose we want a list of files
     * {@snippet lang = "java" :
     * 
     *   List<Path> listSourceFiles(Path dir) throws IOException {
     *     List<Path> result = new ArrayList<>();
     *     try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.{c,h,cpp,hpp,java}")) {
     *        for (Path entry : stream) {
     *          result.add(entry);
     *        }
     *     } catch (DirectoryIteratorException ex) {
     *        // I/O error encountered during the iteration, the cause is an IOException
     *        throw ex.getCause();
     *     }
     *     return result;
     *   }
     *   
     * }
     * 
     */
    public int test(int i) {
        return i;
    }
}

does not display type parameters for List or DirectoryStream. This is because the type parameters are being passed directly into the html and treated as unknown tags. They need to be escaped.