Skip to content

feat: webview for the graphical editor #1317

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

Open
wants to merge 51 commits into
base: main
Choose a base branch
from

Conversation

GideonKoenig
Copy link
Contributor

Related to #1243

Summary of Changes

Adds the svelte package, that provides the webview for the graphical editor.

Copy link

github-actions bot commented Jan 21, 2025

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Elapsed time
❌ CSS stylelint 3 1 1 1.74s
✅ JAVASCRIPT eslint 3 0 0 3.12s
✅ JAVASCRIPT prettier 3 0 0 1.19s
✅ JSON jsonlint 6 0 0.19s
✅ JSON npm-package-json-lint yes no 0.41s
✅ JSON prettier 75 6 0 1.56s
✅ JSON v8r 6 0 11.28s
✅ MARKDOWN markdown-link-check 1 0 0.52s
✅ REPOSITORY git_diff yes no 0.23s
✅ TSX eslint 66 0 0 12.4s
✅ TYPESCRIPT eslint 49 0 0 9.56s
✅ TYPESCRIPT prettier 49 1 0 2.29s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 79.53216% with 175 lines in your changes missing coverage. Please review.

Project coverage is 98.48%. Comparing base (fdbefe3) to head (a83371e).

Files with missing lines Patch % Lines
...e/graphical-editor/ast-parser/tools/debug-utils.ts 9.43% 48 Missing ⚠️
...g/src/language/graphical-editor/ast-parser/call.ts 78.88% 37 Missing and 1 partial ⚠️
.../language/graphical-editor/ast-parser/statement.ts 62.33% 29 Missing ⚠️
...src/language/graphical-editor/ast-parser/parser.ts 81.25% 21 Missing ⚠️
...uage/graphical-editor/graphical-editor-provider.ts 89.24% 17 Missing ⚠️
...rc/language/lsp/safe-ds-document-update-handler.ts 38.46% 8 Missing ⚠️
...language/graphical-editor/ast-parser/expression.ts 86.53% 7 Missing ⚠️
...afe-ds-lang/src/language/graphical-editor/types.ts 83.33% 4 Missing ⚠️
...g/src/language/graphical-editor/ast-parser/edge.ts 95.00% 2 Missing ⚠️
...fe-ds-lang/src/language/graphical-editor/global.ts 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1317      +/-   ##
==========================================
- Coverage   99.73%   98.48%   -1.25%     
==========================================
  Files         120      136      +16     
  Lines       13031    13886     +855     
  Branches     4266     4439     +173     
==========================================
+ Hits        12996    13676     +680     
- Misses         35      208     +173     
- Partials        0        2       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GideonKoenig
Copy link
Contributor Author

GideonKoenig commented Jan 21, 2025

Edit: Has been resolved.

@lars-reimann There seems to be an issue with the current implementation of the graphical-editor service in the language server. During the initialization of the class, I store references to various services (e.g. the IndexManager). This pattern was taken from other ServiceProviders.
However, it seems, that during some RPCs some of these stored references are undefined.

2025-01-21 23:23:24.719 [error] Error: Request graphical-editor/getBuildins failed with message: Cannot read properties of undefined (reading 'IndexManager')

        at handleResponse (c:\Users\Gideon\projects\safe-ds-pull-requests\packages\safe-ds-vscode\dist\extension\mainClient.cjs:2120:40)
	at handleMessage (c:\Users\Gideon\projects\safe-ds-pull-requests\packages\safe-ds-vscode\dist\extension\mainClient.cjs:1930:11)
	at processMessageQueue (c:\Users\Gideon\projects\safe-ds-pull-requests\packages\safe-ds-vscode\dist\extension\mainClient.cjs:1945:13)
	at Immediate.<anonymous> (c:\Users\Gideon\projects\safe-ds-pull-requests\packages\safe-ds-vscode\dist\extension\mainClient.cjs:1921:11)
	at process.processImmediate (node:internal/timers:483:21)
	at process.callbackTrampoline (node:internal/async_hooks:130:17)

I assume, that I made a mistake during the registration of the service (in @safe-ds/lang/safe-ds-module.ts).

@GideonKoenig
Copy link
Contributor Author

@lars-reimann
The linting error is a misconfiguration of StyleLinter.
The unknown at-rules in the css file are part of tailwind. Everything I can find online suggests configuration adjustments to ignore these unknown at rules:

  • tailwind
  • apply
  • layers

@GideonKoenig
Copy link
Contributor Author

GideonKoenig commented Jan 21, 2025

Edit: All these issues have been resolved.

Bug 3
The section headers in the sidebar have been translated.
Both the smaller changes (changing the color of the code sample, or just removing it altogether) can be dealt with later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants