-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
sp-forward-slurp-sexp pushes colon out of expression in JSON #701
Comments
@Fuco1 this might not be related to specific mode, just had similar behaviour with So I wanted to wrap these in
Here I wrap expression, which works as expected
After the first slurp, the comma gets pushed out
The second comma is left intact though.
And everything works as you would expect in python-mode. |
Well, fundamental mode is kind of "stupid" in a sense it has barely any config. It works in python because smartparens has it configured. I think this is js-mode issue with syntax classes. We have some hacks to work round it, it mostly has to do with properly configuring what is a prefix/suffix. The second comma was not left intact, it traveled with the The "suffix" feature is an issue in languages where e.g. |
The same happens to me when trying to slurp from:
All the way down:
Is there anything I can do for improving the situation? |
@arichiardi Isn't yours a sort of inverse problem? I suppose what you expect is to end with the Things probably need to be configured such that the The API should be fairly straight forward and there are examples around so it would be awesome if you looked into it and tinkered a bit :) If you take up the challenge and get stuck don't be afraid to ask! I'll add some docs on the things which would be unclear. |
@Fuco1 yeah it looks like it is a bit different, but isn't |
@arichiardi In
What version of Emacs do you use? When you place the cursor over I use Emacs 24.5 and SP master. |
@Fuco1 I am in |
Right. In smartparens there is no mode inheritance, so even if |
Sure I can try. EDIT: it worked! -> #748 |
Turns out The OP's problem was fixed all along but the config simply did not load for them :D /shrug |
@Fuco1 thanks mate! I'll update the version and check it out. |
Let's say I want to wrap
must_not
clause inside of another JSON field.So here I wrap field name in curly brackets, hoping to slurp the field value in.
I execute
sp-forward-slurp-sexp
command, but this is not what I would expect. The JSON is invalid now, as the colon between field namemust_not
and it's value got pushed out of expression.Is there a configuration parameter that can fix this?
The text was updated successfully, but these errors were encountered: