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

combobulate-splice-up triggers (wrong-type-argument integerp #<marker ...>) #112

Open
DamienCassou opened this issue Sep 22, 2024 · 6 comments

Comments

@DamienCassou
Copy link
Contributor

  1. Execute

    emacs -Q \
      --eval "(setq treesit-extra-load-path '(\"/...path-to-grammars/\"))" \
      --eval "(add-to-list 'load-path \"~/.emacs.d/lib/combobulate\")" \
      --eval "(require 'combobulate)" \
      --eval "(setq initial-scratch-message \"console.log(\\\"test\\\")\")" \
      --eval "(js-ts-mode)" \
      --eval "(combobulate-mode)"
    

    You get a buffer containing:

    console.log("test")
  2. Type M-b and C-b to move point between the ( and the "

  3. Type M-<up>

Expected: The string "test" to replace the console.log() call

Actual: (wrong-type-argument integerp #<marker ...>)

Debugger entered--Lisp error: (wrong-type-argument integerp #<marker at 12 in *scratch*>)
  signal(wrong-type-argument (integerp #<marker at 12 in *scratch*>))
  combobulate-proffer-choices((#<treesit-node-outdated> #<treesit-node-outdated> #<treesit-node-outdated>) #f(compiled-function (action) #<bytecode 0xeda6e9c5c0cfd1b>) :prompt-description "Splice out" :quiet t)
  combobulate-splice(#<treesit-node-outdated> (self after around))
  combobulate-splice-up(1)

Actual: transient-setup: Assertion failed: (and prefix (symbolp prefix))

@mickeynp
Copy link
Owner

Hm. I cannot reproduce this. I even wrote a test case matching yours.

If the last error is the one you actually see (the assertion failed error) , then I've fixed it already and this issue is just a casualty of the other one.

@DamienCassou
Copy link
Contributor Author

I can still reproduce using the latest commit in master. I'm using Emacs 30.0.91.

In the *Messages* buffer, I also see:

Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Structure error at" 52 "((arrow_function body:
		 ((_ (sequence_expression left: (_) @combobulate-query-highlight-vibrant-veggie-face)))))" "Debug the query with `treesit-query-validate'")

@mickeynp
Copy link
Owner

That's a different error altogether. Are you using the proper grammar versions as per the readme?

@DamienCassou
Copy link
Contributor Author

I thought I wrote it in the issue's description but I didn't, sorry: I'm using the latest commit from master. This is what my GNU/Linux distribution provides.

Are you interested in such issues? If not, feel free to close the ticket.

@mickeynp
Copy link
Owner

Yes, but the version of tree-sitter and the grammars are very important. There's a table of grammar versions you must use. Does it happen if you use those?

@DamienCassou
Copy link
Contributor Author

DamienCassou commented Sep 25, 2024

I can't manage to be 100% sure but I think I switched back to grammar 0.20.1 and I can still reproduce the issue. If you know a way to ask for the grammar's version, I would happily use that.

I even wrote a test case matching yours.

All 649 unit tests pass, regardless of the version of javascript's grammar. Do you have a clue why?

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

No branches or pull requests

2 participants