Skip to content

Commit

Permalink
chore: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarrus1 committed Sep 8, 2023
1 parent 3c0d0c1 commit 4a3b8e5
Showing 1 changed file with 81 additions and 107 deletions.
188 changes: 81 additions & 107 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,125 +35,98 @@
<!-- <img src="https://raw.githubusercontent.com/Sarrus1/sourcepawn-lsp/main/img/logo.png" alt="Logo"> -->
</div>

## Features
# Features

| **Feature** | **Status** |
| :-------------------: | :--------: |
| Completion ||
| Go To Definition ||
| Find References ||
| Hover ||
| Rename ||
| Semantic Highlighting ||
| Document Symbols ||
| Call Hierarchy ||
| Signature Help ||
| Reference ||
| Diagnostics ||

**Details on how to use the extension available in the [Wiki](https://github.com/Sarrus1/sourcepawn-vscode/wiki)**.
**If you encounter an issue, press CTRL+SHIFT+P and type "SM: Doctor" to diagnose the problem.**

- [Features](#features)
- [Screenshots](#screenshots)
- [.sp and .inc file highlighting](#sp-and-inc-file-highlighting)
- [.cfg file highlighting](#cfg-file-highlighting)
- [Code auto-completion](#code-auto-completion)
- [Event auto-completion](#event-auto-completion)
- [Include auto-completion](#include-auto-completion)
- [Callback auto-completion](#callback-auto-completion)
- [Code outline](#code-outline)
- [Call Hierarchy](#call-hierarchy)
- [Symbol references](#symbol-references)
- [Symbol renaming](#symbol-renaming)
- [Functions signature help](#functions-signature-help)
- [Hover help](#hover-help)
- [Go To Definition](#go-to-definition)
- [Linter](#linter)
- [Credits](#credits)
- [Frequently Asked Questions](#frequently-asked-questions)
- [How can I donate ?](#how-can-i-donate-)
- [How to install the beta build ?](#how-to-install-the-beta-build-)
- [How to contribute ?](#how-to-contribute-)
- [How to run the extension from its source code ?](#how-to-run-the-extension-from-its-source-code-)

## Screenshots

### .sp and .inc file highlighting

![.sp highlighting example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/highlighting-example-1.png)

### .cfg file highlighting

![Highlighting example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/highlighting-example-2.png)

### Code auto-completion

![Completion example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/completion-example-1.png)

### Event auto-completion

![Completion example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/completion-example-2.png)

### Include auto-completion

![Completion example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/completion-example-3.png)

### Callback auto-completion

![Completion example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/completion-example-4.gif)

### Code outline

![Outline example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/outline-example-1.png)

### Call Hierarchy

![Hierarchy example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/hierarchy-example-1.gif)

### Symbol references

![References example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/references-example-1.png)

### Symbol renaming

![Renaming example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/rename-example-1.png)

### Functions signature help

![Signature example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/signature-example-1.png)

### Hover help
<div align="center">
<table class="tg">
<thead>
<tr>
<th><span style="font-weight:bold"><b>Feature</b></span></th>
<th><span style="font-weight:bold"><b>Status</b></span></th>
</tr>
</thead>
<tbody>
<tr>
<td>Completion</td>
<td>✅</td>
</tr>
<tr>
<td>Go To Definition</td>
<td>✅</td>
</tr>
<tr>
<td>Find References</td>
<td>✅</td>
</tr>
<tr>
<td>Hover</td>
<td>✅</td>
</tr>
<tr>
<td>Rename</td>
<td>✅</td>
</tr>
<tr>
<td>Semantic Highlighting</td>
<td>✅</td>
</tr>
<tr>
<td>Document Symbols</td>
<td>✅</td>
</tr>
<tr>
<td>Call Hierarchy</td>
<td>✅</td>
</tr>
<tr>
<td>Signature Help</td>
<td>✅</td>
</tr>
<tr>
<td>Reference</td>
<td>✅</td>
</tr>
<tr>
<td>Diagnostics</td>
<td>✅</td>
</tr>
</tbody>
</table>
</div>

![Hover example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/hover-example-1.png)
# Text editor support

### Go To Definition
The Language Server is compatible with any text editor that implements the Language Server Protocol.

![Go to definition example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/go-to-definition-example-1.png)
## VSCode support

### Linter
For ease of use with [Visual Studio Code](https://code.visualstudio.com/), an extension bundles `sourcepawn-lsp` with a build for each major platform and OS. You can download it from the marketplace [here](https://marketplace.visualstudio.com/items?itemName=Sarrus.sourcepawn-vscode).

![Linter example](https://raw.githubusercontent.com/Sarrus1/sourcepawn-vscode/main/images/linter-example-1.png)
# AMXXPawn support

## Credits
Partial support for `AMXXPawn` is implemented through the `--amxxpawn-mode` flag. The only difference between, the "SourcePawn mode" and the "AMXXPawn mode" boils down to what file extension the server will be looking for (`.sp` vs `.sma`).

- [Dreae's](https://github.com/Dreae/sourcepawn-vscode) extension which is not supported anymore, and on which this extension is based on.
- [Deathreus'](https://github.com/Deathreus/SPLinter) extension which helped me to implement the linting feature.
- Everybody that has helped me improved the extension on the [discord server](https://discord.com/invite/u2Z7dfk).
A VSCode extension exists which bundles the server with the correct launch flags. You can find it [here](https://marketplace.visualstudio.com/items?itemName=Sarrus.amxxpawn-vscode).

## Frequently Asked Questions
# Frequently Asked Questions

- [How can I donate ?](#how-can-i-donate-)
- [How to install the beta build ?](#how-to-install-the-beta-build-)
- [How to contribute ?](#how-to-contribute-)
- [How to run the extension from its source code ?](#how-to-run-the-extension-from-its-source-code-)

### How can I donate ?
## How can I donate ?

Thanks for considering this. But please remember that all of this wouldn't be possible without the Alliedmodders community. If you wish to make a donation for this community, you can make it [here](https://sourcemod.net/donate.php).
If you prefer to make a donation to me for this project, you can [buy me a coffee](https://www.buymeacoffee.com/sarrus)

### How to install the beta build ?
## How to install the beta build ?

### Standalone Language Server

1. Download and install the language server from the [releases page](https://github.com/Sarrus1/sourcepawn-vscode/releases).

### VSCode extension

1. Open VSCode and go to the marketplace.
2. In the search bar, type `SourcePawn` and select the extension.
Expand All @@ -163,25 +136,26 @@ If you prefer to make a donation to me for this project, you can [buy me a coffe

This will install the latest development build of the extension.

Note that a new build might take a few minutes (up to 15) to propagate to the Marketplace after the commit has been pushed to the dev branch.
Note that a new build might take a few minutes (up to 15) to propagate to the Marketplace after the release has been pushed to the releases page.

You can also install the latest pre-release by downloading the .vsix from the [releases page](https://github.com/Sarrus1/sourcepawn-vscode/releases) and [installing it manually](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix).

### How to contribute ?
## How to contribute ?

Pull requests and suggestions are welcome.

- To make a suggestion or to report an issue, please create a new issue [here](https://github.com/Sarrus1/sourcepawn-vscode/issues).
- To make a contribution, fork the repository, make the desired changes, and open a pull request.

### How to run the extension from its source code ?
## How to run the Language Server from its source code ?

To run the extension from the source, do the following:
To run the Language Server from the source, do the following:

- Install the rust toolchain using [rustup](https://rustup.rs/).
- Install [node.js](https://nodejs.org) on your machine. Make sure [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm/) is installed as well.
- Fork this repository and clone it on your machine (do this with VSCode for easier manipulation).
- Run `npm install` from the root of the project folder.
- Run `npm run watch`.
- Press `f5` to run the extension in dev mode.
- From the root of the repository, run the following commands to install npm dependencies: `cd editors/code && npm i`.
- Press `f5` and select the `Run Extension (Debug Build)` launch task in the prompt. This will compile the Language Server server from the source code and package the VSCode extension's source code.
- (Optional) You can attach a debugger to the Language Server by doing the step above, then running another task called `Attach To Server` or `Win Attach To Server` on Windows and typing `sourcepawn-lsp` in the prompt.

</div>

0 comments on commit 4a3b8e5

Please sign in to comment.