Skip to content

Commit f9549c6

Browse files
committed
fix: rename onShowDocument function to showDocument
1 parent 921613b commit f9549c6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/adapters/show-document-adapter.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ export class ShowDocumentAdapter {
99
public attach(arg: Parameters<typeof attach>[0]): ReturnType<typeof attach> {
1010
attach(arg)
1111
}
12-
/** {@inheritDoc onShowDocument} */
13-
public onShowDocument(...args: Parameters<typeof onShowDocument>): ReturnType<typeof onShowDocument> {
14-
return onShowDocument(...args)
12+
/** {@inheritDoc showDocument} */
13+
public onShowDocument(...args: Parameters<typeof showDocument>): ReturnType<typeof showDocument> {
14+
return showDocument(...args)
1515
}
1616
}
1717

1818
/**
1919
* Public: Attach to a {LanguageClientConnection} to recieve requests to show documents.
2020
*/
2121
export function attach(connection: LanguageClientConnection): void {
22-
connection.onShowDocument(onShowDocument)
22+
connection.onShowDocument(showDocument)
2323
}
2424

2525
/**
@@ -30,7 +30,7 @@ export function attach(connection: LanguageClientConnection): void {
3030
* @returns {Promise<ShowDocumentResult>} with a `success: boolean` property specifying if the operation was sucessful
3131
* {@inheritDoc ShowDocumentParams}
3232
*/
33-
export async function onShowDocument(params: ShowDocumentParams): Promise<ShowDocumentResult> {
33+
export async function showDocument(params: ShowDocumentParams): Promise<ShowDocumentResult> {
3434
if (!params.external) {
3535
// open using atom.workspace
3636
const view = await atom.workspace.open(params.uri, {

test/adapters/show-document-adapter.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe("ShowDocumentAdapter", () => {
1616
expect((lcc["_onRequest"] as sinon.SinonSpy).calledOnce).to.be.true
1717
const spyArgs = spy.firstCall.args
1818
expect(spyArgs[0]).to.deep.equal({ method: "window/showDocument" })
19-
expect(spyArgs[1]).to.equal(ShowDocumentAdapter.onShowDocument)
19+
expect(spyArgs[1]).to.equal(ShowDocumentAdapter.showDocument)
2020
})
2121
})
2222
})

0 commit comments

Comments
 (0)