Skip to content

Commit 8bd7318

Browse files
authored
Merge pull request #13 from ViTeXFTW/development
v0.1.2
2 parents 6696c8f + 1071976 commit 8bd7318

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+664679
-2595
lines changed

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Bug
3+
about: Describes a found bug
4+
title: "[BUG]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
# Description
11+
- Describe the bug
12+
13+
# Recreation
14+
- How to recreate the bug
15+
16+
# Image
17+
- Image of the bug

.github/workflows/deploy.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy VSCode Extension
2+
3+
on:
4+
push:
5+
branches:
6+
- master # or the branch you want to trigger deployment from
7+
workflow_dispatch: # Allows manual triggering
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Step 1: Checkout the repository
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
# Step 2: Set up Node.js
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '16.x'
22+
23+
# Step 3: Install dependencies
24+
- name: Install dependencies
25+
run: npm install
26+
27+
# Step 4: Lint, build, and test (optional but recommended)
28+
- name: Run build and tests
29+
run: |
30+
npm run compile # if you have a linting step
31+
# npm run build # if you have a build step
32+
# npm test # if you have tests
33+
34+
# Step 5: Package and publish the extension
35+
- name: Publish VSCode Extension
36+
env:
37+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
38+
run: |
39+
npx vsce package # This packages the extension
40+
npx vsce publish # This publishes the extension
41+

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
TODO.txt
12
out
23
node_modules
34
client/server
4-
.vscode-test
5+
.vscode-test
6+
.vscode
7+
**/*.js.ma

.vscode-test.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// .vscode-test.js
2+
import { defineConfig } from '@vscode/test-cli';
3+
4+
export default defineConfig({ files: 'server/out/test/**/*.test.js' });

.vscode/launch.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,8 @@
1111
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
1212
"preLaunchTask": {
1313
"type": "npm",
14-
"script": "watch"
14+
"script": "compile"
1515
}
16-
},
17-
{
18-
"name": "Language Server E2E Test",
19-
"type": "extensionHost",
20-
"request": "launch",
21-
"runtimeExecutable": "${execPath}",
22-
"args": [
23-
"--extensionDevelopmentPath=${workspaceRoot}",
24-
"--extensionTestsPath=${workspaceRoot}/client/out/test/index",
25-
"${workspaceRoot}/client/testFixture"
26-
],
27-
"outFiles": ["${workspaceRoot}/client/out/test/**/*.js"]
2816
}
2917
]
3018
}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"typescript.tsc.autoDetect": "off",
44
"typescript.preferences.quoteStyle": "single",
55
"editor.codeActionsOnSave": {
6-
"source.fixAll.eslint": true
6+
"source.fixAll.eslint": "explicit"
77
}
88
}

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.gitignore
55
**/tsconfig.json
66
**/tsconfig.base.json
7+
**/*.js.map
78
contributing.md
89
.travis.yml
910
client/node_modules/**

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 ViTeXFTW
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,57 @@
1-
# LSP Example
1+
<div align="center">
2+
<h1>ZeroSyntax-Server</h1>
3+
<img src="https://github.com/ViTeXFTW/ZeroSyntax/blob/main/ZeroSyntaxLogo128.png?raw=true">
4+
</div>
5+
6+
## Introduction
7+
**ZeroHour-Server** is a language server written in TypeScript for Command and Conquor Generals Zero Hour INI. The server is intended to provide formatting, linting and code completion. Currently this is intended for Visual Studio Code only, however all functionallities will be server sided and can be utilized in other IDEs by creating an interface for communicating with the server over Json-RPC.
8+
9+
## How to install
10+
11+
1. Open Visual Studio Code
12+
2. Open the Extensions Tab
13+
3. Search for ZeroSyntax
14+
4. Click Install
15+
5. Click Reload
16+
6. Done!
17+
18+
## Functionallities
19+
ZeroSyntax language server supports the following functionallities:
20+
- Formatting
21+
- Diagnostics
22+
- Code Completion
23+
24+
### Formatting
25+
To format a ini file you can use the following command:
26+
27+
1. Access it from the Command Pallette (Ctrl+Shift+P or Cmd+Shift+P on Mac)
28+
2. Write:
29+
```plaintext
30+
> Format Document
31+
```
32+
3. Press Enter
233

3-
Heavily documented sample code for https://code.visualstudio.com/api/language-extensions/language-server-extension-guide
34+
### Diagnostics
35+
Diagnostics works out of the box. Any syntax errors will be highlighted in the editor.
436

5-
## Functionality
37+
### Code Completion
38+
The server supports context based code completion. This is done by analyzing the syntax tree and collecting possible completions based on the current context.
639

7-
This Language Server works for plain text file. It has the following language features:
8-
- Completions
9-
- Diagnostics regenerated on each file change or configuration change
40+
1. Write some code
41+
2. Press Ctrl+Space
1042

11-
It also includes an End-to-End test.
43+
![Completions](./images/gifs/ZeroSyntax-ServerCompletionGif.gif)
1244

13-
## Structure
1445

15-
```
16-
.
17-
├── client // Language Client
18-
│ ├── src
19-
│ │ ├── test // End to End tests for Language Client / Server
20-
│ │ └── extension.ts // Language Client entry point
21-
├── package.json // The extension manifest.
22-
└── server // Language Server
23-
└── src
24-
└── server.ts // Language Server entry point
25-
```
46+
## Contributing
47+
For contributing you will need to fork the repository, create your own branch make and test any changes you feel is missing from the project and create a pull request. I will then take a look at the code changes and merge the code if everything is in order.
48+
49+
## Licsens
50+
This projct is under the MIT [LICENSE](LICENSE)
51+
52+
## Sugestions
53+
As this is my first open-source project, if you have any ideas or suggestions please write to me on eithre Discord or mail. (Discord might be better)
2654

27-
## Running the Sample
28-
29-
- Run `npm install` in this folder. This installs all necessary npm modules in both the client and server folder
30-
- Open VS Code on this folder.
31-
- Press Ctrl+Shift+B to start compiling the client and server in [watch mode](https://code.visualstudio.com/docs/editor/tasks#:~:text=The%20first%20entry%20executes,the%20HelloWorld.js%20file.).
32-
- Switch to the Run and Debug View in the Sidebar (Ctrl+Shift+D).
33-
- Select `Launch Client` from the drop down (if it is not already).
34-
- Press ▷ to run the launch config (F5).
35-
- In the [Extension Development Host](https://code.visualstudio.com/api/get-started/your-first-extension#:~:text=Then%2C%20inside%20the%20editor%2C%20press%20F5.%20This%20will%20compile%20and%20run%20the%20extension%20in%20a%20new%20Extension%20Development%20Host%20window.) instance of VSCode, open a document in 'plain text' language mode.
36-
- Type `j` or `t` to see `Javascript` and `TypeScript` completion.
37-
- Enter text content such as `AAA aaa BBB`. The extension will emit diagnostics for all words in all-uppercase.
55+
## Questions
56+
Discord: ViTeXFTW#6644
57+

0 commit comments

Comments
 (0)