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

chore: plural naming #188887

Closed
wants to merge 5 commits into from
Closed
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: 2 additions & 2 deletions src/vs/editor/contrib/codelens/browser/codelens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ export class CodeLensModel {

export async function getCodeLensModel(registry: LanguageFeatureRegistry<CodeLensProvider>, model: ITextModel, token: CancellationToken): Promise<CodeLensModel> {

const provider = registry.ordered(model);
const providers = registry.ordered(model);
const providerRanks = new Map<CodeLensProvider, number>();
const result = new CodeLensModel();

const promises = provider.map(async (provider, i) => {
const promises = providers.map(async (provider, i) => {

providerRanks.set(provider, i);

Expand Down
14 changes: 7 additions & 7 deletions src/vs/editor/contrib/documentSymbols/browser/outlineModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ export class OutlineModel extends TreeElement {

const cts = new CancellationTokenSource(token);
const result = new OutlineModel(textModel.uri);
const provider = registry.ordered(textModel);
const promises = provider.map((provider, index) => {
const providers = registry.ordered(textModel);
const promises = providers.map((provider, index) => {

const id = TreeElement.findId(`provider_${index}`, result);
const group = new OutlineGroup(id, result, provider.displayName ?? 'Unknown Outline Provider', index);
Expand All @@ -221,8 +221,8 @@ export class OutlineModel extends TreeElement {
});

const listener = registry.onDidChange(() => {
const newProvider = registry.ordered(textModel);
if (!equals(newProvider, provider)) {
const newProviders = registry.ordered(textModel);
if (!equals(newProviders, providers)) {
cts.cancel();
}
});
Expand Down Expand Up @@ -433,14 +433,14 @@ export class OutlineModelService implements IOutlineModelService {
async getOrCreate(textModel: ITextModel, token: CancellationToken): Promise<OutlineModel> {

const registry = this._languageFeaturesService.documentSymbolProvider;
const provider = registry.ordered(textModel);
const providers = registry.ordered(textModel);

let data = this._cache.get(textModel.id);
if (!data || data.versionId !== textModel.getVersionId() || !equals(data.provider, provider)) {
if (!data || data.versionId !== textModel.getVersionId() || !equals(data.provider, providers)) {
const source = new CancellationTokenSource();
data = {
versionId: textModel.getVersionId(),
provider,
provider: providers,
promiseCnt: 0,
source,
promise: OutlineModel.create(registry, textModel, source.token),
Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/contrib/gotoSymbol/browser/goToSymbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ async function getLocationLinks<T>(
registry: LanguageFeatureRegistry<T>,
provide: (provider: T, model: ITextModel, position: Position) => ProviderResult<LocationLink | LocationLink[]>
): Promise<LocationLink[]> {
const provider = registry.ordered(model);
const providers = registry.ordered(model);

// get results
const promises = provider.map((provider): Promise<LocationLink | LocationLink[] | undefined> => {
const promises = providers.map((provider): Promise<LocationLink | LocationLink[] | undefined> => {
return Promise.resolve(provide(provider, model, position)).then(undefined, err => {
onUnexpectedExternalError(err);
return undefined;
Expand Down