You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this sounds to me like we should move the existing implementation for converting properties -> yml into the language server and make it available via a command to the client. Then, we could serve this as menu item / command in the various clients. Maybe the command can be generic in terms of which conversion should happen so that we can use the same command with different params for converting properties -> yml and then, down the line, for yml -> properties as well (so that the command is on the level of "convert" and the params specify the "to" format maybe. The input file would/could determine the "from" format.
Reacted by Wolfgang Geck, Manuel Jordan Elera and alexxey83
Another thought here: If we allow the conversion to change the existing file (rename + content conversion), we would need to make sure that the conversion is exact and nothing gets lost in the conversion. This might be hard to achieve.
As a consequence, we could also always create a new file (in addition to the existing one) and put the converted content in the new file without deleting the existing file. That would prevent the user from loosing something in case the conversion is not fully complete or missed something.
We could also add a preference for this to switch between the modes ("delete file after property conversion") that would be disabled at the beginning and users could enable this if they think the old file should always be deleted.
In that way keeping the 2 files, the original and converted. Is assumed that in Spring Boot exists a priority about what file to choice if exists both with the same name but with different extension (.properties/.yml/.yaml). But it is other history and is assumed the developer knows what to do - either keep both files or delete the former when the latter was generated from the former (manually or automatically according with your propose).
Same instructions as indicated for Windows experience, it works fine, but appears the following:
The warning message is the same for the three points
And just in case, that Warning message appeared just once in Windows too, but not anymore, it remains in Linux/Ubuntu. I am assuming it would happen and should remain as in Linux, it based with the new installer
As summary:
From .properties to .yaml works and the former file is deleted and replaced by the latter (and the message warning appears)
From .yaml to .properties works and the former file is deleted and replaced by the latter
Thanks to your quick patch and I did do realize and confirmed that any comment disappears. And finally:
It seems it is almost completed (I must re-test Windows), but I did do realize the following.
After to did do a conversion, if within the opened file is do right click, appears the context menu as expected, but is enabled the item about Undo Ctrl + Z and it throws an error if is executed. Should be enabled that item/option?
For any conversion scenario, all the properties keys are sorted alphabetically. But if from the scratch prior to do any conversion (take as reference my original .properties file), how is expected to sort that content? If within the opened file is done right click to open the context menu, there is no option to reach this goal. Pls confirm if once solved this Issue of conversion - I should create a new issue to request this feature.
@manueljordan awesome!!! Thanks very much for testing!-) I'm moving the refactoring logic on the Boot LS side now to make yaml <-> props conversions available in both Eclipse and VSCode (and Theia therefore).
Is this about performing "Undo" action once conversion is applied? I did notice that it refuses to execute with a warning dialog that renamed file has been changed etc. Looks like this was the initial limitation with props -> yaml conversion. I'd treat this as a separate issue and curious if it is Eclipse only issue.
I observer this only with props -> yaml. The yaml -> props seems to keep the initial order. I'll look into it but consider it as a low priority things which could factored out in a separate issue.
Understood. It seems they are candidates to create two new issues. And even would exist a 3rd one, it to suggest and apply a refactoring to solve the mentioned warning messages shown in the .yaml files - what do you think?
@manueljordan I'd create 2 additional issues once this issue is resolved as there is a chance to resolve them once conversion is an LS command. Is the 3rd issue about warnings/errors inside of the produced yaml files in a form of comments?
Pushed in the Boot LS based yaml <-> props conversion. It is now available on both VSCode and Eclipse. I was able to somewhat maintain the order of keys for props -> yaml conversion. The undo still didn't work properly in Eclipse therefore in Eclipse you'd be only able to create new file without replacing the old. The old file could be replaced in VSCode if preference setting for replacing the old file is on (by default it is off). The change is: aed2127
Activity
BoykoAlex commentedon Feb 18, 2022
Is this the request for Spring Boot Tools for vscode plugin?
javahacks commentedon Feb 18, 2022
Yes just a simple command that can be triggered from within the editor or context menu:
martinlippert commentedon Mar 24, 2022
Here is another related feature request to have yml -> properties convention: spring-attic/spring-ide#331.
It looks to me like we have three parts of this:
So this sounds to me like we should move the existing implementation for converting properties -> yml into the language server and make it available via a command to the client. Then, we could serve this as menu item / command in the various clients. Maybe the command can be generic in terms of which conversion should happen so that we can use the same command with different params for converting properties -> yml and then, down the line, for yml -> properties as well (so that the command is on the level of "convert" and the params specify the "to" format maybe. The input file would/could determine the "from" format.
martinlippert commentedon Mar 24, 2022
Another thought here: If we allow the conversion to change the existing file (rename + content conversion), we would need to make sure that the conversion is exact and nothing gets lost in the conversion. This might be hard to achieve.
As a consequence, we could also always create a new file (in addition to the existing one) and put the converted content in the new file without deleting the existing file. That would prevent the user from loosing something in case the conversion is not fully complete or missed something.
We could also add a preference for this to switch between the modes ("delete file after property conversion") that would be disabled at the beginning and users could enable this if they think the old file should always be deleted.
manueljordan commentedon Mar 25, 2022
Has a lot of sense what you are proposing.
In that way keeping the 2 files, the original and converted. Is assumed that in Spring Boot exists a priority about what file to choice if exists both with the same name but with different extension (.properties/.yml/.yaml). But it is other history and is assumed the developer knows what to do - either keep both files or delete the former when the latter was generated from the former (manually or automatically according with your propose).
15 remaining items
manueljordan commentedon Mar 26, 2024
@BoykoAlex thanks for the quick update for Windows, pls let me know when is ready/built the new installer - it about to wait 1.5hrs
Np - I enjoy this IDE
manueljordan commentedon Mar 26, 2024
Report II
Working with the installer for Linux (Ubuntu and Fedora):
spring-tool-suite-4-4.22.1.202403261702-SNAPSHOT-e4.32.0-linux.gtk.x86_64.tar.gzUnpacked and nothing more done prior to start it.
Same instructions as indicated for Windows experience, it works fine, but appears the following:
The warning message is the same for the three points
And just in case, that Warning message appeared just once in Windows too, but not anymore, it remains in Linux/Ubuntu. I am assuming it would happen and should remain as in Linux, it based with the new installer
As summary:
.propertiesto.yamlworks and the former file is deleted and replaced by the latter (and the message warning appears).yamlto.propertiesworks and the former file is deleted and replaced by the latterThanks to your quick patch and I did do realize and confirmed that any comment disappears. And finally:
manueljordan commentedon Mar 26, 2024
It seems it is almost completed (I must re-test Windows), but I did do realize the following.
Thanks for your understanding
BoykoAlex commentedon Mar 26, 2024
@manueljordan build has succeeded and ready to for testing
manueljordan commentedon Mar 27, 2024
@BoykoAlex it works fine now, same behavior as Linux.
BoykoAlex commentedon Mar 27, 2024
@manueljordan awesome!!! Thanks very much for testing!-) I'm moving the refactoring logic on the Boot LS side now to make yaml <-> props conversions available in both Eclipse and VSCode (and Theia therefore).
manueljordan commentedon Mar 27, 2024
@BoykoAlex no problem :) - let me know your thoughts about points 1 and 2.
BoykoAlex commentedon Mar 27, 2024
@manueljordan Regarding the two points:
manueljordan commentedon Mar 27, 2024
Thanks @BoykoAlex
Understood. It seems they are candidates to create two new issues. And even would exist a 3rd one, it to suggest and apply a refactoring to solve the mentioned warning messages shown in the
.yamlfiles - what do you think?BoykoAlex commentedon Mar 27, 2024
@manueljordan I'd create 2 additional issues once this issue is resolved as there is a chance to resolve them once conversion is an LS command. Is the 3rd issue about warnings/errors inside of the produced yaml files in a form of comments?
manueljordan commentedon Mar 27, 2024
@BoykoAlex
Yes, about that
BoykoAlex commentedon Mar 28, 2024
Pushed in the Boot LS based yaml <-> props conversion. It is now available on both VSCode and Eclipse. I was able to somewhat maintain the order of keys for props -> yaml conversion. The undo still didn't work properly in Eclipse therefore in Eclipse you'd be only able to create new file without replacing the old. The old file could be replaced in VSCode if preference setting for replacing the old file is on (by default it is off). The change is: aed2127
manueljordan commentedon Mar 28, 2024
Sounds great.
Two files in parallel, right? .properties and .yaml?
BoykoAlex commentedon Mar 28, 2024
@manueljordan Exactly - in the same folder.