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

refactor(query): heavily reduce query wiki size #1069

Merged
merged 1 commit into from
Oct 11, 2024
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
15 changes: 9 additions & 6 deletions src/documentation/print-query-wiki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ registerQueryDocumentation('dataflow', {
functionName: executeDataflowQuery.name,
functionFile: '../queries/catalog/dataflow-query/dataflow-query-executor.ts',
buildExplanation: async(shell: RShell) => {
const exampleCode = 'x + 1';
return `
Maybe you want to handle only the result of the query execution, or you just need the [dataflow graph](${FlowrWikiBaseRef}/Dataflow%20Graph) again.
This query type does exactly that!

Using the example code from above, the following query returns the dataflow graph of the code:
Using the example code \`${exampleCode}\`, the following query returns the dataflow graph of the code:
${
await showQuery(shell, exampleQueryCode, [{
await showQuery(shell, exampleCode, [{
type: 'dataflow'
}], { showCode: true })
}
Expand All @@ -114,13 +115,14 @@ registerQueryDocumentation('normalized-ast', {
functionName: executeNormalizedAstQuery.name,
functionFile: '../queries/catalog/normalized-ast-query/normalized-ast-query-executor.ts',
buildExplanation: async(shell: RShell) => {
const exampleCode = 'x + 1';
return `
Maybe you want to handle only the result of the query execution, or you just need the [normalized AST](${FlowrWikiBaseRef}/Normalized%20AST) again.
This query type does exactly that!

Using the example code from above, the following query returns the normalized AST of the code:
Using the example code \`${exampleCode}\`, the following query returns the normalized AST of the code:
${
await showQuery(shell, exampleQueryCode, [{
await showQuery(shell, exampleCode, [{
type: 'normalized-ast'
}], { showCode: true })
}
Expand All @@ -135,12 +137,13 @@ registerQueryDocumentation('id-map', {
functionName: executeIdMapQuery.name,
functionFile: '../queries/catalog/id-map-query/id-map-query-executor.ts',
buildExplanation: async(shell: RShell) => {
const exampleCode = 'x + 1';
return `
This query provides access to all nodes in the [normalized AST](${FlowrWikiBaseRef}/Normalized%20AST) as a mapping from their id to the node itself.

Using the example code from above, the following query returns all nodes from the code:
Using the example code \`${exampleCode}\`, the following query returns all nodes from the code:
${
await showQuery(shell, exampleQueryCode, [{
await showQuery(shell, exampleCode, [{
type: 'id-map'
}], { showCode: true })
}
Expand Down
2,298 changes: 360 additions & 1,938 deletions wiki/Query API.md

Large diffs are not rendered by default.

Loading