Commit Graph

42 Commits

Author SHA1 Message Date
9cb4c8b637 fix(:lang): ensure lsp! is always appended to hooks 2022-07-25 18:12:03 +02:00
7f814e5d99 refactor(:lang): redo tree-sitter hooks
- bind to major-mode-local-vars-hook instead of major mode hook
- bind the autodef tree-sitter! instead of the functions.
2022-05-22 21:26:08 +01:00
0c2f986708 feat(:lang): enable ts text objs in modes 2022-05-22 21:26:03 +01:00
06ed5ade3f refactor!(tree-sitter): add +tree-sitter flag
BREAKING CHANGE: break the global nature of the tree sitter
module by adding a +tree-sitter flag to every applicable module

In the background this hooks turn-on-tree-sitter-mode
to the major-mode-hook of the language.
This may also solve the eager loading of tree sitter
2022-05-22 21:26:00 +01:00
47d9f52b6f ocamlforamt hook: buffers without a file name
The behavior before this PR would cause an error if a buffer not backed
by a file was opened. This can be trivially reproduced by opening a
merge/rebase conflict using ediff inside an .ml file.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
2021-04-12 20:18:49 -07:00
e3750dbf66 checkers/spell: add +flyspell flag
spell-fu lacks support for multiple dictionaries, affix expansion, and
many non-English dictionaries, so I've added back flyspell support to
the spell module, but opt-in, because it is still the significantly
slower option and spell-fu may support them one day.

If not, tlikonen/wcheck-mode is another alternative to consider.

Fixes #3813
2020-08-23 18:48:50 -04:00
7081d833f6 Move :ui pretty-code to :ui ligatures
Includes a major refactor of the module.
2020-08-20 02:14:32 -04:00
88dd15e204 Revise comments 2020-02-28 22:26:19 -05:00
78b4c6c5df Enable tuareg-mode minor modes on local-vars hooks
In time to read file/dir local variables.
2020-02-25 22:35:58 -05:00
f426623e4b Revert 3bb384f95 & improve ocaml comment continuation
Back to the default behavior because this implementation was too buggy.
Solution needs a rework.
2020-02-25 22:35:50 -05:00
3bb384f95c lang/ocaml: make asterix in continued comments optional 2020-02-25 20:03:33 -05:00
a14e3afc10 Fix async lookup handlers for tuareg-mode #2394 2020-02-02 03:16:53 -05:00
a5ff21f212 Merge pull request #2353 from facelesspanda/lang/eliom
lang/ocaml: support eliom files
2020-01-20 02:28:48 -05:00
12094788d7 Fix references to :tools fly{spell,check} 2020-01-14 03:04:26 -05:00
fd130a9c2e [ocaml] support eliom files
Eliom/eliomi is ocsigen's extensions for its files using the eliom ppx.

More info at http://ocsigen.org/eliom/6.6/manual/ppx-syntax
2020-01-11 18:39:14 +01:00
78ca397439 Do not quit utop buffers automatically 2019-12-08 16:17:39 +07:00
bdeb02ddc2 Fix tuareg-find-alternate-file binding
This binding should be available whenever tuareg is loaded. Previously,
it would loaded only after merlin.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2019-10-13 20:36:49 +09:00
14b5e545c4 Remove detection for .merlin files
These files are generated and hence this detection fails if they haven't
been generated yet. Merlin is essential for basically all OCaml
development so there's no need for this extra check.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2019-10-13 11:26:49 +09:00
2d365619cd General refactor & cleanup, across the board 2019-09-13 22:00:34 -04:00
a3e262c7ac 💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00
76cacb5bfe 💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
52dc5001bc lang/ocaml: refactor & reformat
This ensures that users' after! blocks have precendence over ocaml
packages.
2019-07-08 22:08:59 +02:00
56393420e5 lang/ocaml: ensure * in block comments are padded
(*
 * <-- ensures there is at least one space here
 *)
2019-07-08 22:08:59 +02:00
d0412b7f56 lang/ocaml: start lsp as late as possible
Gives the user more opportunity to customize lsp et co with
file/dir-local variables or mode hooks.
2019-07-08 21:24:36 +02:00
77e4cc4d58 💥 Remove :feature category
:feature was a "catch-all" category. Many of its modules fit better in
other categories, so they've been moved:

- feature/debugger -> tools/debugger
- feature/evil -> editor/evil
- feature/eval -> tools/eval
- feature/lookup -> tools/lookup
- feature/snippets -> editor/snippets
- feature/file-templates -> editor/file-templates
- feature/workspaces -> ui/workspaces

More potential changes in the future:

- A new :term category for terminal emulation modules (eshell, term and
  vterm).
- A new :os category for modules dedicated to os-specific functionality.
  The :tools macos module would fit here, but so would modules for nixos
  and arch.
- A new :services category for web-service integration, like wakatime,
  twitter, elfeed, gist and pastebin services.
2019-04-24 18:16:04 -04:00
eb3c569e1d Replace +lsp|init with lsp! autodef 2019-03-02 01:34:19 -05:00
69ed1a4a99 feature/{syntax-checker,spellcheck} -> tools/fly{check,spell} 2019-02-22 00:25:30 -05:00
cb923eadcc Add basic LSP support
Still needs to be documented, but includes support for the following
languages:

+ C/C++/ObjC
+ Go
+ Java
+ Javascript
+ OCaml
+ PHP
+ Python
+ Ruby
+ Scala
+ Swift
+ HTML/CSS

Relevant to #460, #716, #1186
2019-02-21 19:13:35 -05:00
3f195614d9 Normalize :leader/:localleader keybinds
Evil states no longer apply to them. Also removes x-alt-keysym.
2018-12-23 23:54:27 -05:00
4029bd7dd0 lang/ocaml: drop bad imenu initialization 2018-10-31 00:03:26 +00:00
a4a42d3141 lang/ocaml: enable merlin-imenu and merlin-iedit (part of merlin)
merlin-imenu works nicely with `SPC / i`.

merlin-iedit is a refactoring tool that locates all occurences of an
identifier in scope and you can use multiple cursors to edit.
integration with evil-multiedit could be better.

There is also a merlin-xref backend, but since we got the individual
def/lookup/etc. already bound not sure if it is worth using it.

Signed-off-by: Edwin Török <edwin@etorok.net>
2018-10-17 00:06:20 +01:00
cdd39b20a5 lang/ocaml: add merlin-eldoc type and doc on hover display
This displays the type and documentation of thing under point
and highlights occurrences automatically when idle. Could be achieved by appropriate use of
keyboard shortcuts already set up by this module.

However `merlin-eldoc` can also display the expected type of function call parameters,
which merlin itself wouldn't.

Signed-off-by: Edwin Török <edwin@etorok.net>
2018-10-17 00:06:20 +01:00
50b324b683 lang/ocaml: always initialize merlin, but wait for a .merlin file for flycheck
Signed-off-by: Edwin Török <edwin@etorok.net>
2018-10-17 00:06:20 +01:00
d1d9cffcc8 lang/ocaml: major refactor
+ Load flyspell-mode a little later, to allow file/dir-local variables
  to customize flyspell.
+ Ensure setters (in merlin's config) are used as late as possible, by
  making merlin's (and all the other packages) config run after tuareg
  is loaded.
+ As discussed, installing packages locally is a bit unreliable, so I'm
  commenting out the +ocaml-site-lisp flag, and rely solely on packages
  from MELPA.
+ Add optional ocamlformat check in doctor.el and conditionally load the
  ocamlformat package (if editor/format is enabled).
+ Add docstrings to init hooks.
2018-10-16 02:49:21 -04:00
064579e33e Improve ocaml language support
See README.org.

Signed-off-by: Edwin Török <edwin@etorok.net>
2018-10-15 20:37:58 +01:00
d8b1e469bc Introduce autodefs to replace some settings
+ :popup -> set-popup-rule!
+ :popups -> set-popup-rules!
+ :company-backend -> set-company-backend!
+ :evil-state -> set-evil-initial-state!

I am slowly phasing out the setting system (def-setting! and set!),
starting with these.

What are autodefs? These are functions that are always defined, whether
or not their respective modules are enabled. However, when their modules
are disabled, they are replaced with macros that no-op and don't
waste time evaluating their arguments.

The old set! function will still work, for a while.
2018-06-15 03:42:01 +02:00
ee49b5ff29 Fix typo in OCaml module. 2018-05-28 11:30:17 +08:00
09cb4f6716 Major refactor & optimization of how modules load their packages
Now that we are loading package autoloads files (as part of the
generated doom-package-autoload-file when running make autoloads), many
:commands properties are redundant. In fact, many def-package! blocks
are redundant.

In some cases, we can do without a config.el file entirely, and can move
into the autoloads file or rely entirely on package autoloads.

Also, many settings have been moved in their module's autoloads files,
which makes them available ASAP; their use no longer depends on module
load order.

This gained me a modest ~10% boost in startup speed.
2018-05-25 00:46:16 +02:00
9d81bc5a8b Major refactor: use-package-always-defer = nil & use :hook
Possibly breaking change: packages are no longer deferred by default.

Addresses #286
2017-12-08 23:14:11 -05:00
53e3670d9a lang/ocaml: adding ml4, mli, mlp to recognized extensions 2017-07-27 11:33:10 -07:00
94f9d05c3a lang/ocaml: refactor 2017-06-28 12:26:49 +02:00
f7ce419265 Added lang/ocaml 2017-06-27 11:39:15 -07:00