-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
85 lines (54 loc) · 3.9 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
EXTENSION:
Outstanding ISSUES with highlighed html tags:
The following highlight selection: |text <dog>| - will result in the selection to be changed to |text <dogs|> and the inversion will result in |text >=dogs|>
this is difficult to fix as <if="|condition">| needs to have the selection to be changed to <if="|condition"|>
Likewise, text |<div>div content</div>| will result in the selection to be changed to <|div>div content</div>| and the inversion will result in <|div<=div content</div>|
this originates from a similar problem to the fact that |<div if="condition|"> needs to have the selection changed to <|div if="condition|"> to be inverted correctly
The ONLY way the above can be fixed is having one side of the cursor selection to be changed by what is on the other side of the selection.
On multiline statements, if a condition indicator is not on the same line as the condition and the cursor has been selected (not highlighted) after the condition word, it will not be inverted:
if (
condition|
)
Will result in:
if (
condition|
)
the reason for this is because if there selected cursor is after a word, it will not traverse upwards to find the condition indicator (for performance), hence the following is sent to
the inverter:
condition\n)
which is not inverted
vscode:prepublish is using esbuild to bundle and minify the code into a single file. It exports the file to out/extension.js. The reason why it
is using that path is because the 'main' property inside the package.json file as well as being the export entry file, is also used for code coverage,
hence the file pointing at main needs to be the unminified for test coverage and minified for publishing the extension
additionally not using the following:
"esbuild:watch": "npm run esbuild:base -- --sourcemap --watch"
because it does not automatically recompile test files
compile is not using the following:
tsc --build ./ and tsc -p ./ are run before each test because tsc --build ./ compiles the extension files and the shared directory files, however tsc -p ./ compilation is required
for all files to be analyzed by code coverage
WEBSITE:
the website has an alternative top right logo that is a github corner, however decided to not use it as we need to use a vscode logo as well
currently not detecting the language used, but can implement this via:
https://www.npmjs.com/package/lang-detector
Suggestions:
If removing the brackets along with the exclamation marks is too much:
E.g:
if (!(hello)) = if (hello)
The code can easily be changed to fit this by simply removing the code at REF - 1889
KNOWLEDGE:
if test coverage is not meeting the threshold exclusively in Windows, need to make sure that the imports from shared/inverter are module paths and not relative paths
e.g. for code:
change :import { Tokens } from '../../../../../../../../shared/inverter/src/shared/types/tokens';
to: import { Tokens } from 'shared/inverter/src/shared/types/tokens';
for tests:
change: import { Inverter } from '../../../../../shared/out/inverter/src/inverter';
to: import { Inverter } from 'shared/inverter/src/inverter';
STRATEGY:
REF - 1334
When the user has highlighted or selected an arbitrary position within a line, the algorithm attempts to expand and find the closest condition indicator on the left and right,
however to not have to traverse upwards and downwards infinitely, it looks for the first non space token on each side and then attempts to find the condition indicator on that line
REF - 1335
Strategy for extending user cursor selection in VSCode exntension when working with HTML:
If cursor is between >|<, selection is extended to both sides to prevent symbol inversion by the inverter |><|
If cursor is at start of editor and the first token is < or end of editor and last token is >, do not include them in the selection - e.g. |< changed to <| and >| changed to |>
If cursor is beside < or > - the general strategy (as above) is to not include them in the selection