Skip to content

Commit 5674b3e

Browse files
committed
chore: convert uri to path to open
1 parent d7af1bc commit 5674b3e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/adapters/show-document-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function showDocument(params: ShowDocumentParams): Promise<ShowDocu
3434
try {
3535
if (!params.external) {
3636
// open using atom.workspace
37-
const view = await atom.workspace.open(params.uri, {
37+
const view = await atom.workspace.open(Convert.uriToPath(params.uri), {
3838
activateItem: params.takeFocus,
3939
activatePane: params.takeFocus,
4040
pending: true,

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { TextEditor } from "atom"
22
import * as sinon from "sinon"
33
import { expect } from "chai"
44
import { join, dirname } from "path"
5-
import Convert from "../../lib/convert"
65
import * as ShowDocumentAdapter from "../../lib/adapters/show-document-adapter"
76
import { LanguageClientConnection, ShowDocumentParams } from "../../lib/languageclient"
87
import { createSpyConnection } from "../helpers"
@@ -40,7 +39,6 @@ describe("ShowDocumentAdapter", () => {
4039
describe("can show documents", () => {
4140
describe("shows the document inside Atom", async () => {
4241
const helloPath = join(dirname(__dirname), "fixtures", "hello.js")
43-
const helloURI = Convert.pathToUri(helloPath)
4442

4543
beforeEach(() => {
4644
atom.workspace.getTextEditors().forEach((ed) => {
@@ -52,7 +50,7 @@ describe("ShowDocumentAdapter", () => {
5250

5351
it("shows the document inside Atom for the given URI", async () => {
5452
const params: ShowDocumentParams = {
55-
uri: helloURI,
53+
uri: helloPath,
5654
}
5755

5856
const { success } = await ShowDocumentAdapter.showDocument(params)

0 commit comments

Comments
 (0)