Sublime Text 3: Worth a look!

That’s not good. You should file a bug report with a log of jsonrpc requests/responses/notifications if you can get at it, and I’ll try to take a look since I’ve been touching that area of the codebase recently. It sounds like the server is getting reconfigured at runtime somehow with the default false values. I assume document formatting also doesn’t work?

Thanks for helping. In contrast to the linter, document formatting works fine for me. That the server/linter gets reconfigured somehow sounds indeed plausible from the behavior I see, and oddly there are two successive workspace/configuration request (with the same values) in the logs. But let’s indeed move this discussion to GitHub, I think I will look closer at the problem again and file a report on the weekend.

I also set the “command” just like yours, but still have no Auto-completion. :sweat_smile:
Could you write a detail configabout this?
Thanks for your time.

This is the relevant part of my LSP.sublime-settings configuration file, basically as described in the LSP docs (to install SymbolServer is actually not necessary because LanguageServer.jl brings its own SymbolServer):

{
    "log_payloads": false,
    "log_stderr": false,

    "clients": {
        "julials": {
            "command": ["julia", "--startup-file=no", "--history-file=no", "-e", "using Pkg; using LanguageServer; using LanguageServer.SymbolServer; env_path=dirname(Pkg.Types.Context().env.project_file); server=LanguageServer.LanguageServerInstance(stdin,stdout,false,env_path,first(Base.DEPOT_PATH)); run(server)"],
            "enabled": true,
            "languageId": "julia",
            "scopes": ["source.julia"],
            "settings": {
                // Default values from VS Code:
                "julia": {
                    "format": {
                        "calls": true,        // Format function calls
                        "comments": true,     // Format comments
                        "curly": true,        // Format braces
                        "docs": true,         // Format inline documentation
                        "indent": 4,          // Indent size for formatting
                        "indents": true,      // Format file indents
                        "iterOps": true,      // Format loop iterators
                        "kw": true,           // Remove spaces around = in function keywords
                        "lineends": false,    // [undocumented]
                        "ops": true,          // Format whitespace around operators
                        "tuples": true        // Format tuples
                    },
                    "lint": {
                        "call": false,        // Check calls against existing methods (experimental)
                        "constif": true,      // Check for constant conditionals of if statements
                        "datadecl": false,    // [undocumented]
                        "iter": true,         // Check iterator syntax of loops
                        "lazy": true,         // Check for deterministic lazy boolean operators
                        "modname": true,      // Check for invalid submodule names
                        "nothingcomp": false, // [undocumented]
                        "pirates": true,      // Check for type piracy
                        "run": true,          // run the linter on active files
                        "typeparam": true,    // Check for unused DataType parameters
                        "missingrefs": true,  // Report possibly missing references
                        "useoffuncargs": true // [undocumented]
                    }
                }
            },
            "syntaxes": ["Packages/Julia/Julia.sublime-syntax"]
        }
    }
}

The first time after configuring the server and after adding or modifying Julia packages it might take some time for background package indexing, which should be displayed in the status bar.

If autocompletion still doesn’t work, try setting "log_payloads" and "log_stderr" to true, and look for the response for textDocument/completion requests in the Output: Language Servers panel or whether there are some errors from the server.

1 Like

Thanks for your share.
I config the LSP.sublime-settings just like yours before, but only the auto-format done well.
The auto-completion function in LSP don’t work for me.
I can’t find the reason about this error.

Hm… did you see the package indexing from the server? At the first run it probably will take several minutes for that, but after that the server uses cached results and it should be noticeably faster. Can you share the logs in the output panel with "log_payloads": true? There should be entries with textDocument/completion while typing and the corresponding server response is denoted by <<< (see below). I’ve tried with LanguageServer versions v2.0.1 and (with adjusted starting command) v3.0.0 which was just released, and both are working for me.

screenshot

I can’t see the textDocument/completion in LSP’ output panel with “log_payloads:true & log_stderr:true”.
Pls see the log below.


I also install the TabNine and config:“auto_complete: false” in settings.
The version of LanguageServer is v2.0.1.
I guess maybe there are some configuration errors.

I also install the TabNine and config:“auto_complete: false” in settings.

Well, then I would try to temporarily disable that package (Package Control: Disable Package from command palette) and reset the setting to true and look whether it works after that.
Perhaps these plugins don’t work well together, especially since that TabNine package states in its Readme that it disables Sublime’s built-in autocompletion :see_no_evil:

Otherwise file an issue with the complete log on the LSP package GitHub repo.
However, LSP should probably still send requests to the server…

I also get various warnings from the SymbolServer that it cannot find some Julia packages, but it seems those are only dependencies of other packages which aren’t directly used by me, so I guess there are no downsides by that. There might be a way with adjusted starting options for the language server to solve that, but its documentation is very sparse. And I think I have previously seen an issue for it on the server’s GitHub too.

The output is the same after i disable the TabNine and reset the auto-complete to true.
I’m curious about what does the “Info: Received new data from Julia Symbol Server” mean.
At first i guess it means the LSP collect infomation in julia&packages, but the termianal looks still after several minutes. So i’m at a loss. :rofl:

The Auto-completion in LSP work well finnally after i have disabled the TabNine and set the auto_complete to true in Preferences.sublime-settings-user. :blush:

One thing to note is that the LanguageServer.jl package has now changed the arguments to create the server instance in version 3.0, so this is the command needed in Sublime now for me:

command":
			[
				"julia1.5",
				"--startup-file=no",
				"--history-file=no",
				"-e",
			    "using Pkg; using LanguageServer; using LanguageServer.SymbolServer; env_path=dirname(Pkg.Types.Context().env.project_file); server=LanguageServer.LanguageServerInstance(stdin,stdout,env_path); run(server)"
			],
1 Like