-
Notifications
You must be signed in to change notification settings - Fork 310
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
Error in condition evaluation: Symbol’s function definition is void: js2-node-type #1186
Comments
When working with `<style>` blocks of the `.vue` files I get the
following errors when trying to expand `lsp-mode` suggestions.
I don't know what `.vue` files are.
I assume they're some kind of JavaScript files?
Which JavaScript mode do you use?
```
[yas] Error in condition evaluation: Symbol’s function definition is void: js2-node-type [8 times]
[yas] Error running #[128 \302\301\303\300""\207 [(yas-after-exit-snippet-hook) run-hooks apply append] 6
```
The #[128 ...] byte code is the function created by:
(apply-partially #'run-hooks hook)
in `yas--safely-run-hook`, which is a function used only at one place,
where it's asked to run `yas-after-exit-snippet-hook`.
The above suggests that one of the functions on that hook wants to call
the `js2-node-type` which is a function defined in `js2-mode.el` by the
following code:
(cl-defstruct (js2-node
(:constructor nil)) ; abstract
"Base AST node type."
(type -1) ; token type
(pos -1) ; start position of this AST node in parsed input
(len 1) ; num characters spanned by the node
props ; optional node property list (an alist)
parent)
IOW, `js2-node-type` is an accessor function that returns the `type`
attribute/slot/field of an object of type `js2-node` (or a subtype thereof).
The only places I see (within (Non)GNU ELPA) where `js2-node-type` is
called are in `js2-mode.el`, so I can't see how you end up having code
that calls it without it being defined.
If you use `eglot-mode` instead of `lsp-mode`, do you see the same problem?
|
The only places I see (within (Non)GNU ELPA) where `js2-node-type` is
called are in `js2-mode.el`, so I can't see how you end up having code
that calls it without it being defined.
Didn't look carefully enough. I see it now in:
% find . -type f -print0 | xargs -0 grep js2-node-type)
./snippets/js-mode/param-comment:#condition: (= (js2-node-type (js2-node-at-point)) js2-COMMENT)
./snippets/js-mode/return-comment:#condition: (= (js2-node-type (js2-node-at-point)) js2-COMMENT)
./snippets/js-mode/type-inline-comment:#condition: (not (= (js2-node-type (js2-node-at-point)) js2-COMMENT))
./snippets/js-mode/type-multiline-comment:#condition: (= (js2-node-type (js2-node-at-point)) js2-COMMENT)
%
This looks like a bug in those snippets, since they say they're for
`js-mode` but they need `js2-mode`.
I think you want to report that to https://github.com/AndreaCrotti/yasnippet-snippets
|
Thanks @monnier! Reported to AndreaCrotti/yasnippet-snippets#486 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When working with
<style>
blocks of the.vue
files I get the following errors when trying to expandlsp-mode
suggestions.Additionally Emacs freezes for couple of seconds before completing the selection.
I get similar errors when editing
<script>
tags too, but without freeze.When I turn off
yas-minor-mode
Emacs stops freezing.Below are parts of my .emacs file related to
yas
,lsp-mode
andcompany-mode
The text was updated successfully, but these errors were encountered: