Commit graph

29 commits

Author SHA1 Message Date
Maximilian Wolff 500e58341c
Defer loading of lsp servers up to when the buffer is visible 2021-06-06 22:26:31 +02:00
Lucius Hu 3bbc7a7d40
core-customization: improved SAFE variable handling (#14679)
* core-customization: improved SAFE variable handling

- SAFE can either be a function or t.
  - When it's t, use a default validation function
    `(lambda (val) (validate-value val TYPE t))`
  - When it's a function, use the supplied function.

* Fixed bugs in go and groovy layer

In almost any cases, it's better to supply `t` instead of a function, to
`SAFE` argument of `spacemacs|defc`.

For example,
```elisp
 (spacemacs|defc go-use-gocheck-for-testing nil
   "If using gocheck for testing when running the tests -check.f will be used instead of -run to specify the test that will be ran. Gocheck is mandatory for testing suites."
  'boolean nil #'booleanp)
```

If its value is nil, it evaluate to `nil`, which means that `nil` is not
a safe value for `go-use-gocheck-for-testing` local variable.

But clearly it is.

* core-customization: improved SAFE variable handling

- Added a function `spacemacs-customization//get-variable-validator`.
  This function is designed to be used with `safe-local-variable`
  property of spacemacs custom variables.
  See details in the docstring.

```elisp
(put 'FOO 'safe-local-variable
     (apply-partially 'spacemacs-customization//get-variable-validator
                      'FOO))
```

- This is better than a lambda since `apply-partially` returns a compiled
  function. (Though the performace gain may be tiny.)
- This is better than simply calling `validate-value`, because it returns
  nil when value is nil. But sometimes nil is a valid value.

Co-authored-by: Lucius Hu <lebensterben@users.noreply.github.com>
2021-04-19 21:34:09 +02:00
Maximilian Wolff b3bf5c1fb4
[groovy] Fix wrong customization type 2021-04-17 23:13:48 +02:00
Maximilian Wolff 8814329a11
[groovy] Replace defvar with spacemacs|defc
And extend spacemacs|defc to allow setting
a :safe directive.
2021-04-17 22:07:44 +02:00
Lucius Hu c83a9e76b3
groovy: Fix local vars
- Labelled `groovy-backend` as safe local variable.
- Added local variable hooks of groovy mode:
  - `spacemacs//groovy-setup-backend`
  - `spacemacs//groovy-setup-company`

See: https://github.com/syl20bnr/spacemacs/issues/14653
2021-04-17 21:02:22 +02:00
Lucius Hu e8e99500d4 groovy: refactor
- Moved backend determination to `config.el`
- Replaced unnecessary backquote construct with simple quotation
- Replaced `pcase` form with only one-arm with `when` or `unless` form
2021-04-04 12:48:21 +02: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
emacspace 13791616c7
[bot] Auto-update (#14398)
* documentation formatting: Sat Mar 13 23:53:10 UTC 2021

* Built-in files auto-update: Sat Mar 13 23:51:34 UTC 2021
2021-03-14 00:57:56 +01:00
Peixian Wang 34aeca5f98 Add note on which jar to use
Build system for https://github.com/prominic/groovy-language-server generates two different jars, this adds a note on which jar to use.
2021-03-14 00:11:26 +01:00
Maximilian Wolff afc133d2ff
[groovy] Fix broken binding for non-lsp company backend 2020-07-18 10:07:30 +02:00
emacspace dec350eb84 documentation formatting: Sun Jul 12 08:21:50 UTC 2020 2020-07-12 21:03:53 +02:00
Maximilian Wolff 920f568d81
[groovy] Make all variables adhere to layer naming scheme 2020-07-12 01:42:44 +02:00
Maximilian Wolff f3f0e3a98d
[groovy] Fix missing ")" in documentation 2020-07-09 22:05:19 +02:00
Maximilian Wolff eacab70047
[groovy] Add lsp server support 2020-07-06 22:26:07 +02:00
duianto 0a06c7ca6b Fix filenames in layer file headers
Also fixed the groovy/funcs.el header which said: Java
2020-02-20 00:07:30 +01:00
Anton-Latukha f6660f82d4
Switch to the new layers generator 2019-05-15 21:08:21 +03:00
Anton-Latukha ba074bc908 layers: lang: new structure: general: add pure, multi-paradigm (&js) 2019-05-15 21:04:48 +03:00
JAremko 77c680160e Add placeholder tags 2019-05-05 20:40:47 +03:00
emacspace 45276bd96f documentation formatting: Wed Dec 5 03:03:03 UTC 2018 2018-12-04 22:06:14 -05:00
JAremko cd39f80c24 Reformat documentation 2018-10-11 00:13:43 +03:00
syl20bnr fcd9d31bcb groovy: add import for symbol key binding 2018-05-07 01:03:47 -04:00
syl20bnr ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.

The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
2018-03-03 23:40:10 -05:00
syl20bnr 29c78ce841 Defer packages by default using use-package-always-defer
Warning now `:defer t` is implied, to force a package to load `:demand t` is
now necessary.
2018-02-27 23:32:52 -05:00
syl20bnr 326965d4ce Happy New Year 2018! 2018-01-04 02:00:25 -05:00
syl20bnr 17fc89f9e7 java: improve maven and gradle support (also for groovy)
Add new packages `mvn` and `maven-test-mode`.
Move `gradle-mode` configuration from groovy layer to java layer
New prefix commands `SPC m m` for maven and `SPC m l` for gradle.
Make maven and gradle commands available in java-mode.
Update documentation.
2017-12-17 18:45:46 -05:00
Johnson Denen a8340a0262 Add Gradle support to the Groovy layer 2017-12-17 15:29:11 -05:00
CeleritasCelery e32acfbf3b Fixed feature header 2017-08-29 20:00:44 +03:00
syl20bnr a496401e1f Move groovy configuration to its own layer and improve it
Enable company, org babel and repl.
2017-08-28 13:49:09 -04:00