https://github.com/yaegassy/sqlfluff-language-server
[Expelmental] A sql language server exclusively for sqlfluff and coc.nvim extension
https://github.com/yaegassy/sqlfluff-language-server
language-server pygls sql
Last synced: about 2 months ago
JSON representation
[Expelmental] A sql language server exclusively for sqlfluff and coc.nvim extension
- Host: GitHub
- URL: https://github.com/yaegassy/sqlfluff-language-server
- Owner: yaegassy
- License: mit
- Created: 2021-05-13T07:03:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-14T23:08:20.000Z (almost 5 years ago)
- Last Synced: 2025-10-19T20:42:13.901Z (6 months ago)
- Topics: language-server, pygls, sql
- Language: Python
- Homepage:
- Size: 59.6 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Expelmental] sqlfluff-language-server
[Expelmental] A sql language server exclusively for [sqlfluff](https://pypi.org/project/sqlfluff/).

## Overview
- "Server" by `sqlfluff-language-server` command ([pygls](https://github.com/openlawlibrary/pygls) based language server)
- "Client" by `coc-sqlfluff-ls` (For operation test)
## Features
- Lint
- Format
- Code Action
## Note
sqlfluff-language-server is a language server that uses the sqlfluff [API](https://docs.sqlfluff.com/en/stable/api.html).
## Server (sqlfluff-language-server)
**setup**:
```sh
poetry install
poetry shell
sqlfluff-language-server --help
```
**help**:
```sh
usage: sqlfluff-language-server [-h] [--version] [--tcp] [--host HOST]
[--port PORT] [--log-file LOG_FILE] [-v]
sqlfluff-language-server
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 Bind to this address
--port PORT Bind to this port
--log-file LOG_FILE redirect logs to the given file instead of writing to
stderr
-v, --verbose increase verbosity of log output
```
> default: `stdio`
## Client
### coc-sqlfluff-ls
```sh
yarn install
# or yarn build
```
Now `set runtimepath^=/path/to/sqlfluff-language-server` in "vimrc/init.vim"
### vim-lsp
```vim
if executable('sqlfluff-language-server')
augroup LspVim
au!
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'sqlfluff-language-server',
\ 'cmd': {server_info->['sqlfluff-language-server']},
\ 'allowlist': ['sql'],
\ })
augroup END
endif
```
## Related coc.nvim extension
- [yaegassy/coc-sqlfluff](https://github.com/yaegassy/coc-sqlfluff)
- Using the sqlfluff [CLI](https://docs.sqlfluff.com/en/stable/cli.html)
## Thanks
- [sqlfluff/sqlfluff](https://github.com/sqlfluff/sqlfluff)
- [openlawlibrary/pygls](https://github.com/openlawlibrary/pygls)
## License
MIT