-`;
- }
-
- // Protected for testing
- protected sanitize(content: string) {
- const user = process.env.USERNAME === undefined ? process.env.USER : process.env.USERNAME;
-
- if (user === undefined) {
- // Couldn't determine user, therefore can't truly sanitize the content.
- return content;
- }
-
- const replacer = new RegExp(user, 'g');
- const sanitizedContent = content.replace(replacer, 'anonymous');
- return sanitizedContent;
- }
-
- // Protected for testing
- protected async getRazor(document: vscode.TextDocument) {
- const content = document.getText();
-
- return content;
- }
-
- // Protected for testing
- protected async getProjectedCSharp(razorDocument: IRazorDocument) {
- let csharpContent = `////////////////////// Projected CSharp as seen by extension ///////////////////////
-${razorDocument.csharpDocument.getContent()}
-
-
-////////////////////// Projected CSharp as seen by VSCode ///////////////////////`;
-
- try {
- const csharpTextDocument = await this.vscodeApi.workspace.openTextDocument(razorDocument.csharpDocument.uri);
- if (csharpTextDocument) {
- csharpContent = `${csharpContent}
-${csharpTextDocument.getText()}`;
- } else {
- csharpContent = `${csharpContent}
-Unable to resolve VSCode's version of CSharp`;
- }
- } catch (e) {
- csharpContent = `${csharpContent}
-Unable to resolve VSCode's version of CSharp`;
- }
-
- return csharpContent;
- }
-
- // Protected for testing
- protected async getProjectedHtml(razorDocument: IRazorDocument) {
- let htmlContent = `////////////////////// Projected Html as seen by extension ///////////////////////
-${razorDocument.htmlDocument.getContent()}
-
-
-////////////////////// Projected Html as seen by VSCode ///////////////////////`;
-
- try {
- const htmlTextDocument = await this.vscodeApi.workspace.openTextDocument(razorDocument.htmlDocument.uri);
- if (htmlTextDocument) {
- htmlContent = `${htmlContent}
-${htmlTextDocument.getText()}`;
- } else {
- htmlContent = `${htmlContent}
-Unable to resolve VSCode's version of Html`;
- }
- } catch (e) {
- htmlContent = `${htmlContent}
-Unable to resolve VSCode's version of Html`;
- }
-
- return htmlContent;
- }
-
- // Protected for testing
- protected getExtensionVersion(): string {
- const extension = this.vscodeApi.extensions.getExtension(razorExtensionId);
- if (!extension) {
- return 'Unable to find Razor extension version.';
- }
- return extension.packageJSON.version;
- }
-
- // Protected for testing
- protected getInstalledExtensions() {
- const extensions: Array> = this.vscodeApi.extensions.all
- .filter(extension => extension.packageJSON.isBuiltin === false);
-
- return extensions.sort((a, b) =>
- a.packageJSON.name.toLowerCase().localeCompare(b.packageJSON.name.toLowerCase()));
- }
-
- // Protected for testing
- protected generateExtensionTable() {
- const extensions = this.getInstalledExtensions();
- if (extensions.length <= 0) {
- return 'none';
- }
-
- const tableHeader = `|Extension|Author|Version|${os.EOL}|---|---|---|`;
- const table = extensions.map(
- (e) => `|${e.packageJSON.name}|${e.packageJSON.publisher}|${e.packageJSON.version}|`).join(os.EOL);
-
- const extensionTable = `
-${tableHeader}${os.EOL}${table};
-`;
-
- return extensionTable;
- }
-
- private getDotnetInfo(): Promise {
- return new Promise((resolve, reject) => {
- try {
- cp.exec('dotnet --info', { cwd: process.cwd(), maxBuffer: 500 * 1024 }, (error, stdout, stderr) => {
- if (error) {
- reject(error);
- } else if (stderr && stderr.length > 0) {
- reject(error);
- } else {
- resolve(stdout);
- }
- });
- } catch (error) {
- reject(error);
- }
- });
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Diagnostics/ReportIssueDataCollector.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Diagnostics/ReportIssueDataCollector.ts
deleted file mode 100644
index 5cd90c55aed..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Diagnostics/ReportIssueDataCollector.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as os from 'os';
-import * as vscode from 'vscode';
-import { RazorLogger } from '../RazorLogger';
-import { IReportIssueDataCollectionResult } from './IReportIssueDataCollectionResult';
-
-export class ReportIssueDataCollector {
- private readonly logMessages: string[] = [];
- private logOutput = '';
- private focusRegistration: vscode.Disposable | undefined;
- private logRegistration: vscode.Disposable | undefined;
- private lastFocusedRazorDocument: vscode.TextDocument | undefined;
- constructor(
- private readonly razorFileFocusChange: vscode.Event,
- private readonly logger: RazorLogger) {
-
- this.focusRegistration = this.razorFileFocusChange((razorDocument) => this.lastFocusedRazorDocument = razorDocument);
- this.logRegistration = this.logger.onLog(message => this.logMessages.push(message));
-
- this.logger.outputChannel.show(/* preserveFocus: */ true);
- this.logger.logAlways('-- Starting Issue Data Collection-- ');
- }
-
- public stop() {
- this.logger.logAlways('-- Stopping Issue Data Collection-- ');
- this.logOutput = this.logMessages.join(os.EOL);
- this.logMessages.length = 0;
- if (this.focusRegistration) {
- this.focusRegistration.dispose();
- }
- if (this.logRegistration) {
- this.logRegistration.dispose();
- }
- }
-
- public collect(): IReportIssueDataCollectionResult {
- return {
- document: this.lastFocusedRazorDocument,
- logOutput: this.logOutput,
- };
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Diagnostics/ReportIssueDataCollectorFactory.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Diagnostics/ReportIssueDataCollectorFactory.ts
deleted file mode 100644
index 792f282b8f8..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Diagnostics/ReportIssueDataCollectorFactory.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { RazorLanguage } from '../RazorLanguage';
-import { RazorLogger } from '../RazorLogger';
-import { ReportIssueDataCollector } from './ReportIssueDataCollector';
-
-export class ReportIssueDataCollectorFactory {
- private onRazorDocumentFocusedEmitter = new vscode.EventEmitter();
-
- constructor(private readonly logger: RazorLogger) {
- this.onRazorDocumentFocusedEmitter = new vscode.EventEmitter();
- }
-
- public register() {
- return vscode.window.onDidChangeActiveTextEditor((newEditor) => {
- if (newEditor && RazorLanguage.fileExtensions.some(ext => newEditor.document.fileName.endsWith(ext))) {
- this.onRazorDocumentFocusedEmitter.fire(newEditor.document);
- }
- });
- }
-
- public create() {
- const collector = new ReportIssueDataCollector(this.onRazorDocumentFocusedEmitter.event, this.logger);
- return collector;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Diagnostics/ReportIssuePanel.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Diagnostics/ReportIssuePanel.ts
deleted file mode 100644
index e53f9ad06c2..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Diagnostics/ReportIssuePanel.ts
+++ /dev/null
@@ -1,182 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { RazorLogger } from '../RazorLogger';
-import { Trace } from '../Trace';
-import { ReportIssueCreator } from './ReportIssueCreator';
-import { ReportIssueDataCollector } from './ReportIssueDataCollector';
-import { ReportIssueDataCollectorFactory } from './ReportIssueDataCollectorFactory';
-
-export class ReportIssuePanel {
- public static readonly viewType = 'razorReportIssue';
-
- private panel: vscode.WebviewPanel | undefined;
- private dataCollector: ReportIssueDataCollector | undefined;
- private issueContent: string | undefined;
- private traceLevelChange: vscode.Disposable | undefined;
-
- constructor(
- private readonly dataCollectorFactory: ReportIssueDataCollectorFactory,
- private readonly reportIssueCreator: ReportIssueCreator,
- private readonly logger: RazorLogger) {
- }
-
- public async show() {
- if (this.panel) {
- this.panel.reveal(vscode.ViewColumn.Two);
- } else {
- this.panel = vscode.window.createWebviewPanel(
- ReportIssuePanel.viewType,
- 'Report Razor Issue',
- vscode.ViewColumn.Two, {
- enableScripts: true,
- // Disallow any remote sources
- localResourceRoots: [],
- });
- this.attachToCurrentPanel();
- }
-
- await this.update();
- }
-
- public async revive(panel: vscode.WebviewPanel) {
- this.panel = panel;
- this.attachToCurrentPanel();
- await this.update();
- }
-
- private attachToCurrentPanel() {
- if (!this.panel) {
- vscode.window.showErrorMessage('Unexpected error when attaching to report Razor issue window.');
- return;
- }
-
- this.panel.webview.onDidReceiveMessage(async message => {
- switch (message.command) {
- case 'copyIssue':
- if (!this.issueContent) {
- if (!this.dataCollector) {
- vscode.window.showErrorMessage('You must first start the data collection before copying.');
- return;
- }
- const collectionResult = this.dataCollector.collect();
- this.issueContent = await this.reportIssueCreator.create(collectionResult);
- this.dataCollector = undefined;
- }
-
- await vscode.env.clipboard.writeText(this.issueContent);
- vscode.window.showInformationMessage('Razor issue copied to clipboard');
- return;
- case 'startIssue':
- if (this.dataCollector) {
- this.dataCollector.stop();
- this.dataCollector = undefined;
- }
- this.issueContent = undefined;
- this.dataCollector = this.dataCollectorFactory.create();
- vscode.window.showInformationMessage('Razor issue data collection started. Reproduce the issue then press "Stop"');
- return;
- case 'stopIssue':
- if (!this.dataCollector) {
- vscode.window.showErrorMessage('You must first start the data collection before stopping.');
- return;
- }
- this.dataCollector.stop();
- vscode.window.showInformationMessage('Razor issue data collection stopped. Copying issue content...');
- return;
- }
- });
-
- this.traceLevelChange = this.logger.onTraceLevelChange(async () => this.update());
-
- this.panel.onDidDispose(() => {
- if (this.traceLevelChange) {
- this.traceLevelChange.dispose();
- }
- this.panel = undefined;
- });
- }
-
- private async update() {
- if (!this.panel) {
- return;
- }
-
- let panelBodyContent = '';
- if (this.logger.trace.valueOf() === Trace.Verbose) {
- panelBodyContent = `
-
Press
-
Perform the actions (or no action) that resulted in your Razor issue
-
Click . This will copy all relevant issue information.
-
Go to GitHub, paste your issue contents as the body of the issue. Don't forget to fill out any details left unfilled.
-
-
-
Privacy Alert! The contents copied to your clipboard may contain personal data. Prior to posting to
-GitHub, please remove any personal data which should not be publicly viewable.
-https://privacy.microsoft.com/en-US/privacystatement
-
-`;
- } else {
- panelBodyContent = `
Cannot start collecting Razor logs when razor.trace is set to ${Trace[this.logger.trace]}.
-Please set razor.trace to ${Trace[Trace.Verbose]} and then reload your VSCode environment and re-run the report Razor issue command.
-
-`;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Html/HtmlProjectedDocument.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Html/HtmlProjectedDocument.ts
deleted file mode 100644
index 29d608a22b4..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Html/HtmlProjectedDocument.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { IProjectedDocument } from '../Projection/IProjectedDocument';
-import { ServerTextChange } from '../RPC/ServerTextChange';
-import { getUriPath } from '../UriPaths';
-
-export class HtmlProjectedDocument implements IProjectedDocument {
- public readonly path: string;
- private content = '';
- private hostDocumentVersion: number | null = null;
- private projectedDocumentVersion = 0;
-
- public constructor(public readonly uri: vscode.Uri) {
- this.path = getUriPath(uri);
- }
-
- public get hostDocumentSyncVersion(): number | null {
- return this.hostDocumentVersion;
- }
-
- public get projectedDocumentSyncVersion(): number {
- return this.projectedDocumentVersion;
- }
-
- public update(edits: ServerTextChange[], hostDocumentVersion: number) {
- this.hostDocumentVersion = hostDocumentVersion;
-
- if (edits.length === 0) {
- return;
- }
-
- let content = this.content;
- for (const edit of edits.reverse()) {
- // TODO: Use a better data structure to represent the content, string concatenation is slow.
- content = this.getEditedContent(edit.newText, edit.span.start, edit.span.start + edit.span.length, content);
- }
-
- this.setContent(content);
- }
-
- public getContent() {
- return this.content;
- }
-
- public reset() {
- this.projectedDocumentVersion++;
- this.hostDocumentVersion = null;
- this.setContent('');
- }
-
- private getEditedContent(newText: string, start: number, end: number, content: string) {
- const before = content.substr(0, start);
- const after = content.substr(end);
- content = `${before}${newText}${after}`;
-
- return content;
- }
-
- private setContent(content: string) {
- this.projectedDocumentVersion++;
- this.content = content;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Html/HtmlProjectedDocumentContentProvider.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Html/HtmlProjectedDocumentContentProvider.ts
deleted file mode 100644
index ea4ef4c1dd0..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Html/HtmlProjectedDocumentContentProvider.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import { IRazorDocumentChangeEvent } from '../Document/IRazorDocumentChangeEvent';
-import { IRazorDocumentManager } from '../Document/IRazorDocumentManager';
-import { RazorDocumentChangeKind } from '../Document/RazorDocumentChangeKind';
-import { IEventEmitterFactory } from '../IEventEmitterFactory';
-import { RazorLogger } from '../RazorLogger';
-import { getUriPath } from '../UriPaths';
-import * as vscode from '../vscodeAdapter';
-
-export class HtmlProjectedDocumentContentProvider implements vscode.TextDocumentContentProvider {
- public static readonly scheme = 'razor-html';
-
- private readonly onDidChangeEmitter: vscode.EventEmitter;
-
- constructor(
- private readonly documentManager: IRazorDocumentManager,
- eventEmitterFactory: IEventEmitterFactory,
- private readonly logger: RazorLogger) {
- documentManager.onChange((event: IRazorDocumentChangeEvent) => this.documentChanged(event));
- this.onDidChangeEmitter = eventEmitterFactory.create();
- }
-
- public get onDidChange() { return this.onDidChangeEmitter.event; }
-
- public provideTextDocumentContent(uri: vscode.Uri) {
- const razorDocument = this.findRazorDocument(uri);
- if (!razorDocument) {
- // Document was removed from the document manager, meaning there's no more content for this
- // file. Report an empty document.
-
- if (this.logger.verboseEnabled) {
- this.logger.logVerbose(
- `Could not find document '${getUriPath(uri)}' when updating the HTML buffer. This typically happens when a document is removed.`);
- }
- return '';
- }
-
- const content = `${razorDocument.htmlDocument.getContent()}
-// ${razorDocument.htmlDocument.projectedDocumentSyncVersion}`;
-
- return content;
- }
-
- private documentChanged(event: IRazorDocumentChangeEvent) {
- if (event.kind === RazorDocumentChangeKind.htmlChanged ||
- event.kind === RazorDocumentChangeKind.opened ||
- event.kind === RazorDocumentChangeKind.removed) {
- // We also notify changes on document removal in order to tell VSCode that there's no more
- // HTML content for the file.
-
- this.onDidChangeEmitter.fire(event.document.htmlDocument.uri);
- }
- }
-
- private findRazorDocument(uri: vscode.Uri) {
- const projectedPath = getUriPath(uri);
-
- return this.documentManager.documents.find(razorDocument =>
- razorDocument.htmlDocument.path.localeCompare(
- projectedPath, undefined, { sensitivity: 'base' }) === 0);
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Html/HtmlTagCompletionProvider.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Html/HtmlTagCompletionProvider.ts
deleted file mode 100644
index 40c5821191e..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Html/HtmlTagCompletionProvider.ts
+++ /dev/null
@@ -1,175 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import {
- getLanguageService as getHtmlLanguageService,
- LanguageService as HtmlLanguageService,
-} from 'vscode-html-languageservice';
-import { TextDocument as ServiceTextDocument } from 'vscode-languageserver-textdocument';
-import { IRazorDocumentManager } from '../Document/IRazorDocumentManager';
-import { RazorLanguage } from '../RazorLanguage';
-import { RazorLanguageServiceClient } from '../RazorLanguageServiceClient';
-import { LanguageKind } from '../RPC/LanguageKind';
-
-export class HtmlTagCompletionProvider {
- private timeout: NodeJS.Timer | undefined = void 0;
- private enabled = false;
- private htmlLanguageService: HtmlLanguageService | undefined;
-
- constructor(private readonly documentManager: IRazorDocumentManager,
- private readonly serviceClient: RazorLanguageServiceClient) {
- }
-
- public register() {
- this.htmlLanguageService = getHtmlLanguageService();
-
- const onChangeRegistration = vscode.workspace.onDidChangeTextDocument(
- args => this.onDidChangeTextDocument(args.document, args.contentChanges));
-
- const onActiveTextEditorChange = vscode.window.onDidChangeActiveTextEditor(() => this.checkIfEnabled());
-
- this.checkIfEnabled();
-
- return vscode.Disposable.from(onChangeRegistration, onActiveTextEditorChange);
- }
-
- private checkIfEnabled() {
- this.enabled = false;
-
- const editor = vscode.window.activeTextEditor;
- if (!editor) {
- return;
- }
-
- const document = editor.document;
- if (document.languageId !== RazorLanguage.id) {
- return;
- }
-
- if (!vscode.workspace.getConfiguration(void 0, document.uri).get('html.autoClosingTags')) {
- return;
- }
-
- this.enabled = true;
- }
-
- private async onDidChangeTextDocument(
- document: vscode.TextDocument,
- changes: ReadonlyArray) {
- if (!this.enabled) {
- return;
- }
-
- if (changes.length === 0) {
- return;
- }
-
- if (!vscode.window.activeTextEditor || vscode.window.activeTextEditor.document !== document) {
- // Don't trigger for virtual documents
- return;
- }
-
- // At this point we're guarunteed to be looking at the correct document.
- if (this.timeout !== undefined) {
- clearTimeout(this.timeout);
- }
-
- const lastChange = changes[changes.length - 1];
- if (lastChange.rangeLength > 0) {
- // Don't auto-complete self-closing tags when replacing.
- return;
- }
-
- const lastCharacter = lastChange.text[lastChange.text.length - 1];
- if (lastCharacter !== '>') {
- // We only want to operate on open tags
- return;
- }
-
- const rangeStart = lastChange.range.start;
-
- if (rangeStart.character < 2) {
- // Only operate when we're working with a semi-usable tag such as '' where O is some sort of identifier.
- return;
- }
-
- const changeOffset = document.offsetAt(lastChange.range.start);
- let documentContent = document.getText();
- const potentialSelfClosingCharacter = documentContent.charAt(changeOffset - 1);
- if (potentialSelfClosingCharacter === '/' || potentialSelfClosingCharacter === '>') {
- // Tag was already closed or is incomplete no need to auto-complete.
- return;
- }
-
- if (this.atMarkupTransition(documentContent, changeOffset)) {
- // We're at a tag, no need to check if we're operating in a non-HTML area
- // (we want to auto-complete ).
- } else {
- // Check language kind
- const languageResponse = await this.serviceClient.languageQuery(lastChange.range.start, document.uri);
- if (languageResponse.kind !== LanguageKind.Html) {
- // This prevents auto-completion of things like C# generics
- return;
- }
- }
-
- const version = document.version;
-
- // We set a timeout to allow for multi-changes or quick document switches (opening a document then
- // instantly swapping to another) to flow through the system. Basically, if content that would trigger
- // an auto-close occurs we allow a small amount of time for other edits to invalidate the current
- // auto-close task.
- this.timeout = setTimeout(async () => {
- if (!this.enabled) {
- return;
- }
-
- const activeEditor = vscode.window.activeTextEditor;
- if (!activeEditor) {
- return;
- }
- const activeDocument = activeEditor.document;
- if (document !== activeDocument || activeDocument.version !== version) {
- // User has already moved on or the current document was already edited.
- return;
- }
-
- const position = new vscode.Position(rangeStart.line, rangeStart.character + lastChange.text.length);
- if (!this.htmlLanguageService) {
- return;
- }
-
- const razorDoc = await this.documentManager.getActiveDocument();
- if (razorDoc) {
- // The document is guaranteed to be a Razor document
- documentContent = razorDoc.htmlDocument.getContent();
- }
-
- const serviceTextDocument = ServiceTextDocument.create(
- document.uri.fsPath,
- document.languageId,
- document.version,
- documentContent);
- const htmlDocument = this.htmlLanguageService.parseHTMLDocument(serviceTextDocument);
- const tagCompletion = this.htmlLanguageService.doTagComplete(serviceTextDocument, position, htmlDocument);
-
- if (!tagCompletion) {
- return;
- }
-
- const selections = activeEditor.selections;
- if (selections.length && selections.some(s => s.active.isEqual(position))) {
- activeEditor.insertSnippet(new vscode.SnippetString(tagCompletion), selections.map(s => s.active));
- } else {
- activeEditor.insertSnippet(new vscode.SnippetString(tagCompletion), position);
- }
- }, 75);
- }
-
- private atMarkupTransition(documentContent: string, changeOffset: number): boolean {
- return documentContent.substring(changeOffset - ' this.htmlPreviewPanel.show()),
- this.htmlTagCompletionProvider.register(),
- ];
-
- if (vscode.window.registerWebviewPanelSerializer) {
- registrations.push(vscode.window.registerWebviewPanelSerializer(HtmlPreviewPanel.viewType, {
- deserializeWebviewPanel: async (panel: vscode.WebviewPanel) => {
- await this.htmlPreviewPanel.revive(panel);
- },
- }));
- }
-
- return vscode.Disposable.from(...registrations);
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IEventEmitterFactory.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IEventEmitterFactory.ts
deleted file mode 100644
index dbb663e80c5..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IEventEmitterFactory.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/* --------------------------------------------------------------------------------------------
-* Copyright (c) Microsoft Corporation. All rights reserved.
-* Licensed under the MIT License. See License.txt in the project root for license information.
-* ------------------------------------------------------------------------------------------ */
-
-import { EventEmitter } from './vscodeAdapter';
-
-export interface IEventEmitterFactory {
- create: () => EventEmitter;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IRazorProject.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IRazorProject.ts
deleted file mode 100644
index 1c08db4f23f..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IRazorProject.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { IRazorProjectConfiguration } from './IRazorProjectConfiguration';
-
-export interface IRazorProject {
- readonly uri: vscode.Uri;
- readonly path: string;
- readonly configuration?: IRazorProjectConfiguration;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IRazorProjectChangeEvent.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IRazorProjectChangeEvent.ts
deleted file mode 100644
index 2b707aa28ac..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IRazorProjectChangeEvent.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import { IRazorProject } from './IRazorProject';
-import { RazorProjectChangeKind } from './RazorProjectChangeKind';
-
-export interface IRazorProjectChangeEvent {
- readonly project: IRazorProject;
- readonly kind: RazorProjectChangeKind;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IRazorProjectConfiguration.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IRazorProjectConfiguration.ts
deleted file mode 100644
index 7c4a3ea70ef..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/IRazorProjectConfiguration.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-
-export interface IRazorProjectConfiguration {
- readonly path: string;
- readonly uri: vscode.Uri;
- readonly projectPath: string;
- readonly projectUri: vscode.Uri;
- readonly configuration: any;
- readonly rootNamespace: string;
- readonly projectWorkspaceState: any;
- readonly lastUpdated: Date;
- readonly documents: any;
- readonly serializationFormat: string;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Implementation/RazorImplementationProvider.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Implementation/RazorImplementationProvider.ts
deleted file mode 100644
index 9976de6bbbd..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Implementation/RazorImplementationProvider.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { RazorLanguageFeatureBase } from '../RazorLanguageFeatureBase';
-import { LanguageKind } from '../RPC/LanguageKind';
-
-export class RazorImplementationProvider
- extends RazorLanguageFeatureBase
- implements vscode.ImplementationProvider {
-
- public async provideImplementation(
- document: vscode.TextDocument,
- position: vscode.Position,
- token: vscode.CancellationToken) {
-
- const projection = await this.getProjection(document, position, token);
- if (!projection ||
- projection.languageKind === LanguageKind.Html ||
- projection.languageKind === LanguageKind.Razor) {
- // We don't think that javascript implementations are supported by VSCodes HTML support.
- // Since we shim through to them we'll do nothing until we get an ask.
- return;
- }
-
- const implementations = await vscode.commands.executeCommand(
- 'vscode.executeImplementationProvider',
- projection.uri,
- projection.position) as vscode.Location[];
-
- // Omnisharp should have already done all the remapping. Nothing for us to do here.
- return implementations;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Projection/IProjectedDocument.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Projection/IProjectedDocument.ts
deleted file mode 100644
index 643cc2ec438..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Projection/IProjectedDocument.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-
-export interface IProjectedDocument {
- readonly path: string;
- readonly uri: vscode.Uri;
- readonly hostDocumentSyncVersion: number | null;
- readonly projectedDocumentSyncVersion: number;
- getContent(): string;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Projection/ProjectionResult.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Projection/ProjectionResult.ts
deleted file mode 100644
index 0c702fbf9db..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Projection/ProjectionResult.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { LanguageKind } from '../RPC/LanguageKind';
-
-export interface ProjectionResult {
- uri: vscode.Uri;
- position: vscode.Position;
- languageKind: LanguageKind;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/ProposedApisFeature.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/ProposedApisFeature.ts
deleted file mode 100644
index 2087995d31c..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/ProposedApisFeature.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import * as vscodeapi from 'vscode';
-
-export class ProposedApisFeature {
- public async register(vscodeType: typeof vscodeapi, localRegistrations: vscode.Disposable[]) {
- if (vscodeType.env.appName.endsWith('Insiders')) {
- return;
- }
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/LanguageKind.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/LanguageKind.ts
deleted file mode 100644
index e7f58bd75ac..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/LanguageKind.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
- export enum LanguageKind {
- CSharp = 1,
- Html = 2,
- Razor = 3,
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/LanguageQueryRequest.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/LanguageQueryRequest.ts
deleted file mode 100644
index bf6b3081086..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/LanguageQueryRequest.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-
-export class LanguageQueryRequest {
- public readonly uri: string;
-
- constructor(public readonly position: vscode.Position, uri: vscode.Uri) {
- this.uri = uri.toString();
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/LanguageQueryResponse.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/LanguageQueryResponse.ts
deleted file mode 100644
index 149d785eafb..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/LanguageQueryResponse.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { LanguageKind } from './LanguageKind';
-
-export interface LanguageQueryResponse {
- kind: LanguageKind;
- position: vscode.Position;
- positionIndex: number;
- hostDocumentVersion: number | undefined;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/RazorMapToDocumentRangesRequest.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/RazorMapToDocumentRangesRequest.ts
deleted file mode 100644
index 3bdfe31a03f..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/RazorMapToDocumentRangesRequest.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { LanguageKind } from './LanguageKind';
-import { SerializableRange } from './SerializableRange';
-
-export class RazorMapToDocumentRangesRequest {
- public readonly razorDocumentUri: string;
-
- constructor(
- public readonly kind: LanguageKind,
- public readonly projectedRanges: SerializableRange[],
- razorDocumentUri: vscode.Uri) {
- this.razorDocumentUri = razorDocumentUri.toString();
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/RazorMapToDocumentRangesResponse.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/RazorMapToDocumentRangesResponse.ts
deleted file mode 100644
index 6b2eeee63c0..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/RazorMapToDocumentRangesResponse.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-
-export interface RazorMapToDocumentRangesResponse {
- ranges: vscode.Range[];
- hostDocumentVersion: number;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/RazorTextDocumentItem.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/RazorTextDocumentItem.ts
deleted file mode 100644
index b68b339ba2a..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/RazorTextDocumentItem.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-
-export class RazorTextDocumentItem {
- public readonly languageId: string;
- public readonly version: number;
- public readonly text: string;
- public readonly uri: string;
-
- constructor(document: vscode.TextDocument) {
- this.languageId = document.languageId;
- this.version = document.version;
- this.text = document.getText();
- this.uri = document.uri.toString();
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableCreateDocument.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableCreateDocument.ts
deleted file mode 100644
index d0e2ab190c4..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableCreateDocument.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-/* --------------------------------------------------------------------------------------------
-* Copyright (c) Microsoft Corporation. All rights reserved.
-* Licensed under the MIT License. See License.txt in the project root for license information.
-* ------------------------------------------------------------------------------------------ */
-
-export interface SerializableCreateDocument {
- kind: 'create';
- uri: string;
- options: {
- overwrite: boolean;
- ignoreIfExists: boolean;
- };
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableDeleteDocument.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableDeleteDocument.ts
deleted file mode 100644
index a25049fe6a6..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableDeleteDocument.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
- export interface SerializableDeleteDocument {
- kind: 'delete';
- uri: string;
- options: {
- recursive: boolean;
- ignoreIfNotExists: boolean;
- };
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializablePosition.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializablePosition.ts
deleted file mode 100644
index 7da61a9619b..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializablePosition.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-
-// We'd typically just use vscode.Position here; however, that type doesn't serialize properly over the wire.
-export interface SerializablePosition {
- readonly line: number;
- readonly character: number;
-}
-
-export function convertPositionToSerializable(position: vscode.Position): SerializablePosition {
- return {
- line: position.line,
- character: position.character,
- };
-}
-
-export function convertPositionFromSerializable(position: SerializablePosition): vscode.Position {
- return new vscode.Position(position.line, position.character);
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableRange.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableRange.ts
deleted file mode 100644
index 7b97232bffa..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableRange.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/* --------------------------------------------------------------------------------------------
-* Copyright (c) Microsoft Corporation. All rights reserved.
-* Licensed under the MIT License. See License.txt in the project root for license information.
-* ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { convertPositionFromSerializable, convertPositionToSerializable, SerializablePosition } from './SerializablePosition';
-
-// We'd typically just use vscode.Range here; however, that type doesn't serialize properly over the wire.
-export interface SerializableRange {
- readonly start: SerializablePosition;
- readonly end: SerializablePosition;
-}
-
-export function convertRangeToSerializable(range: vscode.Range): SerializableRange {
- return {
- start: convertPositionToSerializable(range.start),
- end: convertPositionToSerializable(range.end),
- };
-}
-
-export function convertRangeFromSerializable(range: SerializableRange): vscode.Range {
- return new vscode.Range(
- convertPositionFromSerializable(range.start),
- convertPositionFromSerializable(range.end));
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableTextDocumentEdit.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableTextDocumentEdit.ts
deleted file mode 100644
index e70cbbe488f..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableTextDocumentEdit.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import { SerializableTextEdit } from './SerializableTextEdit';
-
-export interface SerializableTextDocumentEdit {
- kind: undefined;
- textDocument: {
- uri: string;
- version: number;
- };
- edits: Array;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableTextDocumentIdentifier.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableTextDocumentIdentifier.ts
deleted file mode 100644
index 7216464a442..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableTextDocumentIdentifier.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-export interface SerializableTextDocumentIdentifier {
- uri: string;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableTextEdit.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableTextEdit.ts
deleted file mode 100644
index 5d94fe6ada0..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableTextEdit.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/* --------------------------------------------------------------------------------------------
-* Copyright (c) Microsoft Corporation. All rights reserved.
-* Licensed under the MIT License. See License.txt in the project root for license information.
-* ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { convertRangeFromSerializable, convertRangeToSerializable, SerializableRange } from './SerializableRange';
-
-// We'd typically just use vscode.TextEdit here; however, that type doesn't serialize properly over the wire.
-export interface SerializableTextEdit {
- readonly range: SerializableRange;
- readonly newText: string;
-}
-
-export function convertTextEditToSerializable(textEdit: vscode.TextEdit): SerializableTextEdit {
- return {
- range: convertRangeToSerializable(textEdit.range),
- newText: textEdit.newText,
- };
-}
-
-export function convertTextEditFromSerializable(textEdit: SerializableTextEdit): vscode.TextEdit {
- return new vscode.TextEdit(
- convertRangeFromSerializable(textEdit.range),
- textEdit.newText);
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableWorkspaceEdit.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableWorkspaceEdit.ts
deleted file mode 100644
index 415560cf2b7..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/SerializableWorkspaceEdit.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { SerializableRenameDocument } from '../Rename/SerializableRenameDocument';
-import { SerializableCreateDocument } from './SerializableCreateDocument';
-import { SerializableDeleteDocument } from './SerializableDeleteDocument';
-import { SerializableTextDocumentEdit } from './SerializableTextDocumentEdit';
-import { convertTextEditFromSerializable, SerializableTextEdit } from './SerializableTextEdit';
-
-type SerializableDocumentChange = SerializableCreateDocument | SerializableRenameDocument | SerializableDeleteDocument | SerializableTextDocumentEdit;
-
-export interface SerializableWorkspaceEdit {
- changes?: {[key: string]: Array};
- documentChanges?: Array;
-}
-
-export function convertWorkspaceEditFromSerializable(data: SerializableWorkspaceEdit): vscode.WorkspaceEdit {
- const workspaceEdit = new vscode.WorkspaceEdit();
-
- if (Array.isArray(data.documentChanges)) {
- for (const documentChange of data.documentChanges) {
- if (documentChange.kind === 'create') {
- workspaceEdit.createFile(vscode.Uri.parse(documentChange.uri), documentChange.options);
- } else if (documentChange.kind === 'rename') {
- workspaceEdit.renameFile(vscode.Uri.parse(documentChange.oldUri), vscode.Uri.parse(documentChange.newUri), documentChange.options);
- } else if (documentChange.kind === 'delete') {
- workspaceEdit.deleteFile(vscode.Uri.parse(documentChange.uri), documentChange.options);
- } else {
- const changes = documentChange.edits.map(convertTextEditFromSerializable);
- workspaceEdit.set(vscode.Uri.parse(documentChange.textDocument.uri), changes);
- }
- }
- }
-
- if (data.changes !== undefined) {
- for (const uri in data.changes) {
- if (!data.changes.hasOwnProperty(uri)) {
- continue;
- }
- const changes = data.changes[uri].map(convertTextEditFromSerializable);
- workspaceEdit.set(vscode.Uri.parse(uri), changes);
- }
- }
-
- return workspaceEdit;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/ServerTextChange.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/ServerTextChange.ts
deleted file mode 100644
index d3af53a6f33..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/ServerTextChange.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/* --------------------------------------------------------------------------------------------
-* Copyright (c) Microsoft Corporation. All rights reserved.
-* Licensed under the MIT License. See License.txt in the project root for license information.
-* ------------------------------------------------------------------------------------------ */
-
-import { ServerTextSpan } from './ServerTextSpan';
-
-export interface ServerTextChange {
- readonly newText: string;
- readonly span: ServerTextSpan;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/ServerTextSpan.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/ServerTextSpan.ts
deleted file mode 100644
index 2ee37befa43..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/ServerTextSpan.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-/* --------------------------------------------------------------------------------------------
-* Copyright (c) Microsoft Corporation. All rights reserved.
-* Licensed under the MIT License. See License.txt in the project root for license information.
-* ------------------------------------------------------------------------------------------ */
-
-export interface ServerTextSpan {
- readonly start: number;
- readonly length: number;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/UpdateBufferRequest.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/UpdateBufferRequest.ts
deleted file mode 100644
index 850a6d04b23..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RPC/UpdateBufferRequest.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/* --------------------------------------------------------------------------------------------
-* Copyright (c) Microsoft Corporation. All rights reserved.
-* Licensed under the MIT License. See License.txt in the project root for license information.
-* ------------------------------------------------------------------------------------------ */
-
-import { ServerTextChange } from './ServerTextChange';
-
-export class UpdateBufferRequest {
- constructor(
- public readonly hostDocumentVersion: number,
- public readonly hostDocumentFilePath: string,
- public readonly changes: ServerTextChange[]) {
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorCSharpLanguageMiddleware.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorCSharpLanguageMiddleware.ts
deleted file mode 100644
index d2b60e5dec7..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorCSharpLanguageMiddleware.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { getRazorDocumentUri, isRazorCSharpFile } from './RazorConventions';
-import { RazorLanguageServiceClient } from './RazorLanguageServiceClient';
-import { RazorLogger } from './RazorLogger';
-import { LanguageKind } from './RPC/LanguageKind';
-
-// This interface should exactly match the `LanguageMiddleware` interface defined in Omnisharp.
-// https://github.com/OmniSharp/omnisharp-vscode/blob/master/src/omnisharp/LanguageMiddlewareFeature.ts#L9-L16
-interface LanguageMiddleware {
-
- language: string;
-
- remapWorkspaceEdit?(workspaceEdit: vscode.WorkspaceEdit, token: vscode.CancellationToken): vscode.ProviderResult;
-
- remapLocations?(locations: vscode.Location[], token: vscode.CancellationToken): vscode.ProviderResult;
-}
-
-export class RazorCSharpLanguageMiddleware implements LanguageMiddleware {
- public readonly language = 'Razor';
-
- constructor(
- private readonly serviceClient: RazorLanguageServiceClient,
- private readonly logger: RazorLogger) {}
-
- public async remapWorkspaceEdit(workspaceEdit: vscode.WorkspaceEdit, token: vscode.CancellationToken) {
- const map = new Map();
-
- // The returned edits will be for the projected C# documents. We now need to re-map that to the original document.
- for (const entry of workspaceEdit.entries()) {
- const uri = entry[0];
- const edits = entry[1];
-
- if (!isRazorCSharpFile(uri)) {
- // This edit happens outside of a Razor document. Let the edit go through as is.
- map.set(uri, edits);
- continue;
- }
-
- // We're now working with a Razor CSharp document.
- const documentUri = getRazorDocumentUri(uri);
-
- // Re-map each edit to its position in the original Razor document.
- for (const edit of edits) {
- const remappedResponse = await this.serviceClient.mapToDocumentRanges(
- LanguageKind.CSharp,
- [edit.range],
- documentUri);
-
- if (!remappedResponse ||
- !remappedResponse.ranges ||
- !remappedResponse.ranges[0]) {
- // This is kind of wrong. Workspace edits commonly consist of a bunch of different edits which
- // don't make sense individually. If we try to introspect on them individually there won't be
- // enough context to do anything intelligent. But we also need to know if the edit can just
- // be handled by mapToDocumentRange (something went wrong here), so we ignore the edit.
- this.logger.logWarning(`Unable to remap file ${uri.path} at ${edit.range}.`);
- continue;
- } else {
- const remappedEdit = new vscode.TextEdit(remappedResponse.ranges[0], edit.newText);
-
- this.logger.logVerbose(
- `Re-mapping text ${edit.newText} at ${edit.range} in ${uri.path} to ${remappedResponse.ranges[0]} in ${documentUri.path}`);
-
- this.addElementToDictionary(map, documentUri, remappedEdit);
- }
-
- }
- }
-
- const result = this.mapToTextEdit(map);
- return result;
- }
-
- public async remapLocations(locations: vscode.Location[], token: vscode.CancellationToken) {
- const result: vscode.Location[] = [];
-
- for (const location of locations) {
- if (!isRazorCSharpFile(location.uri)) {
- // This location exists outside of a Razor document. Leave it unchanged.
- result.push(location);
- continue;
- }
-
- // We're now working with a Razor CSharp document.
- const documentUri = getRazorDocumentUri(location.uri);
- const remappedResponse = await this.serviceClient.mapToDocumentRanges(
- LanguageKind.CSharp,
- [location.range],
- documentUri);
-
- if (!remappedResponse ||
- !remappedResponse.ranges ||
- !remappedResponse.ranges[0]) {
- // Something went wrong when re-mapping to the original document. Ignore this location.
- this.logger.logWarning(`Unable to remap file ${location.uri.path} at ${location.range}.`);
- continue;
- }
-
- const newLocation = new vscode.Location(documentUri, remappedResponse.ranges[0]);
- result.push(newLocation);
-
- this.logger.logVerbose(
- `Re-mapping location ${location.range} in ${location.uri.path} to ${remappedResponse.ranges[0]} in ${documentUri.path}`);
- }
-
- return result;
- }
-
- private mapToTextEdit(map: Map): vscode.WorkspaceEdit {
- const result = new vscode.WorkspaceEdit();
- map.forEach((value, key) => {
- result.set(key, value);
- });
-
- return result;
- }
-
- private addElementToDictionary(map: Map, uri: vscode.Uri, edit: vscode.TextEdit) {
- let mapArray: vscode.TextEdit[] | undefined;
-
- if (map.has(uri)) {
- mapArray = map.get(uri);
- if (mapArray) {
- mapArray.push(edit);
- }
- } else {
- const editArray = new Array();
- editArray.push(edit);
- map.set(uri, editArray);
- }
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorConventions.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorConventions.ts
deleted file mode 100644
index 11f3d01f542..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorConventions.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { getUriPath } from './UriPaths';
-
-export const virtualHtmlSuffix = '__virtual.html';
-export const virtualCSharpSuffix = '__virtual.cs';
-export const backgroundVirtualCSharpSuffix = `__bg${virtualCSharpSuffix}`;
-
-export function isRazorCSharpFile(uri: vscode.Uri) {
- const path = getUriPath(uri);
- return path.endsWith(virtualCSharpSuffix);
-}
-
-export function isRazorHtmlFile(uri: vscode.Uri) {
- const path = getUriPath(uri);
- return path.endsWith(virtualHtmlSuffix);
-}
-
-export function getRazorDocumentUri(uri: vscode.Uri) {
- const path = getUriPath(uri);
- let originalDocumentPath = path.replace(backgroundVirtualCSharpSuffix, '');
- originalDocumentPath = originalDocumentPath.replace(virtualCSharpSuffix, '');
- originalDocumentPath = originalDocumentPath.replace(virtualHtmlSuffix, '');
-
- const documentUri = vscode.Uri.file(originalDocumentPath);
- return documentUri;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorExtensionId.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorExtensionId.ts
deleted file mode 100644
index 690ca024144..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorExtensionId.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-// The Razor experience is shipped as part of OmniSharp, this is their extension ID.
-export const razorExtensionId = 'ms-dotnettools.csharp';
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguage.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguage.ts
deleted file mode 100644
index ab2128539ff..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguage.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from './vscodeAdapter';
-
-export class RazorLanguage {
- public static id = 'aspnetcorerazor';
- public static fileExtensions = [ 'cshtml', 'razor' ];
- public static globbingPattern = `**/*.{${RazorLanguage.fileExtensions.join(',')}}`;
- public static documentSelector: vscode.DocumentSelector = { language: this.id, pattern: RazorLanguage.globbingPattern };
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageConfiguration.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageConfiguration.ts
deleted file mode 100644
index 965e1f21b36..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageConfiguration.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { RazorLanguage } from './RazorLanguage';
-
-const VOID_ELEMENTS: string[] = [
- 'area',
- 'base',
- 'br',
- 'col',
- 'embed',
- 'hr',
- 'img',
- 'input',
- 'keygen',
- 'link',
- 'menuitem',
- 'meta',
- 'param',
- 'source',
- 'track',
- 'wbr',
-];
-
-export class RazorLanguageConfiguration {
- public register() {
- const configurationRegistration = vscode.languages.setLanguageConfiguration(RazorLanguage.id, {
- wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
- onEnterRules: [
- {
- beforeText: new RegExp(
- `<(?!(?:${VOID_ELEMENTS.join('|')}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
- afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>/i,
- action: { indentAction: vscode.IndentAction.IndentOutdent },
- },
- {
- beforeText: new RegExp(
- `<(?!(?:${VOID_ELEMENTS.join('|')}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
- action: { indentAction: vscode.IndentAction.Indent },
- },
- ],
- });
-
- return configurationRegistration;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageFeatureBase.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageFeatureBase.ts
deleted file mode 100644
index 62f87c527ab..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageFeatureBase.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { RazorDocumentManager } from './Document/RazorDocumentManager';
-import { RazorDocumentSynchronizer } from './Document/RazorDocumentSynchronizer';
-import { ProjectionResult } from './Projection/ProjectionResult';
-import { RazorLanguageServiceClient } from './RazorLanguageServiceClient';
-import { RazorLogger } from './RazorLogger';
-import { LanguageKind } from './RPC/LanguageKind';
-import { getUriPath } from './UriPaths';
-
-export class RazorLanguageFeatureBase {
- constructor(
- private readonly documentSynchronizer: RazorDocumentSynchronizer,
- protected readonly documentManager: RazorDocumentManager,
- protected readonly serviceClient: RazorLanguageServiceClient,
- protected readonly logger: RazorLogger) {
- }
-
- protected async getProjection(
- document: vscode.TextDocument,
- position: vscode.Position,
- token: vscode.CancellationToken) {
- const languageResponse = await this.serviceClient.languageQuery(position, document.uri);
-
- switch (languageResponse.kind) {
- case LanguageKind.CSharp:
- case LanguageKind.Html:
- const razorDocument = await this.documentManager.getDocument(document.uri);
- const projectedDocument = languageResponse.kind === LanguageKind.CSharp
- ? razorDocument.csharpDocument
- : razorDocument.htmlDocument;
-
- if (languageResponse.hostDocumentVersion === undefined) {
- // There should always be a document version attached to an open document.
- // Log it and move on as if it was synchronized.
- if (this.logger.verboseEnabled) {
- this.logger.logVerbose(
- `Could not find a document version associated with the document '${getUriPath(document.uri)}'.`);
- }
- } else {
- const synchronized = await this.documentSynchronizer.trySynchronizeProjectedDocument(
- document,
- projectedDocument,
- languageResponse.hostDocumentVersion,
- token);
- if (!synchronized) {
- // Could not synchronize
- return null;
- }
- }
-
- const projectedUri = projectedDocument.uri;
- return {
- uri: projectedUri,
- position: languageResponse.position,
- languageKind: languageResponse.kind,
- } as ProjectionResult;
-
- default:
- return null;
- }
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerClient.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerClient.ts
deleted file mode 100644
index f7b225bc296..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerClient.ts
+++ /dev/null
@@ -1,247 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import { EventEmitter } from 'events';
-import * as vscode from 'vscode';
-import {
- RequestHandler,
- RequestType,
-} from 'vscode-jsonrpc';
-import {
- GenericNotificationHandler,
- InitializeResult,
- LanguageClientOptions,
- State,
-} from 'vscode-languageclient';
-import {
- LanguageClient,
- ServerOptions,
-} from 'vscode-languageclient/node';
-import { RazorLanguage } from './RazorLanguage';
-import { RazorLanguageServerOptions } from './RazorLanguageServerOptions';
-import { resolveRazorLanguageServerOptions } from './RazorLanguageServerOptionsResolver';
-import { resolveRazorLanguageServerTrace } from './RazorLanguageServerTraceResolver';
-import { RazorLogger } from './RazorLogger';
-import { TelemetryReporter } from './TelemetryReporter';
-
-const events = {
- ServerStop: 'ServerStop',
-};
-
-export class RazorLanguageServerClient implements vscode.Disposable {
- private clientOptions!: LanguageClientOptions;
- private serverOptions!: ServerOptions;
- private client!: LanguageClient;
- private onStartListeners: Array<() => Promise> = [];
- private onStartedListeners: Array<() => Promise> = [];
- private eventBus: EventEmitter;
- private isStarted: boolean;
- private startHandle: Promise | undefined;
- private stopHandle: Promise | undefined;
-
- constructor(
- private readonly vscodeType: typeof vscode,
- private readonly languageServerDir: string,
- private readonly telemetryReporter: TelemetryReporter,
- private readonly logger: RazorLogger) {
- this.isStarted = false;
-
- this.setupLanguageServer();
-
- this.eventBus = new EventEmitter();
- }
-
- public get initializeResult(): InitializeResult | undefined {
- return this.client.initializeResult;
- }
-
- public updateTraceLevel() {
- const languageServerTrace = resolveRazorLanguageServerTrace(this.vscodeType);
- this.setupLanguageServer();
- this.logger.setTraceLevel(languageServerTrace);
- }
-
- public onStarted(listener: () => Promise) {
- this.onStartedListeners.push(listener);
- }
-
- public onStart(listener: () => Promise) {
- this.onStartListeners.push(listener);
- }
-
- public onStop(listener: () => any) {
- this.eventBus.addListener(events.ServerStop, listener);
-
- const disposable = new vscode.Disposable(() =>
- this.eventBus.removeListener(events.ServerStop, listener));
- return disposable;
- }
-
- public async start() {
- if (this.startHandle) {
- return this.startHandle;
- }
-
- let resolve: () => void = Function;
- let reject: (reason: any) => void = Function;
- this.startHandle = new Promise((resolver, rejecter) => {
- resolve = resolver;
- reject = rejecter;
- });
-
- // Workaround https://github.com/Microsoft/vscode-languageserver-node/issues/472 by tying into state
- // change events to detect when restarts are occuring and then properly reject the Language Server
- // start listeners.
- let restartCount = 0;
- const didChangeStateDisposable = this.client.onDidChangeState((stateChangeEvent: { newState: any; oldState: any; }) => {
- if (stateChangeEvent.oldState === State.Starting && stateChangeEvent.newState === State.Stopped) {
- restartCount++;
-
- if (restartCount === 5) {
- // Timeout, the built-in LanguageClient retries a hardcoded 5 times before giving up. We tie into that
- // and then given up on starting the language server if we can't start by then.
- reject('Server failed to start after retrying 5 times.');
- }
- } else if (stateChangeEvent.newState === State.Running) {
- restartCount = 0;
- }
- });
-
- try {
- this.logger.logMessage('Starting Razor Language Server...');
- await this.client.start();
- this.logger.logMessage('Server started, waiting for client to be ready...');
- this.isStarted = true;
- for (const listener of this.onStartListeners) {
- await listener();
- }
-
- // Succesfully started, notify listeners.
- resolve();
-
- this.logger.logMessage('Server ready!');
- for (const listener of this.onStartedListeners) {
- await listener();
- }
-
- // We don't want to track restart management after the server has been initially started,
- // the language client will handle that.
- didChangeStateDisposable.dispose();
- } catch (error) {
- vscode.window.showErrorMessage(
- 'Razor Language Server failed to start unexpectedly, ' +
- 'please check the \'Razor Log\' and report an issue.');
-
- this.telemetryReporter.reportErrorOnServerStart(error as Error);
- reject(error);
- }
-
- return this.startHandle;
- }
-
- public async sendRequest(method: string, param: any) {
- if (!this.isStarted) {
- throw new Error('Tried to send requests while server is not started.');
- }
-
- return this.client.sendRequest(method, param);
- }
-
- public async onRequestWithParams
(method: RequestType
, handler: RequestHandler
) {
- if (!this.isStarted) {
- throw new Error('Tried to bind on request logic while server is not started.');
- }
-
- this.client.onRequest(method, handler);
- }
-
- public onNotification(method: string, handler: GenericNotificationHandler) {
- if (!this.isStarted) {
- throw new Error('Tried to bind on notification logic while server is not started.');
- }
-
- this.client.onNotification(method, handler);
- }
-
- public dispose() {
- this.logger.logMessage('Disposing Razor Language Server.');
-
- this.isStarted = false;
- this.startHandle = undefined;
- this.eventBus.emit(events.ServerStop);
- }
-
- public async stop() {
- let resolve: () => void = Function;
- let reject: (reason: any) => void = Function;
- this.stopHandle = new Promise((resolver, rejecter) => {
- resolve = resolver;
- reject = rejecter;
- });
-
- if (!this.startHandle) {
- reject(new Error('Cannot stop Razor Language Server as it is already stopped.'));
- }
-
- this.logger.logMessage('Stopping Razor Language Server.');
-
- try {
- if (this.client) {
- await this.client.stop();
- }
-
- this.dispose();
-
- resolve();
- } catch (error) {
- vscode.window.showErrorMessage(
- 'Razor Language Server failed to stop correctly, ' +
- 'please check the \'Razor Log\' and report an issue.');
-
- reject(error);
- }
-
- return this.stopHandle;
- }
-
- private setupLanguageServer() {
- const languageServerTrace = resolveRazorLanguageServerTrace(this.vscodeType);
- const options: RazorLanguageServerOptions = resolveRazorLanguageServerOptions(this.vscodeType, this.languageServerDir, languageServerTrace, this.logger);
-
- this.clientOptions = {
- outputChannel: options.outputChannel,
- documentSelector: [ { language: RazorLanguage.id, pattern: RazorLanguage.globbingPattern } ],
- };
-
- const args: string[] = [];
- let command = options.serverPath;
- if (options.serverPath.endsWith('.dll')) {
- this.logger.logMessage('Razor Language Server path is an assembly. ' +
- 'Using \'dotnet\' from the current path to start the server.');
-
- command = 'dotnet';
- args.push(options.serverPath);
- }
-
- this.logger.logMessage(`Razor language server path: ${options.serverPath}`);
-
- args.push('-lsp');
- args.push('--trace');
-
- this.telemetryReporter.reportTraceLevel(options.trace);
-
- args.push(options.trace.toString());
-
- if (options.debug) {
- this.telemetryReporter.reportDebugLanguageServer();
-
- this.logger.logMessage('Debug flag set for Razor Language Server.');
- args.push('--debug');
- }
-
- this.serverOptions = { command, args };
- this.client = new LanguageClient('razorLanguageServer', 'Razor Language Server', this.serverOptions, this.clientOptions);
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerOptions.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerOptions.ts
deleted file mode 100644
index e18f7389c5e..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerOptions.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { Trace } from './Trace';
-
-export interface RazorLanguageServerOptions {
- serverPath: string;
- outputChannel?: vscode.OutputChannel;
- debug?: boolean;
- trace: Trace;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerOptionsResolver.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerOptionsResolver.ts
deleted file mode 100644
index 46fb9b7b192..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerOptionsResolver.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as fs from 'fs';
-import * as os from 'os';
-import * as path from 'path';
-import { RazorLanguageServerOptions } from './RazorLanguageServerOptions';
-import { RazorLogger } from './RazorLogger';
-import { Trace } from './Trace';
-import * as vscode from './vscodeAdapter';
-
-export function resolveRazorLanguageServerOptions(
- vscodeApi: vscode.api,
- languageServerDir: string,
- trace: Trace,
- logger: RazorLogger) {
- const languageServerExecutablePath = findLanguageServerExecutable(languageServerDir);
- const serverConfig = vscodeApi.workspace.getConfiguration('razor.languageServer');
- const debugLanguageServer = serverConfig.get('debug');
-
- return {
- serverPath: languageServerExecutablePath,
- debug: debugLanguageServer,
- trace,
- outputChannel: logger.outputChannel,
- } as RazorLanguageServerOptions;
-}
-
-function findLanguageServerExecutable(withinDir: string) {
- const extension = isWindows() ? '.exe' : '';
- const executablePath = path.join(
- withinDir,
- `rzls${extension}`);
- let fullPath = '';
-
- if (fs.existsSync(executablePath)) {
- fullPath = executablePath;
- } else {
- // Exe doesn't exist.
- const dllPath = path.join(
- withinDir,
- 'rzls.dll');
-
- if (!fs.existsSync(dllPath)) {
- throw new Error(`Could not find Razor Language Server executable within directory '${withinDir}'`);
- }
-
- fullPath = dllPath;
- }
-
- return fullPath;
-}
-
-function isWindows() {
- return !!os.platform().match(/^win/);
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerTraceResolver.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerTraceResolver.ts
deleted file mode 100644
index 241682c18ce..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServerTraceResolver.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import { Trace } from './Trace';
-import * as vscode from './vscodeAdapter';
-
-export function resolveRazorLanguageServerTrace(vscodeApi: vscode.api) {
- const languageConfig = vscodeApi.workspace.getConfiguration('razor');
- const traceString = languageConfig.get('trace');
- const trace = parseTraceString(traceString);
-
- return trace;
-}
-
-function parseTraceString(traceString: string | undefined) {
- switch (traceString) {
- case 'Off':
- return Trace.Off;
- case 'Messages':
- return Trace.Messages;
- case 'Verbose':
- return Trace.Verbose;
- default:
- console.log('Invalid trace setting for Razor language server. Defaulting to \'Off\'');
- return Trace.Off;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServiceClient.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServiceClient.ts
deleted file mode 100644
index 8bddaa3a9e8..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLanguageServiceClient.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { RazorLanguageServerClient } from './RazorLanguageServerClient';
-import { LanguageKind } from './RPC/LanguageKind';
-import { LanguageQueryRequest } from './RPC/LanguageQueryRequest';
-import { LanguageQueryResponse } from './RPC/LanguageQueryResponse';
-import { RazorMapToDocumentRangesRequest } from './RPC/RazorMapToDocumentRangesRequest';
-import { RazorMapToDocumentRangesResponse } from './RPC/RazorMapToDocumentRangesResponse';
-import { convertRangeFromSerializable, convertRangeToSerializable } from './RPC/SerializableRange';
-import { SemanticTokensRangeRequest } from './Semantic/SemanticTokensRangeRequest';
-
-export class RazorLanguageServiceClient {
- constructor(private readonly serverClient: RazorLanguageServerClient) {
- }
-
- public async languageQuery(position: vscode.Position, uri: vscode.Uri) {
- await this.ensureStarted();
-
- const request = new LanguageQueryRequest(position, uri);
- const response = await this.serverClient.sendRequest('razor/languageQuery', request);
- response.position = new vscode.Position(response.position.line, response.position.character);
- return response;
- }
-
- public async mapToDocumentRanges(languageKind: LanguageKind, ranges: vscode.Range[], uri: vscode.Uri) {
- await this.ensureStarted();
-
- const serializableRanges = [];
- for (const range of ranges) {
- const serializableRange = convertRangeToSerializable(range);
- serializableRanges.push(serializableRange);
- }
-
- const request = new RazorMapToDocumentRangesRequest(languageKind, serializableRanges, uri);
- const response = await this.serverClient.sendRequest('razor/mapToDocumentRanges', request);
- const responseRanges = [];
- for (const range of response.ranges) {
- if (range.start.line >= 0) {
- const remappedRange = convertRangeFromSerializable(response.ranges[0]);
- responseRanges.push(remappedRange);
- }
- }
-
- response.ranges = responseRanges;
- return response;
- }
-
- public async semanticTokensRange(uri: vscode.Uri, range: vscode.Range): Promise {
- await this.ensureStarted();
-
- const request = new SemanticTokensRangeRequest(uri, range);
- const response = await this.serverClient.sendRequest('textDocument/semanticTokens/range', request);
-
- if (response.data && response.data.length > 0) {
- return response;
- }
- }
-
- private async ensureStarted() {
- // If the server is already started this will instantly return.
- await this.serverClient.start();
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLogger.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLogger.ts
deleted file mode 100644
index c1a0b525e8d..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorLogger.ts
+++ /dev/null
@@ -1,147 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as fs from 'fs';
-import * as path from 'path';
-import { IEventEmitterFactory } from './IEventEmitterFactory';
-import { Trace } from './Trace';
-import * as vscode from './vscodeAdapter';
-
-export class RazorLogger implements vscode.Disposable {
- public static readonly logName = 'Razor Log';
- public verboseEnabled!: boolean;
- public messageEnabled!: boolean;
- public readonly outputChannel: vscode.OutputChannel;
-
- private readonly onLogEmitter: vscode.EventEmitter;
- private readonly onTraceLevelChangeEmitter: vscode.EventEmitter;
-
- constructor(
- private readonly vscodeApi: vscode.api,
- eventEmitterFactory: IEventEmitterFactory,
- public trace: Trace) {
- this.processTraceLevel();
- this.onLogEmitter = eventEmitterFactory.create();
- this.onTraceLevelChangeEmitter = eventEmitterFactory.create();
-
- this.outputChannel = this.vscodeApi.window.createOutputChannel(RazorLogger.logName);
-
- this.logRazorInformation();
- }
-
- public setTraceLevel(trace: Trace) {
- this.trace = trace;
- this.processTraceLevel();
- this.logMessage(`Updated trace level to: ${Trace[this.trace]}`);
- this.onTraceLevelChangeEmitter.fire(this.trace);
- }
-
- public get onLog() { return this.onLogEmitter.event; }
-
- public get onTraceLevelChange() { return this.onTraceLevelChangeEmitter.event; }
-
- public logAlways(message: string) {
- this.logWithMarker(message);
- }
-
- public logWarning(message: string) {
- // Always log warnings
- const warningPrefixedMessage = `(Warning) ${message}`;
- this.logAlways(warningPrefixedMessage);
- }
-
- public logError(message: string, error: unknown) {
- if (error instanceof Error) {
- this.logErrorInternal(message, error);
- } else {
- const errorMsg = String(error);
- this.logErrorInternal(message, Error(errorMsg));
- }
- }
-
- public logMessage(message: string) {
- if (this.messageEnabled) {
- this.logWithMarker(message);
- }
- }
-
- public logVerbose(message: string) {
- if (this.verboseEnabled) {
- this.logWithMarker(message);
- }
- }
-
- public dispose() {
- this.outputChannel.dispose();
- }
-
- private logErrorInternal(message: string, error: Error) {
- // Always log errors
- const errorPrefixedMessage = `(Error) ${message}
-${error.message}
-Stack Trace:
-${error.stack}`;
- this.logAlways(errorPrefixedMessage);
- }
-
- private logWithMarker(message: string) {
- const timeString = new Date().toLocaleTimeString();
- const markedMessage = `[Client - ${timeString}] ${message}`;
-
- this.log(markedMessage);
- }
-
- private log(message: string) {
- this.outputChannel.appendLine(message);
-
- this.onLogEmitter.fire(message);
- }
-
- private logRazorInformation() {
- const packageJsonContents = readOwnPackageJson();
-
- this.log(
- '--------------------------------------------------------------------------------');
- this.log(`Razor.VSCode version ${packageJsonContents.defaults.razor}`);
- this.log(
- '--------------------------------------------------------------------------------');
- this.log(`Razor's trace level is currently set to '${Trace[this.trace]}'`);
- this.log(
- ' - To change Razor\'s trace level set \'razor.trace\' to ' +
- '\'Off\', \'Messages\' or \'Verbose\' and then restart VSCode.');
- this.log(
- ' - To report issues invoke the \'Report a Razor issue\' command via the command palette.');
- this.log(
- '-----------------------------------------------------------------------' +
- '------------------------------------------------------');
- this.log('');
- }
-
- private processTraceLevel() {
- this.verboseEnabled = this.trace >= Trace.Verbose;
- this.messageEnabled = this.trace >= Trace.Messages;
- }
-}
-
-function readOwnPackageJson() {
- const packageJsonPath = findInDirectoryOrAncestor(__dirname, 'package.json');
- return JSON.parse(fs.readFileSync(packageJsonPath).toString());
-}
-
-function findInDirectoryOrAncestor(dir: string, filename: string) {
- while (true) {
- const candidate = path.join(dir, filename);
- if (fs.existsSync(candidate)) {
- return candidate;
- }
-
- const parentDir = path.dirname(dir);
- if (parentDir === dir) {
- throw new Error(`Could not find '${filename}' in or above '${dir}'.`);
- }
-
- dir = parentDir;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorProjectChangeKind.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorProjectChangeKind.ts
deleted file mode 100644
index b4d78cb4859..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorProjectChangeKind.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-export enum RazorProjectChangeKind {
- added,
- removed,
- changed,
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Reference/RazorReferenceProvider.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Reference/RazorReferenceProvider.ts
deleted file mode 100644
index c3de466ec16..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Reference/RazorReferenceProvider.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { getRazorDocumentUri, isRazorHtmlFile } from '../RazorConventions';
-import { RazorLanguageFeatureBase } from '../RazorLanguageFeatureBase';
-import { LanguageKind } from '../RPC/LanguageKind';
-
-export class RazorReferenceProvider
- extends RazorLanguageFeatureBase
- implements vscode.ReferenceProvider {
-
- public async provideReferences(
- document: vscode.TextDocument,
- position: vscode.Position,
- context: vscode.ReferenceContext,
- token: vscode.CancellationToken) {
-
- const projection = await this.getProjection(document, position, token);
- if (!projection || projection.languageKind === LanguageKind.Razor) {
- return;
- }
-
- const references = await vscode.commands.executeCommand(
- 'vscode.executeReferenceProvider',
- projection.uri,
- projection.position) as vscode.Location[];
-
- const result = new Array();
- for (const reference of references) {
- if (projection.languageKind === LanguageKind.Html && isRazorHtmlFile(reference.uri)) {
-
- // Because the line pragmas for html are generated referencing the projected document
- // we need to remap their file locations to reference the top level Razor document.
- const razorFile = getRazorDocumentUri(reference.uri);
- result.push(new vscode.Location(razorFile, reference.range));
-
- } else {
- // This means it is one of the following,
- // 1. A .razor/.cshtml file (because OmniSharp already remapped the background C# to the original document)
- // 2. A .cs file
- // 3. A .html/.js file
- // In all of these cases, we don't need to remap. So accept it as is and move on.
- result.push(reference);
- }
- }
-
- return result;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Rename/RazorRenameProvider.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Rename/RazorRenameProvider.ts
deleted file mode 100644
index 18de64b7122..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Rename/RazorRenameProvider.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { RazorDocumentManager } from '../Document/RazorDocumentManager';
-import { RazorDocumentSynchronizer } from '../Document/RazorDocumentSynchronizer';
-import { RazorLanguageFeatureBase } from '../RazorLanguageFeatureBase';
-import { RazorLanguageServiceClient } from '../RazorLanguageServiceClient';
-import { RazorLogger } from '../RazorLogger';
-import { LanguageKind } from '../RPC/LanguageKind';
-
-export class RazorRenameProvider
- extends RazorLanguageFeatureBase
- implements vscode.RenameProvider {
-
- constructor(
- documentSynchronizer: RazorDocumentSynchronizer,
- documentManager: RazorDocumentManager,
- serviceClient: RazorLanguageServiceClient,
- logger: RazorLogger) {
- super(documentSynchronizer, documentManager, serviceClient, logger);
- }
-
- public async prepareRename(
- document: vscode.TextDocument,
- position: vscode.Position,
- token: vscode.CancellationToken) {
-
- const projection = await this.getProjection(document, position, token);
- if (!projection || projection.languageKind !== LanguageKind.CSharp) {
- // We only support C# renames for now. Reject the rename request.
- // Originally we rejected here. However due to how the language
- // server client currently works, if we reject here it prevents
- // other servers from being able to return a response instead.
- // Null is the only return that allows us to handle renaming
- // from the Razor language server.
- return null; // Promise.reject('Cannot rename this symbol.');
- }
-
- // Let the rename go through. OmniSharp doesn't currently support "prepareRename" so we need to utilize document
- // APIs in order to resolve the appropriate rename range.
- const range = document.getWordRangeAtPosition(position);
- return range;
- }
-
- public async provideRenameEdits(
- document: vscode.TextDocument,
- position: vscode.Position,
- newName: string,
- token: vscode.CancellationToken) {
-
- const projection = await this.getProjection(document, position, token);
- if (!projection) {
- return;
- }
-
- if (projection.languageKind !== LanguageKind.CSharp) {
- // We only support C# renames for now.
- return;
- }
-
- // Send a rename command to Omnisharp which in turn would call our command to get the Razor documents re-mapped.
- const response = await vscode.commands.executeCommand(
- 'vscode.executeDocumentRenameProvider',
- projection.uri,
- projection.position,
- newName,
- );
-
- return response;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Rename/SerializableRenameDocument.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Rename/SerializableRenameDocument.ts
deleted file mode 100644
index 91b6f937ad2..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Rename/SerializableRenameDocument.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
- export interface SerializableRenameDocument {
- kind: 'rename';
- oldUri: string;
- newUri: string;
- options: {
- overwrite: boolean;
- ignoreIfExists: boolean;
- };
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/ProvideSemanticTokensResponse.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/ProvideSemanticTokensResponse.ts
deleted file mode 100644
index 5bec77de3a9..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/ProvideSemanticTokensResponse.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import { SemanticTokensResponse } from './SemanticTokensResponse';
-
-export class ProvideSemanticTokensResponse {
- // tslint:disable-next-line: variable-name
- constructor(public Result: SemanticTokensResponse, public HostDocumentSyncVersion: number | null) {}
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/RazorDocumentSemanticTokensProvider.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/RazorDocumentSemanticTokensProvider.ts
deleted file mode 100644
index 0c004f410e6..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/RazorDocumentSemanticTokensProvider.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { RazorLanguageFeatureBase } from '../RazorLanguageFeatureBase';
-
-export class RazorDocumentSemanticTokensProvider
- extends RazorLanguageFeatureBase
- implements vscode.DocumentRangeSemanticTokensProvider {
- public async provideDocumentRangeSemanticTokens(
- document: vscode.TextDocument,
- range: vscode.Range,
- token: vscode.CancellationToken,
- ): Promise {
- let semanticRangeResponse = await this.serviceClient.semanticTokensRange(document.uri, range);
-
- if (semanticRangeResponse) {
- // However we're serializing into Uint32Array doesn't set byteLength, which is checked by some stuff under the covers.
- // Solution? Create a new one, blat it over the old one, go home for the weekend.
- const fixedArray = new Uint32Array(semanticRangeResponse.data);
- semanticRangeResponse = new vscode.SemanticTokens(fixedArray, semanticRangeResponse.resultId);
- }
-
- return semanticRangeResponse;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokens.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokens.ts
deleted file mode 100644
index cc4059dff34..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokens.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-export interface SemanticTokens {
- data: number[];
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokensRangeHandler.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokensRangeHandler.ts
deleted file mode 100644
index e18fd45411f..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokensRangeHandler.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as vscode from 'vscode';
-import { RequestType } from 'vscode-languageclient';
-import { RazorLanguageServerClient } from '../RazorLanguageServerClient';
-import { ProvideSemanticTokensResponse } from './ProvideSemanticTokensResponse';
-import { SemanticTokensResponse } from './SemanticTokensResponse';
-import { SerializableSemanticTokensParams } from './SerializableSemanticTokensParams';
-
-export class SemanticTokensRangeHandler {
- private static readonly getSemanticTokensRangeEndpoint = 'razor/provideSemanticTokensRange';
- private semanticTokensRequestType: RequestType =
- new RequestType(SemanticTokensRangeHandler.getSemanticTokensRangeEndpoint);
- private emptySemanticTokensResponse: ProvideSemanticTokensResponse = new ProvideSemanticTokensResponse(
- new SemanticTokensResponse(new Array(), ''),
- null);
-
- constructor(private readonly serverClient: RazorLanguageServerClient) { }
-
- public register() {
- return this.serverClient.onRequestWithParams(
- this.semanticTokensRequestType,
- async (request: SerializableSemanticTokensParams, token: vscode.CancellationToken) => this.getSemanticTokens(request, token));
- }
-
- private async getSemanticTokens(
- semanticTokensParams: SerializableSemanticTokensParams,
- cancellationToken: vscode.CancellationToken): Promise {
-
- // This is currently a no-op since (1) the default C# semantic tokens experience is already powerful and
- // (2) there seems to be an issue with the semantic tokens execute command - possibly either O# not
- // returning tokens, or an issue with the command itself:
- // https://github.com/dotnet/razor-tooling/issues/6922
- return this.emptySemanticTokensResponse;
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokensRangeRequest.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokensRangeRequest.ts
deleted file mode 100644
index 905e8b22b5c..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokensRangeRequest.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { TextDocumentIdentifier } from 'vscode-languageclient';
-import { convertRangeToSerializable, SerializableRange } from '../RPC/SerializableRange';
-
-export class SemanticTokensRangeRequest {
- public readonly range: SerializableRange;
- public readonly textDocument: TextDocumentIdentifier;
-
- constructor(
- razorDocumentUri: vscode.Uri,
- range: vscode.Range,
- ) {
- this.textDocument = TextDocumentIdentifier.create(razorDocumentUri.toString());
- this.range = convertRangeToSerializable(range);
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokensResponse.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokensResponse.ts
deleted file mode 100644
index 89e11498334..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SemanticTokensResponse.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-export class SemanticTokensResponse {
- constructor(
- public readonly data: Array,
- public readonly resultId?: string) {
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SerializableSemanticTokensParams.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SerializableSemanticTokensParams.ts
deleted file mode 100644
index a1e0883db6f..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Semantic/SerializableSemanticTokensParams.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import { SerializableRange } from '../RPC/SerializableRange';
-import { SerializableTextDocumentIdentifier } from '../RPC/SerializableTextDocumentIdentifier';
-
-export interface SerializableSemanticTokensParams {
- textDocument: SerializableTextDocumentIdentifier;
- range: SerializableRange;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/SignatureHelp/RazorSignatureHelpProvider.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/SignatureHelp/RazorSignatureHelpProvider.ts
deleted file mode 100644
index fcb0d7da516..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/SignatureHelp/RazorSignatureHelpProvider.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import { RazorLanguageFeatureBase } from './../RazorLanguageFeatureBase';
-
-export class RazorSignatureHelpProvider
- extends RazorLanguageFeatureBase
- implements vscode.SignatureHelpProvider {
-
- public async provideSignatureHelp(
- document: vscode.TextDocument, position: vscode.Position,
- token: vscode.CancellationToken) {
-
- const projection = await this.getProjection(document, position, token);
- if (projection) {
- const result = await vscode.commands.executeCommand(
- 'vscode.executeSignatureHelpProvider',
- projection.uri,
- projection.position);
- return result;
- }
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/TelemetryReporter.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/TelemetryReporter.ts
deleted file mode 100644
index 7bf71e27fcb..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/TelemetryReporter.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import { createTelemetryErrorEvent, createTelemetryEvent, HostEventStream } from './HostEventStream';
-import { Trace } from './Trace';
-
-export class TelemetryReporter {
- private readonly razorExtensionActivated = createTelemetryEvent('VSCode.Razor.RazorExtensionActivated');
- private readonly debugLanguageServerEvent = createTelemetryEvent('VSCode.Razor.DebugLanguageServer');
- private readonly workspaceContainsRazorEvent = createTelemetryEvent('VSCode.Razor.WorkspaceContainsRazor');
- private reportedWorkspaceContainsRazor = false;
-
- constructor(
- private readonly eventStream: HostEventStream) {
- // If this telemetry reporter is created it means the rest of the Razor extension world was created.
- this.eventStream.post(this.razorExtensionActivated);
- }
-
- public reportTraceLevel(trace: Trace) {
- const traceLevelEvent = createTelemetryEvent(
- 'VSCode.Razor.TraceLevel',
- {
- trace: Trace[trace],
- });
- this.eventStream.post(traceLevelEvent);
- }
-
- public reportErrorOnServerStart(error: unknown) {
- let realError;
- if (error instanceof Error) {
- realError = error;
- } else {
- realError = Error(String(error));
- }
-
- this.reportError('VSCode.Razor.ErrorOnServerStart', realError);
- }
-
- public reportErrorOnActivation(error: unknown) {
- let realError;
- if (error instanceof Error) {
- realError = error;
- } else {
- realError = Error(String(error));
- }
-
- this.reportError('VSCode.Razor.ErrorOnActivation', realError);
- }
-
- public reportDebugLanguageServer() {
- this.eventStream.post(this.debugLanguageServerEvent);
- }
-
- public reportWorkspaceContainsRazor() {
- if (this.reportedWorkspaceContainsRazor) {
- return;
- }
-
- this.reportedWorkspaceContainsRazor = true;
- this.eventStream.post(this.workspaceContainsRazorEvent);
- }
-
- private reportError(eventName: string, error: Error) {
- const errorOnActivationEvent = createTelemetryErrorEvent(
- eventName,
- {
- error: JSON.stringify(error),
- },
- /*measures*/ undefined,
- /*errorProps*/['error']);
-
- this.eventStream.post(errorOnActivationEvent);
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Trace.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Trace.ts
deleted file mode 100644
index 77ccc632454..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/Trace.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-export enum Trace {
- Off = 0,
- Messages = 1,
- Verbose = 2,
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/UriPaths.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/UriPaths.ts
deleted file mode 100644
index 5bb269c53db..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/UriPaths.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-
-export function getUriPath(uri: vscode.Uri) {
- let newUri = uri;
- if (uri.authority && uri.scheme === 'file') {
- // UNC path. The host(authority) part of this is case-insensitive. Let's normalize it so we don't create duplicate documents.
- const authority = uri.authority.toLowerCase();
- newUri = uri.with({ authority });
- }
-
- return newUri.fsPath || newUri.path;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/extension.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/extension.ts
deleted file mode 100644
index 657e043fcf0..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/extension.ts
+++ /dev/null
@@ -1,258 +0,0 @@
-/* --------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- * ------------------------------------------------------------------------------------------ */
-
-import * as vscode from 'vscode';
-import * as vscodeapi from 'vscode';
-import { ExtensionContext } from 'vscode';
-import { BlazorDebugConfigurationProvider } from './BlazorDebug/BlazorDebugConfigurationProvider';
-import { RazorCodeActionRunner } from './CodeActions/RazorCodeActionRunner';
-import { RazorCodeLensProvider } from './CodeLens/RazorCodeLensProvider';
-import { ColorPresentationHandler } from './ColorPresentation/ColorPresentationHandler';
-import { ProvisionalCompletionOrchestrator } from './Completion/ProvisionalCompletionOrchestrator';
-import { RazorCompletionItemProvider } from './Completion/RazorCompletionItemProvider';
-import { listenToConfigurationChanges } from './ConfigurationChangeListener';
-import { RazorCSharpFeature } from './CSharp/RazorCSharpFeature';
-import { RazorDefinitionProvider } from './Definition/RazorDefinitionProvider';
-import { ReportIssueCommand } from './Diagnostics/ReportIssueCommand';
-import { RazorDocumentManager } from './Document/RazorDocumentManager';
-import { RazorDocumentSynchronizer } from './Document/RazorDocumentSynchronizer';
-import { DocumentColorHandler } from './DocumentColor/DocumentColorHandler';
-import { RazorDocumentHighlightProvider } from './DocumentHighlight/RazorDocumentHighlightProvider';
-import { reportTelemetryForDocuments } from './DocumentTelemetryListener';
-import { FoldingRangeHandler } from './Folding/FoldingRangeHandler';
-import { FormattingHandler } from './Formatting/FormattingHandler';
-import { HostEventStream } from './HostEventStream';
-import { RazorHoverProvider } from './Hover/RazorHoverProvider';
-import { RazorHtmlFeature } from './Html/RazorHtmlFeature';
-import { IEventEmitterFactory } from './IEventEmitterFactory';
-import { RazorImplementationProvider } from './Implementation/RazorImplementationProvider';
-import { ProposedApisFeature } from './ProposedApisFeature';
-import { RazorCSharpLanguageMiddleware } from './RazorCSharpLanguageMiddleware';
-import { RazorLanguage } from './RazorLanguage';
-import { RazorLanguageConfiguration } from './RazorLanguageConfiguration';
-import { RazorLanguageServerClient } from './RazorLanguageServerClient';
-import { resolveRazorLanguageServerTrace } from './RazorLanguageServerTraceResolver';
-import { RazorLanguageServiceClient } from './RazorLanguageServiceClient';
-import { RazorLogger } from './RazorLogger';
-import { RazorReferenceProvider } from './Reference/RazorReferenceProvider';
-import { RazorRenameProvider } from './Rename/RazorRenameProvider';
-import { RazorDocumentSemanticTokensProvider } from './Semantic/RazorDocumentSemanticTokensProvider';
-import { SemanticTokensRangeHandler } from './Semantic/SemanticTokensRangeHandler';
-import { RazorSignatureHelpProvider } from './SignatureHelp/RazorSignatureHelpProvider';
-import { TelemetryReporter } from './TelemetryReporter';
-
-// We specifically need to take a reference to a particular instance of the vscode namespace,
-// otherwise providers attempt to operate on the null extension.
-export async function activate(vscodeType: typeof vscodeapi, context: ExtensionContext, languageServerDir: string, eventStream: HostEventStream, enableProposedApis = false) {
- const telemetryReporter = new TelemetryReporter(eventStream);
- const eventEmitterFactory: IEventEmitterFactory = {
- create: () => new vscode.EventEmitter(),
- };
-
- const languageServerTrace = resolveRazorLanguageServerTrace(vscodeType);
- const logger = new RazorLogger(vscodeType, eventEmitterFactory, languageServerTrace);
-
- try {
- const languageServerClient = new RazorLanguageServerClient(vscodeType, languageServerDir, telemetryReporter, logger);
- const languageServiceClient = new RazorLanguageServiceClient(languageServerClient);
-
- const razorLanguageMiddleware = new RazorCSharpLanguageMiddleware(languageServiceClient, logger);
-
- const documentManager = new RazorDocumentManager(languageServerClient, logger);
- reportTelemetryForDocuments(documentManager, telemetryReporter);
- const languageConfiguration = new RazorLanguageConfiguration();
- const csharpFeature = new RazorCSharpFeature(documentManager, eventEmitterFactory, logger);
- const htmlFeature = new RazorHtmlFeature(documentManager, languageServiceClient, eventEmitterFactory, logger);
- const localRegistrations: vscode.Disposable[] = [];
- const reportIssueCommand = new ReportIssueCommand(vscodeType, documentManager, logger);
- const razorCodeActionRunner = new RazorCodeActionRunner(languageServerClient, logger);
-
- let documentSynchronizer: RazorDocumentSynchronizer;
- languageServerClient.onStart(async () => {
- vscodeType.commands.executeCommand('omnisharp.registerLanguageMiddleware', razorLanguageMiddleware);
- documentSynchronizer = new RazorDocumentSynchronizer(documentManager, logger);
- const provisionalCompletionOrchestrator = new ProvisionalCompletionOrchestrator(
- documentManager,
- csharpFeature.projectionProvider,
- languageServiceClient,
- logger);
- const semanticTokenHandler = new SemanticTokensRangeHandler(languageServerClient);
- const colorPresentationHandler = new ColorPresentationHandler(
- documentManager,
- languageServerClient,
- logger);
- const documentColorHandler = new DocumentColorHandler(
- documentManager,
- languageServerClient,
- logger);
- const foldingRangeHandler = new FoldingRangeHandler(
- languageServerClient,
- documentManager,
- logger);
- const formattingHandler = new FormattingHandler(
- documentManager,
- documentSynchronizer,
- languageServerClient,
- logger);
-
- const completionItemProvider = new RazorCompletionItemProvider(
- documentSynchronizer,
- documentManager,
- languageServiceClient,
- provisionalCompletionOrchestrator,
- logger);
- const signatureHelpProvider = new RazorSignatureHelpProvider(
- documentSynchronizer,
- documentManager,
- languageServiceClient,
- logger);
- const definitionProvider = new RazorDefinitionProvider(
- documentSynchronizer,
- documentManager,
- languageServiceClient,
- logger);
- const implementationProvider = new RazorImplementationProvider(
- documentSynchronizer,
- documentManager,
- languageServiceClient,
- logger);
- const hoverProvider = new RazorHoverProvider(
- documentSynchronizer,
- documentManager,
- languageServiceClient,
- logger);
- const codeLensProvider = new RazorCodeLensProvider(
- documentSynchronizer,
- documentManager,
- languageServiceClient,
- logger);
- const renameProvider = new RazorRenameProvider(
- documentSynchronizer,
- documentManager,
- languageServiceClient,
- logger);
- const referenceProvider = new RazorReferenceProvider(
- documentSynchronizer,
- documentManager,
- languageServiceClient,
- logger);
- const documentHighlightProvider = new RazorDocumentHighlightProvider(
- documentSynchronizer,
- documentManager,
- languageServiceClient,
- logger);
-
- localRegistrations.push(
- languageConfiguration.register(),
- provisionalCompletionOrchestrator.register(),
- vscodeType.languages.registerCompletionItemProvider(
- RazorLanguage.id,
- completionItemProvider,
- '.', '<', '@'),
- vscodeType.languages.registerSignatureHelpProvider(
- RazorLanguage.id,
- signatureHelpProvider,
- '(', ','),
- vscodeType.languages.registerDefinitionProvider(
- RazorLanguage.id,
- definitionProvider),
- vscodeType.languages.registerImplementationProvider(
- RazorLanguage.id,
- implementationProvider),
- vscodeType.languages.registerHoverProvider(
- RazorLanguage.documentSelector,
- hoverProvider),
- vscodeType.languages.registerReferenceProvider(
- RazorLanguage.id,
- referenceProvider),
- vscodeType.languages.registerCodeLensProvider(
- RazorLanguage.id,
- codeLensProvider),
- vscodeType.languages.registerRenameProvider(
- RazorLanguage.id,
- renameProvider),
- vscodeType.languages.registerDocumentHighlightProvider(
- RazorLanguage.id,
- documentHighlightProvider),
- documentManager.register(),
- csharpFeature.register(),
- htmlFeature.register(),
- documentSynchronizer.register(),
- reportIssueCommand.register(),
- listenToConfigurationChanges(languageServerClient));
-
- if (enableProposedApis) {
- const proposedApisFeature = new ProposedApisFeature();
-
- await proposedApisFeature.register(vscodeType, localRegistrations);
- }
-
- razorCodeActionRunner.register();
- await colorPresentationHandler.register();
- await documentColorHandler.register();
- await foldingRangeHandler.register();
- await formattingHandler.register();
- await semanticTokenHandler.register();
- });
-
- const onStopRegistration = languageServerClient.onStop(() => {
- localRegistrations.forEach(r => r.dispose());
- localRegistrations.length = 0;
- });
-
- const provider = new BlazorDebugConfigurationProvider(logger, vscodeType);
- context.subscriptions.push(vscodeType.debug.registerDebugConfigurationProvider('blazorwasm', provider));
-
- languageServerClient.onStarted(async () => {
- const legend = languageServerClient.initializeResult?.capabilities.semanticTokensProvider?.legend;
- const semanticTokenProvider = new RazorDocumentSemanticTokensProvider(
- documentSynchronizer,
- documentManager,
- languageServiceClient,
- logger);
- if (legend) {
- localRegistrations.push(vscodeType.languages.registerDocumentRangeSemanticTokensProvider(RazorLanguage.id, semanticTokenProvider, legend));
- }
-
- await documentManager.initialize();
- });
-
- await startLanguageServer(vscodeType, languageServerClient, logger, context);
-
- context.subscriptions.push(languageServerClient, onStopRegistration, logger);
- } catch (error) {
- logger.logError('Failed when activating Razor VSCode.', error as Error);
- telemetryReporter.reportErrorOnActivation(error as Error);
- }
-}
-
-async function startLanguageServer(
- vscodeType: typeof vscodeapi,
- languageServerClient: RazorLanguageServerClient,
- logger: RazorLogger,
- context: vscode.ExtensionContext) {
-
- const razorFiles = await vscodeType.workspace.findFiles(RazorLanguage.globbingPattern);
- if (razorFiles.length === 0) {
- // No Razor files in workspace, language server should stay off until one is added or opened.
- logger.logAlways('No Razor files detected in workspace, delaying language server start.');
-
- const watcher = vscodeType.workspace.createFileSystemWatcher(RazorLanguage.globbingPattern);
- const delayedLanguageServerStart = async () => {
- razorFileCreatedRegistration.dispose();
- razorFileOpenedRegistration.dispose();
- await languageServerClient.start();
- };
- const razorFileCreatedRegistration = watcher.onDidCreate(() => delayedLanguageServerStart());
- const razorFileOpenedRegistration = vscodeType.workspace.onDidOpenTextDocument(async (event) => {
- if (event.languageId === RazorLanguage.id) {
- await delayedLanguageServerStart();
- }
- });
- context.subscriptions.push(razorFileCreatedRegistration, razorFileOpenedRegistration);
- } else {
- await languageServerClient.start();
- }
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/vscode.proposed.d.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/vscode.proposed.d.ts
deleted file mode 100644
index 3780fc1a59b..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/vscode.proposed.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-/**
- * This is the place for API experiments and proposals.
- * These API are NOT stable and subject to change. They are only available in the Insiders
- * distribution and CANNOT be used in published extensions.
- *
- * To test these API in local environment:
- * - Use Insiders release of VS Code.
- * - Add `"enableProposedApi": true` to your package.json.
- * - Copy this file to your project.
- */
-
-/* tslint:disable:max-classes-per-file */
-declare module 'vscode' {
-
-}
-/* tslint:enable:max-classes-per-file */
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/vscodeAdapter.ts b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/vscodeAdapter.ts
deleted file mode 100644
index 8e30777c033..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/src/vscodeAdapter.ts
+++ /dev/null
@@ -1,1468 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-/* tslint:disable */
-
-export type ProviderResult = T | undefined | null | Thenable;
-
-/**
- * A text document content provider allows to add readonly documents
- * to the editor, such as source from a dll or generated html from md.
- *
- * Content providers are [registered](#workspace.registerTextDocumentContentProvider)
- * for a [uri-scheme](#Uri.scheme). When a uri with that scheme is to
- * be [loaded](#workspace.openTextDocument) the content provider is
- * asked.
- */
-export interface TextDocumentContentProvider {
-
- /**
- * An event to signal a resource has changed.
- */
- onDidChange?: Event;
-
- /**
- * Provide textual content for a given uri.
- *
- * The editor will use the returned string-content to create a readonly
- * [document](#TextDocument). Resources allocated should be released when
- * the corresponding document has been [closed](#workspace.onDidCloseTextDocument).
- *
- * **Note**: The contents of the created [document](#TextDocument) might not be
- * identical to the provided text due to end-of-line-sequence normalization.
- *
- * @param uri An uri which scheme matches the scheme this provider was [registered](#workspace.registerTextDocumentContentProvider) for.
- * @param token A cancellation token.
- * @return A string or a thenable that resolves to such.
- */
- provideTextDocumentContent(uri: Uri, token: CancellationToken): ProviderResult;
-}
-
-/**
- * Represents a typed event.
- *
- * A function that represents an event to which you subscribe by calling it with
- * a listener function as argument.
- *
- * @sample `item.onDidChange(function(event) { console.log("Event happened: " + event); });`
- */
-export interface Event {
-
- /**
- * A function that represents an event to which you subscribe by calling it with
- * a listener function as argument.
- *
- * @param listener The listener function will be called when the event happens.
- * @param thisArgs The `this`-argument which will be used when calling the event listener.
- * @param disposables An array to which a [disposable](#Disposable) will be added.
- * @return A disposable which unsubscribes the event listener.
- */
- (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;
-}
-
-/**
- * An event emitter can be used to create and manage an [event](#Event) for others
- * to subscribe to. One emitter always owns one event.
- *
- * Use this class if you want to provide event from within your extension, for instance
- * inside a [TextDocumentContentProvider](#TextDocumentContentProvider) or when providing
- * API to other extensions.
- */
-export declare class EventEmitter {
- /**
- * The event listeners can subscribe to.
- */
- event: Event;
-
- /**
- * Notify all subscribers of the [event](EventEmitter#event). Failure
- * of one or more listener will not fail this function call.
- *
- * @param data The event object.
- */
- fire(data: T): void;
-
- /**
- * Dispose this object and free resources.
- */
- dispose(): void;
-}
-
-export interface OutputChannel {
-
- /**
- * The human-readable name of this output channel.
- */
- readonly name: string;
-
- /**
- * Append the given value to the channel.
- *
- * @param value A string, falsy values will not be printed.
- */
- append(value: string): void;
-
- /**
- * Append the given value and a line feed character
- * to the channel.
- *
- * @param value A string, falsy values will be printed.
- */
- appendLine(value: string): void;
-
- /**
- * Removes all output from the channel.
- */
- clear(): void;
-
- /**
- * Reveal this channel in the UI.
- *
- * @param preserveFocus When `true` the channel will not take focus.
- */
- show(preserveFocus?: boolean): void;
-
- /**
- * Hide this channel from the UI.
- */
- hide(): void;
-
- /**
- * Dispose and free associated resources.
- */
- dispose(): void;
-}
-
-export enum ViewColumn {
- /**
- * A *symbolic* editor column representing the currently
- * active column. This value can be used when opening editors, but the
- * *resolved* [viewColumn](#TextEditor.viewColumn)-value of editors will always
- * be `One`, `Two`, `Three`, or `undefined` but never `Active`.
- */
- Active = -1,
- /**
- * The left most editor column.
- */
- One = 1,
- /**
- * The center editor column.
- */
- Two = 2,
- /**
- * The right most editor column.
- */
- Three = 3
-}
-
-export interface WorkspaceConfiguration {
-
- /**
- * Return a value from this configuration.
- *
- * @param section Configuration name, supports _dotted_ names.
- * @return The value `section` denotes or `undefined`.
- */
- get(section: string): T | undefined;
-
- /**
- * Return a value from this configuration.
- *
- * @param section Configuration name, supports _dotted_ names.
- * @param defaultValue A value should be returned when no value could be found, is `undefined`.
- * @return The value `section` denotes or the default.
- */
- get(section: string, defaultValue: T): T;
-
- /**
- * Check if this configuration has a certain value.
- *
- * @param section Configuration name, supports _dotted_ names.
- * @return `true` if the section doesn't resolve to `undefined`.
- */
- has(section: string): boolean;
-
- /**
- * Retrieve all information about a configuration setting. A configuration value
- * often consists of a *default* value, a global or installation-wide value,
- * a workspace-specific value and a folder-specific value.
- *
- * The *effective* value (returned by [`get`](#WorkspaceConfiguration.get))
- * is computed like this: `defaultValue` overwritten by `globalValue`,
- * `globalValue` overwritten by `workspaceValue`. `workspaceValue` overwritten by `workspaceFolderValue`.
- * Refer to [Settings Inheritance](https://code.visualstudio.com/docs/getstarted/settings)
- * for more information.
- *
- * *Note:* The configuration name must denote a leaf in the configuration tree
- * (`editor.fontSize` vs `editor`) otherwise no result is returned.
- *
- * @param section Configuration name, supports _dotted_ names.
- * @return Information about a configuration setting or `undefined`.
- */
- inspect(section: string): { key: string; defaultValue?: T; globalValue?: T; workspaceValue?: T, workspaceFolderValue?: T } | undefined;
-
- /**
- * Update a configuration value. The updated configuration values are persisted.
- *
- * A value can be changed in
- *
- * - [Global configuration](#ConfigurationTarget.Global): Changes the value for all instances of the editor.
- * - [Workspace configuration](#ConfigurationTarget.Workspace): Changes the value for current workspace, if available.
- * - [Workspace folder configuration](#ConfigurationTarget.WorkspaceFolder): Changes the value for the
- * [Workspace folder](#workspace.workspaceFolders) to which the current [configuration](#WorkspaceConfiguration) is scoped to.
- *
- * *Note 1:* Setting a global value in the presence of a more specific workspace value
- * has no observable effect in that workspace, but in others. Setting a workspace value
- * in the presence of a more specific folder value has no observable effect for the resources
- * under respective [folder](#workspace.workspaceFolders), but in others. Refer to
- * [Settings Inheritance](https://code.visualstudio.com/docs/getstarted/settings) for more information.
- *
- * *Note 2:* To remove a configuration value use `undefined`, like so: `config.update('somekey', undefined)`
- *
- * Will throw error when
- * - Writing a configuration which is not registered.
- * - Writing a configuration to workspace or folder target when no workspace is opened
- * - Writing a configuration to folder target when there is no folder settings
- * - Writing to folder target without passing a resource when getting the configuration (`workspace.getConfiguration(section, resource)`)
- * - Writing a window configuration to folder target
- *
- * @param section Configuration name, supports _dotted_ names.
- * @param value The new value.
- * @param configurationTarget The [configuration target](#ConfigurationTarget) or a boolean value.
- * - If `true` configuration target is `ConfigurationTarget.Global`.
- * - If `false` configuration target is `ConfigurationTarget.Workspace`.
- * - If `undefined` or `null` configuration target is
- * `ConfigurationTarget.WorkspaceFolder` when configuration is resource specific
- * `ConfigurationTarget.Workspace` otherwise.
- */
- update(section: string, value: any, configurationTarget?: ConfigurationTarget | boolean): Thenable;
-
- /**
- * Readable dictionary that backs this configuration.
- */
- readonly [key: string]: any;
-}
-
-/**
- * The configuration target
- */
-export enum ConfigurationTarget {
- /**
- * Global configuration
- */
- Global = 1,
-
- /**
- * Workspace configuration
- */
- Workspace = 2,
-
- /**
- * Workspace folder configuration
- */
- WorkspaceFolder = 3
-}
-
-/**
- * Represents the alignment of status bar items.
- */
-export enum StatusBarAlignment {
-
- /**
- * Aligned to the left side.
- */
- Left = 1,
-
- /**
- * Aligned to the right side.
- */
- Right = 2
-}
-
-
-export interface StatusBarItem {
-
- /**
- * The alignment of this item.
- */
- readonly alignment: StatusBarAlignment;
-
- /**
- * The priority of this item. Higher value means the item should
- * be shown more to the left.
- */
- readonly priority: number;
-
- /**
- * The text to show for the entry. You can embed icons in the text by leveraging the syntax:
- *
- * `My text $(icon-name) contains icons like $(icon'name) this one.`
- *
- * Where the icon-name is taken from the [octicon](https://octicons.github.com) icon set, e.g.
- * `light-bulb`, `thumbsup`, `zap` etc.
- */
- text: string;
-
- /**
- * The tooltip text when you hover over this entry.
- */
- tooltip: string | undefined;
-
- /**
- * The foreground color for this entry.
- */
- color: string | undefined;
-
- /**
- * The identifier of a command to run on click. The command must be
- * [known](#commands.getCommands).
- */
- command: string | undefined;
-
- /**
- * Shows the entry in the status bar.
- */
- show(): void;
-
- /**
- * Hide the entry in the status bar.
- */
- hide(): void;
-
- /**
- * Dispose and free associated resources. Call
- * [hide](#StatusBarItem.hide).
- */
- dispose(): void;
-}
-
-export interface Event {
- /**
- * A function that represents an event to which you subscribe by calling it with
- * a listener function as argument.
- *
- * @param listener The listener function will be called when the event happens.
- * @param thisArgs The `this`-argument which will be used when calling the event listener.
- * @param disposables An array to which a [disposable](#Disposable) will be added.
- * @return A disposable which unsubscribes the event listener.
- */
- (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;
-}
-
-export interface Disposable {
- /**
- * Dispose this object.
- */
- dispose(): any;
-}
-
-
-export interface CancellationToken {
-
- /**
- * Is `true` when the token has been cancelled, `false` otherwise.
- */
- isCancellationRequested: boolean;
-
- /**
- * An [event](#Event) which fires upon cancellation.
- */
- onCancellationRequested: Event;
-}
-
-
-export interface DocumentFilter {
-
- /**
- * A language id, like `typescript`.
- */
- language?: string;
-
- /**
- * A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
- */
- scheme?: string;
-
- /**
- * A [glob pattern](#GlobPattern) that is matched on the absolute path of the document. Use a [relative pattern](#RelativePattern)
- * to filter documents to a [workspace folder](#WorkspaceFolder).
- */
- pattern?: GlobPattern;
-}
-
-export type GlobPattern = string;
-
-export type DocumentSelector = string | DocumentFilter | (string | DocumentFilter)[];
-
-export interface MessageOptions {
-
- /**
- * Indicates that this message should be modal.
- */
- modal?: boolean;
-}
-
-export interface TextEditor {
-
- /**
- * The document associated with this text editor. The document will be the same for the entire lifetime of this text editor.
- */
- document: TextDocument;
-}
-
-/**
- * A universal resource identifier representing either a file on disk
- * or another resource, like untitled resources.
- */
-export interface Uri {
-
- /**
- * Create an URI from a file system path. The [scheme](#Uri.scheme)
- * will be `file`.
- *
- * @param path A file system or UNC path.
- * @return A new Uri instance.
- */
-
- /**
- * Create an URI from a string. Will throw if the given value is not
- * valid.
- *
- * @param value The string value of an Uri.
- * @return A new Uri instance.
- */
- /**
- * Scheme is the `http` part of `http://www.msft.com/some/path?query#fragment`.
- * The part before the first colon.
- */
- readonly scheme: string;
-
- /**
- * Authority is the `www.msft.com` part of `http://www.msft.com/some/path?query#fragment`.
- * The part between the first double slashes and the next slash.
- */
- readonly authority: string;
-
- /**
- * Path is the `/some/path` part of `http://www.msft.com/some/path?query#fragment`.
- */
- readonly path: string;
-
- /**
- * Query is the `query` part of `http://www.msft.com/some/path?query#fragment`.
- */
- readonly query: string;
-
- /**
- * Fragment is the `fragment` part of `http://www.msft.com/some/path?query#fragment`.
- */
- readonly fragment: string;
-
- /**
- * The string representing the corresponding file system path of this Uri.
- *
- * Will handle UNC paths and normalize windows drive letters to lower-case. Also
- * uses the platform specific path separator. Will *not* validate the path for
- * invalid characters and semantics. Will *not* look at the scheme of this Uri.
- */
- readonly fsPath: string;
-
- /**
- * Derive a new Uri from this Uri.
- *
- * ```ts
- * let file = Uri.parse('before:some/file/path');
- * let other = file.with({ scheme: 'after' });
- * assert.ok(other.toString() === 'after:some/file/path');
- * ```
- *
- * @param change An object that describes a change to this Uri. To unset components use `null` or
- * the empty string.
- * @return A new Uri that reflects the given change. Will return `this` Uri if the change
- * is not changing anything.
- */
- with(change: { scheme?: string; authority?: string; path?: string; query?: string; fragment?: string }): Uri;
-
- /**
- * Returns a string representation of this Uri. The representation and normalization
- * of a URI depends on the scheme. The resulting string can be safely used with
- * [Uri.parse](#Uri.parse).
- *
- * @param skipEncoding Do not percentage-encode the result, defaults to `false`. Note that
- * the `#` and `?` characters occurring in the path will always be encoded.
- * @returns A string representation of this Uri.
- */
- toString(skipEncoding?: boolean): string;
-
- /**
- * Returns a JSON representation of this Uri.
- *
- * @return An object.
- */
- toJSON(): any;
-}
-
-export interface MessageItem {
-
- /**
- * A short title like 'Retry', 'Open Log' etc.
- */
- title: string;
-
- /**
- * Indicates that this item replaces the default
- * 'Close' action.
- */
- isCloseAffordance?: boolean;
-}
-
-/**
- * Represents a text document, such as a source file. Text documents have
- * [lines](#TextLine) and knowledge about an underlying resource like a file.
- */
-export interface TextDocument {
-
- /**
- * The associated URI for this document. Most documents have the __file__-scheme, indicating that they
- * represent files on disk. However, some documents may have other schemes indicating that they are not
- * available on disk.
- */
- readonly uri: Uri;
-
- /**
- * The file system path of the associated resource. Shorthand
- * notation for [TextDocument.uri.fsPath](#TextDocument.uri). Independent of the uri scheme.
- */
- readonly fileName: string;
-
- /**
- * Is this document representing an untitled file.
- */
- readonly isUntitled: boolean;
-
- /**
- * The identifier of the language associated with this document.
- */
- readonly languageId: string;
-
- /**
- * The version number of this document (it will strictly increase after each
- * change, including undo/redo).
- */
- readonly version: number;
-
- /**
- * `true` if there are unpersisted changes.
- */
- readonly isDirty: boolean;
-
- /**
- * `true` if the document have been closed. A closed document isn't synchronized anymore
- * and won't be re-used when the same resource is opened again.
- */
- readonly isClosed: boolean;
-
- /**
- * Save the underlying file.
- *
- * @return A promise that will resolve to true when the file
- * has been saved. If the file was not dirty or the save failed,
- * will return false.
- */
- save(): Thenable;
-
- /**
- * The [end of line](#EndOfLine) sequence that is predominately
- * used in this document.
- */
- readonly eol: EndOfLine;
-
- /**
- * The number of lines in this document.
- */
- readonly lineCount: number;
-
- /**
- * Returns a text line denoted by the line number. Note
- * that the returned object is *not* live and changes to the
- * document are not reflected.
- *
- * @param line A line number in [0, lineCount).
- * @return A [line](#TextLine).
- */
- lineAt(line: number): TextLine;
-
- /**
- * Returns a text line denoted by the position. Note
- * that the returned object is *not* live and changes to the
- * document are not reflected.
- *
- * The position will be [adjusted](#TextDocument.validatePosition).
- *
- * @see [TextDocument.lineAt](#TextDocument.lineAt)
- * @param position A position.
- * @return A [line](#TextLine).
- */
- lineAt(position: Position): TextLine;
-
- /**
- * Converts the position to a zero-based offset.
- *
- * The position will be [adjusted](#TextDocument.validatePosition).
- *
- * @param position A position.
- * @return A valid zero-based offset.
- */
- offsetAt(position: Position): number;
-
- /**
- * Converts a zero-based offset to a position.
- *
- * @param offset A zero-based offset.
- * @return A valid [position](#Position).
- */
- positionAt(offset: number): Position;
-
- /**
- * Get the text of this document. A substring can be retrieved by providing
- * a range. The range will be [adjusted](#TextDocument.validateRange).
- *
- * @param range Include only the text included by the range.
- * @return The text inside the provided range or the entire text.
- */
- getText(range?: Range): string;
-
- /**
- * Get a word-range at the given position. By default words are defined by
- * common separators, like space, -, _, etc. In addition, per language custom
- * [word definitions](#LanguageConfiguration.wordPattern) can be defined. It
- * is also possible to provide a custom regular expression.
- *
- * * *Note 1:* A custom regular expression must not match the empty string and
- * if it does, it will be ignored.
- * * *Note 2:* A custom regular expression will fail to match multiline strings
- * and in the name of speed regular expressions should not match words with
- * spaces. Use [`TextLine.text`](#TextLine.text) for more complex, non-wordy, scenarios.
- *
- * The position will be [adjusted](#TextDocument.validatePosition).
- *
- * @param position A position.
- * @param regex Optional regular expression that describes what a word is.
- * @return A range spanning a word, or `undefined`.
- */
- getWordRangeAtPosition(position: Position, regex?: RegExp): Range | undefined;
-
- /**
- * Ensure a range is completely contained in this document.
- *
- * @param range A range.
- * @return The given range or a new, adjusted range.
- */
- validateRange(range: Range): Range;
-
- /**
- * Ensure a position is contained in the range of this document.
- *
- * @param position A position.
- * @return The given position or a new, adjusted position.
- */
- validatePosition(position: Position): Position;
-}
-
-/**
- * Represents an end of line character sequence in a [document](#TextDocument).
- */
-export enum EndOfLine {
- /**
- * The line feed `\n` character.
- */
- LF = 1,
- /**
- * The carriage return line feed `\r\n` sequence.
- */
- CRLF = 2
-}
-
-/**
- * Represents a line and character position, such as
- * the position of the cursor.
- *
- * Position objects are __immutable__. Use the [with](#Position.with) or
- * [translate](#Position.translate) methods to derive new positions
- * from an existing position.
- */
-export interface Position {
-
- /**
- * The zero-based line value.
- */
- readonly line: number;
-
- /**
- * The zero-based character value.
- */
- readonly character: number;
-
- /**
- * @param line A zero-based line value.
- * @param character A zero-based character value.
- */
-
- /**
- * Check if `other` is before this position.
- *
- * @param other A position.
- * @return `true` if position is on a smaller line
- * or on the same line on a smaller character.
- */
- isBefore(other: Position): boolean;
-
- /**
- * Check if `other` is before or equal to this position.
- *
- * @param other A position.
- * @return `true` if position is on a smaller line
- * or on the same line on a smaller or equal character.
- */
- isBeforeOrEqual(other: Position): boolean;
-
- /**
- * Check if `other` is after this position.
- *
- * @param other A position.
- * @return `true` if position is on a greater line
- * or on the same line on a greater character.
- */
- isAfter(other: Position): boolean;
-
- /**
- * Check if `other` is after or equal to this position.
- *
- * @param other A position.
- * @return `true` if position is on a greater line
- * or on the same line on a greater or equal character.
- */
- isAfterOrEqual(other: Position): boolean;
-
- /**
- * Check if `other` equals this position.
- *
- * @param other A position.
- * @return `true` if the line and character of the given position are equal to
- * the line and character of this position.
- */
- isEqual(other: Position): boolean;
-
- /**
- * Compare this to `other`.
- *
- * @param other A position.
- * @return A number smaller than zero if this position is before the given position,
- * a number greater than zero if this position is after the given position, or zero when
- * this and the given position are equal.
- */
- compareTo(other: Position): number;
-
- /**
- * Create a new position relative to this position.
- *
- * @param lineDelta Delta value for the line value, default is `0`.
- * @param characterDelta Delta value for the character value, default is `0`.
- * @return A position which line and character is the sum of the current line and
- * character and the corresponding deltas.
- */
- translate(lineDelta?: number, characterDelta?: number): Position;
-
- /**
- * Derived a new position relative to this position.
- *
- * @param change An object that describes a delta to this position.
- * @return A position that reflects the given delta. Will return `this` position if the change
- * is not changing anything.
- */
- translate(change: { lineDelta?: number; characterDelta?: number; }): Position;
-
- /**
- * Create a new position derived from this position.
- *
- * @param line Value that should be used as line value, default is the [existing value](#Position.line)
- * @param character Value that should be used as character value, default is the [existing value](#Position.character)
- * @return A position where line and character are replaced by the given values.
- */
- with(line?: number, character?: number): Position;
-
- /**
- * Derived a new position from this position.
- *
- * @param change An object that describes a change to this position.
- * @return A position that reflects the given change. Will return `this` position if the change
- * is not changing anything.
- */
- with(change: { line?: number; character?: number; }): Position;
-}
-
-export interface Range {
-
- /**
- * The start position. It is before or equal to [end](#Range.end).
- */
- readonly start: Position;
-
- /**
- * The end position. It is after or equal to [start](#Range.start).
- */
- readonly end: Position;
-
- /**
- * `true` if `start` and `end` are equal.
- */
- isEmpty: boolean;
-
- /**
- * `true` if `start.line` and `end.line` are equal.
- */
- isSingleLine: boolean;
-
- /**
- * Check if a position or a range is contained in this range.
- *
- * @param positionOrRange A position or a range.
- * @return `true` if the position or range is inside or equal
- * to this range.
- */
- contains(positionOrRange: Position | Range): boolean;
-
- /**
- * Check if `other` equals this range.
- *
- * @param other A range.
- * @return `true` when start and end are [equal](#Position.isEqual) to
- * start and end of this range.
- */
- isEqual(other: Range): boolean;
-
- /**
- * Intersect `range` with this range and returns a new range or `undefined`
- * if the ranges have no overlap.
- *
- * @param range A range.
- * @return A range of the greater start and smaller end positions. Will
- * return undefined when there is no overlap.
- */
- intersection(range: Range): Range | undefined;
-
- /**
- * Compute the union of `other` with this range.
- *
- * @param other A range.
- * @return A range of smaller start position and the greater end position.
- */
- union(other: Range): Range;
-
- /**
- * Derived a new range from this range.
- *
- * @param start A position that should be used as start. The default value is the [current start](#Range.start).
- * @param end A position that should be used as end. The default value is the [current end](#Range.end).
- * @return A range derived from this range with the given start and end position.
- * If start and end are not different `this` range will be returned.
- */
- with(start?: Position, end?: Position): Range;
-
- /**
- * Derived a new range from this range.
- *
- * @param change An object that describes a change to this range.
- * @return A range that reflects the given change. Will return `this` range if the change
- * is not changing anything.
- */
- with(change: { start?: Position, end?: Position }): Range;
-}
-
-/**
- * Represents a line of text, such as a line of source code.
- *
- * TextLine objects are __immutable__. When a [document](#TextDocument) changes,
- * previously retrieved lines will not represent the latest state.
- */
-export interface TextLine {
-
- /**
- * The zero-based line number.
- */
- readonly lineNumber: number;
-
- /**
- * The text of this line without the line separator characters.
- */
- readonly text: string;
-
- /**
- * The range this line covers without the line separator characters.
- */
- readonly range: Range;
-
- /**
- * The range this line covers with the line separator characters.
- */
- readonly rangeIncludingLineBreak: Range;
-
- /**
- * The offset of the first character which is not a whitespace character as defined
- * by `/\s/`. **Note** that if a line is all whitespace the length of the line is returned.
- */
- readonly firstNonWhitespaceCharacterIndex: number;
-
- /**
- * Whether this line is whitespace only, shorthand
- * for [TextLine.firstNonWhitespaceCharacterIndex](#TextLine.firstNonWhitespaceCharacterIndex) === [TextLine.text.length](#TextLine.text).
- */
- readonly isEmptyOrWhitespace: boolean;
-}
-
-export interface FileSystemWatcher extends Disposable {
-
- /**
- * true if this file system watcher has been created such that
- * it ignores creation file system events.
- */
- ignoreCreateEvents: boolean;
-
- /**
- * true if this file system watcher has been created such that
- * it ignores change file system events.
- */
- ignoreChangeEvents: boolean;
-
- /**
- * true if this file system watcher has been created such that
- * it ignores delete file system events.
- */
- ignoreDeleteEvents: boolean;
-
- /**
- * An event which fires on file/folder creation.
- */
- onDidCreate: Event;
-
- /**
- * An event which fires on file/folder change.
- */
- onDidChange: Event;
-
- /**
- * An event which fires on file/folder deletion.
- */
- onDidDelete: Event;
-}
-
-export interface ConfigurationChangeEvent {
-
- /**
- * Returns `true` if the given section for the given resource (if provided) is affected.
- *
- * @param section Configuration name, supports _dotted_ names.
- * @param resource A resource Uri.
- * @return `true` if the given section for the given resource (if provided) is affected.
- */
- affectsConfiguration(section: string, resource?: Uri): boolean;
-}
-
-export interface WebviewPanelSerializer {
- /**
- * Restore a webview panel from its serialized `state`.
- *
- * Called when a serialized webview first becomes visible.
- *
- * @param webviewPanel Webview panel to restore. The serializer should take ownership of this panel. The
- * serializer must restore the webview's `.html` and hook up all webview events.
- * @param state Persisted state from the webview content.
- *
- * @return Thenable indicating that the webview has been fully restored.
- */
- deserializeWebviewPanel(webviewPanel: WebviewPanel, state: any): Thenable;
-}
-
-/**
- * Content settings for a webview panel.
- */
-export interface WebviewPanelOptions {
- /**
- * Controls if the find widget is enabled in the panel.
- *
- * Defaults to false.
- */
- readonly enableFindWidget?: boolean;
-
- /**
- * Controls if the webview panel's content (iframe) is kept around even when the panel
- * is no longer visible.
- *
- * Normally the webview panel's html context is created when the panel becomes visible
- * and destroyed when it is is hidden. Extensions that have complex state
- * or UI can set the `retainContextWhenHidden` to make VS Code keep the webview
- * context around, even when the webview moves to a background tab. When a webview using
- * `retainContextWhenHidden` becomes hidden, its scripts and other dynamic content are suspended.
- * When the panel becomes visible again, the context is automatically restored
- * in the exact same state it was in originally. You cannot send messages to a
- * hidden webview, even with `retainContextWhenHidden` enabled.
- *
- * `retainContextWhenHidden` has a high memory overhead and should only be used if
- * your panel's context cannot be quickly saved and restored.
- */
- readonly retainContextWhenHidden?: boolean;
-}
-
-/**
- * A panel that contains a webview.
- */
-export interface WebviewPanel {
- /**
- * Identifies the type of the webview panel, such as `'markdown.preview'`.
- */
- readonly viewType: string;
-
- /**
- * Title of the panel shown in UI.
- */
- title: string;
-
- /**
- * Webview belonging to the panel.
- */
- readonly webview: Webview;
-
- /**
- * Content settings for the webview panel.
- */
- readonly options: WebviewPanelOptions;
-
- /**
- * Editor position of the panel. This property is only set if the webview is in
- * one of the editor view columns.
- *
- * @deprecated
- */
- readonly viewColumn: ViewColumn;
-
- /**
- * Whether the panel is active (focused by the user).
- */
- readonly active: boolean;
-
- /**
- * Whether the panel is visible.
- */
- readonly visible: boolean;
-
- /**
- * Fired when the panel's view state changes.
- */
- readonly onDidChangeViewState: Event;
-
- /**
- * Fired when the panel is disposed.
- *
- * This may be because the user closed the panel or because `.dispose()` was
- * called on it.
- *
- * Trying to use the panel after it has been disposed throws an exception.
- */
- readonly onDidDispose: Event;
-
- /**
- * Show the webview panel in a given column.
- *
- * A webview panel may only show in a single column at a time. If it is already showing, this
- * method moves it to a new column.
- *
- * @param viewColumn View column to show the panel in. Shows in the current `viewColumn` if undefined.
- * @param preserveFocus When `true`, the webview will not take focus.
- */
- reveal(viewColumn?: ViewColumn, preserveFocus?: boolean): void;
-
- /**
- * Dispose of the webview panel.
- *
- * This closes the panel if it showing and disposes of the resources owned by the webview.
- * Webview panels are also disposed when the user closes the webview panel. Both cases
- * fire the `onDispose` event.
- */
- dispose(): any;
-}
-
-/**
- * Event fired when a webview panel's view state changes.
- */
-export interface WebviewPanelOnDidChangeViewStateEvent {
- /**
- * Webview panel whose view state changed.
- */
- readonly webviewPanel: WebviewPanel;
-}
-
-/**
- * A webview displays html content, like an iframe.
- */
-export interface Webview {
- /**
- * Content settings for the webview.
- */
- options: WebviewOptions;
-
- /**
- * Contents of the webview.
- *
- * Should be a complete html document.
- */
- html: string;
-
- /**
- * Fired when the webview content posts a message.
- */
- readonly onDidReceiveMessage: Event;
-
- /**
- * Post a message to the webview content.
- *
- * Messages are only delivered if the webview is visible.
- *
- * @param message Body of the message.
- */
- postMessage(message: any): Thenable;
-
- /**
- * Convert a uri for the local file system to one that can be used inside webviews.
- *
- * Webviews cannot directly load resources from the workspace or local file system using `file:` uris. The
- * `asWebviewUri` function takes a local `file:` uri and converts it into a uri that can be used inside of
- * a webview to load the same resource:
- *
- * ```ts
- * webview.html = ``
- * ```
- */
- asWebviewUri(localResource: Uri): Uri;
-
- /**
- * Content security policy source for webview resources.
- *
- * This is the origin that should be used in a content security policy rule:
- *
- * ```
- * img-src https: ${webview.cspSource} ...;
- * ```
- */
- readonly cspSource: string;
-}
-
-/**
- * Content settings for a webview.
- */
-export interface WebviewOptions {
- /**
- * Controls whether scripts are enabled in the webview content or not.
- *
- * Defaults to false (scripts-disabled).
- */
- readonly enableScripts?: boolean;
-
- /**
- * Controls whether command uris are enabled in webview content or not.
- *
- * Defaults to false.
- */
- readonly enableCommandUris?: boolean;
-
- /**
- * Root paths from which the webview can load local (filesystem) resources using the `vscode-resource:` scheme.
- *
- * Default to the root folders of the current workspace plus the extension's install directory.
- *
- * Pass in an empty array to disallow access to any local resources.
- */
- readonly localResourceRoots?: ReadonlyArray;
-}
-
-/**
- * Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
- * and others. This API makes no assumption about what promise library is being used which
- * enables reusing existing code without migrating to a specific promise implementation. Still,
- * we recommend the use of native promises which are available in this editor.
- */
-export interface Thenable {
- /**
- * Attaches callbacks for the resolution and/or rejection of the Promise.
- * @param onfulfilled The callback to execute when the Promise is resolved.
- * @param onrejected The callback to execute when the Promise is rejected.
- * @returns A Promise for the completion of which ever callback is executed.
- */
- then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Thenable;
- then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => void): Thenable;
-}
-
-export interface Extension {
- readonly id: string;
- readonly packageJSON: any;
-}
-
-/**
- * Represents semantic tokens, either in a range or in an entire document.
- * @see [provideDocumentSemanticTokens](#DocumentSemanticTokensProvider.provideDocumentSemanticTokens) for an explanation of the format.
- * @see [SemanticTokensBuilder](#SemanticTokensBuilder) for a helper to create an instance.
- */
-export class SemanticTokens {
- /**
- * The result id of the tokens.
- *
- * This is the id that will be passed to `DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits` (if implemented).
- */
- readonly resultId?: string;
- /**
- * The actual tokens data.
- * @see [provideDocumentSemanticTokens](#DocumentSemanticTokensProvider.provideDocumentSemanticTokens) for an explanation of the format.
- */
- readonly data: Uint32Array;
-
- constructor(data: Uint32Array, resultId?: string) {
- this.data = data;
- this.resultId = resultId;
- }
-}
-
-/**
- * Represents edits to semantic tokens.
- * @see [provideDocumentSemanticTokensEdits](#DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits) for an explanation of the format.
- */
-export class SemanticTokensEdits {
- /**
- * The result id of the tokens.
- *
- * This is the id that will be passed to `DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits` (if implemented).
- */
- readonly resultId?: string;
- /**
- * The edits to the tokens data.
- * All edits refer to the initial data state.
- */
- readonly edits: SemanticTokensEdit[];
-
- constructor(edits: SemanticTokensEdit[], resultId?: string) {
- this.edits = edits;
- this.resultId = resultId;
- }
-}
-
-/**
- * Represents an edit to semantic tokens.
- * @see [provideDocumentSemanticTokensEdits](#DocumentSemanticTokensProvider.provideDocumentSemanticTokensEdits) for an explanation of the format.
- */
-export class SemanticTokensEdit {
- /**
- * The start offset of the edit.
- */
- readonly start: number;
- /**
- * The count of elements to remove.
- */
- readonly deleteCount: number;
- /**
- * The elements to insert.
- */
- readonly data?: Uint32Array;
-
- constructor(start: number, deleteCount: number, data?: Uint32Array) {
- this.start = start;
- this.deleteCount = deleteCount;
- this.data = data;
- }
-}
-
-export interface SemanticTokensLegend {
- readonly tokenTypes: string[];
- readonly tokenModifiers: string[];
-}
-
-/**
- * The document semantic tokens provider interface defines the contract between extensions and
- * semantic tokens.
- */
-export interface DocumentSemanticTokensProvider {
- /**
- * An optional event to signal that the semantic tokens from this provider have changed.
- */
- onDidChangeSemanticTokens?: Event;
-
- /**
- * Tokens in a file are represented as an array of integers. The position of each token is expressed relative to
- * the token before it, because most tokens remain stable relative to each other when edits are made in a file.
- *
- * ---
- * In short, each token takes 5 integers to represent, so a specific token `i` in the file consists of the following array indices:
- * - at index `5*i` - `deltaLine`: token line number, relative to the previous token
- * - at index `5*i+1` - `deltaStart`: token start character, relative to the previous token (relative to 0 or the previous token's start if they are on the same line)
- * - at index `5*i+2` - `length`: the length of the token. A token cannot be multiline.
- * - at index `5*i+3` - `tokenType`: will be looked up in `SemanticTokensLegend.tokenTypes`. We currently ask that `tokenType` < 65536.
- * - at index `5*i+4` - `tokenModifiers`: each set bit will be looked up in `SemanticTokensLegend.tokenModifiers`
- *
- * ---
- * ### How to encode tokens
- *
- * Here is an example for encoding a file with 3 tokens in a uint32 array:
- * ```
- * { line: 2, startChar: 5, length: 3, tokenType: "property", tokenModifiers: ["private", "static"] },
- * { line: 2, startChar: 10, length: 4, tokenType: "type", tokenModifiers: [] },
- * { line: 5, startChar: 2, length: 7, tokenType: "class", tokenModifiers: [] }
- * ```
- *
- * 1. First of all, a legend must be devised. This legend must be provided up-front and capture all possible token types.
- * For this example, we will choose the following legend which must be passed in when registering the provider:
- * ```
- * tokenTypes: ['property', 'type', 'class'],
- * tokenModifiers: ['private', 'static']
- * ```
- *
- * 2. The first transformation step is to encode `tokenType` and `tokenModifiers` as integers using the legend. Token types are looked
- * up by index, so a `tokenType` value of `1` means `tokenTypes[1]`. Multiple token modifiers can be set by using bit flags,
- * so a `tokenModifier` value of `3` is first viewed as binary `0b00000011`, which means `[tokenModifiers[0], tokenModifiers[1]]` because
- * bits 0 and 1 are set. Using this legend, the tokens now are:
- * ```
- * { line: 2, startChar: 5, length: 3, tokenType: 0, tokenModifiers: 3 },
- * { line: 2, startChar: 10, length: 4, tokenType: 1, tokenModifiers: 0 },
- * { line: 5, startChar: 2, length: 7, tokenType: 2, tokenModifiers: 0 }
- * ```
- *
- * 3. The next step is to represent each token relative to the previous token in the file. In this case, the second token
- * is on the same line as the first token, so the `startChar` of the second token is made relative to the `startChar`
- * of the first token, so it will be `10 - 5`. The third token is on a different line than the second token, so the
- * `startChar` of the third token will not be altered:
- * ```
- * { deltaLine: 2, deltaStartChar: 5, length: 3, tokenType: 0, tokenModifiers: 3 },
- * { deltaLine: 0, deltaStartChar: 5, length: 4, tokenType: 1, tokenModifiers: 0 },
- * { deltaLine: 3, deltaStartChar: 2, length: 7, tokenType: 2, tokenModifiers: 0 }
- * ```
- *
- * 4. Finally, the last step is to inline each of the 5 fields for a token in a single array, which is a memory friendly representation:
- * ```
- * // 1st token, 2nd token, 3rd token
- * [ 2,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ]
- * ```
- *
- * @see [SemanticTokensBuilder](#SemanticTokensBuilder) for a helper to encode tokens as integers.
- * *NOTE*: When doing edits, it is possible that multiple edits occur until VS Code decides to invoke the semantic tokens provider.
- * *NOTE*: If the provider cannot temporarily compute semantic tokens, it can indicate this by throwing an error with the message 'Busy'.
- */
- provideDocumentSemanticTokens(document: TextDocument, token: CancellationToken): ProviderResult;
-
- /**
- * Instead of always returning all the tokens in a file, it is possible for a `DocumentSemanticTokensProvider` to implement
- * this method (`provideDocumentSemanticTokensEdits`) and then return incremental updates to the previously provided semantic tokens.
- *
- * ---
- * ### How tokens change when the document changes
- *
- * Suppose that `provideDocumentSemanticTokens` has previously returned the following semantic tokens:
- * ```
- * // 1st token, 2nd token, 3rd token
- * [ 2,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ]
- * ```
- *
- * Also suppose that after some edits, the new semantic tokens in a file are:
- * ```
- * // 1st token, 2nd token, 3rd token
- * [ 3,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ]
- * ```
- * It is possible to express these new tokens in terms of an edit applied to the previous tokens:
- * ```
- * [ 2,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ] // old tokens
- * [ 3,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ] // new tokens
- *
- * edit: { start: 0, deleteCount: 1, data: [3] } // replace integer at offset 0 with 3
- * ```
- *
- * *NOTE*: If the provider cannot compute `SemanticTokensEdits`, it can "give up" and return all the tokens in the document again.
- * *NOTE*: All edits in `SemanticTokensEdits` contain indices in the old integers array, so they all refer to the previous result state.
- */
- provideDocumentSemanticTokensEdits?(document: TextDocument, previousResultId: string, token: CancellationToken): ProviderResult;
-}
-
-/**
- * The document range semantic tokens provider interface defines the contract between extensions and
- * semantic tokens.
- */
-export interface DocumentRangeSemanticTokensProvider {
- /**
- * @see [provideDocumentSemanticTokens](#DocumentSemanticTokensProvider.provideDocumentSemanticTokens).
- */
- provideDocumentRangeSemanticTokens(document: TextDocument, range: Range, token: CancellationToken): ProviderResult;
-}
-
-export interface api {
- commands: {
- executeCommand: (command: string, ...rest: any[]) => Thenable;
- registerCommand(command: string, callback: (...args: any[]) => any, thisArg?: any): Disposable;
- };
- languages: {
- match: (selector: DocumentSelector, document: TextDocument) => number;
- /**
- * Register a semantic tokens provider for a whole document.
- *
- * Multiple providers can be registered for a language. In that case providers are sorted
- * by their [score](#languages.match) and the best-matching provider is used. Failure
- * of the selected provider will cause a failure of the whole operation.
- *
- * @param selector A selector that defines the documents this provider is applicable to.
- * @param provider A document semantic tokens provider.
- * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
- */
- registerDocumentSemanticTokensProvider(selector: DocumentSelector, provider: DocumentSemanticTokensProvider, legend: SemanticTokensLegend): Disposable;
-
- /**
- * Register a semantic tokens provider for a document range.
- *
- * *Note:* If a document has both a `DocumentSemanticTokensProvider` and a `DocumentRangeSemanticTokensProvider`,
- * the range provider will be invoked only initially, for the time in which the full document provider takes
- * to resolve the first request. Once the full document provider resolves the first request, the semantic tokens
- * provided via the range provider will be discarded and from that point forward, only the document provider
- * will be used.
- *
- * Multiple providers can be registered for a language. In that case providers are sorted
- * by their [score](#languages.match) and the best-matching provider is used. Failure
- * of the selected provider will cause a failure of the whole operation.
- *
- * @param selector A selector that defines the documents this provider is applicable to.
- * @param provider A document range semantic tokens provider.
- * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
- */
- registerDocumentRangeSemanticTokensProvider(selector: DocumentSelector, provider: DocumentRangeSemanticTokensProvider, legend: SemanticTokensLegend): Disposable;
-
- };
- window: {
- activeTextEditor: TextEditor | undefined;
- showInformationMessage: (message: string, ...items: T[]) => Thenable;
- showWarningMessage: (message: string, ...items: T[]) => Thenable;
- showErrorMessage(message: string, ...items: string[]): Thenable;
- createOutputChannel(name: string): OutputChannel;
- registerWebviewPanelSerializer(viewType: string, serializer: WebviewPanelSerializer): Disposable;
- };
- workspace: {
- openTextDocument: (uri: Uri) => Thenable;
- getConfiguration: (section?: string, resource?: Uri) => WorkspaceConfiguration;
- asRelativePath: (pathOrUri: string | Uri, includeWorkspaceFolder?: boolean) => string;
- createFileSystemWatcher(globPattern: GlobPattern, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): FileSystemWatcher;
- onDidChangeConfiguration: Event;
- };
- extensions: {
- getExtension(extensionId: string): Extension | undefined;
- all: ReadonlyArray>;
- };
- Uri: {
- parse(value: string): Uri;
- };
- Disposable: {
- from(...disposableLikes: { dispose: () => any }[]): Disposable;
- };
-
- version: string;
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/tsconfig.json b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/tsconfig.json
deleted file mode 100644
index 17f0209c07b..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/tsconfig.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "extends": "../../tsconfig.json",
- "compilerOptions": {
- "outDir": "dist"
- },
- "include": [
- "./src/**/*"
- ]
-}
\ No newline at end of file
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/tslint.json b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/tslint.json
deleted file mode 100644
index 40a18cdec2d..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/tslint.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": "../../tslint.json"
-}
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/yarn.lock b/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/yarn.lock
deleted file mode 100644
index 5e20c8cca11..00000000000
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/yarn.lock
+++ /dev/null
@@ -1,376 +0,0 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
-# yarn lockfile v1
-
-
-"@babel/code-frame@^7.0.0":
- version "7.16.0"
- resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz"
- integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==
- dependencies:
- "@babel/highlight" "^7.16.0"
-
-"@babel/helper-validator-identifier@^7.15.7":
- version "7.15.7"
- resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz"
- integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==
-
-"@babel/highlight@^7.16.0":
- version "7.16.0"
- resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz"
- integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==
- dependencies:
- "@babel/helper-validator-identifier" "^7.15.7"
- chalk "^2.0.0"
- js-tokens "^4.0.0"
-
-"@types/node@^10.9.4":
- version "10.17.60"
- resolved "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz"
- integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==
-
-"@types/vscode@1.69.0":
- version "1.69.0"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.69.0.tgz"
- integrity sha1-pHIBGvOS+8+Cy7gvYLTCOcIbkhw=
-
-ansi-styles@^3.2.1:
- version "3.2.1"
- resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz"
- integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
- dependencies:
- color-convert "^1.9.0"
-
-argparse@^1.0.7:
- version "1.0.10"
- resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz"
- integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
- dependencies:
- sprintf-js "~1.0.2"
-
-argparse@^2.0.1:
- version "2.0.1"
- resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz"
- integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
-
-balanced-match@^1.0.0:
- version "1.0.2"
- resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz"
- integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
-
-brace-expansion@^1.1.7:
- version "1.1.11"
- resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz"
- integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
- dependencies:
- balanced-match "^1.0.0"
- concat-map "0.0.1"
-
-builtin-modules@^1.1.1:
- version "1.1.1"
- resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz"
- integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
-
-chalk@^2.0.0, chalk@^2.3.0:
- version "2.4.2"
- resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz"
- integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
- dependencies:
- ansi-styles "^3.2.1"
- escape-string-regexp "^1.0.5"
- supports-color "^5.3.0"
-
-color-convert@^1.9.0:
- version "1.9.3"
- resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz"
- integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
- dependencies:
- color-name "1.1.3"
-
-color-name@1.1.3:
- version "1.1.3"
- resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
- integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
-
-commander@^2.12.1:
- version "2.20.3"
- resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz"
- integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
-
-concat-map@0.0.1:
- version "0.0.1"
- resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
- integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
-
-diff@^4.0.1:
- version "4.0.2"
- resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz"
- integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
-
-escape-string-regexp@^1.0.5:
- version "1.0.5"
- resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz"
- integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
-
-esprima@^4.0.0:
- version "4.0.1"
- resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz"
- integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
-
-fs.realpath@^1.0.0:
- version "1.0.0"
- resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
- integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
-
-function-bind@^1.1.1:
- version "1.1.1"
- resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
- integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
-
-glob@^7.1.1, glob@^7.1.3:
- version "7.2.0"
- resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz"
- integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
- dependencies:
- fs.realpath "^1.0.0"
- inflight "^1.0.4"
- inherits "2"
- minimatch "^3.0.4"
- once "^1.3.0"
- path-is-absolute "^1.0.0"
-
-has-flag@^3.0.0:
- version "3.0.0"
- resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz"
- integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
-
-has@^1.0.3:
- version "1.0.3"
- resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz"
- integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
- dependencies:
- function-bind "^1.1.1"
-
-inflight@^1.0.4:
- version "1.0.6"
- resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz"
- integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
- dependencies:
- once "^1.3.0"
- wrappy "1"
-
-inherits@2:
- version "2.0.4"
- resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz"
- integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
-
-is-core-module@^2.2.0:
- version "2.8.0"
- resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz"
- integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==
- dependencies:
- has "^1.0.3"
-
-js-tokens@^4.0.0:
- version "4.0.0"
- resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
- integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
-
-js-yaml@>=3.13.1:
- version "4.1.0"
- resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz"
- integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
- dependencies:
- argparse "^2.0.1"
-
-js-yaml@^3.13.1:
- version "3.14.1"
- resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz"
- integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
- dependencies:
- argparse "^1.0.7"
- esprima "^4.0.0"
-
-minimatch@3.0.5:
- version "3.0.5"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/minimatch/-/minimatch-3.0.5.tgz#4da8f1290ee0f0f8e83d60ca69f8f134068604a3"
- integrity sha1-TajxKQ7g8PjoPWDKafjxNAaGBKM=
- dependencies:
- brace-expansion "^1.1.7"
-
-minimatch@^3.0.4:
- version "3.0.4"
- resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz"
- integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
- dependencies:
- brace-expansion "^1.1.7"
-
-minimist@^1.2.5:
- version "1.2.6"
- resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz"
- integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
-
-mkdirp@^0.5.1:
- version "0.5.5"
- resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz"
- integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
- dependencies:
- minimist "^1.2.5"
-
-once@^1.3.0:
- version "1.4.0"
- resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz"
- integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
- dependencies:
- wrappy "1"
-
-path-is-absolute@^1.0.0:
- version "1.0.1"
- resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz"
- integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
-
-path-parse@^1.0.6:
- version "1.0.7"
- resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz"
- integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
-
-ps-list@7.2.0:
- version "7.2.0"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ps-list/-/ps-list-7.2.0.tgz"
- integrity sha1-PREOHegkmksXjJsc8qIV0eTkL8A=
-
-resolve@^1.3.2:
- version "1.20.0"
- resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz"
- integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
- dependencies:
- is-core-module "^2.2.0"
- path-parse "^1.0.6"
-
-rimraf@2.6.3:
- version "2.6.3"
- resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz"
- integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
- dependencies:
- glob "^7.1.3"
-
-semver@^5.3.0:
- version "5.7.1"
- resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz"
- integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
-
-semver@^7.3.5:
- version "7.3.7"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/semver/-/semver-7.3.7.tgz"
- integrity sha1-EsW2Sa/b+QSXB3luIqQCiBTOUj8=
- dependencies:
- lru-cache "^6.0.0"
-
-sprintf-js@~1.0.2:
- version "1.0.3"
- resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
- integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
-
-supports-color@^5.3.0:
- version "5.5.0"
- resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz"
- integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
- dependencies:
- has-flag "^3.0.0"
-
-tslib@^1.8.0, tslib@^1.8.1:
- version "1.14.1"
- resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"
- integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
-
-tslint@^5.11.0:
- version "5.20.1"
- resolved "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz"
- integrity sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==
- dependencies:
- "@babel/code-frame" "^7.0.0"
- builtin-modules "^1.1.1"
- chalk "^2.3.0"
- commander "^2.12.1"
- diff "^4.0.1"
- glob "^7.1.1"
- js-yaml "^3.13.1"
- minimatch "^3.0.4"
- mkdirp "^0.5.1"
- resolve "^1.3.2"
- semver "^5.3.0"
- tslib "^1.8.0"
- tsutils "^2.29.0"
-
-tsutils@^2.29.0:
- version "2.29.0"
- resolved "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz"
- integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
- dependencies:
- tslib "^1.8.1"
-
-typescript@~4.5.4:
- version "4.5.5"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
- integrity sha1-2MlTgy0okkqePTfHPXKchGxYlvM=
-
-vscode-html-languageservice@^5.0.1:
- version "5.0.1"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/vscode-html-languageservice/-/vscode-html-languageservice-5.0.1.tgz"
- integrity sha1-vfeEfSekU6npiuKDbq11lHhMXBw=
- dependencies:
- vscode-languageserver-textdocument "^1.0.4"
- vscode-languageserver-types "^3.17.1"
- vscode-nls "^5.0.1"
- vscode-uri "^3.0.3"
-
-vscode-jsonrpc@8.0.2:
- version "8.0.2"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz"
- integrity sha1-8jntLNYAQCG2VQr5/Z0+R+7jysk=
-
-vscode-languageclient@8.0.2:
- version "8.0.2"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/vscode-languageclient/-/vscode-languageclient-8.0.2.tgz"
- integrity sha1-8fI86MhISqEeS337JEN9Plm7YcY=
- dependencies:
- minimatch "^3.0.4"
- semver "^7.3.5"
- vscode-languageserver-protocol "3.17.2"
-
-vscode-languageserver-protocol@3.17.2:
- version "3.17.2"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2.tgz"
- integrity sha1-vqpGrqBu0GFXZYbF4RNoqa/B03g=
- dependencies:
- vscode-jsonrpc "8.0.2"
- vscode-languageserver-types "3.17.2"
-
-vscode-languageserver-textdocument@^1.0.4, vscode-languageserver-textdocument@^1.0.5:
- version "1.0.7"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz"
- integrity sha1-Ft9GjVwmBhA8kFVK4F+fPTNbdxs=
-
-vscode-languageserver-types@3.17.2, vscode-languageserver-types@^3.17.1:
- version "3.17.2"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz"
- integrity sha1-ssLn3kBa09c6iD6RmJuFAXD/xPI=
-
-vscode-nls@^5.0.1:
- version "5.2.0"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/vscode-nls/-/vscode-nls-5.2.0.tgz"
- integrity sha1-PLaJPdm9aVJE2KAkvfdG7qZlzD8=
-
-vscode-uri@^3.0.3:
- version "3.0.3"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/vscode-uri/-/vscode-uri-3.0.3.tgz"
- integrity sha1-qVwc4ub0G3VJ+GJ50Z9HlR5PTYQ=
-
-wrappy@1:
- version "1.0.2"
- resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz"
- integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
-
-yallist@^4.0.0:
- version "4.0.0"
- resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/yallist/-/yallist-4.0.0.tgz"
- integrity sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=
diff --git a/src/Razor/src/rzls/rzls.csproj b/src/Razor/src/rzls/rzls.csproj
index 2e2fedc53e2..2128b080778 100644
--- a/src/Razor/src/rzls/rzls.csproj
+++ b/src/Razor/src/rzls/rzls.csproj
@@ -23,14 +23,6 @@
-
-
- $(PublishDir)\OmniSharpPlugin
-
-
-
-
-