Skip to content

Commit 2dacdf1

Browse files
xperiandriclaude
andcommitted
Add a backgroundTask snippet
Expands and surrounds like `task`, for code that has to run off the caller's context. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent c337cc0 commit 2dacdf1

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

‎docs/release-notes/.VisualStudio/18.vNext.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
* Code-fixes for FS3888 (compiler-semantic attribute on the `.fs` but not the `.fsi`): copy the attribute into the `.fsi`, or remove it from the `.fs`. ([Issue #19560](https://github.com/dotnet/fsharp/issues/19560), [PR #19880](https://github.com/dotnet/fsharp/pull/19880))
44
* Expand `<inheritdoc/>` in IDE tooltips, completion, and signature help, inheriting XML documentation from base classes, interfaces, overridden members, and constructors. ([Issue #19175](https://github.com/dotnet/fsharp/issues/19175), [PR #19188](https://github.com/dotnet/fsharp/pull/19188))
5-
* Code snippets for F#: **Insert Snippet** (Ctrl+K,Ctrl+X), **Surround With** (Ctrl+K,Ctrl+S), Tab expansion of a snippet shortcut, and 40 built-in snippets listed under **Tools ▸ Code Snippets Manager**. `ctor` and `equals` fill in the enclosing type name, and `match` generates the cases of the union or enum it is given. ([Issue #1498](https://github.com/dotnet/fsharp/issues/1498), [PR #20521](https://github.com/dotnet/fsharp/pull/20521))
5+
* Code snippets for F#: **Insert Snippet** (Ctrl+K,Ctrl+X), **Surround With** (Ctrl+K,Ctrl+S), Tab expansion of a snippet shortcut, and 41 built-in snippets listed under **Tools ▸ Code Snippets Manager**. `ctor` and `equals` fill in the enclosing type name, and `match` generates the cases of the union or enum it is given. ([Issue #1498](https://github.com/dotnet/fsharp/issues/1498), [PR #20521](https://github.com/dotnet/fsharp/pull/20521))
66

77
### Fixed
88

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
3+
<CodeSnippet Format="1.0.0">
4+
<Header>
5+
<Title>backgroundTask</Title>
6+
<Shortcut>backgroundTask</Shortcut>
7+
<Description>Code snippet for a backgroundTask expression</Description>
8+
<Author>Microsoft Corporation</Author>
9+
<SnippetTypes>
10+
<SnippetType>Expansion</SnippetType>
11+
<SnippetType>SurroundsWith</SnippetType>
12+
</SnippetTypes>
13+
</Header>
14+
<Snippet>
15+
<Code Language="FSharp"><![CDATA[backgroundTask {
16+
$selected$$end$
17+
}]]></Code>
18+
</Snippet>
19+
</CodeSnippet>
20+
</CodeSnippets>

‎vsintegration/tests/FSharp.Editor.Tests/Snippets/SnippetCatalogTests.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ type SnippetCatalogTests() =
132132

133133
[<Fact>]
134134
member _.``The catalog ships the snippets the registration promises``() =
135-
Assert.Equal(40, SnippetCatalog.files.Length)
135+
Assert.Equal(41, SnippetCatalog.files.Length)
136136
Assert.True(File.Exists SnippetCatalog.indexPath, $"missing {SnippetCatalog.indexPath}")
137137

138138
[<Fact>]

0 commit comments

Comments
 (0)