Skip to content

Commit 9b1c6cb

Browse files
authored
joh/issue152834 (microsoft#153298)
* update sample * dynamically alias `ms-vscode.references-view` onto `vscode.references-view`
1 parent 1df4b3c commit 9b1c6cb

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

extensions/references-view/src/references-view.d.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
import * as vscode from 'vscode';
77

88
/**
9-
* This interface describes the shape for the references viewlet API. It consists
10-
* of a single `setInput` function which must be called with a full implementation
9+
* This interface describes the shape for the references viewlet API. It consists
10+
* of a single `setInput` function which must be called with a full implementation
1111
* of the `SymbolTreeInput`-interface. To acquire this API use the default mechanics, e.g:
12-
*
12+
*
1313
* ```ts
1414
* // get references viewlet API
15-
* const api = await vscode.extensions.getExtension<SymbolTree>('ms-vscode.references-view').activate();
16-
*
15+
* const api = await vscode.extensions.getExtension<SymbolTree>('vscode.references-view').activate();
16+
*
1717
* // instantiate and set input which updates the view
1818
* const myInput: SymbolTreeInput<MyItems> = ...
1919
* api.setInput(myInput)
@@ -22,16 +22,16 @@ import * as vscode from 'vscode';
2222
export interface SymbolTree {
2323

2424
/**
25-
* Set the contents of the references viewlet.
26-
*
25+
* Set the contents of the references viewlet.
26+
*
2727
* @param input A symbol tree input object
2828
*/
2929
setInput(input: SymbolTreeInput<unknown>): void;
3030
}
3131

3232
/**
3333
* A symbol tree input is the entry point for populating the references viewlet.
34-
* Inputs must be anchored at a code location, they must have a title, and they
34+
* Inputs must be anchored at a code location, they must have a title, and they
3535
* must resolve to a model.
3636
*/
3737
export interface SymbolTreeInput<T> {
@@ -54,17 +54,17 @@ export interface SymbolTreeInput<T> {
5454
readonly location: vscode.Location;
5555

5656
/**
57-
* Resolve this input to a model that contains the actual data. When there are no result
57+
* Resolve this input to a model that contains the actual data. When there are no result
5858
* than `undefined` or `null` should be returned.
5959
*/
6060
resolve(): vscode.ProviderResult<SymbolTreeModel<T>>;
6161

6262
/**
6363
* This function is called when re-running from history. The symbols tree has tracked
64-
* the original location of this input and that is now passed to this input. The
64+
* the original location of this input and that is now passed to this input. The
6565
* implementation of this function should return a clone where the `location`-property
6666
* uses the provided `location`
67-
*
67+
*
6868
* @param location The location at which the new input should be anchored.
6969
* @returns A new input which location is anchored at the position.
7070
*/
@@ -94,7 +94,7 @@ export interface SymbolTreeModel<T> {
9494
navigation?: SymbolItemNavigation<T>;
9595

9696
/**
97-
* Optional support for editor highlights. WHen implemented, the editor will highlight
97+
* Optional support for editor highlights. WHen implemented, the editor will highlight
9898
* symbol ranges in the source code.
9999
*/
100100
highlights?: SymbolItemEditorHighlights<T>;

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ import { ExtHostInteractive } from 'vs/workbench/api/common/extHostInteractive';
9292
import { combinedDisposable } from 'vs/base/common/lifecycle';
9393
import { checkProposedApiEnabled, ExtensionIdentifierSet, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
9494
import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/contrib/debug/common/debug';
95+
import { equalsIgnoreCase } from 'vs/base/common/strings';
9596

9697
export interface IExtensionRegistries {
9798
mine: ExtensionDescriptionRegistry;
@@ -392,6 +393,11 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
392393

393394
const extensions: typeof vscode.extensions = {
394395
getExtension(extensionId: string, includeFromDifferentExtensionHosts?: boolean): vscode.Extension<any> | undefined {
396+
if (equalsIgnoreCase(extensionId, 'ms-vscode.references-view')) {
397+
extHostApiDeprecation.report(`The extension 'ms-vscode.references-view' has been renamed.`, extension, `Use 'vscode.references-view' instead.`);
398+
extensionId = 'vscode.references-view';
399+
}
400+
395401
if (!isProposedApiEnabled(extension, 'extensionsAny')) {
396402
includeFromDifferentExtensionHosts = false;
397403
}

0 commit comments

Comments
 (0)