noorts / toggler Goto Github PK
View Code? Open in Web Editor NEWJetBrains IDE Plugin - Quickly toggle words and symbols with a hotkey
Home Page: https://plugins.jetbrains.com/plugin/16166-toggler
License: MIT License
JetBrains IDE Plugin - Quickly toggle words and symbols with a hotkey
Home Page: https://plugins.jetbrains.com/plugin/16166-toggler
License: MIT License
As requested by a review on the JetBrains marketplace.
The current approach of managing the dictionary within the small settings window is suboptimal. I would prefer the ability to edit a JSON file directly within Rider for a more efficient process.
Being able to edit the configuration in the IDE's editor would be great indeed (with all the editing features developers are used to).
I've looked into the feasibility of this before briefly and it seemed non trivial. It would be nice to either:
I personally prefer approach 1.
Note that I'd like to make sure that Toggler users do not lose their current toggles when they update to a new version that includes this functionality.
On a line indented by tabs (I tried size 2 and 4), if I don't select a word and I merely put the cursor on a word, the word searched is wrong and there's no match.
As requested by a review on the JetBrains marketplace.
It would be beneficial to include shortcuts for shuffling items up and down. When dealing with numerous suggestions, navigating through them becomes more convenient by moving both upward and downward.
This could be implemented as a simple reverse toggle action.
The current shortcut for the toggle action is Ctrl/Cmd+Shift+X
. Using an additional modifier (e.g., Alt/Opt
) for the reverse action might make it cumbersome to activate. However, I'll likely go with that for now anyway (so it will be Ctrl/Cmd+Shift+Alt/Opt+X
). Better keybind suggestions (which do not conflict with the default IDE's keybinds) are very much welcome!
Not working in latest version ((( Idea 2022.3 Beta (Ultimate Edition)
Hi there, I have a strange one.
Clicking on a part of a togglable word is usually enough to trigger a partial match. However, this does not work on my java files. It does work on scratch file with exactly the same data. What's even stranger, it works when selecting the exact part that I want to toggle.
I can reproduce on at least 3 of our repos (Those use Maven, Spring web, Lombok, and mapstruct).
I run IntelliJ Idea 2021.2, with the following extensions:
Also, I absolutely love this extension. Thank you.
The plugin in its current form using the default toggles is already fast enough not to cause noticable lag. There are however parts of Toggler's implementation that can be optimised. This issue has been set up to investigate potential performance improvements.
The structure used to store the toggles is a List<List<String>>
(thus O(n) in terms of space complexity). Utilities have been written to parse and stringify this toggles structure into JSON. The JSON representation maps onto this structure quite well (as can be seen from the default toggles).
We should be aware that the toggles structure persists the users their personal configs. Thus changing this might be risky as users could lose their personal configs if an update changes this structure.
The business logic found in ToggleAction.java uses the following steps to perform a toggle for each caret separately.
const s|etName = 0
(with the |
indicating the caret and selection) would turn into const |setName| = 0
.const |setName| = 0
would return one match if partial matching is enabled, namely set
.set
. We then return the next word in the structure (wrapping around if the match is the last in the sublist). Finding the match its replacement using this implementation is thus an O(n) operation.The following is a list of potential improvements that can be made.
Hello, thanks for this plugin so far, I just wanted to share a small feature request with you:
Sometimes I am working with symbols such as add_class
or addClass
. It would be nice to be able to change it to remove_class
or removeClass
with your plugin. Sure I could add the whole word to the list in my settings, but often enough it is not just this exact combination of these two words.
Would it be possible to add the functionality to toggle parts of strings as well? Maybe only allow it if there is a underscore or a case-change present, or allow it in general for all partial matches (addclass
would match too).
I'd love to here your opinion on this!
To be able to test functionality which can't be tested through direct integration tests, we'll have to set up UI tests.
build.gradle.kts
to support the robotWe should also integrate the UI tests into the GitHub workflow.
We should add tests to verify the following scenarios.
Allow adding toggles to the configuration which are only enabled for files in certain languages.
The following is an example configuration just to get the point across. Of course with an optimal and valid JSON structure (which is backwards compatible with the current structure).
{
"default": [
["byte", "short", "int", "long", "float", "double"],
["String", "Character"],
],
"java": [
["public", "private", "protected"],
["class", "interface"],
["extends", "implements"],
["import", "export"],
],
"js, jsx, ts, tsx": [
["const", "let", "var"],
]
}
See the shifter plugin for inspiration.
Expand the tests to cover the plugin's main features.
Simple integration tests
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.