Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a syntax table to clojure-ts-mode, Emacs syntax tables are used to determine where words, symbols, and other syntactic constructs begin and end. This information is used by many Emacs facilities, (not just font locking).
I ran into a use case for it, while using cider.
Cider relies on clojure-mode.el
clojure-find-ns
which relies on(thing-at-point 'symbol)
to give you the full clojure symbol, in many of it's functionality.e.g. When Cider is sending sexp's to the nREPL it needs to determine which namespace that sexp should be executed under, and this boils down to a (thing-at-point 'symbol) call. Originally, I was getting 'namespace' not found, because at the top of my file
(ns foo.bar)
, (thing-at-point 'symbol) was being called by cider at the beginning of the symbol , but thing-at-point was returning 'foo instead of 'foo.bar leading to my sexps being evaluated under the wrong namespace. Some of the code for this can be found at:https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L2142
This PR simply adds a syntax table, i've confirmed thing-at-point behaves as expected now. The syntax table I copied verbatim from clojure-mode.el, so it'll be accurate.
Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):
M-x checkdoc
and fixed any warnings in the code you've written.Thanks!