eclipse-jdt / eclipse-jdt/eclipse.jdt.core
External snippet files with Java 18
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
From Oracles [description](https://docs.oracle.com/en/java/javase/18/code-snippet/index.html) on how to use external snippet files:
> The first example shows a directory named src, containing the source for a class p.Main, an image icon.png in the doc-files subdirectory, and a file for external snippets, Snippets.java, in the snippet-files directory. The presence of doc-files/icon.png is just to show the similarity between the use of doc-files and snippet-files directories. No additional options are required for the Standard Doclet to locate the external snippets in this example.
```
src
└── p
├── Main.java
├── doc-files
│ └── icon.png
└── snippet-files
└── Snippets.java
```
> Note: some build systems may (incorrectly) treat files in the snippet-files directory as part of the enclosing package hierarchy, even though snippet-files is not a valid Java identifier and cannot be part of a Java package name. The local snippet-files directory cannot be used in these cases.
If I try this in eclipse I get

and

Is this reasonably fixable? The other solution listed by Oracle requires setting `--snippet-path` which I'd rather avoid, if possible.
(Copied from [#42 of eclipse-platform](https://github.com/eclipse-platform/.github/issues/42))
Contributor guide
Assessment
This issue has not been assessed yet.