sublimelsp / lsp-julia Goto Github PK
View Code? Open in Web Editor NEWJulia support for Sublime's LSP plugin using LanguageServer.jl
License: MIT License
Julia support for Sublime's LSP plugin using LanguageServer.jl
License: MIT License
From what I understand this language server depends on environments. But I don't know how that would work exactly. There is no support for environments out of the box at the moment.
See: https://github.com/julia-vscode/julia-vscode/blob/master/src/jlpkgenv.ts
We can probably replace this with self.session
and co. e.g.
class JuliaExecuteCommand(LspExecuteCommand):
def is_enabled(self):
return self.view.match_selector(0, "source.julia") and any(self.sessions())
Failed to register plugin
Traceback (most recent call last):
File "/home/raoul/.config/sublime-text-3/Packages/LSP/plugin/core/sessions.py", line 466, in register_plugin
client_configs.add_external_config(name, *plugin.configuration())
File "/home/raoul/.config/sublime-text-3/Packages/LSP/plugin/core/main.py", line 63, in configuration
cfg = cls.handler.config # type: ignore
File "/home/raoul/.config/sublime-text-3/Packages/LSP-julia/plugin.py", line 118, in config
settings = load_settings(SETTINGS_FILE)
File "/home/raoul/.config/sublime-text-3/Packages/LSP-julia/utils.py", line 32, in load_settings
user_settings_json = sublime.load_resource("Packages/User/{}".format(base_name))
File "/opt/sublime_text/Lib/python33/sublime.py", line 333, in load_resource
raise IOError('resource "%s" not found' % name)
OSError: resource "Packages/User/LSP-julia.sublime-settings" not found
There are some limitations when running a selection or block of code with Alt+Enter; macros like @__FILE__
don't work and if there is an exception thrown, no information about where the error location within the file is, will be show. That's because the corresponding text is only copy/pasted into the Terminus instance. The VS Code extension has multiple ways of running a code block, described in https://www.julia-vscode.org/docs/dev/userguide/runningcode/, and some of them don't have these limitations. I should figure out how they do it and see whether it's possible to implement here too.
I got the error "permission denied" when trying to connect LSP-julia to my Julia environment. I have Julia installed in Applications folder, and symlinked to "/usr/local/bin". I've also set "julia_executable_path": "/usr/local/bin"
, as mentioned in the instruction page.
The troubleshooting message:
# Troubleshooting: julia
## Version
- LSP: 1.28.0
- Sublime Text: 4169
## Server Test Run
- exit code: -1
- output
[Errno 13] Permission denied
## Server Configuration
- command
[
"$julia_exe",
"--startup-file=no",
"--history-file=no",
"--project=$server_path",
"--eval",
"using LanguageServer; runserver()"
]
- shell command
/usr/local/bin --startup-file=no --history-file=no "--project=/Users/ishidatetsurou/Library/Caches/Sublime Text/Package Storage/LSP-julia/languageserver" --eval "using LanguageServer; runserver()"
- selector
source.julia
- priority_selector
source.julia
- init_options
{
"julialangTestItemIdentification": true
}
- settings
{
"julia": {
"completionmode": "qualify",
"lint": {
"call": true,
"constif": true,
"datadecl": true,
"disabledDirs": [
"docs",
"test"
],
"iter": true,
"lazy": true,
"missingrefs": "none",
"modname": true,
"nothingcomp": true,
"pirates": true,
"run": true,
"typeparam": true,
"useoffuncargs": true
}
}
}
- env
{}
## Active view
- File name
/Users/~/Desktop/test.jl
- Settings
{
"auto_complete_selector": "meta.tag - punctuation.definition.tag.begin, source - meta.disable-completion - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",
"lsp_active": null,
"syntax": "Packages/Julia/Julia.sublime-syntax"
}
- base scope
source.julia
## Project / Workspace
- folders
[]
- is project: False
## LSP configuration
<not found>
## System PATH
- /Users/~/.pyenv/shims
- /Library/Frameworks/Python.framework/Versions/3.9/bin
- /Library/Frameworks/Python.framework/Versions/3.8/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Library/TeX/texbin
- /usr/local/go/bin
- /opt/X11/bin
- /Library/Apple/usr/bin
- /Library/Frameworks/Mono.framework/Versions/Current/Commands
Hi, mostly out of interest I wanted to set-up a Julia LS in Sublime-Text version 4.4121-1 running on Manjaro with kernel version 5.14.18-1 and I must say I found the installation guide very lacking.
I had to do a bit of googling to figure out that i first need to run
julia> import Pkg;
julia> Pkg.add("LanguageServer")
julia> Pkg.add("SymbolServer")
as described in LSP docs.
And after installing LSP-julia I have to modify the "command" setting in LSP-julia.sublime-settings
to
"command": ["bash", "/LANGUAGE_SERVER_PATH/contrib/languageserver.sh"],
Where the path can be found by running
julia> using LanguageServer
julia> pathof(LanguageServer)
"/LANGUAGE_SERVER_PATH/src/LanguageServer.jl"
I suggest that some of these steps should be added to the "README".
I'm seeing a bunch of missing references, but I don't know how that could be fixed. This is the source code of https://github.com/julia-vscode/LanguageServer.jl running with the language server itself, so I would expect to see no errors/warnings.
My version of this package is called LSP-julia with lowercase "j", because based on the other LSP-* packages this seems to be the convention. I could make a pull request to replace all the files here, but I think it would be easier to delete this repo and transfer ownership of my repo to sublimelsp directly, and I guess existing clones get redirected then automatically.
The other two issues here are fixed in my version.
I find that whenever I open a new file/project and the language server initializes, it doesn't recognize any of the packages I have installed (this is true for project environments and the global environment). However, when I explicitly set the environment using the "Change Current Environment" command, it all works fine. Any idea what could be going on here?
I have to install the server manually apparently. Well, I suggest not doing this for now, until you can switch to the ST4 API.
Have the option of opening up the REPL in a tab view instead of just the panel.
I also noticed that when opening the panel and running the terminus command Terminus: Maximise to Tab
, upon sending a code block to it, the connection would break and nothing would happen, instead if attempted again, another REPL would spawn in the panel again.
I'm using Sublime Text 4 with the LSP and LSP-julia plugins. I have a Julia project with the following file structure:
MyProj
├── LICENSE
├── Manifest.toml
├── Project.toml
├── README.md
├── example.jl
├── src
│ ├── MyProj.jl
│ ├── adder.jl
│ └── divider.jl
└── test
└── runtests.jl
The LSP appears to activate the correct environment but the autocompletion and linter do not work.
In the isntallation / configuration instructions it is mentioned, that the full-path of the julia executable needs to be specified,
if it is not in the %PATH%.
What is the correct way to specify the full-path of the julia executable?
I'm on Windows 11 and use juliaup
to manage my julia installations. It seems that juliaup creates (the windows equivalent of) a symlink to the currently selected julia environment in {USER}\AppData\Local\Microsoft\WindowsApps\julia.exe
-- that directory is on my path but even when I explicitly set the path for LSP-Julia I get the error that the file is not found.
In Sublime's console I was able to confirm that Sublime's python env can see the executable and run it successfully.
>>> 'julia.exe' in os.listdir(os.environ['PATH'].split(';')[-1])
True
>>> os.system('julia.exe --version')
0
If I manually set LSP-Julia's path to one of the julia environments in {user}\.julia\.juliaup (i.e., resolve the symlink for it) then the LSP server works fine (but I'd like it to be able to use the link so I don't have to continually update the config as I update julia).
Hello,
I've tried this package but it doesn't seem to work. I am on Mac Os.
I noticed that the LSP log said that julia could not find the Language Server. And suggested to run Pkg.Instantiate()
to install it.
If I run the subprocess call by hand it then actually instantiates. but the subprocess call returns 0 every time. That is why i had the ready
file even if it wasn't actually ready. related
After running import Pkg; Pkg.instantiate()
manually the plugin now runs.
What about using the command Base.active_project() to take the right Pkg-Julia-Environment per default?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.