Coder Social home page Coder Social logo

italianswirls's Introduction

Italian Swirls 🍝

Minimal Python language server, based on Jedi and pygls.

Still in development but works on my machine. ✨

Supported features:

LSP method Description
textDocument/completion Complete
textDocument/definition Go to definition
textDocument/typeDefinition Go to type definition
textDocument/hover Show documentation
textDocument/references Show references
textDocument/rename Renaming symbols and files

Install

You can either clone and build the server package from this repository, or install it from PyPI:

pip install italianswirls

The only dependencies are pygls and Jedi.

Because Jedi is able to detect which environment it is installed in and which environment is the project you're working on in, you do not need to install in every virtualenv where it might be handy; a global user (or root) installation should be sufficient to work regardless of your current virtualenv.

Refer to your client documentation on how to setup a server. Yes I have no idea how to do it for your editor, except if it's Neovim and you use nvim-lspconfig, then you can add something like that to your init:

require('lspconfig.configs').italianswirls = {
  default_config = {
    cmd = { 'italianswirls' },
    filetypes = { 'python' },
    root_dir = require('lspconfig.util').root_pattern(
      unpack({ 'pyproject.toml', 'setup.cfg' })
    ),
    single_file_support = true,
  },
  docs = {
    description = "β€œIs this a Star Wars reference?” Language Server",
    default_config = {
      root_dir = "vim's starting directory",
    },
  },
}

-- using a previously defined on_attach function…
lspconfig.italianswirls.setup { on_attach = on_attach }

About

Why?

General-purpose servers (e.g. pyls, py-lsp) try to do too much and break stuff too often for me. Locking Neovim when I press tab, crashes of all kind, LspRestart failing. Also I like my linting and formatting done by dedicated tools such as nvim-lint and formatter.

Other Jedi-based servers (e.g. jedi-language-server) seem to focus on coc-nvim and frequently fail on Neovim's native LSP client for me. I tried to fix jedi-language-server several times when it failed me but I thought it could be fun to try pygls to redo it as small and simple as I can. And running a Node server to get Python completions? No way. That said, jedi-language-server is a good project and if you're fine with coc-nvim you should definitely check it out. Lots of the code here is stolen inspired from this project.

Why the name?

Take the string β€œIs this a Star Wars reference?” Language Server, compress it to ITASWRLS and expand it back to Italian Swirls. Italian dishes are made of few elements that work well together. Enough questions!

License

GPLv3.

italianswirls's People

Contributors

dece avatar

Watchers

 avatar

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.