Skip to content

Commit

Permalink
docs: Add language server and neovim setup instructions (#56)
Browse files Browse the repository at this point in the history
* docs(language-server): add contextive language server installation guide

* docs(neovim): add neovim language server client configuration guide
  • Loading branch information
erikjuhani authored Oct 25, 2023
1 parent a098580 commit 62fa42f
Showing 1 changed file with 56 additions and 2 deletions.
58 changes: 56 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,68 @@ The following list of features is a draft proposal of the vision at the start of

## Installation

### Visual Studio Code
### All in one IDE Plugins

Contextive language server does not need to be installed separately.

#### Visual Studio Code

Open Visual Studio Code, launch the quick open (`Ctrl+P`) and then enter `ext install devcycles.contextive`. OR, search `contextive` in the extensions side-bar.

Visit the [Contextive Marketplace](https://marketplace.visualstudio.com/items?itemName=devcycles.contextive) page for details.

Check the extension [README](src/vscode/contextive/README.md) for usage instructions.

### Language Server Configurations

#### Installing Contextive Language Server

To install the language server, you need to do it manually from GitHub releases assets. This is necessary for users who are not using the Contextive VSCode extension and Visual Studio Code.

##### 1. Download the appropriate zip file for your operating system and architecture:

```shell
curl -L https://github.com/dev-cycles/contextive/releases/download/<version>/Contextive.LanguageServer-<os>-<arch>-<version>.zip -o Contextive.LanguageServer-<os>-<arch>-<version>.zip
```

##### 2. Unzip the Contextive.LanguageServer and copy the file into a folder that is included in your system's PATH:

The $HOME/bin directory has been created beforehand and is included in the system's PATH.

```shell
unzip Contextive.LanguageServer-<os>-<arch>-<version>.zip -d contextive-language-server
cp contextive-language-server/Contextive.LanguageServer $HOME/bin
```

##### 3. Verify that Contextive.LanguageServer is found in the PATH. A non-zero exit code indicates that the language server was not found in the PATH:

```shell
command -v Contextive.LanguageServer
```

The command should return the absolute path to the binary if it's found in the system PATH.

#### Neovim

How to configure Neovim with lua modules: https://neovim.io/doc/user/lua-guide.html#lua-guide-config

Use lspconfig to create a custom contextive language server configuration and initialize the language server by calling the setup function. The following lua snippet needs to be included in the `init.lua` file either directly or from another lua module like `lspconfigs.lua`.

```lua
local lspconfig = require("lspconfig")

local lspconfig_configs = require("lspconfig.configs")

lspconfig_configs.contextive = {
default_config = {
cmd = { "Contextive.LanguageServer" },
root_dir = lspconfig.util.root_pattern('.contextive', '.git'),
},
}

lspconfig.contextive.setup {}
```

### Others

Coming soon!
Expand All @@ -94,4 +148,4 @@ The Contextive logo is based (with extreme gratitude!) on the `Bibliophile` imag

## License

This project is licensed under the [MIT](https://choosealicense.com/licenses/mit/) license. See [LICENSE](LICENSE).
This project is licensed under the [MIT](https://choosealicense.com/licenses/mit/) license. See [LICENSE](LICENSE).

0 comments on commit 62fa42f

Please sign in to comment.