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: use shared html resource and add checks to keep resources in sync #258

Merged
merged 9 commits into from
Feb 10, 2025

Conversation

andrewrobinsonhodges-snyk
Copy link
Contributor

Description

Provide description of this PR and changes, if linked Jira ticket doesn't cover it in full.

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

Screenshots / GIFs

Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!

@andrewrobinsonhodges-snyk andrewrobinsonhodges-snyk requested a review from a team as a code owner February 6, 2025 09:49
- name: Check Static Resources
run: |
declare -A resources
# Add each resource as a kay, value pair, mapping the local resource to the reference wile (which should be stored in the lanaguage server repository). For example:
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: key instead of kay, while instead of wile ;)

@@ -102,6 +102,7 @@ public String replaceCssVariables(String html) {
htmlStyled = htmlStyled.replace("<style nonce=\"ideNonce\" data-ide-style></style>", css);
htmlStyled = htmlStyled.replace("var(--default-font)",
" ui-sans-serif, \"SF Pro Text\", \"Segoe UI\", \"Ubuntu\", Tahoma, Geneva, Verdana, sans-serif;");
htmlStyled = htmlStyled.replace("var(--main-font-size)", "10px");
Copy link
Contributor

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also: can this be taken from the IDE font configuration in Eclipse? See: https://www.perplexity.ai/search/how-to-access-the-eclipse-plat-kwR4S6_ESB29RHq7YGW9kw

// Language server HTML assumes a base font size of 10px. The default Eclipse font size is 17px (13pt), so we
// apply a scaling factor here. This ensures that HTML fonts scale correctly if the user changes the text size.
int scaledHeight = (int) (defaultHeight / 1.7);
return String.valueOf(scaledHeight) + "pt";

Check warning

Code scanning / PMD

No need to call String.valueOf to append to a string. Warning

No need to call String.valueOf to append to a string.
@andrewrobinsonhodges-snyk andrewrobinsonhodges-snyk merged commit 56f808d into main Feb 10, 2025
8 checks passed
@andrewrobinsonhodges-snyk andrewrobinsonhodges-snyk deleted the feat/static-resource-checks branch February 10, 2025 14:22
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