Metadata-Version: 2.1
Name: kedro-lsp
Version: 0.4.0.dev0
Summary: Kedro Language Server
Project-URL: Homepage, https://pypi.org/project/kedro-lsp/
Project-URL: Source, https://github.com/Kedro-Zero-to-Hero/kedro-lsp
Project-URL: Bug Tracker, https://github.com/Kedro-Zero-to-Hero/kedro-lsp/issues
Author-email: Lim Hoang <limdauto@gmail.com>, Waylon Walker <waylon@waylonwalker.com>
License: MIT License
        
        Copyright (c) 2021 Kedro: Zero to Hero
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Kedro
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.6
Requires-Dist: kedro
Requires-Dist: pygls
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: flake8; extra == 'dev'
Requires-Dist: isort; extra == 'dev'
Requires-Dist: seed-isort-config; extra == 'dev'
Description-Content-Type: text/markdown

# kedro-lsp

A [Language Server](https://microsoft.github.io/language-server-protocol/) for the latest version(s) of [Kedro](https://kedro.readthedocs.io/en/latest/). It provides features to enable IDE support for Kedro. For example, you can jump to dataset and parameter definition when constructing the pipeline.

![](./assets/demo.gif)

**Note**: This is pre-alpha software.

## Features

* [x] Provide dataset and parameter definition when constructing the pipeline.

> **Note**: I need your help! If you think this project is a good idea, please submit features request via Github Issue.

## Compatibility

Kedro Language Server aims to be compatible with Kedro 0.17.x and above. Currently it is restricted to 0.17.3 and above during pre-alpha phase.

## Installation

```shell
pip install kedro-lsp
```

## Usage

### Standlone

```
usage: kedro-lsp [-h] [--version] [--tcp] [--host HOST] [--port PORT] [--log-file LOG_FILE] [-v]

Kedro Language Server: an LSP wrapper for Kedro.

optional arguments:
  -h, --help           show this help message and exit
  --version            display version information and exit
  --tcp                use TCP server instead of stdio
  --host HOST          host for TCP server (default 127.0.0.1)
  --port PORT          port for TCP server (default 2087)
  --log-file LOG_FILE  redirect logs to the given file instead of writing to stderr
  -v, --verbose        increase verbosity of log output

Examples:
    Run from stdio: kedro-lsp
```

### Visual Studio Code

To use it with visual studio code, install the Kedro extension from Visual Studio Code Marketplace.

### Pycharm

TBD

### nvim

To use it with nvim, install [lspconfig](https://github.com/neovim/nvim-lspconfig).
```
:Plug 'neovim/nvim-lspconfig'
```

Then add the following config to your vimrc.

``` vim
lua <<EOF
local configs = require 'lspconfig/configs'

configs.kedro = {
    default_config = {
        cmd = {"kedro-lsp"};
        filetypes = {"python"};
        root_dir = function(fname)
            return vim.fn.getcwd()
        end;
    };
};
EOF
```

> 🗒️ Note, you must have the `kedro-lsp` installed and on your `PATH`

There are a number of plugins that will help setup lsp functionality in nvim, but if you want a bare minimum go-to-definition add this to your `.vimrc` as well.

``` vim
nnoremap <leader>n <cmd>lua vim.lsp.buf.definition()<CR>
```

If you are having any issues with `kedro-lsp` not working in nvim try running `:LspInfo` or looking into your `~/.cache/nvim/lsp.log` file.

## Todos

* [ ] Provide diagnostic when there is a typo in dataset or parameter name in the pipeline.
* [ ] Be Kedro environment-aware

## License

MIT
