-
Notifications
You must be signed in to change notification settings - Fork 8
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
Feature Request: Generate GUID for each cursor #13
Comments
Feel free, and thanks! |
Yeah, I wanted something that behaved the same as: https://github.com/SublimeText/GenerateUUID - which has that feature! I guess the UI would need to change to list the formats with an EXAMPLE rather than a particular GUID in the command window. |
If either of you want to review the changes (also had to "modernize" my old extension project), I can go ahead and get a new version built and published. Manual testing looks good, so I'll go ahead and publish in a few days regardless, but a third-party review would be desirable. |
BTW, this adds a new command "Insert many GUIDs" but with no keyboard binding. You could always rebind if you want that to be default. If you'd prefer, I could update the documentation about how someone could do that if they are not familiar. |
I will have a look tomorrow! This is awesome! |
I don't know about anyone else - but I will never want to copy one to my clipboard again once you add this. So for me, making this the default (w/keybinding) would obviously be better. But perhaps I'm unusual 😅 |
I'll at least update the README about changing keybindings. I'd rather avoid a breaking change, but considering other options. Perhaps |
Another option is that I could make this a preference with a single command, and after the update to this version prompt if you want to make it the default. One could always change it in preferences then, or I could even make a new command to easily toggle the default. |
I wonder if it's even worth creating a new extension, with that as the focus? |
That would be chaotic, IMO. There's already several extensions that generate GUIDs - albeit like the very utility that shipped with VS that my extension aimed to replace and improve. Why add another? And since 1 line is a subset of multiple, it would still do the exact same thing as this one. What I'd prefer is a more NPM-like approach to VSCode extensions, like I opened at microsoft/vscode#37162. I'm actually considering just changing this new behavior to be the default. I'll make a decision by tomorrow. There's several options, but I'm not sure keeping backward compatibility with a recent change most people probably don't even know about (wasn't really advertised) is worth it. |
Checking on this history of the multi-select, I see this was indeed to replace a single GUID in multiple places, as called out in issue #9. So instead, I'll bind this to
|
* Add support to insert multiple unique GUIDs Fixes #13 * Bump version to 1.4 and fix PR comments
New version is up: https://marketplace.visualstudio.com/items?itemName=heaths.vscode-guid |
That's an amazing turn around speed! Only small remaining problem for me is that when I press ctrl+shift+alt+[, I get the command palette appear with a guid in it - I'd love to either not have that step at all 👍 - or, if there has to be another step there, have it be more clear that it will be inserting many different GUIDs 👍 |
The quick pick list is numbered so you can quickly and easily hot the number you want. I've been very careful about making sure the defaults remain the same so the numbers will always be the same unless you change the default options. Given that, muscle memory should be fast enough to not differentiate that I'll insert multiple different GUIDs. After all, that is the command you invoked. |
FWIW, I did previously consider adding an option to default the format and should the quick pick, but as soon as you need a different format you'll have to change options just to do it. If that's really what you want I can add it but you'll need to opt in. Given the structure of the code now, it would probably be the numeric identifier given the options you have configured. |
Cool re: numbers, I just pressed 'enter' to insert the default - which is probably all most people need - but sure, more options is good. The thing was when I first used it via ctrl+shift+alt+[ I couldn't tell that the command was different to inserting the same one every time, because it showed me an actual GUID (55b4fd35-d36e...), rather than |
Also, people do need different formats. I'm not sure into what format you're using the first item, but in most authoring I work - and even the reason I created this in the first place, for WiX authoring - the second format is the only valid format. One cannot assume what people need, and needs vary. Default formats 3 and 4 were to provide the same functionality of the old Insert GUID utility that shipped as a tool with Visual Studio, which I also use quite a bit in native coding (most often COM, which also makes heavy use of GUIDs). And because I want to maintain backward compatibility because users do develop muscle memory, that is why format 5 was added at the end despite being more similar to 1 and 2. |
Sure, having more options is better - especially with a good default - which it is. My only remaining quibble was around the content of that box - I think it would be clearer if you didn't use a specific GUID - or made it clearer with some text that it was an example? Either |
An awesome feature would be the ability to hook into multiple cursors and generate a unique GUID for each cursor on the screen 👍 If you are open for PR's I could have a look at it. Thanks for a nifty extension.
The text was updated successfully, but these errors were encountered: