Skip to content

Commit 6e65b16

Browse files
committed
Add a language server and features supplied by it
* Add a language server with the syntax-checking, quick fixes, built-in type completion, hover hints, symbol outline, local identifier definition, references and renaming. * Show a "what is new" notification after an upgrade. * Recognize strings delimited by backticks in syntax highlighting. * Add a problem matcher for `oslint`.
1 parent 580dce9 commit 6e65b16

File tree

130 files changed

+21933
-83
lines changed

Some content is hidden

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

130 files changed

+21933
-83
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ indent_size = 2
77
end_of_line = lf
88
trim_trailing_whitespace = true
99
insert_final_newline = true
10+
11+
[*.os]
12+
indent_style = tab
13+
indent_size = 4

.eslintrc.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
root: true
2+
parser: '@typescript-eslint/parser'
3+
parserOptions:
4+
ecmaVersion: 6
5+
sourceType: module
6+
env:
7+
node: true
8+
plugins:
9+
- '@typescript-eslint'
10+
extends:
11+
- 'eslint:recommended'
12+
- 'plugin:@typescript-eslint/recommended'
13+
rules:
14+
'@typescript-eslint/explicit-module-boundary-types': 0
15+
'@typescript-eslint/no-empty-function': 0
16+
'@typescript-eslint/no-explicit-any': 0
17+
'@typescript-eslint/no-non-null-assertion': 0
18+
'@typescript-eslint/no-unused-vars': 0
19+
'@typescript-eslint/naming-convention': off
20+
'@typescript-eslint/semi': off
21+
curly: off
22+
eqeqeq: warn
23+
indent: [warn, 2, { SwitchCase: 1 }]
24+
no-extra-semi: warn
25+
no-throw-literal: warn
26+
semi: [2, never]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Problem encountered
3+
about: Report information that could help fixing a bug in the OScript support
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
**What is the version of `vscode-oscript` that you use?**
10+
11+
You can find the extension information in the Extensions side bar (`Cmd+Shift+X`) by searching for "@installed oscript".
12+
13+
**What does not work or work unexpectedly?**
14+
15+
Explain what does not work as you would expect. You can attach screenshots too.
16+
17+
**How do you expect it to work?**
18+
19+
Describe what would be your expectation.
20+
21+
**Were there any errors reported?**
22+
23+
You can find the errors on the console, which you can open by clicking on "Help -> Toggle Developer Tools" (`Cmd+Alt+I`). If you see something suspicious there, mentioning it on the issue will help. You can also attach the whole console log.
24+
25+
**If there debug diagnostics available?**
26+
27+
Diagnostic messages can be enabled by:
28+
29+
```json
30+
"oscript.logging.level": "debug"
31+
````
32+
33+
Then you open the development tools from the menu "Help" -\> "Toggle Developer Tools", perform tyhe operation that you want to investigate ans and save the content of the console. The interesting messages will start with "[oscript]".
34+
35+
**What is the input OScript source that you used?**
36+
37+
A minimum source code reproducing the problem will be a great help. You can attach it as a file if it is too big.

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.*'
7+
8+
jobs:
9+
create_release:
10+
name: Create Release
11+
runs-on: ubuntu-latest
12+
outputs:
13+
upload_url: ${{ steps.create_release.outputs.upload_url }}
14+
version: ${{ steps.get_version.outputs.version }}
15+
steps:
16+
- name: Version
17+
id: get_version
18+
run: echo "::set-output name=version::$(echo "${{ github.ref }}" | sed 's/[^.0-9]\+//')"
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
- name: Describe
22+
run: |
23+
CHANGELOG=$(awk -v ver=${{ steps.get_version.outputs.version }} '/## / { if (p) { exit }; if ($2 == ver) { p=1; next } } p' CHANGELOG.md)
24+
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
25+
echo "$CHANGELOG" >> $GITHUB_ENV
26+
echo "EOF" >> $GITHUB_ENV
27+
- name: Release
28+
id: create_release
29+
uses: actions/create-release@v1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
tag_name: ${{ github.ref }}
34+
release_name: Release ${{ github.ref }}
35+
draft: false
36+
prerelease: false
37+
body: ${{ env.CHANGELOG }}
38+
39+
publish_assets:
40+
name: Upload Package
41+
runs-on: ubuntu-latest
42+
needs: create_release
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v2
46+
- name: Install and Build
47+
run: npm ci
48+
- name: Package
49+
run: |
50+
npx vsce package
51+
echo "$(npx hasha-cli -a sha256 < vscode-oscript-${{ needs.create_release.outputs.version }}.vsix) vscode-oscript-${{ needs.create_release.outputs.version }}.vsix" > vscode-oscript-${{ needs.create_release.outputs.version }}.vsix.sha256
52+
- name: Upload Archive
53+
uses: actions/upload-release-asset@v1
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
upload_url: ${{ needs.create_release.outputs.upload_url }}
58+
asset_name: vscode-oscript-${{ needs.create_release.outputs.version }}.vsix
59+
asset_path: vscode-oscript-${{ needs.create_release.outputs.version }}.vsix
60+
asset_content_type: application/octet-stream
61+
- name: Upload Checksum
62+
uses: actions/upload-release-asset@v1
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
with:
66+
upload_url: ${{ needs.create_release.outputs.upload_url }}
67+
asset_name: vscode-oscript-${{ needs.create_release.outputs.version }}.vsix.sha256
68+
asset_path: vscode-oscript-${{ needs.create_release.outputs.version }}.vsix.sha256
69+
asset_content_type: text/plain

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize
12+
13+
jobs:
14+
build:
15+
name: Build and Test
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
- name: Install and Build
21+
run: npm ci
22+
- name: Test
23+
run: |
24+
npm test
25+
npx vsce package

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
.DS_Store
2+
.rollup.cache
3+
dist
24
node_modules
3-
syntaxes/*.json
5+
npm-debug.log
6+
tsconfig.tsbuildinfo
47
*.vsix

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
5+
// List of extensions which should be recommended for users of this workspace.
6+
"recommendations": [
7+
"dbaeumer.vscode-eslint"
8+
]
9+
}

.vscode/launch.json

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,41 @@
66
"version": "0.2.0",
77
"configurations": [
88
{
9-
"name": "Extension",
9+
"name": "Launch Client",
1010
"type": "extensionHost",
1111
"request": "launch",
1212
"runtimeExecutable": "${execPath}",
13-
"args": [
14-
"--extensionDevelopmentPath=${workspaceFolder}"
15-
]
16-
}
17-
]
13+
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
14+
"sourceMaps": true,
15+
"outFiles": ["${workspaceRoot}/dist/extension.js"]
16+
},
17+
{
18+
"name": "Attach to Server",
19+
"type": "node",
20+
"request": "attach",
21+
"port": 6009,
22+
"restart": true,
23+
"sourceMaps": true,
24+
"outFiles": ["${workspaceRoot}/dist/server.js"]
25+
},
26+
{
27+
"name": "Test Server",
28+
"type": "extensionHost",
29+
"request": "launch",
30+
"runtimeExecutable": "${execPath}",
31+
"args": [
32+
"--extensionDevelopmentPath=${workspaceRoot}",
33+
"--extensionTestsPath=${workspaceRoot}/out/client/test/index",
34+
"${workspaceRoot}/pkg/client/testFixture"
35+
],
36+
"sourceMaps": true,
37+
"outFiles": ["${workspaceRoot}/dist/extension.js"]
38+
}
39+
],
40+
"compounds": [
41+
{
42+
"name": "Client + Server",
43+
"configurations": ["Launch Client", "Attach to Server"]
44+
}
45+
]
1846
}

.vscode/settings.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
33
"files.exclude": {
4-
"**/.git": true,
54
"**/.DS_Store": true,
5+
"**/.git": true,
6+
"**/.rollup.cache": true,
7+
"**/dist": true,
68
"**/node_modules": true,
7-
"**/package-lock.json": true
8-
"**/syntaxes/*.json": true
9-
}
9+
"**/out": true,
10+
"**/package-lock.json": true,
11+
"**/tsconfig.tsbuildinfo": true
12+
},
13+
"tslint.enable": true,
14+
"typescript.tsc.autoDetect": "off",
15+
"typescript.preferences.quoteStyle": "single",
16+
"editor.codeActionsOnSave": {
17+
"source.fixAll.eslint": true
18+
}
1019
}

.vscode/tasks.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "compile",
6+
"type": "npm",
7+
"script": "compile",
8+
"group": "build",
9+
"problemMatcher": "$tsc"
10+
},
11+
{
12+
"label": "watch:client",
13+
"type": "npm",
14+
"script": "watch:client",
15+
"isBackground": true,
16+
"group": "build",
17+
"problemMatcher": "$tsc-watch"
18+
},
19+
{
20+
"label": "watch:server",
21+
"type": "npm",
22+
"script": "watch:server",
23+
"isBackground": true,
24+
"group": {
25+
"kind": "build",
26+
"isDefault": true
27+
},
28+
"problemMatcher": "$tsc-watch",
29+
"detail": "cd src/server && rollup -cw"
30+
}
31+
]
32+
}

0 commit comments

Comments
 (0)