From b45e819b1d879f2365dcb06769b9e7a6de12feb2 Mon Sep 17 00:00:00 2001 From: Ravi Chande Date: Tue, 2 Oct 2018 10:28:42 -0700 Subject: [PATCH] Revert "Merge pull request #2554 from SteveSandersonMS/stevesa/initial-razor-support" This reverts commit 44536b3bc812b9d4b300644d4a25ed7581bfcd58, reversing changes made to 984b2f8464ef34e928a9d168bfdd3afe9a6c5a25. --- .gitignore | 1 - package-lock.json | 83 +---------- package.json | 136 +----------------- src/main.ts | 5 - src/omnisharp/options.ts | 7 +- src/omnisharp/server.ts | 18 +-- src/razor/language-configuration.json | 23 --- src/razor/razor.ts | 25 ---- .../syntaxes/aspnetcorerazor.tmLanguage.json | 9 -- 9 files changed, 15 insertions(+), 292 deletions(-) delete mode 100644 src/razor/language-configuration.json delete mode 100644 src/razor/razor.ts delete mode 100644 src/razor/syntaxes/aspnetcorerazor.tmLanguage.json diff --git a/.gitignore b/.gitignore index 16d4f06af..8f4f1755c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ out .omnisharp-*/ .debugger .vscode-test -.razor install.* diff --git a/package-lock.json b/package-lock.json index 2c2bc7ee8..61aef1462 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "csharp", - "version": "1.17.0-beta2", + "version": "1.17.0-beta1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2508,7 +2508,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", - "dev": true, "requires": { "pend": "1.2.0" } @@ -4251,7 +4250,7 @@ "through2": "2.0.3", "vinyl": "2.1.0", "vinyl-fs": "2.4.4", - "yauzl": "2.10.0", + "yauzl": "2.9.1", "yazl": "2.4.3" }, "dependencies": { @@ -5666,14 +5665,6 @@ "to-regex": "3.0.2" } }, - "microsoft.aspnetcore.razor.vscode": { - "version": "https://download.visualstudio.microsoft.com/download/pr/d426e899-f31c-4405-81ca-1d17254c3721/ce32e93d4d2f9c165fde02c82dc408ad/microsoft.aspnetcore.razor.vscode-1.0.0-alpha1-20180928.2.tgz", - "integrity": "sha512-mO7YCMcGVY6dYRjeJaSZ1vNI8YtL8jjj25/RDC9cUFUattNZLXGr9bfKecm3Hq6C11NfB3RFsjDtfz+EEq1egw==", - "requires": { - "vscode-html-languageservice": "2.1.9", - "vscode-languageclient": "5.1.0" - } - }, "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -11629,7 +11620,7 @@ "tmp": "0.0.29", "url-join": "1.1.0", "vso-node-api": "6.1.2-preview", - "yauzl": "2.10.0", + "yauzl": "2.9.1", "yazl": "2.4.3" }, "dependencies": { @@ -11708,61 +11699,11 @@ "applicationinsights": "1.0.1" } }, - "vscode-html-languageservice": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-2.1.9.tgz", - "integrity": "sha512-zHb6zqt55THIkHjywsjBqGwBr9vCOmBDh6mGyyawGi/8XH2Y6yIAH7KXTxN4Ov9A2M0CT2mwSA3tl+IKtIJtjg==", - "requires": { - "vscode-languageserver-types": "3.13.0", - "vscode-nls": "4.0.0", - "vscode-uri": "1.0.6" - }, - "dependencies": { - "vscode-nls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-4.0.0.tgz", - "integrity": "sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw==" - } - } - }, - "vscode-jsonrpc": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz", - "integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==" - }, - "vscode-languageclient": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-5.1.0.tgz", - "integrity": "sha512-Z95Kps8UqD4o17HE3uCkZuvenOsxHVH46dKmaGVpGixEFZigPaVuVxLM/JWeIY9aRenoC0ZD9CK1O7L4jpffKg==", - "requires": { - "semver": "5.5.0", - "vscode-languageserver-protocol": "3.13.0" - } - }, - "vscode-languageserver-protocol": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.13.0.tgz", - "integrity": "sha512-2ZGKwI+P2ovQll2PGAp+2UfJH+FK9eait86VBUdkPd9HRlm8e58aYT9pV/NYanHOcp3pL6x2yTLVCFMcTer0mg==", - "requires": { - "vscode-jsonrpc": "4.0.0", - "vscode-languageserver-types": "3.13.0" - } - }, - "vscode-languageserver-types": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.13.0.tgz", - "integrity": "sha512-BnJIxS+5+8UWiNKCP7W3g9FlE7fErFw0ofP5BXJe7c2tl0VeWh+nNHFbwAS2vmVC4a5kYxHBjRy0UeOtziemVA==" - }, "vscode-nls": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-2.0.2.tgz", "integrity": "sha1-gIUiOAhEuK0VNJmvXDsDkhrqAto=" }, - "vscode-uri": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-1.0.6.tgz", - "integrity": "sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww==" - }, "vso-node-api": { "version": "6.1.2-preview", "resolved": "https://registry.npmjs.org/vso-node-api/-/vso-node-api-6.1.2-preview.tgz", @@ -11921,22 +11862,12 @@ } }, "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.9.1.tgz", + "integrity": "sha1-qBmB6nCleUYTOIPwKcWCGok1mn8=", "requires": { "buffer-crc32": "0.2.13", - "fd-slicer": "1.1.0" - }, - "dependencies": { - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "requires": { - "pend": "1.2.0" - } - } + "fd-slicer": "1.0.1" } }, "yazl": { diff --git a/package.json b/package.json index f2b9c9b5a..96eb3f2ce 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,6 @@ "http-proxy-agent": "2.1.0", "https-proxy-agent": "2.2.1", "jsonc-parser": "1.0.0", - "microsoft.aspnetcore.razor.vscode": "https://download.visualstudio.microsoft.com/download/pr/d426e899-f31c-4405-81ca-1d17254c3721/ce32e93d4d2f9c165fde02c82dc408ad/microsoft.aspnetcore.razor.vscode-1.0.0-alpha1-20180928.2.tgz", "mkdirp": "0.5.1", "node-filter-async": "0.0.4", "open": "*", @@ -85,7 +84,7 @@ "tmp": "0.0.33", "vscode-debugprotocol": "1.6.1", "vscode-extension-telemetry": "0.0.15", - "yauzl": "2.10.0" + "yauzl": "2.9.1" }, "devDependencies": { "@types/archiver": "2.1.1", @@ -269,56 +268,6 @@ "./vsdbg" ], "installTestPath": "./.debugger/vsdbg-ui" - }, - { - "description": "Razor Language Server (Windows / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d426e899-f31c-4405-81ca-1d17254c3721/d468ed9ab48f88c032d9eed7a53c8ef4/razorlanguageserver-win-x64-1.0.0-alpha1-20180928.2.zip", - "installPath": ".razor", - "platforms": [ - "win32" - ], - "architectures": [ - "x86_64" - ] - }, - { - "description": "Razor Language Server (Windows / x86)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d426e899-f31c-4405-81ca-1d17254c3721/99eb2f24eb073c70d5a8082bfbf5a965/razorlanguageserver-win-x86-1.0.0-alpha1-20180928.2.zip", - "installPath": ".razor", - "platforms": [ - "win32" - ], - "architectures": [ - "x86" - ] - }, - { - "description": "Razor Language Server (Linux / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d426e899-f31c-4405-81ca-1d17254c3721/775ccdd8f99150fe3175359d54e2bb20/razorlanguageserver-linux-x64-1.0.0-alpha1-20180928.2.zip", - "installPath": ".razor", - "platforms": [ - "linux" - ], - "architectures": [ - "x86_64" - ], - "binaries": [ - "./rzls" - ] - }, - { - "description": "Razor Language Server (macOS / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d426e899-f31c-4405-81ca-1d17254c3721/26c0909b773db807d0578c0a0eefb225/razorlanguageserver-osx-x64-1.0.0-alpha1-20180928.2.zip", - "installPath": ".razor", - "platforms": [ - "darwin" - ], - "architectures": [ - "x86_64" - ], - "binaries": [ - "./rzls" - ] } ], "engines": { @@ -327,7 +276,6 @@ "activationEvents": [ "onDebug", "onLanguage:csharp", - "onLanguage:aspnetcorerazor", "onCommand:o.restart", "onCommand:o.pickProjectAndStart", "onCommand:o.showOutput", @@ -654,39 +602,6 @@ "type": "boolean", "default": false, "description": "Specifies whether notifications should be shown if OmniSharp encounters warnings or errors loading a project. Note that these warnings/errors are always emitted to the OmniSharp log" - }, - "razor.disabled": { - "type": "boolean", - "default": false, - "description": "Specifies whether to disable Razor language features." - }, - "razor.languageServer.directory": { - "type": [ - "string", - "null" - ], - "default": null, - "description": "Overrides the path to the Razor Language Server directory." - }, - "razor.languageServer.debug": { - "type": "boolean", - "default": false, - "description": "Specifies whether to wait for debug attach when launching the language server." - }, - "razor.languageServer.trace": { - "type": "string", - "default": "Off", - "enum": [ - "Off", - "Messages", - "Verbose" - ], - "enumDescriptions": [ - "Does not log messages from Razor Language Server", - "Logs only some messages from Razor Language Server", - "Logs all messages from Razor Language Server" - ], - "description": "Specifies whether to output all messages [Verbose], some messages [Messages] or not at all [Off]." } } }, @@ -745,16 +660,6 @@ "command": "csharp.reportIssue", "title": "Start authoring a new issue on GitHub", "category": "CSharp" - }, - { - "command": "extension.showRazorCSharpWindow", - "title": "Show Razor CSharp", - "category": "Razor" - }, - { - "command": "extension.showRazorHtmlWindow", - "title": "Show Razor Html", - "category": "Razor" } ], "keybindings": [ @@ -777,8 +682,7 @@ "enableBreakpointsFor": { "languageIds": [ "csharp", - "razor", - "aspnetcorerazor" + "razor" ] }, "variables": { @@ -1845,8 +1749,7 @@ "enableBreakpointsFor": { "languageIds": [ "csharp", - "razor", - "aspnetcorerazor" + "razor" ] }, "variables": { @@ -2809,37 +2712,6 @@ } } } - ], - "languages": [ - { - "id": "aspnetcorerazor", - "extensions": [ - ".cshtml" - ], - "mimetypes": [ - "text/x-cshtml" - ], - "configuration": "./src/razor/language-configuration.json" - } - ], - "grammars": [ - { - "language": "aspnetcorerazor", - "scopeName": "text.aspnetcorerazor", - "path": "./src/razor/syntaxes/aspnetcorerazor.tmLanguage.json" - } - ], - "menus": { - "editor/title": [ - { - "command": "extension.showRazorCSharpWindow", - "when": "resourceLangId == aspnetcorerazor" - }, - { - "command": "extension.showRazorHtmlWindow", - "when": "resourceLangId == aspnetcorerazor" - } - ] - } + ] } } diff --git a/src/main.ts b/src/main.ts index e48f524c0..cbc8b93f2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -37,7 +37,6 @@ import { ShowOmniSharpConfigChangePrompt } from './observers/OptionChangeObserve import createOptionStream from './observables/CreateOptionStream'; import { CSharpExtensionId } from './constants/CSharpExtensionId'; import { OpenURLObserver } from './observers/OpenURLObserver'; -import { activateRazorExtension } from './razor/razor'; export async function activate(context: vscode.ExtensionContext): Promise { @@ -135,10 +134,6 @@ export async function activate(context: vscode.ExtensionContext): Promise { let omniSharp = await omniSharpPromise; diff --git a/src/omnisharp/options.ts b/src/omnisharp/options.ts index 7853df52e..0f9dd1199 100644 --- a/src/omnisharp/options.ts +++ b/src/omnisharp/options.ts @@ -23,8 +23,7 @@ export class Options { public minFindSymbolsFilterLength: number, public maxFindSymbolsItems: number, public defaultLaunchSolution?: string, - public monoPath?: string, - public razorDisabled?: boolean) { } + public monoPath?: string) { } public static Read(vscode: vscode): Options { @@ -37,7 +36,6 @@ export class Options { const omnisharpConfig = vscode.workspace.getConfiguration('omnisharp'); const csharpConfig = vscode.workspace.getConfiguration('csharp'); - const razorConfig = vscode.workspace.getConfiguration('razor'); const path = Options.readPathOption(csharpConfig, omnisharpConfig); const useGlobalMono = Options.readUseGlobalMonoOption(omnisharpConfig, csharpConfig); @@ -70,8 +68,6 @@ export class Options { const minFindSymbolsFilterLength = omnisharpConfig.get('minFindSymbolsFilterLength', 0); const maxFindSymbolsItems = omnisharpConfig.get('maxFindSymbolsItems', 1000); // The limit is applied only when this setting is set to a number greater than zero - const razorDisabled = !!razorConfig && razorConfig.get('disabled', false); - return new Options( path, useGlobalMono, @@ -90,7 +86,6 @@ export class Options { maxFindSymbolsItems, defaultLaunchSolution, monoPath, - razorDisabled ); } diff --git a/src/omnisharp/server.ts b/src/omnisharp/server.ts index 11761756a..38a537a24 100644 --- a/src/omnisharp/server.ts +++ b/src/omnisharp/server.ts @@ -3,7 +3,6 @@ * 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 * as protocol from './protocol'; import * as utils from '../common'; @@ -94,7 +93,7 @@ export class OmniSharpServer { private updateProjectDebouncer = new Subject(); private firstUpdateProject: boolean; - constructor(private vscode: vscode, networkSettingsProvider: NetworkSettingsProvider, private packageJSON: any, private platformInfo: PlatformInformation, private eventStream: EventStream, private optionProvider: OptionProvider, private extensionPath: string, private monoResolver: IMonoResolver) { + constructor(private vscode: vscode, networkSettingsProvider: NetworkSettingsProvider, private packageJSON: any, private platformInfo: PlatformInformation, private eventStream: EventStream, private optionProvider: OptionProvider, extensionPath: string, private monoResolver: IMonoResolver) { this._requestQueue = new RequestQueueCollection(this.eventStream, 8, request => this._makeRequest(request)); let downloader = new OmnisharpDownloader(networkSettingsProvider, this.eventStream, this.packageJSON, platformInfo, extensionPath); this._omnisharpManager = new OmnisharpManager(downloader, platformInfo); @@ -305,25 +304,14 @@ export class OmniSharpServer { '--loglevel', options.loggingLevel ]; - if (!options.razorDisabled) { - // Razor support only exists for certain platforms, so only load the plugin if present - const razorPluginPath = path.join( - this.extensionPath, - '.razor', - 'OmniSharpPlugin', - 'Microsoft.AspNetCore.Razor.OmniSharpPlugin.dll'); - if (fs.existsSync(razorPluginPath)) { - args.push('--plugin', razorPluginPath); - } - } - if (options.waitForDebugger === true) { args.push('--debug'); } let launchInfo: LaunchInfo; try { - launchInfo = await this._omnisharpManager.GetOmniSharpLaunchInfo(this.packageJSON.defaults.omniSharp, options.path, serverUrl, latestVersionFileServerPath, installPath, this.extensionPath); + let extensionPath = utils.getExtensionPath(); + launchInfo = await this._omnisharpManager.GetOmniSharpLaunchInfo(this.packageJSON.defaults.omniSharp, options.path, serverUrl, latestVersionFileServerPath, installPath, extensionPath); } catch (error) { this.eventStream.post(new ObservableEvents.OmnisharpFailure(`Error occured in loading omnisharp from omnisharp.path\nCould not start the server due to ${error.toString()}`, error)); diff --git a/src/razor/language-configuration.json b/src/razor/language-configuration.json deleted file mode 100644 index e2a49bcbd..000000000 --- a/src/razor/language-configuration.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "comments": { - "blockComment": [ "" ] - }, - "brackets": [ - [""], - ["<", ">"], - ["{", "}"], - ["(", ")"] - ], - "autoClosingPairs": [ - { "open": "{", "close": "}"}, - { "open": "[", "close": "]"}, - { "open": "(", "close": ")" }, - { "open": "'", "close": "'" }, - { "open": "\"", "close": "\"" } - ], - "surroundingPairs": [ - { "open": "'", "close": "'" }, - { "open": "\"", "close": "\"" }, - { "open": "<", "close": ">" } - ] -} \ No newline at end of file diff --git a/src/razor/razor.ts b/src/razor/razor.ts deleted file mode 100644 index e40034d8d..000000000 --- a/src/razor/razor.ts +++ /dev/null @@ -1,25 +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 * as vscode from 'vscode'; -import * as Razor from 'microsoft.aspnetcore.razor.vscode'; -import { EventStream } from '../EventStream'; - -export async function activateRazorExtension(context: vscode.ExtensionContext, extensionPath: string, eventStream: EventStream) { - const razorConfig = vscode.workspace.getConfiguration('razor'); - const configuredLanguageServerDir = razorConfig.get('languageServer.directory', null); - const languageServerDir = configuredLanguageServerDir || path.join(extensionPath, '.razor'); - - if (fs.existsSync(languageServerDir)) { - await Razor.activate(context, languageServerDir, eventStream); - } else if (configuredLanguageServerDir) { - // It's only an error if the nonexistent dir was explicitly configured - // If it's the default dir, this is expected for unsupported platforms - vscode.window.showErrorMessage( - `Cannot load Razor language server because the configured directory was not found: '${languageServerDir}'`); - } -} diff --git a/src/razor/syntaxes/aspnetcorerazor.tmLanguage.json b/src/razor/syntaxes/aspnetcorerazor.tmLanguage.json deleted file mode 100644 index 382d53b1f..000000000 --- a/src/razor/syntaxes/aspnetcorerazor.tmLanguage.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "ASP.NET Core Razor", - "scopeName": "text.aspnetcorerazor", - "patterns": [ - { - "include": "text.html.cshtml" - } - ] -}