Code Monkey home page Code Monkey logo

lsp-julia's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ghyatzo wangwei90

lsp-julia's Issues

client_with_capability doesn't exist in ST4 version

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())

The file Packages/User/LSP-julia.sublime-settings may not exist

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

Run code in REPL limitations

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.

Unable to connect LSP-julia "permission denied"

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

Setting up LSP-Julia on Linux

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".

Rename to LSP-julia?

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.

Environment not correctly read on initialization

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?

Opening terminus window in tab view instead of panel.

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.

Autocomplete and linting do not work with activated project environment

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.

example
toolbar

Unable to start julia LSP server with juliaup

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).

Julia exited with status code 1

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.