Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug tests #7707

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 75 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@
"tmp": "0.0.33",
"uuid": "^9.0.0",
"vscode-html-languageservice": "^5.0.1",
"vscode-jsonrpc": "8.2.0-next.0",
"vscode-languageclient": "8.2.0-next.1",
"vscode-languageserver-protocol": "3.17.4-next.1",
"vscode-jsonrpc": "8.2.1",
"vscode-languageclient": "9.0.1",
"vscode-languageserver-protocol": "3.17.5",
"vscode-languageserver-textdocument": "^1.0.5",
"vscode-nls": "5.0.1",
"yauzl": "2.10.0"
Expand Down
2 changes: 2 additions & 0 deletions src/csharpExtensionExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ export interface CSharpExtensionExperimentalExports {
token: vscode.CancellationToken
) => Promise<Response>;
languageServerEvents: LanguageServerEvents;
outputChannel: vscode.OutputChannel;
traceChannel: vscode.OutputChannel;
}
3 changes: 3 additions & 0 deletions src/lsptoolshost/onAutoInsertFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export class OnAutoInsertFeature implements DynamicFeature<RoslynProtocol.OnAuto
RoslynProtocol.OnAutoInsertRegistrationOptions
>(RoslynProtocol.OnAutoInsertRequest.method);
}
clear(): void {
this._registrations.clear();
}
fillInitializeParams?: ((params: InitializeParams) => void) | undefined;
preInitialize?:
| ((capabilities: ServerCapabilities<any>, documentSelector: DocumentSelector | undefined) => void)
Expand Down
6 changes: 2 additions & 4 deletions src/lsptoolshost/roslynLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1063,14 +1063,12 @@ export async function activateRoslynLanguageServer(
platformInfo: PlatformInformation,
optionObservable: Observable<void>,
outputChannel: vscode.LogOutputChannel,
traceChannel: vscode.OutputChannel,
reporter: TelemetryReporter,
languageServerEvents: RoslynLanguageServerEvents
): Promise<RoslynLanguageServer> {
// Create a channel for outputting general logs from the language server.
_channel = outputChannel;
// Create a separate channel for outputting trace logs - these are incredibly verbose and make other logs very difficult to see.
// The trace channel verbosity is controlled by the _channel verbosity.
_traceChannel = vscode.window.createOutputChannel('C# LSP Trace Logs');
_traceChannel = traceChannel;

const hostExecutableResolver = new DotnetRuntimeExtensionResolver(
platformInfo,
Expand Down
5 changes: 2 additions & 3 deletions src/lsptoolshost/roslynProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import { Command } from 'vscode';
import * as lsp from 'vscode-languageserver-protocol';
import { CodeAction, TextDocumentRegistrationOptions } from 'vscode-languageserver-protocol';
import { ProjectConfigurationMessage } from '../shared/projectConfiguration';

export interface VSProjectContextList {
Expand Down Expand Up @@ -95,7 +94,7 @@ export interface OnAutoInsertOptions {
/**
* Registration options for an {@link OnAutoInsertRequest}.
*/
export interface OnAutoInsertRegistrationOptions extends TextDocumentRegistrationOptions, OnAutoInsertOptions {}
export interface OnAutoInsertRegistrationOptions extends lsp.TextDocumentRegistrationOptions, OnAutoInsertOptions {}

export interface RegisterSolutionSnapshotResponseItem {
/**
Expand Down Expand Up @@ -185,7 +184,7 @@ export interface BuildOnlyDiagnosticIdsResult {
ids: string[];
}

export interface RoslynFixAllCodeAction extends CodeAction {
export interface RoslynFixAllCodeAction extends lsp.CodeAction {
scope: string;
}

Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export async function activate(
let roslynLanguageServerStartedPromise: Promise<RoslynLanguageServer> | undefined = undefined;
let razorLanguageServerStartedPromise: Promise<void> | undefined = undefined;
let projectInitializationCompletePromise: Promise<void> | undefined = undefined;

const traceChannel = vscode.window.createOutputChannel('C# LSP Trace Logs');
if (!useOmnisharpServer) {
// Activate Razor. Needs to be activated before Roslyn so commands are registered in the correct order.
// Otherwise, if Roslyn starts up first, they could execute commands that don't yet exist on Razor's end.
Expand Down Expand Up @@ -139,6 +139,7 @@ export async function activate(
platformInfo,
optionStream,
csharpChannel,
traceChannel,
reporter,
roslynLanguageServerEvents
);
Expand Down Expand Up @@ -244,6 +245,8 @@ export async function activate(
experimental: {
sendServerRequest: async (t, p, ct) => await languageServerExport.sendRequest(t, p, ct),
languageServerEvents: roslynLanguageServerEvents,
outputChannel: csharpChannel,
traceChannel: traceChannel,
},
getComponentFolder: (componentName) => {
return getComponentFolder(componentName, languageServerOptions);
Expand Down
2 changes: 1 addition & 1 deletion src/omnisharp/engines/lspEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ export class LspEngine implements IEngine {
registrations: true,
};
},
dispose() {
clear() {
/* empty */
},
fillClientCapabilities(_) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import * as vscode from 'vscode';
import { Range } from 'vscode-languageserver-types';
import { Range } from 'vscode-languageserver-protocol';

export class ColorPresentationContext {
constructor(public readonly uri: vscode.Uri, public readonly range: Range) {}
Expand Down
2 changes: 1 addition & 1 deletion src/razor/src/folding/serializableFoldingRangeParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { integer } from 'vscode-languageserver-types';
import { integer } from 'vscode-languageserver-protocol';
import { SerializableTextDocumentIdentifier } from '../rpc/serializableTextDocumentIdentifier';

export interface SerializableFoldingRangeParams {
Expand Down
10 changes: 8 additions & 2 deletions src/razor/src/razorLanguageServerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
import * as cp from 'child_process';
import { EventEmitter } from 'events';
import * as vscode from 'vscode';
import { RequestHandler, RequestType } from 'vscode-jsonrpc';
import { GenericNotificationHandler, InitializeResult, LanguageClientOptions, State } from 'vscode-languageclient';
import { RequestHandler } from 'vscode-jsonrpc';
import {
GenericNotificationHandler,
InitializeResult,
LanguageClientOptions,
RequestType,
State,
} from 'vscode-languageclient';
import { ServerOptions } from 'vscode-languageclient/node';
import { RazorLanguage } from './razorLanguage';
import { RazorLanguageServerOptions } from './razorLanguageServerOptions';
Expand Down
Loading
Loading