Skip to content

Commit

Permalink
Merge pull request #364 from TypeFox/remove-unsupported-features
Browse files Browse the repository at this point in the history
Remove unsupported features
  • Loading branch information
CGNonofr committed May 30, 2022
2 parents fbf9db0 + 0d52019 commit 88b63cc
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions packages/client/src/monaco-language-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,33 @@ import { IConnectionProvider } from './connection';
export * from 'vscode-languageclient/lib/common/client';
import type * as vscode from 'vscode'
import { MonacoC2PConverter, MonacoP2CConverter } from "./converters";
import { ConfigurationFeature, SyncConfigurationFeature } from "vscode-languageclient/lib/common/configuration";
import { DidChangeTextDocumentFeature, DidCloseTextDocumentFeature, DidOpenTextDocumentFeature, DidSaveTextDocumentFeature, WillSaveFeature, WillSaveWaitUntilFeature } from "vscode-languageclient/lib/common/textSynchronization";
import { CompletionItemFeature } from "vscode-languageclient/lib/common/completion";
import { HoverFeature } from "vscode-languageclient/lib/common/hover";
import { SignatureHelpFeature } from "vscode-languageclient/lib/common/signatureHelp";
import { DefinitionFeature } from "vscode-languageclient/lib/common/definition";
import { ReferencesFeature } from "vscode-languageclient/lib/common/reference";
import { DocumentHighlightFeature } from "vscode-languageclient/lib/common/documentHighlight";
import { DocumentSymbolFeature } from "vscode-languageclient/lib/common/documentSymbol";
import { CodeActionFeature } from "vscode-languageclient/lib/common/codeAction";
import { CodeLensFeature } from "vscode-languageclient/lib/common/codeLens";
import { DocumentFormattingFeature, DocumentOnTypeFormattingFeature, DocumentRangeFormattingFeature } from "vscode-languageclient/lib/common/formatting";
import { RenameFeature } from "vscode-languageclient/lib/common/rename";
import { DocumentLinkFeature } from "vscode-languageclient/lib/common/documentLink";
import { ExecuteCommandFeature } from "vscode-languageclient/lib/common/executeCommand";
import { TypeDefinitionFeature } from "vscode-languageclient/lib/common/typeDefinition";
import { ImplementationFeature } from "vscode-languageclient/lib/common/implementation";
import { ColorProviderFeature } from "vscode-languageclient/lib/common/colorProvider";
import { WorkspaceFoldersFeature } from "vscode-languageclient/lib/common/workspaceFolder";
import { FoldingRangeFeature } from "vscode-languageclient/lib/common/foldingRange";
import { DeclarationFeature } from "vscode-languageclient/lib/common/declaration";
import { SelectionRangeFeature } from "vscode-languageclient/lib/common/selectionRange";
import { SemanticTokensFeature } from "vscode-languageclient/lib/common/semanticTokens";
import { LinkedEditingFeature } from "vscode-languageclient/lib/common/linkedEditingRange";
import { InlayHintsFeature } from "vscode-languageclient/lib/common/inlayHint";
import { DiagnosticFeature } from "vscode-languageclient/lib/common/diagnostic";
import { ProgressFeature } from "vscode-languageclient/lib/common/progress";

export class MonacoLanguageClient extends BaseLanguageClient {

Expand Down Expand Up @@ -39,6 +66,57 @@ export class MonacoLanguageClient extends BaseLanguageClient {
protected getLocale(): string {
return navigator.language || 'en-US'
}

protected override registerBuiltinFeatures() {
this.registerFeature(new DidOpenTextDocumentFeature(this, this['_syncedDocuments']));
this.registerFeature(new DidChangeTextDocumentFeature(this));
this.registerFeature(new DidCloseTextDocumentFeature(this, this['_syncedDocuments']));
this.registerFeature(new CompletionItemFeature(this));
this.registerFeature(new HoverFeature(this));
this.registerFeature(new SignatureHelpFeature(this));
this.registerFeature(new DefinitionFeature(this));
this.registerFeature(new ReferencesFeature(this));
this.registerFeature(new DocumentHighlightFeature(this));
this.registerFeature(new DocumentSymbolFeature(this));
this.registerFeature(new CodeActionFeature(this));
this.registerFeature(new CodeLensFeature(this));
this.registerFeature(new DocumentFormattingFeature(this));
this.registerFeature(new DocumentRangeFormattingFeature(this));
this.registerFeature(new DocumentOnTypeFormattingFeature(this));
this.registerFeature(new RenameFeature(this));
this.registerFeature(new DocumentLinkFeature(this));
this.registerFeature(new ExecuteCommandFeature(this));
this.registerFeature(new TypeDefinitionFeature(this));
this.registerFeature(new ImplementationFeature(this));
this.registerFeature(new ColorProviderFeature(this));
// We only register the workspace folder feature if the client is not locked
// to a specific workspace folder.
if (this.clientOptions.workspaceFolder === undefined) {
this.registerFeature(new WorkspaceFoldersFeature(this));
}
this.registerFeature(new FoldingRangeFeature(this));
this.registerFeature(new DeclarationFeature(this));
this.registerFeature(new SelectionRangeFeature(this));
this.registerFeature(new SemanticTokensFeature(this));
this.registerFeature(new LinkedEditingFeature(this));
this.registerFeature(new InlayHintsFeature(this));
this.registerFeature(new DiagnosticFeature(this));
}

public registerTextDocumentSaveFeatures() {
this.registerFeature(new WillSaveFeature(this));
this.registerFeature(new WillSaveWaitUntilFeature(this));
this.registerFeature(new DidSaveTextDocumentFeature(this));
}

public registerConfigurationFeatures() {
this.registerFeature(new ConfigurationFeature(this));
this.registerFeature(new SyncConfigurationFeature(this));
}

public registerProgressFeatures() {
this.registerFeature(new ProgressFeature(this));
}
}
export namespace MonacoLanguageClient {
export interface Options {
Expand Down

0 comments on commit 88b63cc

Please sign in to comment.