-
Notifications
You must be signed in to change notification settings - Fork 181
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
Add elm support #613
Comments
Did you try this command too?
Also make sure to open the SublimeText Console and check to see if the LSP |
Hrm, I think my problem might be that the file doesn't even get recognized as an elm file? Do I need another extension just to get that working, as I can't choose elm from the file type selector. |
Yes, first order of business would be to have an Elm syntax. You'll probably also need to set the (from: https://packagecontrol.io/packages/Elm%20Language%20Support) It looks like this Elm plugin tries to do a lot more than just syntax-highlighting, unfortunately. |
Yeah, it's a full blown plugin, so I would need a plugin that just does syntax highlighting? |
Well, you could also use the plugin mentioned above. I don't know if any functionality might interfere with each other. But in theory all you need is a I haven't tested this, but when using that plugin your config should look something like this:
|
here is the config that works for me.
And you need to install I tried elm language server, but as far as I can see only the diagnostics are working in LSP for sublime. |
If you can dig into it, that would be awesome. As we don't seem to be able to figure it out: elm-tooling/elm-language-server#99 |
Here is a sample elm project if someone is interested in debugging this:
Next, in the terminal:
Here is what happens when I open an elm file:
I made a NOTE that the Here we get the A Solution for this is to ask Another thing that I noticed is
Changed text document, going to parse it. file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm This is all I could figure out for now, |
I would like to note that the "unhandled notification" messages from window/logMessage seem correct. Quoting from the specification:
|
:D |
@rwols do you think that the |
I guess I should read more than one sentence ahead :)
It seems to be coming from |
You don't know JavaScript, I don't know JavaScript... Nobody knows :D This is what sublime sends to the server for the
Here is what happens when I try to
|
hello @razzeee, |
Let's summarize the discussion so far:
As it turns out I seem to have the
wrapping the URI string into a |
It would be really helpful to get the logs, that the server sends. https://github.com/elm-tooling/elm-language-server/blob/master/src/providers/astProvider.ts#L33 is the problematic part, but I can't get master branch with vscode to go into that if branch. So it seems like your forest var does not get populated. Did you open the folder that has the |
I cloned the latest master for elm language server now.
The |
I opened the folder that contains the Here are further logs when the client tries to interact with the server
No |
I have some news.
|
Seems to work for me too, at least what I can tell without ever having used an lsp for sublime :) |
Well it doesn't work for me |
Try updating the server version, even if it might "break" things for you. Fingers crossed |
Installing the latest version of elm-lanugage-server allows me to start the elm server successfully. I get diagnostics and code actions :) Anyway @razzeee thanks :) we are one step closer to bringing elm support to sublime |
@predragnikolic ping :) You can also drop the |
@razzeee, thanks for reminding me |
@predragnikolic Or at least share your up to date config :) |
@razzeee I opened a PR for adding elm to the LSP sublime docs :) |
Thank you, added it to the ls docs. The only thing that I did not manage to get to work were code lenses. |
No, thank you! Sublime lsp doesn't, yet, support code lens... Yet :-) |
Also I spotted a typo in your docs :-D
|
Fixed |
I would like to reopen this, as we should find a solution for elm-tooling/elm-language-server#121 |
Update: The same setup I had done on Linux, which works,
Does no support for |
Hrm, no in your case the workspace folder is the root folder you've opend. That case works, it starts to be problematic, if you have multiple |
If we implement |
The elm language server could also watch for a keyvalue pair in the initializationOptions that points to the elm.json file. I'm not sure wether the initializationOptions can be overridden per Sublime project. |
I'm not sure that that's the way to go. At the moment we're doing it the other way around and it seems to also be what other IDE support packages do. |
I don't understand what you mean by this sentence. Could you clarify what you're envisioning? There is one connection maintained to a language-server per language per window. So if you have a window open which contains python files and bash scripts, the plugin will maintain a connection to one instance of the python-language-server, and one instance of the bash-language-server. The concept of rootPatterns is a workaround for neovim because it doesn't have the concept of (multiple) workspaces, whereas VSCode and ST do have workspaces: https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders There is also the desire to have less configuration options, not more. |
AS far as I understood the spec especially the The client should start a server per workspace, I guess that's already happening now. Our way of thinking about workspaces was probably off. As we thought, we would best only start a server when we're sure that there is an |
Even without an elm.json the server should still try to make useful suggestions IMO. |
Yeah, your right, that would be the best thing to do. |
I implemented everything that I think is necessary now, haven't created a release yet, but it's in master. Just FYI. |
@razzeee
I opened From the logs I saw something that maybe relates to this. Notice the section when elm started to add imports. It didn't add imports for the other files in the project, like
BTW, the Here is my lsp elm config:
|
The files in that project do not have module declarations, that's a case, that we don't handle well. So that seems to be the reason. Yes, the package has been renamed. I already updated the readme in master https://github.com/elm-tooling/elm-language-server#sublime Thank you for looking at this. |
Updated our documentation pointing to the new syntax package as well. Closing as it appears to be working in general, for specific Sublime-related discussions please open a new issue. |
Hey there,
it would be awesome to get Elm support via https://github.com/elm-tooling/elm-language-server
I tried this config, but that doesn't seem to be enough:
Thanks
The text was updated successfully, but these errors were encountered: