-
Notifications
You must be signed in to change notification settings - Fork 339
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
Consider marking pragmas as something other than comments #1766
Comments
FWIW I already have this customization: '(haskell-pragma-face ((t (:inherit font-lock-preprocessor-face :foreground "royal blue")))) So I think the underlying distinction is already being made. |
Right, I meant to mention that: |
This may be technically possible, but it seems like an indirect way to solve what is presumably an underlying issue with the LSP backend not completing very usefully inside comments. |
Well, I'm not sure we'll ever get good completion inside comments. We probably just want to have it off. The problem is just that we can't distinguish that case from the weird case where we do want completions: pragmas. And I don't think we have enough context-sensitivity in how completions work in the LSP spec to notice whether or not we're in a comment... |
You could be right, but on the other hand I'd be extremely surprised if the backend for |
The root of this issue is that for
lsp-mode
-based completions, we would like to complete language pragmas. Sincelsp-mode
is quite generic, we don't have a good way of saying this, and we just have to say that we want completion in all comments. That is often quite annoying (emacs-lsp/lsp-haskell#135).@alanz made the suggestion that we could consider not treating pragmas as comments. I think that would mean a change to how
haskell-mode
tokenizes Haskell source, and ultimately I don't have a good sense of whether it would have lots of unintended consequences. But there is a certain logic to it: unlike normal comments, pragmas are active program elements that have a prescribed structure, and so in that sense are perhaps more like real syntax than comments.As I said, I don't really know if this is a good idea or not, so I'd appreciate some wisdom!
The text was updated successfully, but these errors were encountered: