Closed marnen closed 9 years ago
...and I neglected to mention that I'm using Aligner 0.9.1.
Thanks for your interest in aligner, @marnen.
Allow me to answer your thoughts on each of the format,
object
type in config. It wasn't very reliable when I was developing this and hence not using this format.character
and config key
. Atom will render this format into a long and difficult to read title in Atom setting page, so these config objects usually includes a title and a description.
This approach also allows option
to be configurable. I thought of using an unrecognized type (e.g. type: 'private'
) for this config but Atom complains in the console. atom-aligner
but currently there is no good way to guarantee atom-aligner
package is activated before language packages.To be honest, multiple
param was originally created to handle ,
and it wasn't a fully thought-out config parameters. I'm still thinking about it and am open to suggestion.
May I ask what character/operator you are trying to align and how they should be aligned?
Thanks for your detailed response! I'm trying to align tables in Gherkin (Cucumber):
Scenario:
Given I have a pipe-delimited table in my scenario
When I invoke Aligner
Then the table should look something like this:
| first | last | state |
| Marnen | Laibow-Koser | MA |
Just want to leave a quick update.
I'm currently working on this and should have a fix very soon. The update config file will look something like:
config:
':-alignment:
type: 'string'
default: 'right'
privateConfig:
'|-multiple-string-alignment': 'right'
'|-multiple-number-alignment: 'left'
privateConfig
will not show up in the setting panel.
Thanks! I look forward to trying it out.
Aligner has been bumped to v0.11.0
with better configuration support. You can find the documentation at https://github.com/adrianlee44/atom-aligner/wiki/Creating-aligner-add-ons. Let me know if you run into any bug / question.
I'm trying to write an Aligner plugin for Gherkin. I would like to specify
multiple
as a property of the|
character. However, becausemultiple
seems to have to be a nested object rather than a simple string, every method I can think of fails, as follows:1. Specify object within provider.coffee
Result: appears to display correctly on package settings screen, but
operatorConfig.getConfig('|', '.text.gherkin.feature').multiple
is{number: {}, string: {}}
. Also, settings don't appear to save to ~/.atom/config.cson properly. Perhaps this is an Atom bug?2. Use multiply hyphenated keys in provider.coffee
Result:
operatorConfig.getConfig('|', '.text.gherkin.feature').multiple
is just the stringright
. Apparently Aligner, when splitting keys, discards everything after the second hyphen, so both of these keys are equivalent to|-multiple
. I can try to submit a pull request to implement smarter splitting, if that seems like the right solution.3. Specify object in package's config.cson file
This is actually the preferable choice for me, because the
multiple
option really shouldn't be user-configurable for my use case. Now if only I could get it to work!Result: This appears to be entirely ineffective (and likewise when I do the equivalent thing in JSON).
As you might imagine, I'm at my wits' end. What should I do here? Should I patch Atom or Aligner so that one of these works? @adrianlee44 Do you have any thoughts on which of these three methods is most compatible with Aligner's architecture?
I'm using Atom 0.188.0 on Mac OS X 10.10.