Skip to content

Commit

Permalink
Import directly from @doenet/parser
Browse files Browse the repository at this point in the history
  • Loading branch information
siefkenj committed Sep 14, 2023
1 parent 13a8092 commit 65bdf72
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
3 changes: 0 additions & 3 deletions packages/lsp-tools/src/dast/parser.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/lsp-tools/src/dev-site.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { CodeMirror } from "@doenet/codemirror";
import { lezerToDast, parse } from "./dast/parser";
import { lezerToDast, parse, filterPositionInfo } from "@doenet/parser";
import JsonView from "react18-json-view";
import "react18-json-view/src/style.css";
import { filterPositionInfo } from "./dast/parser";
import { DoenetSourceObject } from "./doenet-source-object";
import { AutoCompleter } from "./auto-completer";

Expand Down Expand Up @@ -57,7 +56,7 @@ function App() {
{ currentPos },
sourceObj.elementAtOffset(currentPos),
sourceObj.attributeAtOffset(currentPos),
completionObj.getCompletionItems(currentPos)
completionObj.getCompletionItems(currentPos),
);
}, [currentPos, doenetSource]);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CursorPosition, DoenetSourceObject, RowCol } from "./index";
import { DastElement, LezerSyntaxNodeName } from "../dast/parser";
import { DastElement, LezerSyntaxNodeName } from "@doenet/parser";

/**
* Get the element containing the position `offset`. `null` is returned if the position is not
Expand Down
2 changes: 1 addition & 1 deletion packages/lsp-tools/src/doenet-source-object/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
DastRoot,
LezerSyntaxNodeName,
toXml,
} from "../dast/parser";
} from "@doenet/parser";
import { SyntaxNode, TreeCursor } from "@lezer/common";
import {
initDast,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
lezerToDast,
stringToLezer,
visit,
} from "../dast/parser";
} from "@doenet/parser";
import { TreeCursor } from "@lezer/common";
import { DoenetSourceObject, OffsetToPositionMap } from "./index";

Expand Down
2 changes: 1 addition & 1 deletion packages/lsp-tools/test/doenet-source-object.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import util from "util";

import { filterPositionInfo } from "../src/dast/parser";
import { filterPositionInfo } from "@doenet/parser";
import { DoenetSourceObject } from "../src/doenet-source-object";

const origLog = console.log;
Expand Down

0 comments on commit 65bdf72

Please sign in to comment.