caos-language-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -0
- package/dist/node/server.js +236289 -0
- package/dist/web/server.js +236224 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# CAOS Language Server
|
|
2
|
+
|
|
3
|
+
This language server implements the Language Server protocol for handling **CAOS** language files
|
|
4
|
+
*\*Workspaces are scoped to a specific CAOS variant*
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
- CAOS syntax error highlighting
|
|
8
|
+
- Invalid command
|
|
9
|
+
- Unclosed control blocks (i.e. `DOIF`, `ENUM`)
|
|
10
|
+
- Out of variant commands and variables
|
|
11
|
+
- Missing parameters
|
|
12
|
+
- Very basic type checking
|
|
13
|
+
- Semantic tokens for use in custom highlighting
|
|
14
|
+
- Code completion
|
|
15
|
+
- Commands scoped to type (i.e. Command, R/L value)
|
|
16
|
+
- Subroutine Name
|
|
17
|
+
- Simple game/name variable name completions (does not scope or restrict `NAME` variables to agent class)
|
|
18
|
+
- Named value completion (i.e. type `hung`, select 'Hunger for Protein' and completion inserts corresponding numeric value)
|
|
19
|
+
- Hover documentation
|
|
20
|
+
- Inlay Hints (can be disabled)
|
|
21
|
+
- Known value names (i.e. Show drive name for corresponding numeric value)
|
|
22
|
+
- Bitflag breakdown (i.e. Append inlay hint `(activatable, mousable)` after `attr 3`)
|
|
23
|
+
- Parameter names (minimum number of parameters before showing hint is configurable)
|
|
24
|
+
- Command return values
|
|
25
|
+
- Basic code formatting
|
|
26
|
+
|
|
27
|
+
## Extension Settings
|
|
28
|
+
This extension contributes the following settings:
|
|
29
|
+
|
|
30
|
+
### General
|
|
31
|
+
* `caosScript.maxNumberOfProblems`: Set maximum number of errors to report
|
|
32
|
+
* `caosScript.variant`: Workspace CAOS variant. Can be **[C1,C2,CV,C3,DS]**. Default **DS**
|
|
33
|
+
* `caosScript.formatting.indentComments`: Indent comments inline with commands except when comment is at start of line
|
|
34
|
+
* ### Inlay Hints
|
|
35
|
+
* `caosScript.inlayHints.bitFlagValues`: Show inlay hints for bitflag value
|
|
36
|
+
* `caosScript.inlayHints.parameterHints.showParameterHints`: Show parameter names before arguments
|
|
37
|
+
* `caosScript.inlayHints.parameterHints.minimumParameterCount`: Hide inlay hints for commands with less than this number of parameters
|
|
38
|
+
* `caosScript.inlayHints.setvParameterHints`: Show parameter names before SETV like command arguments
|
|
39
|
+
* `caosScript.inlayHints.genusName`: Show genus name for known family/genus combinations
|
|
40
|
+
* `caosScript.inlayHints.valueName`: Show value name for known integer and string values
|
|
41
|
+
* `caosScript.inlayHints.eventScriptName`: Show event script name for known event numbers
|
|
42
|
+
* `caosScript.inlayHints.ddePictDimensions`: Show `DDE: PICT` command dimensions from dimension characters
|
|
43
|
+
* `caosScript.inlayHints.c1ClasValue`: Show parsed family, genus, and specie from C1 CLAS value
|
|
44
|
+
* `caosScript.inlayHints.rvalueReturnValue`: Show return type for rvalue commands
|
|
45
|
+
* `caosScript.inlayHints.equality.bitFlagValues`: Show Bitflag value on opposing side of equality operator
|
|
46
|
+
* `caosScript.inlayHints.equalityValueName`: Show value name for know integer and string values on opposing side of EQ
|
|
47
|
+
|
|
48
|
+
## Semantic Tokens
|
|
49
|
+
Some CAOS file elements have additional semantic token selectors on them which allows
|
|
50
|
+
for more specific styling
|
|
51
|
+
### Main Tokens
|
|
52
|
+
* `command`: root level command name tokens
|
|
53
|
+
* `rvalue`: rvalue command name tokens
|
|
54
|
+
* `lvalue`: command tokens when command is used as lvalue
|
|
55
|
+
### Token Modifiers
|
|
56
|
+
* `command-prefix`: First token in a multi-word command
|
|
57
|
+
* `command-suffix`: Last token in a three word command
|
|
58
|
+
* `c1-string`: A C1 style bracket string
|
|
59
|
+
* `quote-string`: A C2e style quoted string
|
|
60
|
+
* `byte-string`: A byte string for things like ANIM
|
|
61
|
+
* `not-found`: For a command that cannot be found in context
|
|
62
|
+
* `vaxx`: for VAxx and VARx variables
|
|
63
|
+
* `ovxx`: for OVxx and OBVx variables
|
|
64
|
+
* `mvxx`: For MVxx variables
|
|
65
|
+
* `returns-number`: Decorates command words for commands that return a number
|
|
66
|
+
* `returns-string`: Decorates command words for commands returning a string
|
|
67
|
+
* `returns-variable`: Decorates command word for commands returning a variable
|
|
68
|
+
* `returns-agent`: Decorates command word for commands returning an agent
|
|
69
|
+
* `agent-constructor`: Decorates agent constructor commands like those starting with `new:`
|
|
70
|
+
|
|
71
|
+
### How to theme semantic tokens
|
|
72
|
+
You can these tokens in settings by using
|
|
73
|
+
```JSON
|
|
74
|
+
{
|
|
75
|
+
"editor.semanticTokenColorCustomizations": {
|
|
76
|
+
"[Default Dark+]": {
|
|
77
|
+
"*.returns-string:caos": "#ff0011"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Known Issues
|
|
84
|
+
|
|
85
|
+
- Occasionally completion becomes confused.
|
|
86
|
+
- Suggests commands instead of R/L values unexpectedly
|
|
87
|
+
- Suggests known values for values already completed previously
|
|
88
|
+
- Fails to show suggestions for named values
|
|
89
|
+
- Navigation fails from `SUBR` names to their usages
|
|
90
|
+
|
|
91
|
+
## Release Notes
|
|
92
|
+
|
|
93
|
+
### 0.1.0
|
|
94
|
+
|
|
95
|
+
Initial release
|
|
96
|
+
|
|
97
|
+
## Roadmap
|
|
98
|
+
|
|
99
|
+
* **Rename support:**
|
|
100
|
+
* subroutine (`SUBR`) names
|
|
101
|
+
* `GAME`/`EAME`/`NAME` variable names
|
|
102
|
+
* **CAOS2Pray**
|
|
103
|
+
* Completions
|
|
104
|
+
* File name
|
|
105
|
+
* Known tags
|
|
106
|
+
* Commands
|
|
107
|
+
* Highlighting
|
|
108
|
+
* Compilation
|
|
109
|
+
* **PRAY file support**
|
|
110
|
+
* Completions
|
|
111
|
+
* Error checking
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|