Commit Graph

19 Commits

Author SHA1 Message Date
Arif Er 00f9ab19ac chore: update copyright headers to 2022
The script used to identify and update the change is added into the GitHub
workflows script directory. A workflow action can be created to trigger the
script to update the headers on the first of every new year. Possibly a task for
a consequent PR.
2022-06-03 17:32:20 +02:00
Thanh dd1e077c5d [core] enable lexical binding for all 2022-05-11 19:48:17 +02:00
David McFarland 5c0650282f
core-jump: fix incorrect lookup of :async (#15449) 2022-04-06 14:59:38 -04:00
Lucius Hu f2afab0c32
fixup! core-jump: fixed a typo
This commit prevents the error when `handler` is atomic instead of a list.
2022-02-14 21:49:29 -05:00
Lucius Hu db15a2d5a0
core-jump: fixed a typo
For example, in `rust-mode`, `(spacemacs//get-jump-handlers)` returns
`((lsp-ui-peek-find-definitions :async t) evil-goto-definition)`.

So `-handler` is bound to the first one, i.e. `(lsp-ui-peek-find-definitions :async t)`.
We need to figure out whether it's asynchronous by checking the `:async` keyword argument.

But before this commit, we wrongly checks the second handler in the handlers list.
Even when multiple handlers do exist and they are all async, the typo made it sub-optimal since it uses not the best handler.

This commit fixes that.
2022-02-15 01:24:16 +00:00
Thanh Vuong 8adebd9757 [core] remove jump-to-reference from core-jump
we don't need it and it doesn't work
2021-05-08 22:42:29 +02:00
Maximilian Wolff 9cb5a3f67b [core] Remove some typos in doc of new jump handlers 2021-04-12 21:13:51 +00:00
Thanh Vuong f136f465ab core: revise core-jump
spacemacs|define-jump-handlers only defines a variable
`spacemacs-jump-handlers-MODE' to which handlers can be added and sets up key
bindings for mode. MODE must be a major mode,. It won't add function to mode
hook anymore.

`jump-to-definition` will walk through the three lists of handlers in the
following order: spacemacs-jump-handlers, spacemacs-jump-handlers-MODE, and
finally spacemacs-default-jump-handlers.

Dynamic handlers like lsp, tide, ggtags use spacemacs-jump-handlers to register
(add-to-list 'spacemacs-jump-handlers 'jump-hanlder)

Conventional static handlers should use spacemacs-jump-handlers-MODE
2021-04-12 21:02:23 +00:00
syl20bnr 97cd83e169 Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
syl20bnr d55a9e2e67 Update header for year 2021 2021-03-25 22:59:32 -04:00
Robert O'Connor 82ba73a1c0
update copyright to 2020 2020-09-23 21:25:01 +02:00
Fangrui Song c825035e48 core: add reference handler as per jump handler 2019-07-15 12:28:04 +02:00
syl20bnr 326965d4ce Happy New Year 2018! 2018-01-04 02:00:25 -05:00
syl20bnr 0a338d03ed core: jump-handers, :async can now take a predicate function
Allow to check wether a precondition is met before actually executing an async
jump handler.
2017-03-19 12:40:36 -04:00
syl20bnr fb27ede558 Bump year in copyright headers
Happy New Year 2017!
2017-01-05 23:08:17 -05:00
syl20bnr 034f2ea059 core: add support for conventional `SPC m g G` to jump-to-definition
Unfortunately the point jumps two times and we cannot use save-excursion due
to jump-to-definition being asynchronous depending on the handler.
2016-11-22 09:20:03 -05:00
syl20bnr 9066d073b2 Fix (void-variable spacemacs-jump-handlers-....)
Move the variable definitions to config.el and eval-after-load the
key binding on SPC m g g.
2016-09-04 22:31:47 -04:00
Eivind Fonn 734c87fb24 Don’t break asynchronous jumpers (fix #6898) 2016-08-24 13:11:57 +02:00
Eivind Fonn 928983da47 Refactor jump to definition
This commit defines:

- spacemacs-default-jump-handlers: a list of functions that can jump to
  definition in ALL modes.

- spacemacs-jump-handlers-MODE: a list of functions that can jump to
  definition in MODE.

- spacemacs-jump-handlers: a buffer-local list of functions that can
  jump to definition. This is made up of the values of the two previous
  variables whenever a given major mode is activated.

- spacemacs/jump-to-definition: a function that tries each function in
  spacemacs-jump-handlers in order, and stops when one of them takes us
  somewhere new.

- spacemacs|define-jump-handlers: a macro that
  * defines spacemacs-jump-handlers-MODE, possibly filled with initial
    functions
  * defines a function that is added to the hook of the given MODE
  * binds “SPC m g g” of that MODE to spacemacs/jump-to-definition

This is an attempt to harmonize all the different approaches to jumping.
Specifically,

- Existing intelligent jump packages that work for only a single mode
  should go to the beginning of spacemacs-jump-handlers-MODE. E.g.
  anaconda for python, ensime for scala, etc.

- Packages like gtags that work for several modes (but potentially not
  all) and which is dumber than the intelligent jumpers should go the
  the END of spacemacs-jump-handlers-MODE.

- Packages like dumb-jump that work for all modes should go to
  spacemacs-default-jump-handlers.

In all cases the order of the jump handlers in each list should be from
most to least intelligent.

Fixes #6619
2016-08-22 15:08:25 +02:00