Skip to content

Commit

Permalink
Quick turnaround for 0.0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahTheDuke committed Feb 5, 2024
1 parent 3317d41 commit 0c38c8d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ node_modules/
.env
.env.test
.env.production
lib/
lib/*
!lib/index.js

# clojure stuff
.nrepl-port
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ this project adheres to no versioning scheme.

## Unreleased

## 0.0.16 - 2024-02-05

### Fixed
- Update .gitignore to keep lib/index.js.
- Stop using deprecated `registLanguageClient` method.

## 0.0.15 - 2024-02-05

### Added
Expand Down
36 changes: 21 additions & 15 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
/* eslint-disable @typescript-eslint/no-var-requires */
async function start(watch) {
await require("esbuild").build({
const esbuild = require("esbuild");

async function start(plugins) {
const opts = {
entryPoints: ["src/index.ts"],
bundle: true,
watch,
minify: process.env.NODE_ENV === "production",
sourcemap: process.env.NODE_ENV === "development",
mainFields: ["module", "main"],
external: ["coc.nvim"],
platform: "node",
target: "node14",
outfile: "lib/index.js",
});
plugins,
};
if (plugins) {
const ctx = await esbuild.context(opts);
await ctx.watch();
} else {
await esbuild.build(opts);
}
}

let watch = false;
let counter = 0;
let plugins = [];
if (process.argv.length > 2 && process.argv[2] === "--watch") {
console.log("watching...");
watch = {
onRebuild(error) {
if (error) {
console.error("watch build failed:", error);
} else {
plugins.push({
name: "watcher",
setup(b) {
let counter = 0;
b.onEnd((result) => {
console.log(`watch build #${counter++} succeeded`);
}
});
},
};
});
}

start(watch).catch((e) => {
start(plugins).catch((e) => {
console.error(e);
});
5 changes: 5 additions & 0 deletions lib/index.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import { workspace } from "coc.nvim";
import { homedir } from "os";
import { logger } from "./logger";
import { Dictionary } from "./types";

export const documentSelector = [
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function activate(context: ExtensionContext): Promise<void> {
return;
}

context.subscriptions.push(services.registLanguageClient(client));
context.subscriptions.push(services.registerLanguageClient(client));

context.subscriptions.push(
languages.registerSignatureHelpProvider(
Expand Down

0 comments on commit 0c38c8d

Please sign in to comment.