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

feat: Source Maps for Code Generation #714

Merged
merged 21 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f087d2a
feat: add tracing information to code generation
WinPlay02 Oct 31, 2023
e4596f1
feat: add option to generate source maps
WinPlay02 Oct 31, 2023
85f7e29
fix: Add changes from package-lock
WinPlay02 Oct 31, 2023
128ac7f
style: apply automated linter fixes
megalinter-bot Oct 31, 2023
6596b05
Merge branch 'generator-source-maps' of https://github.com/Safe-DS/DS…
WinPlay02 Oct 31, 2023
2fca0ed
test: added source maps as expected files
WinPlay02 Oct 31, 2023
2f08831
fix: remove sourcesContent from sourcemaps as tests would differ on d…
WinPlay02 Oct 31, 2023
cea4b00
Merge branch 'main' of https://github.com/Safe-DS/DSL into generator-…
WinPlay02 Oct 31, 2023
033dad7
test: fix coverage
WinPlay02 Oct 31, 2023
c51ac72
style: apply automated linter fixes
megalinter-bot Oct 31, 2023
963c2ae
Merge branch 'main' into generator-source-maps
WinPlay02 Nov 2, 2023
d6f3663
feat: source maps now matches convention
WinPlay02 Nov 2, 2023
e3d964d
Merge branch 'generator-source-maps' of https://github.com/Safe-DS/DS…
WinPlay02 Nov 2, 2023
58095f9
fix: only check relative path, when filtering skipped tests
WinPlay02 Nov 2, 2023
43e8294
style: apply automated linter fixes
megalinter-bot Nov 2, 2023
4538078
Merge branch 'main' of https://github.com/Safe-DS/DSL into generator-…
WinPlay02 Nov 2, 2023
6124433
fix: globs with only one extension didn't work
WinPlay02 Nov 2, 2023
7509405
refactor: accept GenerateOptions in generator service, rename Generat…
WinPlay02 Nov 2, 2023
6b87808
Merge branch 'generator-source-maps' of https://github.com/Safe-DS/DS…
WinPlay02 Nov 2, 2023
7a15620
style: apply automated linter fixes
megalinter-bot Nov 2, 2023
666ef96
Update packages/safe-ds-lang/tests/helpers/testResources.test.ts
lars-reimann Nov 2, 2023
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
27 changes: 23 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion packages/safe-ds-cli/src/cli/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export const generate = async (fileName: string, opts: GenerateOptions): Promise
const services = (await createSafeDsServicesWithBuiltins(NodeFileSystem)).SafeDs;
const document = await extractDocument(fileName, services);
const destination = opts.destination ?? path.join(path.dirname(fileName), 'generated');
const generatedFiles = services.generation.PythonGenerator.generate(document, URI.file(path.resolve(destination)));
const generatedFiles = services.generation.PythonGenerator.generate(
document,
URI.file(path.resolve(destination)),
opts.sourceMapDestination ? URI.file(path.resolve(opts.sourceMapDestination)) : undefined,
);

for (const file of generatedFiles) {
const fsPath = URI.parse(file.uri).fsPath;
Expand All @@ -27,4 +31,5 @@ export const generate = async (fileName: string, opts: GenerateOptions): Promise

export interface GenerateOptions {
destination?: string;
sourceMapDestination?: string;
}
1 change: 1 addition & 0 deletions packages/safe-ds-lang/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"chevrotain": "^11.0.3",
"glob": "^10.3.10",
"langium": "^2.0.2",
"source-map": "^0.7.4",
"vscode-languageserver": "^9.0.1",
"vscode-languageserver-textdocument": "^1.0.11"
},
Expand Down
Loading