You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+31-7Lines changed: 31 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,14 @@ Let us first take a brief look at the design of this project.
7
7
8
8

9
9
10
-
The image above shows the layers of the source code. `entry` initializes the extension and applies the vscode workspace configuration to the extension. `provider_interface` registers the providers in vscode. `builders` prepares the data structures from the raw text string/processed semantic information for vscode language features. `collect_info` collects the semantic information from the raw text string. `common` includes some constants and algorithms. `doc` is the interface for getting documentation.
10
+
The image above shows the layers of the source code. `entry` initializes the extension and applies the vscode workspace configuration to the extension. `provider_interface` registers the providers in vscode. `builders` prepare the data structures from the raw text string/processed semantic information for vscode language features. `collect_info` collects the semantic information from the raw text string. `common` includes some constants and algorithms. `doc` is the interface for getting documentation.
11
+
12
+
If you are interested in a more detailed dependency graph, you can find the dependency graph in [`./images/dependency_graph.svg`](./images/dependency_graph.svg). Also, you can generate the dependency graph by running
13
+
> You may need to run `sudo apt install graphviz` first
@@ -25,24 +32,35 @@ Also, the dirty listener will set the dirty flag to true in `structuredInfo` whe
25
32
26
33
### Core Functionality Part
27
34
This part is below the dashed line in the Data Flow diagram. The core functionality is in this part. First, if you are not familiar with vscode extension, please just check [patterns-and-principles](https://vscode-docs.readthedocs.io/en/stable/extensions/patterns-and-principles/) and [programmatic-language-features](https://code.visualstudio.com/api/language-extensions/programmatic-language-features).
28
-
When vscode requests language information from a provider, the provider will call `produceResultByDoc` to get updated semantic information. Then, the provider will return the information to vscode. If you are interested in how the provider works, you can check the samples in [vscode-extension-samples samples](https://github.com/microsoft/vscode-extension-samples#samples) which used API `languages.`
29
-
30
-
## Version Control
31
-
The version number is in the format MAJOR.MINOR.PATCH. We do not comply with the *Semantic Versioning* strictly. We save x.x.0 for the *alpha version* and x.x.1 for the *beta version*.
35
+
When vscode requests language information from a provider, the provider will call `updateResultByDoc` to get updated semantic information. Then, the provider will return the information to vscode. If you are interested in how the provider works, you can check the samples in [vscode-extension-samples samples](https://github.com/microsoft/vscode-extension-samples#samples) which used API `languages.`
32
36
33
37
## Compile & Package
34
38
35
39
### Setup
36
40
37
41
Run `npm install`
38
42
43
+
### Development
44
+
- How to add a vscode provider?
45
+
1. add a pair (k, v) in `TraceableDisposables.disposables`
46
+
2. add a pair (k, v) in `TraceableDisposables.cfgMapDisposable`
47
+
3. add a case in `TraceableDisposables.registerProviderByName`
48
+
4. add a config (k, v) in `WorkspaceConfig.config`
49
+
5. add a config in `contributes.configuration.properties` in `package.json`
50
+
51
+
- How to change the parsing process?
52
+
The parsing process is in `collect_from_text`, and the symbol information are stored in `Map{name: SymbolInfo}`
53
+
54
+
- How to change the vscode-formated language information?
55
+
`builders` prepare the vscode-formated language information. See `export{}` to understand what information the builder is building.
56
+
39
57
### Compile
40
58
41
-
Run `npm run esbuildc` for compile once;
59
+
Run `npm run esbuildc` for compiling once;
42
60
Run `npm run esbuildw` for watch mode;
43
61
Run `npm run esbuildp` for production.
44
62
45
-
> Please remember to execute`npm run tscc` for TypeScript type checking separately.
63
+
> Please remember to run`npm run tscc` for TypeScript type checking separately.
46
64
47
65
For more commands, check them in `"scripts"` in `package.json`.
48
66
@@ -55,6 +73,9 @@ Note that we are trying to use `esbuild` as the bundler since it is faster than
See [debugging-the-extension](https://code.visualstudio.com/api/get-started/your-first-extension#debugging-the-extension). Note that `"preLaunchTask": "npm: esbuildw"` in `launch.json` is disabled in this project so you need to run `npm run esbuildc` (or just enable `"preLaunchTask"`) before launching the debugger.
78
+
58
79
### Linting
59
80
Run `npm run lint` for linting.
60
81
Most errors and warnings can be fixed automatically by running `npm run lint -- --fix`.
@@ -70,6 +91,9 @@ Then, you will get a `common-lisp-x.x.x.vsix` in your `./` .
70
91
71
92
If you would like to use the packaged `.vsix` extension, you can load the `.vsix` extension to vscode by referring to [extension-marketplace install-from-a-vsix](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix).
72
93
94
+
## Version Control
95
+
The version number is in the format MAJOR.MINOR.PATCH. We do not comply with the *Semantic Versioning* strictly. We save x.x.0 for the *alpha version* and x.x.1 for the *beta version*.
96
+
73
97
## Code Style
74
98
We are trying to write dumb code. TypeScript has many fancy syntax features, however, we would not like to use them too much. We are trying to maintain the best readability while utilizing some useful syntax features.
0 commit comments