Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for documentation from septic source code #233

Merged
merged 88 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
84d62c7
Add documentation from SEPTIC source code script
vetlek Jun 27, 2023
f1a6001
Update loading of meta info
vetlek Jun 29, 2023
cb303c3
Update structure of calc documentation
vetlek Jun 30, 2023
3ffc3b0
Update object meta info
vetlek Jul 3, 2023
c00cc2c
Add signature help for calcs
vetlek Jul 3, 2023
ed64c78
Update formating of parameters
vetlek Jul 4, 2023
f76c240
Update parsing of arity
vetlek Jul 4, 2023
9a12d11
Add diagnostics for calcs
vetlek Jul 4, 2023
7c433c4
Use consistent naming for algs
vetlek Jul 4, 2023
2a4bb40
Update flag for optional params
vetlek Jul 4, 2023
66a2994
Add automatic parsing of object doucmentation
vetlek Jul 5, 2023
fd15efb
Update formatting of calcs
vetlek Jul 5, 2023
1b16001
Update output path object doc
vetlek Jul 5, 2023
4c8d24f
Add tests for calc diagnostics
vetlek Jul 6, 2023
9940f20
Refactor alg diagnositcs
vetlek Jul 7, 2023
008a845
Add hover for object documentation
vetlek Jul 10, 2023
d0a8562
Add completion for object attr
vetlek Jul 11, 2023
46d2f45
Add unittest for completion
vetlek Jul 11, 2023
d613259
Refactor diagnostics
vetlek Jul 11, 2023
e6bb2b0
Add diagnostics for attributes based on docs
vetlek Jul 11, 2023
5d8dbd8
Add unittests for hover
vetlek Jul 13, 2023
28c2597
Add unittests for signature help
vetlek Jul 13, 2023
cc306fb
Refactor completion provider to be leaner
vetlek Jul 13, 2023
9e6b7a9
Add ignore for test coverage on providers
vetlek Jul 13, 2023
74989bf
Improve test coverage diagnostics
vetlek Jul 13, 2023
032ad54
Improve test coverage reference provider
vetlek Jul 13, 2023
14294c7
Refactor formatter
vetlek Jul 14, 2023
eb21f8f
Add copyright
vetlek Jul 14, 2023
624642f
Add copyright notice
vetlek Jul 14, 2023
47dff0d
Add validation for max length alg
vetlek Jul 14, 2023
c869211
Remove unused code
vetlek Jul 14, 2023
5fe6e3c
Improve test coverage foldingrange
vetlek Jul 14, 2023
cb145a3
Add ignore statements for coverage test
vetlek Jul 14, 2023
fec8a6e
Add tests for renaming
vetlek Jul 14, 2023
879fb5f
Update format fixtures
vetlek Jul 14, 2023
e1b8622
Fix bug with line ending
vetlek Jul 14, 2023
87aa9f1
Ignore empty references
vetlek Aug 8, 2023
8a0726c
Add parent object for object doc
vetlek Aug 9, 2023
89e30d1
Fix error in yaml
vetlek Aug 9, 2023
7457461
Add levels for obj doc nodes
vetlek Aug 9, 2023
ea12f40
Restructure metainfo file
vetlek Aug 9, 2023
a762477
Add object hierarchy in meta info
vetlek Aug 9, 2023
22b866f
Add diagnotics for object structure
vetlek Aug 9, 2023
14c1baa
Update parsing of object documentation
vetlek Aug 9, 2023
0536182
Add README for updating doc
vetlek Aug 9, 2023
f33d517
Update parsing of doxygen to new format
vetlek Aug 10, 2023
3711b5b
Add completion of public properties in algs
vetlek Aug 10, 2023
5d61b20
Add diagnostics for public properties
vetlek Aug 10, 2023
861f7db
Add check for invalid char in string
vetlek Aug 11, 2023
b8c8a9d
Make completion of calcs searchable based on description
vetlek Aug 23, 2023
e7b7214
Update diagnostic severity levels
vetlek Sep 1, 2023
534f219
Update scripts to current doc spec
vetlek Sep 8, 2023
e6f3e8e
Update parsing of doc to latest spec
vetlek Sep 11, 2023
e257138
WIP
vetlek Sep 18, 2023
7285455
Update calc documentation parsing
vetlek Sep 20, 2023
8f0e038
Update scripts for parsing object doc
vetlek Sep 21, 2023
bb9b48b
Fix parsing of parent objects
vetlek Sep 22, 2023
af57992
Update code to newest doc format
vetlek Sep 22, 2023
d07a998
Add latest doc
vetlek Sep 22, 2023
fe46632
Remove unused import
vetlek Sep 22, 2023
5ec386a
Update documentation
vetlek Sep 22, 2023
c29e673
Support attributes with postfix
vetlek Sep 22, 2023
b48afb8
Update README
vetlek Sep 22, 2023
f91668a
Update supported objects in calc
vetlek Sep 22, 2023
7585a3c
Fix bug with completion in empty doc
vetlek Sep 25, 2023
6d73d22
Support signature help for non alt calcs
vetlek Sep 25, 2023
bf1d897
Add quality and value to calc doc
vetlek Sep 25, 2023
63e5fd2
Update formatting of attrs
vetlek Sep 25, 2023
c20d707
Fix search functionality in calcs
vetlek Sep 25, 2023
0e6e58e
Update readme
vetlek Sep 25, 2023
83aab5d
Add tests for signaturehelp
vetlek Sep 25, 2023
f91d9c1
Update scripts
vetlek Sep 25, 2023
63788ab
Fix updating of object levels scg
vetlek Sep 25, 2023
4702f42
Update documentation
vetlek Sep 25, 2023
2290ba7
Reuse function
vetlek Sep 25, 2023
46959b3
Fix formatting of datatype in error msg
vetlek Sep 25, 2023
f8d33b9
Update readme
vetlek Sep 25, 2023
0e58a8f
Update default level for unknown obj types
vetlek Sep 25, 2023
dbccff7
Update object doc formatting
vetlek Sep 25, 2023
63f9fc5
Update documentation
vetlek Sep 25, 2023
978660b
Update documentation
vetlek Sep 25, 2023
4ea547c
Update snippet to avoid name collision
vetlek Sep 27, 2023
402a52f
Add public properties to object doc
vetlek Sep 27, 2023
36f9012
Add public propety to attribute doc
vetlek Sep 27, 2023
a05f928
Support new bit datatype for attributes
vetlek Sep 27, 2023
d7655b5
Update documentation
vetlek Sep 27, 2023
c3440e9
Update documentation
vetlek Sep 27, 2023
a405bf6
Update documentation
vetlek Sep 28, 2023
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ out
node_modules
.vscode-test/
*.vsix
.env
*.env
.venv
.cpp
__pycache__
.nyc_output
coverage/
8 changes: 8 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Update Documentation",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/scripts/main.py",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Attach to server",
"port": 6009,
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@
- GoToDeclaration: Goes to the declaration of the connected SopcXvr when referenced (e.g. in calcs, Xvr etc.)
- Find References: Finds all references to a (Sopc)Xvr (e.g. in calcs, object declaration, XvrPlot etc.)
- Ignore Diagnostics for specified paths.
- Documentation: Built in documentation of objects/attributes and calcs based on source code.
- SignatureHelp: Signature help for calcs

## Instructions

If you don't know what the SEPTIC file format is, then you don't need this extension.

Adding the SEPTIC extension to VS Code allows you to do the following when loading a SEPTIC .cnfg file:

- Auto-complete (Sopc)Xvr names and Calcs.
- Auto-complete (Sopc)Xvr names/properties, object attributes and calcs.
- Diagnose certain fault modes (missing parenthesis in calcs, mistyped Calc or Xvr names etc.)
- Auto-complete commonly used segments of code, called snippets
- Type e.g. 'sopc' (uncapitalized letters only), and you should see a number of sopcxvr snippet options. Choose the one you want with `arrow up`/`arrow down` and press `Tab` to create a complete sopcxvr section.
Expand All @@ -52,6 +54,12 @@ Adding the SEPTIC extension to VS Code allows you to do the following when loadi

- Formatting of cnfg files can be enabled by setting `septic.formatting.enabled = True` in the settings. Comments `// or /* */` and jinja-comments `{# #}` are not formatted. Everything between the jinja expressions `{% for w %}` ... `{% endfor %}` and `{% if %}` ... `{% endif %}` are not formatted. To avoid formatting certain sections of the file the flags `{# format:off #}` and `{# format:on #}` can be used to turn off and on again formatting (Tip: snippets available by writing `formaton/off`).

- Documentation of objects and calcs are available by hovering over the object/calc definition. Hovering on object definition will provide an overview of the object and related attributes. For more information about a certain attribute (datatype, description etc.), hover over the definition of the attribute. Hovering over a calc will provide information about parameters, return values, quality etc.

- SignatureHelp is provided when writing calcs inside CalcPvr.Alg. The signature is shown with the active parameter highlighted together with the documentation of the active parameter. SignatureHelp can be manually activated by pressing `Ctrl + Shift + Space`.

- Search functionality for calcs are builtin into the completion. To start searching, start typing the search word into the CalcPvr.Alg field and all calcs that has the relevant search word in the documentation is included in the filtered results. Pressing `Ctrl + Space` starts the completion without a starting phrase and can be used to browse all available calcs and variables inside a CalcPvr.Alg.

The extension supports SEPTIC projects that uses the SEPTIC Config Generator (SCG). The SCG-config file for the project is loaded and the relevant `.cnfg` files (required to be in the templates folder) listed in the layout section are loaded into a common context that shares references etc.

## Feedback and contributions
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
".tsx"
],
"exclude": [
"coverage/",
"**/*.test.ts",
"**/test/util/*",
"client/*",
Expand All @@ -125,17 +126,20 @@
"server/src/documentProvider.ts",
"server/src/settings.ts",
"server/src/protocol.ts",
".vscode-test/*"
".vscode-test/*",
"**/index.ts"
],
"reporter": [
"html"
],
"require": [
"ts-node/register"
"ts-node/register",
"source-map-support/register"
],
"all": true,
"cache": false,
"sourceMap": true,
"instrument": true,
"all": true
"instrument": true
},
"scripts": {
"vscode:prepublish": "npm run compile",
Expand All @@ -148,7 +152,7 @@
"postinstall": "cd client && npm install && cd ../server && npm install && cd ..",
"e2e-test": "npm run compile && node ./client/out/test/runTest",
"test": "mocha --require ts-node/register server/src/test/**/*.test.ts ",
"test_with_coverage": "nyc mocha --require ts-node/register --require source-map-support/register server/src/test/**/*.test.ts "
"test_with_coverage": "npm run compile && nyc mocha --require ts-node/register --require source-map-support/register --recursive server/src/test/**/*.test.ts "
},
"devDependencies": {
"@types/chai": "4.3.5",
Expand Down
Loading