-
Notifications
You must be signed in to change notification settings - Fork 2
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
Problems with utf-8 code #2
Comments
Assuming you use Eglot as your LSP client, you can configure the equivalent of the VSCode ((nil . ((eglot-workspace-configuration . (:ada ( :projectFile "utf.gpr"
:defaultCharset "utf8")))))) If you use The Eglot command
Yes, this is an ALS workspace configuration. You can see the specific ALS documentation for the setting here. I'm unclear on exactly what situation it applies, but the docs indicate it's used when the ALS has to read the file itself. AdaCore can probably provide specifics if needed.
I'm glad |
That would be a great help, thanks |
FYI, I just noticed that the VSCode settings.json that @joaopsazevedo provided in the other issue uses "utf8" for the value of The Ada language configuration options for By default, ((nil . ((lsp-ada-project-file . "utf.gpr")
(lsp-ada-option-charset . "utf8")))) |
It doesn’t seem to make any difference to the issues, so I think either must be acceptable. I see that both of those variables are customizable! The |
Unfortunately, I'm not able to reproduce it on my Linux system. I've tried both Eglot and Does the error still happen on VSCode with the suggested settings from @joaopsazevedo? If not, since VSCode defaults to using GNATformat, you could try enabling that as well and see if it still happens. ((nil . ((eglot-workspace-configuration . (:ada ( :projectFile "utf.gpr"
:defaultCharset "utf8"
:useGnatformat t)))))) If that still doesn't work, I'd recommend generating an ALS log and attaching it to the original issue.
The "double initialization" will happen if you enable (defun init.el/lsp-mode ()
(add-hook 'hack-local-variables-hook #'lsp t 'local))
(add-hook 'ada-ts-mode-hook #'init.el/lsp-mode) |
I raised this issue over on ada_language_server.
The last comment is interesting. Joao suggests we could set
ada.defaultCharset
the same was we setada.projectFile
, but as far as I can see we just ask the server what it thinks the default project file is! I had a look through the code but my elisp is a bit weak, and I’m a bit vague on the LS protocol.Would
ada.defaultCharset
be the same for the whole project? that might not be right. Emacs on macOS knows whether a buffer is UTF or not.I’m getting on very well with ada-ts-mode (so long as I avoid utf-encoded source! I get the feeling that as soon as ALS sees a utf-encoded file in a project it gets very confused).
The text was updated successfully, but these errors were encountered: