microsoft / microsoft/vscode-java-dependency

"java.project.resourceFilters" not honored when setting up new project

Open
#717 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

upstream
Dominant language
TypeScript
Stars
199
Forks
105
Avg merge
1d 22h
Merged PRs (30d)
27

Description

I'm getting errors like below while opening java projects. I've tried cleaning workspace, but it just happens again when I re-import.

Java Model Exception: Error in Java Model (code 1006): _/src/xx/xx/xx/xx/protectedModel/view/client/.ade_path [in protectedModel_48d582b1] is not on its project's build path
	at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:584)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:254)
	at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:528)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:248)
	at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:528)

That .ade_path has a symlink that points to a different file on a different filesystem and the error is legitimate.
But the problem is that I already have set the below filters:

"java.project.resourceFilters": [
        "node_modules",
        "\\.git",
        "\\.ade_path"
 ]

I've some projects which are working fine, I'm not sure how.
If I dig up their .project I can see below snippet is already added. But same filter is missing for .project files corresponding to non-working project setups.

       <filteredResources>
		<filter>
			<id>1675774599078</id>
			<name></name>
			<type>30</type>
			<matcher>
				<id>org.eclipse.core.resources.regexFilterMatcher</id>
				<arguments>node_modules|\.git|\.ade_path|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
			</matcher>
		</filter>
	</filteredResources>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the Java extension creates or updates the generated .project file when a new project is set up, using java.project.resourceFilters as the behavior to follow. Reproduce with a project containing .ade_path and compare working and non-working .project files; done means the configured filters are present and the error no longer appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
build-system, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.