sublimelsp / LSP-elixir

Elixir support for Sublime LSP plugin

Home Page:https://lsp.sublimetext.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

does not take config from .sublime-project file

abdul-hamid-achik opened this issue · comments

hey guys, i have an umbrella app and I'm trying to make this work with my project...

basically whenever I save I get this error:

◌ mix.exs:
        1:1   	ElixirLS    	error     	No mixfile found in project. To use a subdirectory, set `elixirLS.projectDir` in your settings

this is my sublime-project config so far

{
	"folders":
	[
		{
			"folder_exclude_patterns":
			[
				"./services/deps",
				"./services/api/assets/node_modules"
			],
			"path": "."
		}
	],
	"settings":
	{
		"LSP": {
			"elixir-ls":
			{
				"enabled": true,
				"projectDir": "./services"
			},		
			"elixirLS": {
				"projectDir": "./services"
			}
		},
		"elixirLS": {
			"projectDir": "./services"
		}
	}
}

as you can see I tried setting the projectDir in different ways, so what I'm wondering is if this is even possible? otherwise ill probably just add it to the global settings

thanks for any help you can provide

The correct schema is, if I'm not mistaken

{
    // settings for each sublime view in the project
    "settings":
    {
        // LSP settings
        "LSP":
        {
            // the name of this plugin
            "LSP-elixir":
            {
                // the server settings
                "settings":
                {
                    // the actual server setting -- dotted notation works
                    "elixirLS.projectDir": "./services"
                }
            }
        }
    }
}

thank you for your quick response! that didn't work but it got me thinking about the server settings and the actual server settings on the dotted notation so I'm gonna look into that under my sublime-project settings

couldnt make it work with sublime text 3 BUT I downloaded the dev build for sublime-text 4 and it worked perfectly, thank you @rwols

I just want to comment here because it took me quite a bit to figure out why it was not working for me, and it might help someone else looking into this.

Issues:

  1. If you just open projects like subl . as I do a lot of times in the terminal and expect that a .sublime-project in its root created by you will work, no it will not. You can open the project like that, but then you should Project > Save Project As... and save it to the root of the project to create the *.sublime-settings and *.sublime-workspace. Then, for example if you saved it as example.sublime-settings and you are in the project root, to open it correctly from the terminal you should subl --project example.sublime-project otherwise the project specific settings will not be loaded.
  2. For the current plugin version at least, the snippet above has a typo "LSP-elixir" should be "lsp-elixir", so for me what worked was:
{
    // settings for each sublime view in the project
    "settings":
    {
        // LSP settings
        "LSP":
        {
            // the name of this plugin
            "lsp-elixir":
            {
                // the server settings
                "settings":
                {
                    // the actual server setting -- dotted notation works
                    "elixirLS.projectDir": "your_sub_dir_here"
                }
            }
        }
    }
}