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

Add Compass Navigator #8823

Merged
merged 4 commits into from
Oct 7, 2023
Merged

Add Compass Navigator #8823

merged 4 commits into from
Oct 7, 2023

Conversation

kapitanluffy
Copy link
Contributor

@kapitanluffy kapitanluffy commented Sep 18, 2023

  • I'm the package's author and/or maintainer.
  • I have have read the docs.
  • I have tagged a release with a semver version number.
  • My package repo has a description and a README describing what it's for and how to use it.
  • My package doesn't add context menu entries. *
  • My package doesn't add key bindings. **
  • Any commands are available via the command palette.
  • Preferences and keybindings (if any) are listed in the menu and the command palette, and open in split view.
  • If my package is a syntax it doesn't also add a color scheme. ***
  • I use .gitattributes to exclude files from the package: images, test files, sublime-project/workspace.

My package is Compass Navigator

There are no packages like it in Package Control.

Copy link
Collaborator

@packagecontrol-bot packagecontrol-bot left a comment

Choose a reason for hiding this comment

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

Automated testing result: ERROR

Repo link: Compass Navigator
Results help

Packages added:
  - Compass Navigator

Processing package "Compass Navigator"
  - ERROR: Invalid key 'alt'
    - File: Default.sublime-keymap
    - Binding: {"command": "compass_reset", "context": [{"key": "overlay_visible", "operand": true, "operator": "equal"}, {"key": "panel_has_focus", "operand": false, "operator": "equal"}, {"key": "compass"}], "keys": ["alt", "alt"]}
  - ERROR: Invalid key 'ctrl'
    - File: Default.sublime-keymap
    - Binding: {"command": "compass_close", "context": [{"key": "overlay_visible", "operand": true, "operator": "equal"}, {"key": "panel_has_focus", "operand": false, "operator": "equal"}, {"key": "compass"}], "keys": ["ctrl", "ctrl"]}
  - WARNING: The binding ['ctrl+tab'] is also defined in default bindings but is masked with a 'context'
    - File: Default.sublime-keymap
  - WARNING: The binding ['ctrl+shift+tab'] is also defined in default bindings but is masked with a 'context'
    - File: Default.sublime-keymap
  - WARNING: The binding ['ctrl+tab'] is also defined in default bindings but is masked with a 'context'
    - File: Default.sublime-keymap
  - WARNING: The binding ['ctrl+shift+tab'] is also defined in default bindings but is masked with a 'context'
    - File: Default.sublime-keymap

Copy link
Collaborator

@packagecontrol-bot packagecontrol-bot left a comment

Choose a reason for hiding this comment

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

Automated testing result: SUCCESS

Repo link: Compass Navigator

Packages added:
  - Compass Navigator

Processing package "Compass Navigator"
  - All checks passed

@jwortmann
Copy link
Contributor

The kind icons for the different sheet types in the quick panel should not be defined as "function", "variable", "keyword", etc., because sheets are semantically completely unrelated to those predefined kinds.

Take a look how e.g. LSP does it to use the desired colors:
https://github.com/sublimelsp/LSP/blob/b7e32635ac9fefe985b9a76a6d2991153a42c54a/plugin/core/views.py#L106-L113

Or the CommandsBrowser package:
https://github.com/Sublime-Instincts/CommandsBrowser/blob/16ef299085854d1f4b61aaf8280c23c3f98a43a5/src/utils/miscellaneous_utils.py#L18-L28

@kapitanluffy
Copy link
Contributor Author

The kind icons for the different sheet types in the quick panel should not be defined as "function", "variable", "keyword", etc., because sheets are semantically completely unrelated to those predefined kinds.

Take a look how e.g. LSP does it to use the desired colors: https://github.com/sublimelsp/LSP/blob/b7e32635ac9fefe985b9a76a6d2991153a42c54a/plugin/core/views.py#L106-L113

Or the CommandsBrowser package: https://github.com/Sublime-Instincts/CommandsBrowser/blob/16ef299085854d1f4b61aaf8280c23c3f98a43a5/src/utils/miscellaneous_utils.py#L18-L28

Thank you! Updated it.

Curious though, where are the last two values of the tuple used? I see that you can also make them empty.

@jwortmann
Copy link
Contributor

Curious though, where are the last two values of the tuple used? I see that you can also make them empty.

https://www.sublimetext.com/docs/completions.html#kind-info

The letter is shown as the icon and the third value of the tuple is shown in the tooltip when you hover with the mouse over the icon. And I think in case of autocompletion it's also shown in the details pane at the bottom of the popup when that is visible.

Btw, the reason of my suggestion from above is that the predefined (non-color) IDs like KIND_ID_FUNCTION will result in special attributes being set on the theme class rule. For example I use a little "trick" in my own theme to make the kind letter transparent for the predefined kinds, and instead show a special icon in that case.

kind_icons

But of course the icons wouldn't make sense anymore if the kind IDs are used by plugins for unrelated things, like in this example for the different sheet types. (But for the "colorish" kind IDs it will be rendered with the letter still visible, like in the default themes.)

@kapitanluffy
Copy link
Contributor Author

kapitanluffy commented Sep 20, 2023

I use a little "trick" in my own theme to make the kind letter transparent for the predefined kinds, and instead show a special icon in that case.

Whoa! So, I can show icons instead of letters? Can you share that? I think icons would be a more suitable visual guide.


Ah I made it work! Weirdly italicized though probably from the theme.

image

@jwortmann
Copy link
Contributor

I can show icons instead of letters? Can you share that?

Sure, I have three different icon sets to choose from at the moment, plus another option to use the regular letters style, see https://github.com/jwortmann/brackets-theme?tab=readme-ov-file#customization

The relevant theme rules needed for that are around here: https://github.com/jwortmann/brackets-theme/blob/e72123f57a478c2cde9c382b6eb0bbe2ed338cf2/Brackets.sublime-theme#L1771-L1999

It works by setting the color of the icon letter to transparent and then using a PNG background image for the icons.
So the icon isn't just an emoji like in your screenshot, and I hope that no plugin ever uses emojis for the kind letters, because the color property on kind_label from the theme doesn't work for emojis.

@braver
Copy link
Collaborator

braver commented Oct 5, 2023

Pretty awesome package, made even more awesome by the interaction here.

Your keymap still has two entries for debugging purposes. I doubt a general user of the package would be able to memorize the bindings for those, might as well disable those two and instead add them to the command palette.

You're still missing main menu entries for your settings and key bindings. You might add those debugging commands there as well.

Personally I would suggest reducing the install message a bit. You already "sold" it to the user: they installed it. If that message has lots of info, people won't read it (as far as users ever read anything...). I would suggest focussing on the fact that the package really is better with keybindings and help users set that up. Also, the version history there is not super relevant for first-time installation.

Other than those details though, very nicely done 👌🏻

@braver braver added feedback provided mergeable The PR is in a mergeable state but awaiting some final comments/acknowledgement from either side labels Oct 5, 2023
@kapitanluffy
Copy link
Contributor Author

Pretty awesome package, made even more awesome by the interaction here.

Your keymap still has two entries for debugging purposes. I doubt a general user of the package would be able to memorize the bindings for those, might as well disable those two and instead add them to the command palette.

You're still missing main menu entries for your settings and key bindings. You might add those debugging commands there as well.

Personally I would suggest reducing the install message a bit. You already "sold" it to the user: they installed it. If that message has lots of info, people won't read it (as far as users ever read anything...). I would suggest focussing on the fact that the package really is better with keybindings and help users set that up. Also, the version history there is not super relevant for first-time installation.

Other than those details though, very nicely done 👌🏻

Thank you. I'll work on it later and let you know.

@kapitanluffy
Copy link
Contributor Author

@braver created a new release

@braver
Copy link
Collaborator

braver commented Oct 7, 2023

Thanks!

Final remark: for existing menu entries please only provide the id ("package_settings") not the mnemonic or the label: you're otherwise effectively overriding those.

@kapitanluffy
Copy link
Contributor Author

Thanks!

Final remark: for existing menu entries please only provide the id ("package_settings") not the mnemonic or the label: you're otherwise effectively overriding those.

Ah, PackageDev added that. I did not notice. Made a re-release 😅

@braver braver merged commit cf72009 into wbond:master Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback provided mergeable The PR is in a mergeable state but awaiting some final comments/acknowledgement from either side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants