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: DEVGUIDE.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,6 +147,22 @@ Linux/macOS:
147
147
export TEST_UPDATE_BSL=1
148
148
```
149
149
150
+
## Automated Source Code Formatting
151
+
152
+
Some of the code in this repository is formatted automatically by [Fantomas](https://github.com/fsprojects/fantomas). To format all files use:
153
+
154
+
```cmd
155
+
dotnet fantomas src/fsharp -r
156
+
```
157
+
158
+
The formatting is checked automatically by CI:
159
+
160
+
```cmd
161
+
dotnet fantomas src/fsharp -r --check
162
+
```
163
+
164
+
At the time of writing only a subset of signature files (`*.fsi`) are formatted. See the settings in `.fantomasignore` and `.editorconfig`.
165
+
150
166
## Developing the F# tools for Visual Studio
151
167
152
168
As you would expect, doing this requires both Windows and Visual Studio are installed.
@@ -191,6 +207,20 @@ To fix this, delete these folders:
191
207
192
208
Where `<version>` corresponds to the latest Visual Studio version on your machine.
193
209
210
+
## Coding conventions
211
+
212
+
* Coding conventions vary from file to file
213
+
214
+
* Format using [the F# style guide](https://docs.microsoft.com/en-us/dotnet/fsharp/style-guide/)
215
+
216
+
* Avoid tick identifiers like `body'`. They are generally harder to read and can't be inspected in the debugger as things stand. Generaly use R suffix instead, e.g. `bodyR`. The R can stand for "rewritten" or "result"
217
+
218
+
* Avoid abbreviations like `bodyty` that run together lowercase are bad, really hard to head for newcomers. Use `bodyTy` instead.
219
+
220
+
* See the comiler docs for common abbreviations
221
+
222
+
* Don't use `List.iter` and `Array.iter` in the compiler, a `for ... do ...` loop is simpler to read and debug
223
+
194
224
## Performance and debugging
195
225
196
226
Use the `Debug` configuration to test your changes locally. It is the default. Do not use the `Release` configuration! Local development and testing of Visual Studio tooling is not designed for the `Release` configuration.
0 commit comments