Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit d337295

Browse files
elektronikworkshopadiazulay
authored andcommitted
Documenting ...
1 parent 4a91647 commit d337295

File tree

1 file changed

+39
-19
lines changed

1 file changed

+39
-19
lines changed

BRANCHNOTES.md

+39-19
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ The generator takes the parser's output and transforms it into a valid `c_cpp_pr
1414
Provide a configuration flag which allows the user to turn this feature off - this is useful for the cases in which this magic fails or the user has a very specific setup. Although this branch tries to eliminate most of the latter cases.
1515

1616
### Global Tasks in vscode-arduino
17-
Places where `c_cpp_properties.json` gets altered (list in progress)
18-
```
19-
src/extension.ts
20-
260, 53: arduinoContextModule.default.arduinoApp.tryToUpdateIncludePaths();
21-
src/arduino/arduino.ts
22-
328, 12: public tryToUpdateIncludePaths() {
23-
24-
```
2517

2618
### Status
2719
**2020-02-05** Currently I'm able to generate error free IntelliSense setups for AVR and ESP32 using the preliminary implementation. For ESP32 I just had to add the intrinsic compiler paths manually. A solution has to be found for these ... which there is, see [here](https://stackoverflow.com/a/6666338)
@@ -41,19 +33,21 @@ src/arduino/arduino.ts
4133
| | :white_check_mark: Merging of parsing result and existing file content |
4234
| | :white_check_mark: Handling inexistent files and folders |
4335
| | :white_check_mark: Write configuration on change only |
44-
| **Configuration flags** | :heavy_check_mark: Disable flag for IntelliSense auto-config |
45-
| | :white_check_mark: Perhaps a general IntelliSense flag `{off/manual, auto, oldstyle}` whereas the old can be removed at some point |
46-
| | :white_check_mark: Fine grained IntelliSense control: Global en-/disable and project override. This is probably more useful since the most boards will hopefully work and for the very special cases the user can disable the feature for this single project but still can enjoy it within his regular projects. |
36+
| | :white_check_mark: Option to backup old configurations? |
37+
| **Configuration flags** | :heavy_check_mark: Provide global disable flag for IntelliSense auto-config |
38+
| | :white_check_mark: Provide project specific override for the global flag - most users will likely use the default setup and disable auto-generation for very specific projects |
4739
| **Unit tests** | :white_check_mark: Basic parser (known boards, match/no match)|
4840
| | :white_check_mark: Querying of compiler built-in includes |
4941
| | :white_check_mark: Throwing arbitrary data at parser engines |
5042
| | :white_check_mark: JSON input |
5143
| | :white_check_mark: JSON output |
5244
| | :white_check_mark: Configuration merging |
53-
| **General** | :white_check_mark: Review and remove previous attempts messing with `c_cpp_properties.json` |
54-
| | :white_check_mark: Auto-run verify after setting a board to generate a valid `c_cpp_properties.json`, identify other occasions where this applies (usually when adding new libraries), hint the user to run *verify*? |
45+
| **General** | :white_check_mark: Review and remove previous attempts messing with `c_cpp_properties.json` or IntelliSense. (Partially done - documented in the [General Tasks](#General-Tasks) section |
46+
| | :white_check_mark: Auto-run verify after setting a board to generate a valid `c_cpp_properties.json`, identify other occasions where this applies (usually when adding new libraries), hint the user to run *verify*? -> Good moment would be after the workbench initialization -> message in arduino channel |
5547
| | :white_check_mark: Document configuration settings in [README.md](README.md) |
5648
| | :white_check_mark: Document features in [README.md](README.md) |
49+
| | :white_check_mark: How to handle compilation failure? Only set if more comprehensive |
50+
| | :white_check_mark: Extract compiler command parser from vscode-arduino and [publish](https://itnext.io/step-by-step-building-and-publishing-an-npm-typescript-package-44fe7164964c) it as a separate package which will allow reusage and tests can be run without the heavy vscode-arduino rucksack |
5751
| | :white_check_mark: Finally: go through my code and look for TODOs |
5852

5953
`*` not committed to branch yet
@@ -85,27 +79,35 @@ I will list every supporter here, thanks!
8579
* [`c_cpp_properties.json` reference](https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference)
8680
* [Interactive regex debugger](https://regex101.com/)
8781
* [Git branch management](https://blog.scottlowe.org/2015/01/27/using-fork-branch-git-workflow/)
82+
* [Collapsible Markdown](https://gist.githubusercontent.com/joyrexus/16041f2426450e73f5df9391f7f7ae5f/raw/f774f242feff6bae4a5be7d6c71aa5df2e3fcb0e/README.md)
8883

84+
## Issues Concerning this Project
85+
* https://github.com/Microsoft/vscode-cpptools/issues/1750
86+
* Problems with IntelliSense itself https://github.com/microsoft/vscode-cpptools/issues/1034
87+
* Logging for IntelliSense https://code.visualstudio.com/docs/cpp/enable-logging-cpp
8988
## Future Work
9089
* Proper interactive serial terminal (this is the second major show stopper in my opinion)
9190
* Lots of redundant code
9291
* e.g. "upload is a superset of "verify"
9392
* general lack of modularity - the above is the result
9493
* It seems that this extension is pretty chaotic. Most probably some refactoring is necessary.
95-
94+
* Possibility to jump to compilation errors from compiler output and highlight compiler errors
9695
----
9796

9897
## Implementation
98+
**Note** Check this vscode feature:
99+
```
100+
Configuration provider
101+
The ID of a VS Code extension that can provide IntelliSense configuration information for source files. For example, use the VS Code extension ID ms-vscode.cmake-tools to provide configuration information from the CMake Tools extension.
102+
```
99103

100104
### Build Output Parser
101105
#### Intrinsic Include Paths
102-
Some include paths are built into gcc and don't have to be specified on the command line. This requires that we have to get them from the compiler.
103-
104-
Just searching the compiler installation directory with something like
106+
Some include paths are built into gcc and don't have to be specified on the command line. Just searching the compiler installation directory with something like
105107
```bash
106108
find ~/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/ -name "include*"
107109
```
108-
won't do since not all include directories are named `include`. Fortunately gcc can be queried about its configuration ([source](https://stackoverflow.com/a/6666338)):
110+
won't do since not all include directories are named `include`. Fortunately gcc can be queried about its configuration ([source](https://stackoverflow.com/a/6666338)) -- built-in include paths are part of it:
109111
```bash
110112
# generally for C++
111113
gcc -xc++ -E -v -
@@ -117,6 +119,7 @@ gcc -xc++ -E -v -
117119
The result can be inspected here:
118120
* [xtensa-esp32-elf-gcc_built_in_specs.txt](doc/intellisense/compilerinfo/xtensa-esp32-elf-gcc_built_in_specs.txt)
119121
* [avr-gcc_built_in_specs.txt](doc/intellisense/compilerinfo/avr-gcc_built_in_specs.txt)
122+
120123
To show the most interesting section in the output of the above commands, for ESP32:
121124
```
122125
#include "..." search starts here:
@@ -172,4 +175,21 @@ Path in project `.vscode/arduino.json`
172175
Code: [src/deviceContext.ts](src/deviceContext.ts)
173176
Validator: [misc/arduinoValidator.json](misc/arduinoValidator.json)
174177

175-
### Global Tasks in vscode-arduino
178+
### General Tasks
179+
#### Removing existing Attempts which mess with c_cpp_properties.json or Intellisense
180+
181+
Remove these as they are helpless attempts to get IntelliSense working:
182+
```ts
183+
//src/arduino/arduino.ts
184+
tryToUpdateIncludePaths()
185+
addLibPath(libraryPath: string)
186+
getDefaultForcedIncludeFiles()
187+
// parts in
188+
openExample()
189+
190+
//probably not needed anymore:
191+
getDefaultPackageLibPaths()
192+
193+
```
194+
Remove this as this messes in an unpredictable and helpless way with Intellisense
195+
[src/langService/completionProvider.ts](src/langService/completionProvider.ts)

0 commit comments

Comments
 (0)