Skip to content

Commit 1b51a03

Browse files
committed
Add option gating xaml intellisense
1 parent 3393e96 commit 1b51a03

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,12 @@
16821682
"default": null,
16831683
"description": "%configuration.dotnet.server.crashDumpPath%"
16841684
},
1685+
"dotnet.server.enableXamlIntellisense": {
1686+
"scope": "machine-overridable",
1687+
"type": "boolean",
1688+
"default": false,
1689+
"description": "%configuration.dotnet.server.enableXamlIntellisense%"
1690+
},
16851691
"dotnet.projects.binaryLogPath": {
16861692
"scope": "machine-overridable",
16871693
"type": "string",

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"configuration.dotnet.server.trace": "Sets the logging level for the language server",
3535
"configuration.dotnet.server.extensionPaths": "Override for path to language server --extension arguments",
3636
"configuration.dotnet.server.crashDumpPath": "Sets a folder path where crash dumps are written to if the language server crashes. Must be writeable by the user.",
37+
"configuration.dotnet.server.enableXamlIntellisense": "[Experimental] Enables Intellisense for XAML files when using C# Dev Kit",
3738
"configuration.dotnet.projects.enableAutomaticRestore": "Enables automatic NuGet restore if the extension detects assets are missing.",
3839
"configuration.dotnet.preferCSharpExtension": "Forces projects to load with the C# extension only. This can be useful when using legacy project types that are not supported by C# Dev Kit. (Requires window reload)",
3940
"configuration.dotnet.implementType.insertionBehavior": "The insertion location of properties, events, and methods When implement interface or abstract class.",

src/lsptoolshost/roslynLanguageServer.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -819,10 +819,12 @@ export class RoslynLanguageServer {
819819

820820
args.push('--sessionId', getSessionId());
821821

822-
// Also include the Xaml Dev Kit extensions
823-
getComponentPaths('xamlDesignTools', languageServerOptions).forEach((path) =>
824-
additionalExtensionPaths.push(path)
825-
);
822+
// Also include the Xaml Dev Kit extensions, if enabled.
823+
if (languageServerOptions.enableXamlIntellisense) {
824+
getComponentPaths('xamlDesignTools', languageServerOptions).forEach((path) =>
825+
additionalExtensionPaths.push(path)
826+
);
827+
}
826828
return args;
827829
}
828830

src/shared/options.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export interface LanguageServerOptions {
7878
readonly analyzerDiagnosticScope: string;
7979
readonly compilerDiagnosticScope: string;
8080
readonly componentPaths: { [key: string]: string } | null;
81+
readonly enableXamlIntellisense: boolean;
8182
}
8283

8384
export interface RazorOptions {
@@ -401,6 +402,9 @@ class LanguageServerOptionsImpl implements LanguageServerOptions {
401402
public get componentPaths() {
402403
return readOption<{ [key: string]: string }>('dotnet.server.componentPaths', {});
403404
}
405+
public get enableXamlIntellisense() {
406+
return readOption<boolean>('dotnet.server.enableXamlIntellisense', false);
407+
}
404408
}
405409

406410
class RazorOptionsImpl implements RazorOptions {
@@ -494,4 +498,6 @@ export const LanguageServerOptionsThatTriggerReload: ReadonlyArray<keyof Languag
494498
'logLevel',
495499
'documentSelector',
496500
'preferCSharpExtension',
501+
'componentPaths',
502+
'enableXamlIntellisense',
497503
];

0 commit comments

Comments
 (0)