Skip to content

Conversation

@AckslD
Copy link
Contributor

@AckslD AckslD commented Dec 25, 2024

On top of #66. @CKolkey I added these actions to expand (list/set/dict) comprehensions and inline for-loops for Python. I added them in actions.ft.python to make them optionally accessible instead of in filetypes.python to not change the current default behavior. Let me know if you prefer some other structure or way of adding this. If this looks okay do you think this should be mentioned in the README?

This can be used as:

local python_actions = require('ts-node-action.actions.ft.python')
require("ts-node-action").setup({
  python = {
    list_comprehension = python_actions.expand_list_comprehension,
    set_comprehension = python_actions.expand_set_comprehension,
    dictionary_comprehension = python_actions.expand_dictionary_comprehension,
    for_statement = python_actions.inline_for_statement
  },
})

@CKolkey
Copy link
Owner

CKolkey commented Dec 29, 2024

Do you mind adding some specs that give a clear expand <-> collapse state check?

@AckslD
Copy link
Contributor Author

AckslD commented Dec 30, 2024

@CKolkey sure thing! Since these are just exposed as optional actions a user can include in their config how do you think that should be handled in the tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants