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: webview for the graphical editor #1317

Open
wants to merge 28 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 0 1 1.47s
✅ JAVASCRIPT eslint 3 0 0 2.95s
✅ JAVASCRIPT prettier 3 0 0 0.96s
✅ JSON jsonlint 6 0 0.21s
✅ JSON npm-package-json-lint yes no 0.41s
✅ JSON prettier 75 7 0 1.9s
✅ JSON v8r 6 0 18.69s
✅ MARKDOWN markdown-link-check 1 0 0.64s
✅ REPOSITORY git_diff yes no 0.23s
✅ TSX eslint 66 0 0 13.01s
✅ TYPESCRIPT eslint 38 0 0 9.42s
✅ TYPESCRIPT prettier 38 1 0 2.38s

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 20.28812% with 664 lines in your changes missing coverage. Please review.

Project coverage is 94.93%. Comparing base (373d404) to head (035f3a1).

Files with missing lines Patch % Lines
...g/src/language/graphical-editor/ast-parser/call.ts 5.00% 171 Missing ⚠️
...uage/graphical-editor/graphical-editor-provider.ts 30.66% 104 Missing ⚠️
...src/language/graphical-editor/ast-parser/parser.ts 14.28% 96 Missing ⚠️
.../language/graphical-editor/ast-parser/statement.ts 10.38% 69 Missing ⚠️
...e/graphical-editor/ast-parser/tools/debug-utils.ts 9.43% 48 Missing ⚠️
...language/graphical-editor/ast-parser/expression.ts 15.38% 44 Missing ⚠️
...rc/language/graphical-editor/ast-parser/segment.ts 14.28% 36 Missing ⚠️
...g/src/language/graphical-editor/ast-parser/edge.ts 37.50% 25 Missing ⚠️
...afe-ds-lang/src/language/graphical-editor/types.ts 37.50% 15 Missing ⚠️
...c/language/graphical-editor/ast-parser/argument.ts 27.77% 13 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1317      +/-   ##
==========================================
- Coverage   99.72%   94.93%   -4.80%     
==========================================
  Files         119      134      +15     
  Lines       12955    13788     +833     
  Branches     4240     4248       +8     
==========================================
+ Hits        12920    13089     +169     
- Misses         35      698     +663     
- Partials        0        1       +1     

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

@GideonKoenig
Copy link
Contributor Author

@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

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.

1 participant