diff --git a/package.json b/package.json index 4a1b3609cb..f468886cb4 100644 --- a/package.json +++ b/package.json @@ -1682,6 +1682,12 @@ "default": null, "description": "%configuration.dotnet.server.crashDumpPath%" }, + "dotnet.server.enableXamlIntellisense": { + "scope": "machine-overridable", + "type": "boolean", + "default": false, + "description": "%configuration.dotnet.server.enableXamlIntellisense%" + }, "dotnet.projects.binaryLogPath": { "scope": "machine-overridable", "type": "string", diff --git a/package.nls.json b/package.nls.json index 64631920a2..dc67523e4f 100644 --- a/package.nls.json +++ b/package.nls.json @@ -34,6 +34,7 @@ "configuration.dotnet.server.trace": "Sets the logging level for the language server", "configuration.dotnet.server.extensionPaths": "Override for path to language server --extension arguments", "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.", + "configuration.dotnet.server.enableXamlIntellisense": "[Experimental] Enables Intellisense for XAML files", "configuration.dotnet.projects.enableAutomaticRestore": "Enables automatic NuGet restore if the extension detects assets are missing.", "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)", "configuration.dotnet.implementType.insertionBehavior": "The insertion location of properties, events, and methods When implement interface or abstract class.", diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index 00aba4801c..9023667451 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -819,10 +819,12 @@ export class RoslynLanguageServer { args.push('--sessionId', getSessionId()); - // Also include the Xaml Dev Kit extensions - getComponentPaths('xamlDesignTools', languageServerOptions).forEach((path) => - additionalExtensionPaths.push(path) - ); + // Also include the Xaml Dev Kit extensions, if enabled. + if (languageServerOptions.enableXamlIntellisense) { + getComponentPaths('xamlDesignTools', languageServerOptions).forEach((path) => + additionalExtensionPaths.push(path) + ); + } return args; } diff --git a/src/shared/options.ts b/src/shared/options.ts index 26a4476f99..816b86aa9f 100644 --- a/src/shared/options.ts +++ b/src/shared/options.ts @@ -78,6 +78,7 @@ export interface LanguageServerOptions { readonly analyzerDiagnosticScope: string; readonly compilerDiagnosticScope: string; readonly componentPaths: { [key: string]: string } | null; + readonly enableXamlIntellisense: boolean; } export interface RazorOptions { @@ -401,6 +402,9 @@ class LanguageServerOptionsImpl implements LanguageServerOptions { public get componentPaths() { return readOption<{ [key: string]: string }>('dotnet.server.componentPaths', {}); } + public get enableXamlIntellisense() { + return readOption('dotnet.server.enableXamlIntellisense', false); + } } class RazorOptionsImpl implements RazorOptions { @@ -494,4 +498,6 @@ export const LanguageServerOptionsThatTriggerReload: ReadonlyArray