Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,61 @@ contexts:

Should work. If it doesn't, [file an issue], we'll help.

Here's a section you can add to your README.md file to configure Neovim:

## Using with Neovim

To use this LSP server with Neovim, you'll need to configure the LSP client.
Here's an example configuration using the built-in LSP client and nvim-lspconfig:

* First, install the LSP server globally:

```bash
npm install -g eo-lsp-server
```

* Ensure nvim-lspconfig is configured in your Neovim configuration.
Then add the EO language server configuration:

```lua
local lspconfig = require('lspconfig')
lspconfig.eo_lsp.setup({
cmd = {'eo-lsp-server', '--stdio'},
filetypes = {'eo'},
root_dir = lspconfig.util.root_pattern('.git', '.eo-root'),
settings = {}
})
```

* For syntax highlighting, you can add file type detection and basic syntax.
Create `ftdetect/eo.vim` in the Neovim configuration directory:

```vim
" ~/.config/nvim/ftdetect/eo.vim
autocmd BufRead,BufNewFile *.eo set filetype=eo
```

And create the base file `syntax/eo.vim`:

```vim
" ~/.config/nvim/syntax/eo.vim
eoComment syntax match "#.*$"
eoMeta syntax match "^\+\S.*$"
eoKeyword syntax match "[@^*?]"
eoOperator syntax match "[\[\]\\>!:\.\)\(]|\+>"
eoString syntax scope start='"' end='"'
eoNumber syntax match "\b\(\+\|-\)\?\d\+\(\.\d\+\(e\(\+\|-\)\?\d\)\?\)\?\b"
Link highlighting eoComment Comment
Link highlighting eoMeta PreProc
Link highlighting eoKeyword Keyword
Link highlighting eoOperator Operator
Link highlighting eoString String
Link highlighting eoNumber Number
```

After configuration, restart Neovim and open the `.eo` file.
The LSP server should start automatically and provide semantic tokens and error diagnostics.

## How to Contribute

First, install [Node] modules with:
Expand Down