Skip to content
Merged
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
4 changes: 4 additions & 0 deletions packages/pyright-internal/src/realLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { CancellationProvider } from './common/cancellationUtils';
import { FileWatcherHandler } from './common/fileWatcher';
import version from './version.json';
import { PartialStubService } from './partialStubService';
import { Commands } from './commands/commands';

const maxAnalysisTimeInForeground = { openFilesTimeInMs: 50, noOpenFilesTimeInMs: 200 };

Expand Down Expand Up @@ -97,6 +98,9 @@ export abstract class RealLanguageServer extends LanguageServerBase {
fileWatcherHandler: fileWatcherProvider,
maxAnalysisTimeInForeground,
supportedCodeActions: [CodeActionKind.QuickFix, CodeActionKind.SourceOrganizeImports],
// TODO: all the other commands are registered in the vscode extension because they seem to have client side logic
// for some reason
supportedCommands: [Commands.createTypeStub, Commands.restartServer, Commands.writeBaseline],
},
connection
);
Expand Down
9 changes: 0 additions & 9 deletions packages/vscode-pyright/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,6 @@ export async function activate(context: ExtensionContext) {
);
});

const genericCommands = [Commands.createTypeStub, Commands.restartServer, Commands.writeBaseline];
genericCommands.forEach((command) => {
context.subscriptions.push(
commands.registerCommand(command, (...args: any[]) => {
client.sendRequest('workspace/executeCommand', { command, arguments: args });
})
);
});

// Register the debug only commands when running under the debugger.
if (context.extensionMode === ExtensionMode.Development) {
// Create a 'when' context for development.
Expand Down
Loading