Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Update project dependencies produces multiple VSCode dialogs #94

Open
LeonovecSergey opened this issue Apr 28, 2021 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@LeonovecSergey
Copy link
Collaborator

Сhanging the build file does not update the dependencies in the Java class

@LeonovecSergey LeonovecSergey self-assigned this Apr 28, 2021
@LeonovecSergey LeonovecSergey added the bug Something isn't working label Apr 28, 2021
@kkazakevich kkazakevich changed the title Bug Update project Update project dependencies produces multiple VSCode dialogs May 5, 2021
@AlexeiShmidman
Copy link
Collaborator

  • The selection mechanism relies on VSCode watch changed files glob patterns. Currently, there is no possibility to use negations in these patterns, therefore all changed files on the workspace, including Bazel-build related, are sent to the language server.
  • In the case of Bazel-build folders, there is a symlink to an original module with corresponding sources and BUILD files. Every build refreshes the symlink and, therefore, the timestamp of this symlink is updated.
  • The updated timestamp leads to include these files in the list of changed ones and passed them to the language server.
  • On the language server side in the org.eclipse.jdt.ls.core.internal.managers.StandardProjectsManager#fileChanged method all paths, including symlinks, are converted into Eclipse-workspace relative paths by the JDTUtils#getFileOrFolder. Symlinks are transformed as the corresponding original files with the same Eclipse-workspace relative paths.
	@Override
	public void fileChanged(String uriString, CHANGE_TYPE changeType) {
...
		IResource resource = JDTUtils.getFileOrFolder(uriString);
		if (resource == null) {
			return;
		}
		try {
			Optional<IBuildSupport> bs = getBuildSupport(resource.getProject());
			if (bs.isPresent()) {
				IBuildSupport buildSupport = bs.get();
				boolean requireConfigurationUpdate = buildSupport.fileChanged(resource, changeType, new NullProgressMonitor());
...
  • IBuildSupport#fileChanged receives transformed paths only and it has no possibility to filter valid from invalid files, which results in a false prompt dialog on the client to rebuild the application.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants