Closed VlachJosef closed 7 years ago
I'm quite sure there is already something that handles real scala syntax such as =>
. For the rest, I understand the idea, but differ with the view that this should be done in scala-mode proper. The list of symbols is totally dependent on the libraries the user is using.
So if we highlight these specially, why not other non-alphabetic names?
Real scala syntax like =>
doesn't behave like symbol currently.
I'm fine with including such a subset of special syntax / method names which will be generally useful for all. I just don't want to go with empty list as default, since it will make purpose of this variable harder to understand.
yeah, can we just have a regex instead of explicit list? Or is there a collision with use of those characters as scala syntax?
Which movement commands exactly were you referring to in your submit comment?
I'm using highlight-symbol-next
etc. a lot for jumping around the buffer, but not just that, for example projectile-ag
command by default select symbol under the point, which also make this to work .
@fommil that list is turned into a single regex when used
In my view, if this change is made, it should mark all symbols as such, not just some selected few. I.e. it should mark everything else than the reserved symbols (so it would NOT mark for example, =>
or :
The code that you are "countering" with the syntax-propertize-function is this
;; by default all opchars are punctuation, but they will be
;; modified by syntax-propertize-function to be symbol
;; constituents when a part of varid or capitalid
(dolist (char (mapcar 'identity "!#%&*+/:<=>?@^|~-\u21D2\u2190")) ;; TODO: Sm, So
(modify-syntax-entry char "." syntab))
My code only marks these characters as symbols if they appear in a varid or capital id. What you should do is to study if that could be expanded to include at least op ids, if not all ids
The all ids case would then include stuff like this being one symbol
`volatile ++`
ok, I've got the idea, I'll take a look
I'm closing this PR as proper solution is still being worked on. It will be little more work to make it right. In the meantime I've raised #137 which makes quoted ids work as a single symbol.
to be treated as symbols in emacs, which allows easy navigation around buffer by jumping from one identifier to another