Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue455 refresh issue due to pom generated in target on building the project #462

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

JoshwinThomasIBM
Copy link
Contributor

@JoshwinThomasIBM JoshwinThomasIBM commented Jan 8, 2025

Fixes #455
changes includes checking if the generated pom is in target /build directory within the project and if yes refresh is avoided,otherwise refresh will be executed .

src/definitions/constants.ts Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
* @returns
*/
export function isInTargetOrBuild(filePath: string): boolean {
return filePath.includes('/target/') || filePath.includes('/build/');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is valid if it is just any "target" or "build" dir. We need to ensure the file/path is in a subdirectory of the project's "target" or "build" directory (i.e. the "target" or "build" directory located in the root project folder).

projectProvider.refresh();
});
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not entirely sure about this approach, since we are still watching the "target" and "build" dirs. It would be better if we could find a way to ignore them completely.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add '&&' operator in vscode.workspace.createFileSystemWatcher?
Did conditions like this work '**/pom.xml && !inside target folder' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for glob patterns && operators are not available in their syntax, however negations are available as per their documentation
https://code.visualstudio.com/docs/editor/glob-patterns

Copy link
Contributor

@aparnamichael aparnamichael Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoshwinThomasIBM {} to group conditions (for example {**/*.pom.xml,!inside target folder} )

Can you try with this group conditions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aparnamichael i tried with "/!(target)//{pom.xml,build.gradle,settings.gradle,src/main/liberty/config/server.xml}
and it seems to be working , but multiple negations is not supported in glob pattern
also with the above glob patten we expect only the one's in target to be negated and other pom's generated to be watched ,but if the the pom is generated in some other location then that is not being caught by the watcher .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Refreshing Liberty Dashboard projects" kicks in all the time
3 participants