Skip to content

Commit

Permalink
Merge pull request #15 from vim-denops/re-modernize
Browse files Browse the repository at this point in the history
Re modernize
  • Loading branch information
lambdalisue authored May 11, 2023
2 parents 1dab437 + 729457f commit 91c919b
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 75 deletions.
10 changes: 0 additions & 10 deletions deps.ts

This file was deleted.

3 changes: 0 additions & 3 deletions deps_test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion example/server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { using } from "https://deno.land/x/[email protected]/mod.ts";
import { Message, Session } from "../mod.ts";
import { using } from "../deps_test.ts";

// NOTE:
// Do NOT use 'console.log()' while stdout is used to communicate with Vim
Expand Down
30 changes: 0 additions & 30 deletions indexer.ts

This file was deleted.

22 changes: 0 additions & 22 deletions indexer_test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion response_waiter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Deferred, deferred } from "./deps.ts";
import { Deferred, deferred } from "https://deno.land/[email protected]/async/mod.ts";
import { Message, MessageId } from "./message.ts";

const DEFAULT_RESPONSE_TIMEOUT = 10000; // milliseconds
Expand Down
5 changes: 4 additions & 1 deletion response_waiter_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { assertEquals, assertRejects } from "./deps_test.ts";
import {
assertEquals,
assertRejects,
} from "https://deno.land/[email protected]/testing/asserts.ts";
import { Message, MessageId } from "./message.ts";
import { ResponseWaiter, TimeoutError } from "./response_waiter.ts";

Expand Down
15 changes: 12 additions & 3 deletions session.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { Deferred, deferred, Disposable, JSONparser, streams } from "./deps.ts";
import * as streams from "https://deno.land/[email protected]/streams/mod.ts";
import {
Deferred,
deferred,
} from "https://deno.land/[email protected]/async/deferred.ts";
import type { Disposable } from "https://deno.land/x/[email protected]/mod.ts";
import { Indexer } from "https://deno.land/x/[email protected]/mod.ts";
// NOTE:
// streamparser-json must be v0.0.5 because it automatically end-up parsing without separator after v0.0.5
// https://github.com/juanjoDiaz/streamparser-json/commit/577e918b90c19d6758b87d41bdb6c5571a2c012d
import JSONParser from "https://deno.land/x/[email protected]/jsonparse.ts#=";
import { isMessage, Message } from "./message.ts";
import * as command from "./command.ts";
import { Indexer } from "./indexer.ts";
import { ResponseWaiter } from "./response_waiter.ts";

const MSGID_THRESHOLD = 2 ** 32;
Expand Down Expand Up @@ -84,7 +93,7 @@ export class Session implements Disposable {
}

private async listen(): Promise<void> {
const parser = new JSONparser();
const parser = new JSONParser();
parser.onValue = (data, _key, _parent, stack) => {
if (stack.length > 0) {
return;
Expand Down
17 changes: 13 additions & 4 deletions session_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { JSONparser, streams } from "./deps.ts";
import { assertEquals, assertRejects, delay, using } from "./deps_test.ts";
import * as streams from "https://deno.land/[email protected]/streams/mod.ts";
import {
assertEquals,
assertRejects,
} from "https://deno.land/[email protected]/testing/asserts.ts";
import { delay } from "https://deno.land/[email protected]/async/mod.ts";
import { using } from "https://deno.land/x/[email protected]/mod.ts";
import { Indexer } from "https://deno.land/x/[email protected]/mod.ts";
// NOTE:
// streamparser-json must be v0.0.5 because it automatically end-up parsing without separator after v0.0.5
// https://github.com/juanjoDiaz/streamparser-json/commit/577e918b90c19d6758b87d41bdb6c5571a2c012d
import JSONParser from "https://deno.land/x/[email protected]/jsonparse.ts#=";
import { Session, SessionClosedError } from "./session.ts";
import { Indexer } from "./indexer.ts";
import * as command from "./command.ts";

const MSGID_THRESHOLD = 2 ** 32;
Expand Down Expand Up @@ -111,7 +120,7 @@ class Vim {
}

private async listen(): Promise<void> {
const parser = new JSONparser();
const parser = new JSONParser();
parser.onValue = (data, _key, _parent, stack) => {
if (stack.length > 0) {
return;
Expand Down

0 comments on commit 91c919b

Please sign in to comment.