mirror of
https://github.com/microsoft/pyright.git
synced 2025-12-23 09:19:29 +00:00
Changed disableLanguageServices feature to apply to hover text as well as other language services. Previously, hover text was excluded. This addresses #8639.
This commit is contained in:
parent
842ab02c34
commit
7802376828
2 changed files with 6 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
The Pyright language server honors the following settings.
|
||||
|
||||
**pyright.disableLanguageServices** [boolean]: Disables all language services except for “hover”. This includes type completion, signature completion, find definition, find references, and find symbols in file. This option is useful if you want to use pyright only as a type checker but want to run another Python language server for language service features.
|
||||
**pyright.disableLanguageServices** [boolean]: Disables all language services. This includes hover text, type completion, signature completion, find definition, find references, etc. This option is useful if you want to use pyright only as a type checker but want to run another Python language server for language service features.
|
||||
|
||||
**pyright.disableOrganizeImports** [boolean]: Disables the “Organize Imports” command. This is useful if you are using another extension that provides similar functionality and you don’t want the two extensions to fight each other.
|
||||
|
||||
|
|
|
|||
|
|
@ -112,6 +112,8 @@ import { DefinitionFilter, DefinitionProvider, TypeDefinitionProvider } from './
|
|||
import { DocumentHighlightProvider } from './languageService/documentHighlightProvider';
|
||||
import { CollectionResult } from './languageService/documentSymbolCollector';
|
||||
import { DocumentSymbolProvider } from './languageService/documentSymbolProvider';
|
||||
import { DynamicFeature, DynamicFeatures } from './languageService/dynamicFeature';
|
||||
import { FileWatcherDynamicFeature } from './languageService/fileWatcherDynamicFeature';
|
||||
import { HoverProvider } from './languageService/hoverProvider';
|
||||
import { canNavigateToFile } from './languageService/navigationUtils';
|
||||
import { ReferencesProvider } from './languageService/referencesProvider';
|
||||
|
|
@ -121,8 +123,6 @@ import { WorkspaceSymbolProvider } from './languageService/workspaceSymbolProvid
|
|||
import { Localizer, setLocaleOverride } from './localization/localize';
|
||||
import { ParseFileResults } from './parser/parser';
|
||||
import { InitStatus, WellKnownWorkspaceKinds, Workspace, WorkspaceFactory } from './workspaceFactory';
|
||||
import { DynamicFeature, DynamicFeatures } from './languageService/dynamicFeature';
|
||||
import { FileWatcherDynamicFeature } from './languageService/fileWatcherDynamicFeature';
|
||||
|
||||
const nullProgressReporter = attachWorkDone(undefined as any, /* params */ undefined);
|
||||
|
||||
|
|
@ -874,6 +874,9 @@ export abstract class LanguageServerBase implements LanguageServerInterface, Dis
|
|||
protected async onHover(params: HoverParams, token: CancellationToken) {
|
||||
const uri = this.convertLspUriStringToUri(params.textDocument.uri);
|
||||
const workspace = await this.getWorkspaceForFile(uri);
|
||||
if (workspace.disableLanguageServices) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return workspace.service.run((program) => {
|
||||
return new HoverProvider(program, uri, params.position, this.client.hoverContentFormat, token).getHover();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue