Closed Erimus-Koo closed 8 months ago
Hi @Erimus-Koo ,
I'm not sure I did understand your scenarios/steps correctly, as I couldn't reproduce it, so I have a few questions:
Bookmarks: Toggle Labeled
command?Thanks in advance
cmd+opt+K
toggle a bookmark on.
Try to edit it. Click the pencil icon and get a blank input.
I hope the input includes const initHandler = (
Directly right-click at the left of the line number, and create a bookmark with label, same as the previous step 2.
And I have already checked Use Workaround For Formatters
, but the bookmarks still frequently shift a few lines, which really has a significant impact.
In addition, if toggle bookmark is pressed in a multi-cursor situation, it will add many bookmarks that cannot be undone. It may be worth considering adding an option to disable this behavior.
And I have already checked Use Workaround For Formatters, but the bookmarks still frequently shift a few lines, which really has a significant impact.
This situation often occurs when there are too many function parameters. Prittier automatically splits the parameters into multiple lines or merges them into fewer lines if the number of parameters decreases, causing the bookmark to be offset.
Hi @Erimus-Koo ,
The Case 1 is the expected behavior, as the idea of the Edit Label
button is to edit the label of the bookmark. In this case, you have a regular bookmark (without label) and the preview shown in the side bar is just the line content. When you click the Edit Label
button, since the bookmark is not labeled, it will not suggest any label. The bookmarks.label.suggestion
setting only works for selections, which is not the case.
The Case 2, on the other hand, I couldn't reproduce the issue. When I click the Edit Label
button on a labeled bookmark, its label is shown in the Input Box
Are you sure you edited a labeled bookmark? It has a ✏️ icon side by side the bookmark icon in the side bar.
About the bookmark shifting while using Prettier, and the setting to disable multi-cursor support, I'll open two separate issues to track.
Hope this helps
Yeah, in case 2, I'm creating a new bookmark with the label, not editing a labeled bookmark, so it's the same issue about the suggest. I prefer to keep the content of the line as suggestion.
And in my usage, I find an automatically generated and updated TOC for functions that will be very helpful. It would be great if this could be a feature.
For your case 2, if you like the suggestion to be the line content, I suggest you to try out the following setting:
"bookmarks.label.suggestion": "suggestWhenSelectedOrLineWhenNoSelected",
As it, Suggests the selected text (if available) or the entire line (when has no selection). You still need to confirm
Hope this helps