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: add custom editor / visualizer to vscode extension #1243

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

Conversation

GideonKoenig
Copy link
Contributor

Giant Pull Request - All in one - I'm sorry

GideonKoenigJukabo and others added 30 commits January 27, 2024 14:08
@GideonKoenig GideonKoenig changed the title feat: add custom editor / visualization to vscode extension feat: add custom editor / visualizer to vscode extension Oct 29, 2024
@GideonKoenig GideonKoenig marked this pull request as ready for review October 29, 2024 14:28
Copy link
Member

@lars-reimann lars-reimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First batch of comments about the stub changes.

lars-reimann added a commit that referenced this pull request Nov 14, 2024
### Summary of Changes

Modifies the language stubs in preparation for the Custom
Editor/Visualization PR #1243.
Defines/Adjusts the DataScienceCategories and assigns them to a sample
amount of functions and classes from the Safe-Ds language.

---------

Co-authored-by: Lars Reimann <mail@larsreimann.com>
packages/safe-ds-lang/.prettierrc.json Outdated Show resolved Hide resolved
.eslintrc.cjs Show resolved Hide resolved
.vscode/settings.json Show resolved Hide resolved
packages/safe-ds-editor/.prettierrc.json Outdated Show resolved Hide resolved
packages/safe-ds-editor/components.json Outdated Show resolved Hide resolved
packages/safe-ds-editor/migrationTools/copyToExtension.js Outdated Show resolved Hide resolved
packages/safe-ds-editor/postcss.config.js Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next step would be to extract the custom-editor service into its own PR. It also requires unit tests. Finally, "custom-editor" is a very general name, maybe something like "graphical-editor" is better (or currently "graphical-view", though then we'd have to rename it eventually). I'm open for suggestions here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1315.
I chose graphical-editor as the name.

static callList: Call[];
static genericExpressionList: GenericExpression[];
static edgeList: Edge[];
static safeDsServices: SafeDsServices;
Copy link
Member

@lars-reimann lars-reimann Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything that needs services should be made a service, so everything gets wired up properly. Here, Utils is in an invalid state before initialize is called.

Likewise, it should not have static state/methods but instance state/methods, since multiple instances of SafeDsServices might be in use at the same time, e.g. when running tests. Using static state here, can quickly lead to subtle bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The language server component has been reworked and separated into its own PR #1315.

Comment on lines +113 to +122
export const zip = <A, B>(arrayA: A[], arrayB: B[]): [A, B][] => {
const minLength = Math.min(arrayA.length, arrayB.length);
const result: [A, B][] = [];

for (let i = 0; i < minLength; i++) {
result.push([arrayA[i]!, arrayB[i]!]);
}

return result;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be a useful addition to packages\safe-ds-lang\src\helpers\collections.ts.

lars-reimann pushed a commit that referenced this pull request Nov 24, 2024
## [0.22.0](v0.21.1...v0.22.0) (2024-11-24)

### Features

* categorize API elements ([#1263](#1263)) ([d0d971e](d0d971e)), closes [#1243](#1243)
* disable inlay hints for assignee types by default ([#1260](#1260)) ([a651ade](a651ade))
* improve error messages from linker ([#1272](#1272)) ([eddd868](eddd868)), closes [#1268](#1268)
* output statement ([#1262](#1262)) ([011ba31](011ba31)), closes [#1259](#1259)
* remove schema concept from grammar ([#1273](#1273)) ([1a3bf80](1a3bf80)), closes [#1133](#1133)
@lars-reimann
Copy link
Member

lars-reimann commented Dec 17, 2024

Bug 1: The following code causes an error:

package demo

pipeline whoSurvived {
    val titanic = Table.fromCsvFile("titanic.csv");
    val _histogram = titanic.plot.histograms();
}
c:\Users\Lars\Desktop\safe-ds-examples\demo.sds:5:22 - Invalid Call receiver: MemberAccess: Receiver is not a Reference or Call but - SdsMemberAccess```

@lars-reimann
Copy link
Member

lars-reimann commented Dec 17, 2024

Bug 2: Closing the graphical view, changing the code, and opening the graphical view shows the old graph without changes. Even changing pipelines and opening the graphical view shows the old graph for the other pipeline.

@lars-reimann
Copy link
Member

lars-reimann commented Dec 17, 2024

Bug 3 (low priority): Examples in the documentation are barely visible:

image

Why do we actually show the textual examples at all in the graphical view?

Also: the headers of the sections in the sidebar should be in English (e.g. Documentation instead of Dokumentation).

lars-reimann pushed a commit that referenced this pull request Dec 20, 2024
### Summary of Changes

Modifies the language stubs in preparation for the Custom
Editor/Visualization PR #1243.
lars-reimann pushed a commit that referenced this pull request Jan 4, 2025
## [0.23.0](v0.22.0...v0.23.0) (2025-01-04)

### Features

* categorize API elements ([#1285](#1285)) ([3275900](3275900)), closes [#1243](#1243)
* optional error messages for constraints ([#1275](#1275)) ([fce761c](fce761c)), closes [#1082](#1082)
* prevent editing built-in stubs ([#1282](#1282)) ([d02c30a](d02c30a))
* show placeholders in outline ([#1286](#1286)) ([3880bfe](3880bfe))

### Bug Fixes

* subtype check for literal and union types ([#1288](#1288)) ([911881c](911881c))
* subtype check for literal and union types (part 2) ([#1289](#1289)) ([56284cf](56284cf))
* type inference for lambdas and their parameters ([#1304](#1304)) ([a9e070f](a9e070f))
@GideonKoenig
Copy link
Contributor Author

This PR has been separated into the three remaining components.

They are meant to be deployed in that order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 New feature or request vscode 🔨 Issues regarding tools like the VS Code extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants