Skip to content

Commit 1269a9b

Browse files
committed
Enable full solution background analysis
- Adds 2 new background analysis scope options: one for compiler diagnostics and one for analyzer diagnostics - Both the options allow the same set of values as in VS: Open documents, Entire solution, Current document and None (disabled). Currently, `Current document` option is not yet supported in LSP as we do not have a way to know which is the current active document in LSP server. - Builds on top of dotnet/roslyn#68799 - Needs couple more Roslyn side changes as a follow-up: dotnet/roslyn#68797 and dotnet/roslyn#68798
1 parent eb0d88d commit 1269a9b

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,42 @@
12741274
"description": "Show regular expressions in completion list.",
12751275
"order": 20
12761276
},
1277+
"dotnet.backgroundAnalysis.solutionCrawlerBackgroundAnalysisScope": {
1278+
"type": "string",
1279+
"enum": [
1280+
"activeFile",
1281+
"openFiles",
1282+
"fullSolution",
1283+
"none"
1284+
],
1285+
"default": "openFiles",
1286+
"enumDescriptions": [
1287+
"Current document (not yet supported)",
1288+
"Open documents",
1289+
"Entire solution",
1290+
"None"
1291+
],
1292+
"description": "Run background code analysis for:",
1293+
"order": 30
1294+
},
1295+
"dotnet.backgroundAnalysis.compilerDiagnosticsScope": {
1296+
"type": "string",
1297+
"enum": [
1298+
"activeFile",
1299+
"openFiles",
1300+
"fullSolution",
1301+
"none"
1302+
],
1303+
"default": "openFiles",
1304+
"enumDescriptions": [
1305+
"Current document (not yet supported)",
1306+
"Open documents",
1307+
"Entire solution",
1308+
"None"
1309+
],
1310+
"description": "Show compiler errors and warnings for:",
1311+
"order": 30
1312+
},
12771313
"dotnet.highlighting.highlightRelatedRegexComponents": {
12781314
"type": "boolean",
12791315
"default": "true",

test/unitTests/lspToolHost/configurationMiddleware.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const testData = [
4545
{ serverOption: "csharp|code_style.formatting.indentation_and_spacing.indent_style", vsCodeConfiguration: "codeStyle.formatting.indentationAndSpacing.indentStyle", declareInPackageJson: false},
4646
{ serverOption: "csharp|code_style.formatting.new_line.end_of_line", vsCodeConfiguration: "codeStyle.formatting.newLine.endOfLine", declareInPackageJson: false},
4747
{ serverOption: "code_style.formatting.new_line.insert_final_newline", vsCodeConfiguration: "codeStyle.formatting.newLine.insertFinalNewline", declareInPackageJson: false},
48+
{ serverOption: "mystery_language|background_analysis.dotnet_solution_crawler_background_analysis_scope", vsCodeConfiguration: "dotnet.backgroundAnalysis.solutionCrawlerBackgroundAnalysisScope", declareInPackageJson: true},
49+
{ serverOption: "mystery_language|background_analysis.dotnet_compiler_diagnostics_scope", vsCodeConfiguration: "dotnet.backgroundAnalysis.compilerDiagnosticsScope", declareInPackageJson: true},
4850
];
4951

5052
suite("Server option name to vscode configuration name test", () => {

0 commit comments

Comments
 (0)