Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
bcb0dfa
Changed client to start server on ini format.
ViTeXFTW Feb 26, 2024
0f745fd
Created SyntaxBuilder and GZHSyntax grammar file.
s215521 Feb 27, 2024
30232b2
Added: Formatter for INI File format
ViTeXFTW Mar 2, 2024
4871a86
Added: Added more blocks to formatter
ViTeXFTW Mar 2, 2024
d08557c
Merge branch 'Development' of https://github.com/ViTeXFTW/ZeroSyntax-…
ViTeXFTW Mar 2, 2024
5f7ceba
Added: Ability to change indentation level in vscode settings.
ViTeXFTW Mar 2, 2024
d37e30c
Fixed: Settings for formatting now works correctly
ViTeXFTW Mar 3, 2024
76b6fb6
Fixed: Upaded readme Added: liscense file
s215521 Mar 4, 2024
30a7da4
Merge pull request #1 from ViTeXFTW/readme_update
ViTeXFTW Mar 4, 2024
de0b024
Added: Settings box for initally starting language server
s215521 Mar 5, 2024
8b90342
Updated package names and versions in package-lock.json files
ViTeXFTW Apr 7, 2024
d0e7c00
Initial coomit. Working tree walker, and formatter.
ViTeXFTW Jul 23, 2024
cc782c3
refactor: Moved formatter to server
ViTeXFTW Jul 27, 2024
80353f9
feat: SymbolTable creator
ViTeXFTW Jul 29, 2024
fd01cd8
refactor: getSamenticTokens, defined return type.
ViTeXFTW Jul 29, 2024
feead6a
refactor: removed unused imports.
ViTeXFTW Jul 31, 2024
a736da9
test: Added code for creating tests.
ViTeXFTW Aug 2, 2024
fbdb41e
feat: test suites for diagnotics implemented.
ViTeXFTW Sep 8, 2024
e1ce23e
fix: Issue where compiled program was placed incorrectly
ViTeXFTW Sep 8, 2024
0f3bb4b
save
ViTeXFTW Sep 24, 2024
7f2f227
feat: refactored grammar file
ViTeXFTW Sep 26, 2024
348db74
Merge pull request #8 from ViTeXFTW/dev/v0.1-alpha/ViTeXFTW
ViTeXFTW Sep 26, 2024
303ea2e
Update README.md
ViTeXFTW Sep 26, 2024
f69b8e2
refactor: Migrated from antlr4ts to antlr4ng
ViTeXFTW Sep 26, 2024
f3d280b
Merge pull request #9 from ViTeXFTW/dev/completions/ViTeXFTW
ViTeXFTW Sep 26, 2024
6852923
Semi working completions
ViTeXFTW Oct 1, 2024
a132922
temp: Optimized completions
ViTeXFTW Oct 2, 2024
c48373f
temp
ViTeXFTW Oct 7, 2024
f8ea846
feat: v0.1.0-alpha
ViTeXFTW Oct 20, 2024
7c06e2d
doc: update
ViTeXFTW Oct 20, 2024
48ba495
Merge pull request #10 from ViTeXFTW/dev/completions/ViTeXFTW
ViTeXFTW Oct 20, 2024
5dde8cc
Update README.md
ViTeXFTW Oct 20, 2024
5351391
Update README.md
ViTeXFTW Oct 20, 2024
10c4d6d
Update issue templates
ViTeXFTW Oct 20, 2024
38e031d
refactor: removed redundant files
ViTeXFTW Oct 20, 2024
c3d28f1
Fixed: Version number for vscode marketplace
ViTeXFTW Oct 20, 2024
1150b56
Fixed: Extension could't find antlr4ng and antlr-c3 modules
ViTeXFTW Oct 20, 2024
afd03dd
Update README.md
ViTeXFTW Oct 20, 2024
506726f
Removed S_ prefix from snippets
ViTeXFTW Oct 20, 2024
d973ba9
Merge branch 'Development' of https://github.com/ViTeXFTW/ZeroSyntax-…
ViTeXFTW Oct 20, 2024
6b2c62a
Create deploy.yml
ViTeXFTW Oct 20, 2024
1071976
Merge pull request #12 from ViTeXFTW/git/actions/ViTeXFTW-1
ViTeXFTW Oct 20, 2024
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
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Bug
about: Describes a found bug
title: "[BUG]"
labels: bug
assignees: ''

---

# Description
- Describe the bug

# Recreation
- How to recreate the bug

# Image
- Image of the bug
41 changes: 41 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy VSCode Extension

on:
push:
branches:
- master # or the branch you want to trigger deployment from
workflow_dispatch: # Allows manual triggering

jobs:
release:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'

# Step 3: Install dependencies
- name: Install dependencies
run: npm install

# Step 4: Lint, build, and test (optional but recommended)
- name: Run build and tests
run: |
npm run compile # if you have a linting step
# npm run build # if you have a build step
# npm test # if you have tests

# Step 5: Package and publish the extension
- name: Publish VSCode Extension
env:
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
run: |
npx vsce package # This packages the extension
npx vsce publish # This publishes the extension

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
TODO.txt
out
node_modules
client/server
.vscode-test
.vscode-test
.vscode
**/*.js.ma
4 changes: 4 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// .vscode-test.js
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({ files: 'server/out/test/**/*.test.js' });
14 changes: 1 addition & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,8 @@
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
"preLaunchTask": {
"type": "npm",
"script": "watch"
"script": "compile"
}
},
{
"name": "Language Server E2E Test",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/client/out/test/index",
"${workspaceRoot}/client/testFixture"
],
"outFiles": ["${workspaceRoot}/client/out/test/**/*.js"]
}
]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"typescript.tsc.autoDetect": "off",
"typescript.preferences.quoteStyle": "single",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.gitignore
**/tsconfig.json
**/tsconfig.base.json
**/*.js.map
contributing.md
.travis.yml
client/node_modules/**
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 ViTeXFTW

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
80 changes: 50 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,57 @@
# LSP Example
<div align="center">
<h1>ZeroSyntax-Server</h1>
<img src="https://github.com/ViTeXFTW/ZeroSyntax/blob/main/ZeroSyntaxLogo128.png?raw=true">
</div>

## Introduction
**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.

## How to install

1. Open Visual Studio Code
2. Open the Extensions Tab
3. Search for ZeroSyntax
4. Click Install
5. Click Reload
6. Done!

## Functionallities
ZeroSyntax language server supports the following functionallities:
- Formatting
- Diagnostics
- Code Completion

### Formatting
To format a ini file you can use the following command:

1. Access it from the Command Pallette (Ctrl+Shift+P or Cmd+Shift+P on Mac)
2. Write:
```plaintext
> Format Document
```
3. Press Enter

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

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

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

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

## Structure

```
.
├── client // Language Client
│ ├── src
│ │ ├── test // End to End tests for Language Client / Server
│ │ └── extension.ts // Language Client entry point
├── package.json // The extension manifest.
└── server // Language Server
└── src
└── server.ts // Language Server entry point
```
## Contributing
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.

## Licsens
This projct is under the MIT [LICENSE](LICENSE)

## Sugestions
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)

## Running the Sample

- Run `npm install` in this folder. This installs all necessary npm modules in both the client and server folder
- Open VS Code on this folder.
- 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.).
- Switch to the Run and Debug View in the Sidebar (Ctrl+Shift+D).
- Select `Launch Client` from the drop down (if it is not already).
- Press ▷ to run the launch config (F5).
- 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.
- Type `j` or `t` to see `Javascript` and `TypeScript` completion.
- Enter text content such as `AAA aaa BBB`. The extension will emit diagnostics for all words in all-uppercase.
## Questions
Discord: ViTeXFTW#6644
Mail: vitexftw@gmail.com
Loading