Skip to content

Commit 38d37db

Browse files
PhilippeChabPhilippeChab
andauthored
Provide static scripts definitions (#49)
* Provide static scripts definitions * Remove /ovr files * Complete static scripts definitions and remove background indexing * Cleanup * Config changes * Update nwscript.nss definitions --------- Co-authored-by: PhilippeChab <philippechab@DESKTOP-ECH2OUF>
1 parent 141877e commit 38d37db

File tree

1,205 files changed

+61003
-25668
lines changed

Some content is hidden

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

1,205 files changed

+61003
-25668
lines changed

.gitignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
# Builds and stuff
2+
*.vsix
13
out
24
dist
35
node_modules
46
tsconfig.tsbuildinfo
5-
*.vsix
6-
server/scripts/nwscript.nss
77
yarn-error.log
8+
9+
# Static definitions
10+
server/scripts/nwscript.nss
11+
server/scripts/base_scripts/*
12+
server/scripts/ovr/*
13+
14+
# Varia
815
.DS_Store
916
TODO.txt
10-
nwscript.nss

.vscode/settings.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,28 @@
22
"editor.formatOnSave": true,
33
"[typescript]": {
44
"editor.defaultFormatter": "esbenp.prettier-vscode"
5-
}
5+
},
6+
"files.associations": {
7+
"*.nss": "nwscript"
8+
},
9+
"[nwscript]": {
10+
"editor.defaultFormatter": "PhilippeChab.nwscript-ee-language-server"
11+
},
12+
"nwscript-ee-lsp.formatter": {
13+
"enabled": true,
14+
"executable": "clang-format",
15+
"style": {
16+
"BasedOnStyle": "Google",
17+
"AlignTrailingComments": true,
18+
"AlignConsecutiveAssignments": true,
19+
"ColumnLimit": 250,
20+
"BreakBeforeBraces": "Allman",
21+
"AlignEscapedNewlinesLeft": true,
22+
"AlwaysBreakBeforeMultilineStrings": true,
23+
"MaxEmptyLinesToKeep": 1,
24+
"TabWidth": 4,
25+
"IndentWidth": 4,
26+
"UseTab": "Always"
27+
}
28+
},
629
}

README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,7 @@ Neverwinter Nights home and installation folders.
3030

3131
## Usage
3232

33-
Simply open a project with nss files and the extension installed. The extension will index your files and you will be ready to go - it can currently take up to 10-15 seconds to index big projects.
34-
35-
![](https://i.imgur.com/DKn8znH.png)
36-
37-
Notes:
38-
39-
- The files are indexed in background processes, which means it will not block other features of the language server like formatting, and a file's local definitions generated on the fly will be available.
40-
- The files are indexed incrementally, which means a file's global definitions become available as soon as it has been indexed.
33+
Simply open a project with nss files and the extension installed.
4134

4235
### Formatting
4336

@@ -95,7 +88,6 @@ Notes:
9588
- The compiler executable is provided for Windows, Darwin and Linux operating systems.
9689
- Diagnostics are currently published when opening or saving a file.
9790
- By default, the compiler will try to detect automatically your Neverwinter Nights home and installation folders if they are not specified. If it fails to do so, you can provide the paths in the extension settings like shown above - input paths are wrapped into quotes automatically.
98-
- In order to compile a file's includes, the compiler needs to know their directories. Files that had been requested a diagnostic while the project is being indexed are queued and processed once the indexing is done.
9991
- You can set the `verbose` setting to `true` if you wish to see detailed logs of the compilation process.
10092
- Big files with a lot of includes can take between half a second to a second to compile on older machines - it will not affect the client performances as the processing is done on the server.
10193

@@ -113,7 +105,7 @@ I personally use the [One Dark Pro](https://marketplace.visualstudio.com/items?i
113105

114106
### Generating the language library definitions
115107

116-
Replace `server/scripts/nwscript.nss` by its new version and execute `yarn run generate-lib-defs` in the server root directory.
108+
Replace `server/scripts/nwscript.nss` by its new version, `server/scripts/base_scripts/` files by their new versions, `server/scripts/ovr/` includes by their new versions and execute `yarn run generate-lib-defs` in the server root directory.
117109

118110
## Issues
119111

package.json

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"url": "https://github.com/PhilippeChab/nwscript-ee-language-server"
99
},
1010
"license": "MIT",
11-
"version": "1.5.5",
11+
"version": "2.0.0",
1212
"author": {
1313
"name": "Philippe Chabot"
1414
},
@@ -55,15 +55,25 @@
5555
"type": "object",
5656
"title": "NWScript: EE LSP Formatter Configuration",
5757
"properties": {
58-
"nwscript-ee-lsp.autoCompleteFunctionsWithParams": {
59-
"type": "boolean",
60-
"default": false,
61-
"description": "Will include a function's params when auto completing it."
58+
"nwscript-ee-lsp.completion": {
59+
"type": "object",
60+
"properties": {
61+
"addParamsToFunctions": {
62+
"type": "boolean",
63+
"default": false,
64+
"description": "Will include a function's params when auto completing it."
65+
}
66+
}
6267
},
63-
"nwscript-ee-lsp.includeCommentsInFunctionsHover": {
64-
"type": "boolean",
65-
"default": false,
66-
"description": "Will include a function's comments when hovering it."
68+
"nwscript-ee-lsp.hovering": {
69+
"type": "object",
70+
"properties": {
71+
"addCommentsToFunctions": {
72+
"type": "boolean",
73+
"default": false,
74+
"description": "Will include a function's comments when hovering it."
75+
}
76+
}
6777
},
6878
"nwscript-ee-lsp.formatter": {
6979
"type": "object",
@@ -118,6 +128,11 @@
118128
"default": true,
119129
"description": "Whether or not the compiler is enabled."
120130
},
131+
"os": {
132+
"type": "string",
133+
"default": null,
134+
"description": "Force to use a specific os executable. Darwin, Linux or Windows_NT."
135+
},
121136
"verbose": {
122137
"type": "boolean",
123138
"default": false,
@@ -147,7 +162,7 @@
147162
"vscode:prepublish": "yarn build",
148163
"build": "yarn clean && yarn buildClient && yarn buildServer",
149164
"buildClient": "esbuild extension=./client/src/extension.ts --sourcemap --bundle --external:vscode --platform=node --outdir=./client/out/",
150-
"buildServer": "esbuild server=./server/src/server.ts indexer=./server/src/Documents/DocumentsIndexer.ts --sourcemap --bundle --external:vscode --platform=node --outdir=./server/out/",
165+
"buildServer": "esbuild server=./server/src/server.ts --sourcemap --bundle --external:vscode --platform=node --outdir=./server/out/",
151166
"compile": "tsc -b",
152167
"compile:client": "tsc -b ./client/tsconfig.json",
153168
"compile:server": "tsc -b ./server/tsconfig.json",
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"complexTokens": [
3+
{
4+
"position": {
5+
"line": 15,
6+
"character": 5
7+
},
8+
"identifier": "ActionPsionicMB",
9+
"tokenType": 3,
10+
"returnType": "void",
11+
"params": [
12+
{
13+
"position": {
14+
"line": 15,
15+
"character": 28
16+
},
17+
"identifier": "oSpellTarget",
18+
"tokenType": 25,
19+
"valueType": "object"
20+
}
21+
],
22+
"comments": []
23+
},
24+
{
25+
"position": {
26+
"line": 17,
27+
"character": 5
28+
},
29+
"identifier": "ActionPsionicCharm",
30+
"tokenType": 3,
31+
"returnType": "void",
32+
"params": [
33+
{
34+
"position": {
35+
"line": 17,
36+
"character": 31
37+
},
38+
"identifier": "oSpellTarget",
39+
"tokenType": 25,
40+
"valueType": "object"
41+
}
42+
],
43+
"comments": []
44+
}
45+
],
46+
"structComplexTokens": [],
47+
"children": [
48+
"NW_I0_GENERIC",
49+
"NW_I0_SPELLS"
50+
]
51+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"complexTokens": [],
3+
"structComplexTokens": [],
4+
"children": [
5+
"nw_i0_plot",
6+
"NW_i0_HENCHMAN"
7+
]
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"complexTokens": [],
3+
"structComplexTokens": [],
4+
"children": [
5+
"nw_i0_plot",
6+
"NW_i0_HENCHMAN"
7+
]
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"complexTokens": [],
3+
"structComplexTokens": [],
4+
"children": [
5+
"nw_i0_plot",
6+
"NW_i0_HENCHMAN"
7+
]
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"complexTokens": [],
3+
"structComplexTokens": [],
4+
"children": [
5+
"nw_i0_plot",
6+
"nw_i0_henchman"
7+
]
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"complexTokens": [],
3+
"structComplexTokens": [],
4+
"children": [
5+
"nw_i0_plot",
6+
"nw_i0_henchman"
7+
]
8+
}

0 commit comments

Comments
 (0)