# `mark-impact`

> Mark impacted code

## Preparation

Creates a `.env` file and puts following environment variables to specify LSP server binaries used by sdet-cli:

```
TYPESCRIPT_LSP_SERVER_BIN=?
JAVA_LSP_SERVER_BIN=?
KOTLIN_LSP_SERVER_BIN=?
CLANG_LSP_SERVER_BIN=?
CSHARP_LSP_SERVER_BIN=?
SWIFT_LSP_SERVER_BIN=?
```

e.g. 

```
TYPESCRIPT_LSP_SERVER_BIN=/usr/local/bin/typescript-language-server
JAVA_LSP_SERVER_BIN=~/lsp/languages/java/plugins/org.eclipse.equinox.launcher_1.6.300.v20210813-1054.jar
KOTLIN_LSP_SERVER_BIN=~/lsp/languages/kotlin/server/bin/kotlin-language-server
CLANG_LSP_SERVER_BIN=~/lsp/languages/clang/clangd_13.0.0/bin/clangd
SWIFT_LSP_SERVER_BIN=/usr/bin/xcrun
CSHARP_LSP_SERVER_BIN=~/lsp/languages/csharp/run
```

## LSP Server Implementations

* [TypeScript](https://github.com/typescript-language-server/typescript-language-server)
    * Install: npm i -g typescript-language-server
* [Java](https://github.com/eclipse/eclipse.jdt.ls)
    * [Download](https://download.eclipse.org/jdtls/milestones)
* [Kotlin](https://github.com/fwcd/kotlin-language-server)
    * [Download](https://github.com/fwcd/kotlin-language-server/releases)
    * Requirements:
      * [mvn](https://maven.apache.org/download.cgi)
      * [gradle](https://gradle.org/releases/)
* [C/C++](https://github.com/llvm/llvm-project/tree/main/clang-tools-extra/clangd)
    * [Download](https://github.com/clangd/clangd/releases/tag/13.0.0)
    * [Document](https://clangd.llvm.org/installation)
* [C#](https://github.com/OmniSharp/csharp-language-server-protocol)
    * [Download](https://github.com/OmniSharp/omnisharp-roslyn/releases)
    * Requirements:
      * [mono](https://www.mono-project.com/download/stable/)
* [Swift](https://github.com/apple/sourcekit-lsp)
    * Require Xcode 11.4+

## Download LSP Server Binaries

There are two ways to download LSP server binaries:

### Download LSP server Binaries Automatically

```shell script
$ scripts/download-lsp-bin.sh [bin_dir]
```

### Download LSP server Binaries Manually

[LSP Server Binaries](https://github.com/nullcc/sdet-cli/tree/main/packages/mark-impact/bin/lsp/storage)

## Read More

* [Language Server Implementations](https://microsoft.github.io/language-server-protocol/implementors/servers/)
* [Language Servers](https://github-wiki-see.page/m/neoclide/coc.nvim/wiki/Language-servers)
