Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update snapshots for non-mac builds #186

Merged
merged 8 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

*.local
.Rproj.user
dist
# dist
dist-ssr
inst/doc
docs
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/editor/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Shiny UI Editor</title>
<script type="module" crossorigin src="./assets/index-4127ea2e.js"></script>
<script type="module" crossorigin src="./assets/index-f95d252b.js"></script>
<link rel="stylesheet" href="./assets/index-e6523c56.css">
</head>

Expand Down
1 change: 1 addition & 0 deletions inst/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"treesitter-parsers": "*",
"@floating-ui/react": "^0.22.0",
"@reduxjs/toolkit": "^1.8.0",
"@testing-library/jest-dom": "^5.16.5",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions inst/treesitter-parsers/dist/CallNode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// <reference types="web-tree-sitter" />
import type { Brand } from "util-functions/src/TypescriptUtils";
import type { ParserNode } from ".";
type TSCallNode = Brand<ParserNode, "CallNode">;
export declare function is_call_node(node: ParserNode): node is TSCallNode;
/**
* Get the contents of a string node without the quotes
* @param node String node to extract the content from
* @returns The text of the string node with the quotes removed
*/
export declare function extract_call_content(node: TSCallNode): {
fn_name: string;
fn_args: import("web-tree-sitter").SyntaxNode[];
};
export {};
16 changes: 16 additions & 0 deletions inst/treesitter-parsers/dist/get_assignment_nodes.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { ParserTree, ParserNode } from ".";
/**
* Find all assignment nodes in a parsed script
* @param tree Syntax node of parsed script from tree-sitter parser
* @param assignment_type The type of assignment node to search for. Defaults to
* `"left_assignment"` and `"assignment"`. To search for all assignment types in
* both python and R.
* @returns All assignment nodes in the script as a map of variable name to the
* node
*/
export declare function get_assignment_nodes(tree: ParserTree, assignment_type?: string | string[]): Node_Assignment_Map;
/**
* A map keyed by name of all assignments in a given python script pointing to
* the node being assigned
*/
export type Node_Assignment_Map = Map<string, ParserNode>;
34 changes: 34 additions & 0 deletions inst/treesitter-parsers/dist/get_node_positions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type { ParserNode } from ".";
/**
* Get position of node in the script in Ui-Editor friendly format
* @param node Node from the tree sitter tree
* @returns Position of that node in the script
*/
export declare function getNodePosition(node: ParserNode): {
start: {
row: number;
column: number;
};
end: {
row: number;
column: number;
};
};
/**
* Get position of the server node in the script in Ui-Editor friendly format
* @param parsed_app Parsed app tree object. As returned from `parse_python_script`
* @returns Location of the server node in the script
*/
export declare function getNodePositionAndIndent(server_node: ParserNode): {
server_fn: {
start: {
row: number;
column: number;
};
end: {
row: number;
column: number;
};
};
indent: number;
};
12 changes: 12 additions & 0 deletions inst/treesitter-parsers/dist/get_ui_assignment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// <reference types="web-tree-sitter" />
import type { Node_Assignment_Map } from ".";
/**
*
* @param assignment_map Map of all assignment nodes in the script as given by
* `find_assignment_nodes()`
* @param ui_node_name Name of the variable we're looking for that contains the
* UI definition. Defaults to `app_ui`.
* @returns The node containing the UI definition, `null` if not found
* @throws Error if the UI node is not found
*/
export declare function get_ui_assignment(assignment_map: Node_Assignment_Map, ui_node_name?: string): import("web-tree-sitter").SyntaxNode;
20 changes: 20 additions & 0 deletions inst/treesitter-parsers/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type Parser from "web-tree-sitter";
export { setup_python_parser, setup_r_parser } from "./setup_language_parsers";
export type { ParserInitOptions } from "./setup_language_parsers";
export { get_assignment_nodes } from "./get_assignment_nodes";
export { get_ui_assignment } from "./get_ui_assignment";
export { is_call_node, extract_call_content } from "./CallNode";
export { getNodePosition, getNodePositionAndIndent, } from "./get_node_positions";
export type { Node_Assignment_Map } from "./get_assignment_nodes";
/**
* Function to parse a python script into a tree-sitter syntax tree
*/
export type TSParser = Parser;
/**
* A node within the tree-sitter syntax tree.
*/
export type ParserNode = Parser.SyntaxNode;
/**
* The main object returned from parsing an app script. Contains the main tree as the root node attribute
*/
export type ParserTree = Parser.Tree;
116 changes: 116 additions & 0 deletions inst/treesitter-parsers/dist/index.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions inst/treesitter-parsers/dist/setup_language_parsers.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Parser from "web-tree-sitter";
export type ParserInitOptions = {
locateFile?: (scriptName: string, scriptDirectory: string) => string;
};
/**
* Setup a tree-sitter parser with the Python grammar
* @returns A tree-sitter parser with the Python grammar loaded
* @param opts Options to pass to the parser as emscripten module-object, see
* https://emscripten.org/docs/api_reference/module.html
*/
export declare function setup_python_parser(opts?: ParserInitOptions): Promise<Parser>;
/**
* Setup a tree-sitter parser with the Python grammar
* @returns A tree-sitter parser with the Python grammar loaded
*/
export declare function setup_r_parser(opts?: ParserInitOptions): Promise<Parser>;
16 changes: 16 additions & 0 deletions inst/treesitter-parsers/dist/setup_python_parser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Parser from "web-tree-sitter";
export type ParserInitOptions = {
locateFile?: (scriptName: string, scriptDirectory: string) => string;
};
/**
* Setup a tree-sitter parser with the Python grammar
* @returns A tree-sitter parser with the Python grammar loaded
* @param opts Options to pass to the parser as emscripten module-object, see
* https://emscripten.org/docs/api_reference/module.html
*/
export declare function setup_python_parser(opts?: ParserInitOptions): Promise<Parser>;
/**
* Setup a tree-sitter parser with the Python grammar
* @returns A tree-sitter parser with the Python grammar loaded
*/
export declare function setup_r_parser(opts?: ParserInitOptions): Promise<Parser>;
6 changes: 6 additions & 0 deletions inst/treesitter-parsers/dist/setup_r_parser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Parser from "web-tree-sitter";
/**
* Setup a tree-sitter parser with the Python grammar
* @returns A tree-sitter parser with the Python grammar loaded
*/
export declare function setup_r_parser(): Promise<Parser>;
Loading