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

fix: Changes on Formatter profiles have no effect before reloading #1738

Merged
merged 3 commits into from
Apr 23, 2021

Conversation

CsCherrYY
Copy link
Contributor

fix: #1736

Signed-off-by: Shi Chen [email protected]

@fbricon fbricon requested a review from snjeza April 22, 2021 10:36
@@ -193,7 +194,12 @@ public void fileChanged(String uriString, CHANGE_TYPE changeType) {
List<URI> uris = getURIs(formatterUrl);
boolean changed = false;
for (URI formatterUri : uris) {
if (formatterUri.equals(uri)) {
if (Platform.OS_WIN32.equals(Platform.getOS()) && URIUtil.isFileURI(formatterUri) && URIUtil.isFileURI(uri)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add similar code for the settingsUri variable - 008b542#diff-f23d0258ce24117c110acd6753e8490a09fbdf0bc039d662bdffe279c8c28469L177 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added in c88f8f5

@@ -175,7 +176,12 @@ public void fileChanged(String uriString, CHANGE_TYPE changeType) {
List<URI> uris = getURIs(settingsUrl);
boolean changed = false;
for (URI settingsURI : uris) {
if (settingsURI.equals(uri)) {
if (Platform.OS_WIN32.equals(Platform.getOS()) && URIUtil.isFileURI(settingsURI) && URIUtil.isFileURI(uri)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be a helper method compareURI(URI uri1, URI uri2).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this util be put into JDTUtils?

Copy link
Contributor

Choose a reason for hiding this comment

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

org.eclipse.core.runtime.URIUtil#sameURI seems to do the same thing you want. Could you check if that satisfies your needs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works. I'll use it then.

Signed-off-by: Shi Chen <[email protected]>
@CsCherrYY
Copy link
Contributor Author

test this please

1 similar comment
@testforstephen
Copy link
Contributor

test this please

@testforstephen testforstephen merged commit d6bf874 into eclipse-jdtls:master Apr 23, 2021
@CsCherrYY CsCherrYY deleted the formatterwatch branch April 23, 2021 09:28
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.

Changes to Formatter profiles don‘t take effect in real time
3 participants