Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module name isn't highlighted in some cases #224

Closed
whatyouhide opened this issue Jun 22, 2015 · 7 comments · Fixed by #271
Closed

Module name isn't highlighted in some cases #224

whatyouhide opened this issue Jun 22, 2015 · 7 comments · Fixed by #271

Comments

@whatyouhide
Copy link

Module names aren't highlighted if preceded by a pipe | character. This is the minimal example to reproduce the behaviour:

|List

and this is a screenshot of the behaviour in action:

screen shot 2015-06-20 at 18 28 36

@michalmuskala
Copy link

It also doesn't work correctly with &
screenshot from 2015-07-14 10 30 14

@tonini
Copy link
Contributor

tonini commented Jul 18, 2015

Thanks for reporting

@tonini
Copy link
Contributor

tonini commented Oct 19, 2015

@syohex I guess you have a solution for this one? ;-)

@syohex
Copy link
Contributor

syohex commented Oct 19, 2015

I suppose elixir-mode should change syntax of such characters from symbol character to punctuation character as following patch. Any other characters than &, | ?

diff --git a/elixir-mode.el b/elixir-mode.el
index 77a0f6b..d4c0a3c 100644
--- a/elixir-mode.el
+++ b/elixir-mode.el
@@ -496,6 +496,10 @@ just return nil."
        #'elixir-syntax-propertize-function)
   (set (make-local-variable 'imenu-generic-expression)
        elixir-imenu-generic-expression)
+
+  (modify-syntax-entry ?| "." elixir-mode-syntax-table)
+  (modify-syntax-entry ?& "." elixir-mode-syntax-table)
+
   (smie-setup elixir-smie-grammar 'verbose-elixir-smie-rules
               :forward-token 'elixir-smie-forward-token
               :backward-token 'elixir-smie-backward-token))

Sreenshot with above patch is here.

fixed

@tonini
Copy link
Contributor

tonini commented Oct 19, 2015

That sounds like a good idea, would you like to make a PR?

Syohei YOSHIDA notifications@github.com schrieb am Mo., 19. Okt. 2015
16:53:

I suppose elixir-mode should change syntax of such characters from symbol
character to punctuation character as following patch. Any other characters
than &, | ?

diff --git a/elixir-mode.el b/elixir-mode.el
index 77a0f6b..d4c0a3c 100644--- a/elixir-mode.el+++ b/elixir-mode.el@@ -496,6 +496,10 @@ just return nil."
#'elixir-syntax-propertize-function)
(set (make-local-variable 'imenu-generic-expression)
elixir-imenu-generic-expression)++ (modify-syntax-entry ?| "." elixir-mode-syntax-table)+ (modify-syntax-entry ?& "." elixir-mode-syntax-table)+
(smie-setup elixir-smie-grammar 'verbose-elixir-smie-rules
:forward-token 'elixir-smie-forward-token
:backward-token 'elixir-smie-backward-token))

Sreenshot with above patch is here.

[image: fixed]
https://cloud.githubusercontent.com/assets/554281/10581202/6cf99d64-76bc-11e5-88f4-481db986a3fb.png


Reply to this email directly or view it on GitHub
#224 (comment)
.

@syohex
Copy link
Contributor

syohex commented Oct 19, 2015

👍

@tonini
Copy link
Contributor

tonini commented Oct 19, 2015

Thanks again for your help 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants