Skip to content

Commit 4bfddf0

Browse files
committed
chore: import Reference and FindReferencesReturn from atom-ide-base
1 parent 3f3099e commit 4bfddf0

File tree

3 files changed

+7
-29
lines changed

3 files changed

+7
-29
lines changed

lib/adapters/find-references-adapter.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as atomIde from 'atom-ide';
1+
import type { Reference, FindReferencesReturn } from 'atom-ide-base';
22
import Convert from '../convert';
33
import {
44
Point,
@@ -44,15 +44,15 @@ export default class FindReferencesAdapter {
4444
editor: TextEditor,
4545
point: Point,
4646
projectRoot: string | null,
47-
): Promise<atomIde.FindReferencesReturn | null> {
47+
): Promise<FindReferencesReturn | null> {
4848
const locations = await connection.findReferences(
4949
FindReferencesAdapter.createReferenceParams(editor, point),
5050
);
5151
if (locations == null) {
5252
return null;
5353
}
5454

55-
const references: atomIde.Reference[] = locations.map(FindReferencesAdapter.locationToReference);
55+
const references: Reference[] = locations.map(FindReferencesAdapter.locationToReference);
5656
return {
5757
type: 'data',
5858
baseUri: projectRoot || '',
@@ -82,7 +82,7 @@ export default class FindReferencesAdapter {
8282
* @param location A {Location} to convert.
8383
* @returns A {Reference} equivalent to the given {Location}.
8484
*/
85-
public static locationToReference(location: Location): atomIde.Reference {
85+
public static locationToReference(location: Location): Reference {
8686
return {
8787
uri: Convert.uriToPath(location.uri),
8888
name: null,
@@ -94,7 +94,7 @@ export default class FindReferencesAdapter {
9494
public static getReferencedSymbolName(
9595
editor: TextEditor,
9696
point: Point,
97-
references: atomIde.Reference[],
97+
references: Reference[],
9898
): string {
9999
if (references.length === 0) {
100100
return '';

lib/auto-languageclient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as ls from './languageclient';
33
import * as rpc from 'vscode-jsonrpc';
44
import * as path from 'path';
55
import * as atomIde from 'atom-ide';
6-
import type { OutlineProvider, Outline, DefinitionProvider, DefinitionQueryResult, FindReferencesProvider } from 'atom-ide-base';
6+
import type { OutlineProvider, Outline, DefinitionProvider, DefinitionQueryResult, FindReferencesProvider, FindReferencesReturn } from 'atom-ide-base';
77
import * as linter from 'atom/linter';
88
import Convert from './convert.js';
99
import ApplyEditAdapter from './adapters/apply-edit-adapter';
@@ -583,7 +583,7 @@ export default class AutoLanguageClient {
583583
};
584584
}
585585

586-
protected async getReferences(editor: TextEditor, point: Point): Promise<atomIde.FindReferencesReturn | null> {
586+
protected async getReferences(editor: TextEditor, point: Point): Promise<FindReferencesReturn | null> {
587587
const server = await this._serverManager.getServer(editor);
588588
if (server == null || !FindReferencesAdapter.canAdapt(server.capabilities)) {
589589
return null;

typings/atom-ide/index.d.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,6 @@ declare module 'atom-ide' {
44

55
export type IdeUri = string;
66

7-
export interface Reference {
8-
/** URI of the file path */
9-
uri: IdeUri;
10-
/** Name of calling method / function / symbol */
11-
name: string | null;
12-
range: Range;
13-
}
14-
15-
export interface FindReferencesData {
16-
type: 'data';
17-
baseUri: IdeUri;
18-
referencedSymbolName: string;
19-
references: Reference[];
20-
}
21-
22-
export interface FindReferencesError {
23-
type: 'error';
24-
message: string;
25-
}
26-
27-
export type FindReferencesReturn = FindReferencesData | FindReferencesError;
28-
297
export type MarkedString =
308
| {
319
type: 'markdown',

0 commit comments

Comments
 (0)