Skip to content

Adds an option to disable auto insert #7381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@
- Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876)

# 2.60.x
* Update Roslyn to 4.13.0-3.24604.4 (PR: [#7381](https://github.com/dotnet/vscode-csharp/pull/7381))
* Add option to disable LSP-based auto insert (PR: [#75224](https://github.com/dotnet/roslyn/pull/75224))
* Report errors processing messages in the build host (PR: [#76252](https://github.com/dotnet/roslyn/pull/76252))
* Update FAR and Go to Def to work on indexers (PR: [#76220](https://github.com/dotnet/roslyn/pull/76220))
* Fix NFW thrown when refreshing source generated files (PR: [#76240](https://github.com/dotnet/roslyn/pull/76240))
* Update find-refs to find references to Dispose in a using-statement (PR: [#76221](https://github.com/dotnet/roslyn/pull/76221))
* Add support for 'find refs' finding references to 'dynamic' (PR: [#76118](https://github.com/dotnet/roslyn/pull/76118))
* Support implementing protected members in implement interface (PR: [#76178](https://github.com/dotnet/roslyn/pull/76178))
* Do not treat Task.Run methods as 'apparent' for 'use var' (PR: [#76229](https://github.com/dotnet/roslyn/pull/76229))
* Support introduce variable at the top level (PR: [#76218](https://github.com/dotnet/roslyn/pull/76218))
* Fix switch indentation for list patterns (PR: [#75953](https://github.com/dotnet/roslyn/pull/75953))
* Keep member bodies when converting DIM property to method (PR: [#76186](https://github.com/dotnet/roslyn/pull/76186))
* Have go-to-def flip between partial definition and implementation (PR: [#76187](https://github.com/dotnet/roslyn/pull/76187))
* Disable 'use coalesce expression' when statements cross a PP boundary (PR: [#76173](https://github.com/dotnet/roslyn/pull/76173))
* Support name completion on generic types (PR: [#76170](https://github.com/dotnet/roslyn/pull/76170))
* Improve extract-local-function in the presence of pp directives (PR: [#76169](https://github.com/dotnet/roslyn/pull/76169))
* Fix issue trying to generate fields/properties from a top level program (PR: [#76161](https://github.com/dotnet/roslyn/pull/76161))
* Update 'introduce using' to support expression statements (PR: [#76147](https://github.com/dotnet/roslyn/pull/76147))
* Use implicit initializer if present to generate type properties (PR: [#76162](https://github.com/dotnet/roslyn/pull/76162))
* Fix issue with explicit interface completion and static interface members (PR: [#76150](https://github.com/dotnet/roslyn/pull/76150))
* When converting to raw strings, do not change \r\n sequences if not explicitly requested by the user (PR: [#76120](https://github.com/dotnet/roslyn/pull/76120))
* Exclude starting symbol when going to implementations if we find implementations (PR: [#76125](https://github.com/dotnet/roslyn/pull/76125))
* Add option to disable auto insertion of documentation comments (PR: [#7381](https://github.com/dotnet/vscode-csharp/pull/7381))
* Bump xamltools to 17.13.35604.65 (PR: [#7848](https://github.com/dotnet/vscode-csharp/pull/7848))

# 2.59.x
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
},
"defaults": {
"roslyn": "4.13.0-3.24577.4",
"roslyn": "4.13.0-3.24604.4",
"omniSharp": "1.39.11",
"razor": "9.0.0-preview.24569.4",
"razorOmnisharp": "7.0.0-preview.23363.1",
Expand Down Expand Up @@ -733,6 +733,11 @@
"title": "Text Editor",
"order": 1,
"properties": {
"dotnet.autoInsert.enableAutoInsert": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will auto insert be used for more than doc comments? Perhaps the settings should be dotnet.autoInsert.insertDocComments imagining that certain auto inserts might be disabled without disabling all auto inserts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do just want one big switch, then I would suggest dotnet.autoInsert.enabled

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"type": "boolean",
"default": true,
"description": "%configuration.dotnet.autoInsert.enableAutoInsert%"
},
"dotnet.typeMembers.memberInsertionLocation": {
"type": "string",
"enum": [
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"command.dotnet.test.runTestsInContext": "Run Tests in Context",
"command.dotnet.test.debugTestsInContext": "Debug Tests in Context",
"command.dotnet.restartServer": "Restart Language Server",
"configuration.dotnet.autoInsert.enableAutoInsert": "Enable automatic insertion of documentation comments.",
"configuration.dotnet.defaultSolution.description": "The path of the default solution to be opened in the workspace, or set to 'disable' to skip it. (Previously `omnisharp.defaultLaunchSolution`)",
"configuration.dotnet.server.path": "Specifies the absolute path to the server (LSP or O#) executable. When left empty the version pinned to the C# Extension is used. (Previously `omnisharp.path`)",
"configuration.dotnet.server.componentPaths": "Allows overriding the folder path for built in components of the language server (for example, override the .roslynDevKit path in the extension directory to use locally built components)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,13 @@ describe(`Go To Implementation Tests`, () => {
const requestPosition = new vscode.Position(4, 22);
const implementationList = await getImplementations(requestPosition);

expect(implementationList).toHaveLength(3);
expect(implementationList).toHaveLength(2);

expect(implementationList[0].uri.path).toContain('BaseClassImplementation.cs');
expect(implementationList[0].range).toStrictEqual(new vscode.Range(2, 17, 2, 40));

expect(implementationList[1].uri.path).toContain('implementation.cs');
expect(implementationList[1].range).toStrictEqual(new vscode.Range(4, 17, 4, 26));

expect(implementationList[2].uri.path).toContain('implementation.cs');
expect(implementationList[2].range).toStrictEqual(new vscode.Range(5, 17, 5, 26));
expect(implementationList[1].range).toStrictEqual(new vscode.Range(5, 17, 5, 26));
});
});

Expand Down
6 changes: 6 additions & 0 deletions test/lsptoolshost/unitTests/configurationMiddleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ const testData = [
vsCodeConfiguration: null,
declareInPackageJson: false,
},
{
serverOption: 'csharp|auto_insert.dotnet_enable_auto_insert',
vsCodeConfiguration: 'dotnet.autoInsert.enableAutoInsert',
declareInPackageJson: true,
section: editorBehaviorSection,
},
];

describe('Server option name to vscode configuration name test', () => {
Expand Down
Loading