Skip to content

Commit

Permalink
[bugfix] Typescript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
corwin-of-amber committed Jul 26, 2023
1 parent 8c6f579 commit 64fddcb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 2 additions & 0 deletions frontend/classic/js/contextual-info.ts
Expand Up @@ -156,7 +156,9 @@ export class CoqContextualInfo {
}

async _query(command, title) {
/** @todo how do you execute queries in coq-lsp? */
try {
// @ts-ignore
var result = await this.coq.queryPromise(0, ['Vernac', command]);
return {pp: this.formatMessages(result), status: 'ok'}
}
Expand Down
19 changes: 10 additions & 9 deletions frontend/classic/js/settings.ts
Expand Up @@ -44,19 +44,20 @@ export class SettingsPanel {
active : ReactiveVar<boolean>;
onAction : (ev : { action: string }) => void;

constructor(model) {
constructor(model?: CoqSettings) {
this.el = $(this.html());
this.model = model || new CoqSettings();
this.model = model ?? new CoqSettings();
this.active = new ReactiveVar(false);
/** @type {(ev: {action: string}) => void} */
this.onAction = () => {};

this.el.find('#settings--theme').on('change',
(ev) => {
(ev: JQuery.ChangeEvent<HTMLInputElement>) => {
this.model.theme.value = ev.target.checked ? 'light' : 'dark';
});
this.el.find('#settings--company').on('change', ev => {
this.model.company.value = ev.target.checked;
this.el.find('#settings--company').on('change',
(ev: JQuery.ChangeEvent<HTMLInputElement>) => {
this.model.company.value = ev.target.checked;
});
this.el.find('.link-to-quick-help').on('click', (/** @type {MouseEvent} */ ev) => {
this.onAction({action: 'quick-help'});
Expand All @@ -65,23 +66,23 @@ export class SettingsPanel {
});
// clickaway trick
this.el.on('blur', ev => {
if (this.el.has(ev.originalEvent.relatedTarget).length)
if (this.el.has(ev.originalEvent.relatedTarget as Element).length)
setTimeout(() => this.el[0].focus(), 1);
else
this.hide();
});
}

configure(options) {
var v;
var v: any;
if (v = options.theme) {
this.el.attr('data-theme', v);
this.model.theme.value = v;
this.el.find('#settings--theme').attr('checked', v == 'light');
this.el.find('#settings--theme').prop('checked', v == 'light');
}
if ((v = options.company) !== undefined) {
this.model.company.value = v;
this.el.find('#settings--company').attr('checked', v);
this.el.find('#settings--company').prop('checked', v);
}
}

Expand Down
5 changes: 5 additions & 0 deletions frontend/node/src/headless.ts
@@ -1,3 +1,8 @@
// @ts-nocheck
/**
* The headless manager is broken with coq-lsp backend.
* All the calls need to be readjusted to the new document model.
*/
import fs from 'fs';
import os from 'os';
import path from 'path';
Expand Down

0 comments on commit 64fddcb

Please sign in to comment.