Skip to content

feat: use shared html resource and add checks to keep resources in sync#258

Merged
andrewrobinsonhodges-snyk merged 9 commits intomainfrom
feat/static-resource-checks
Feb 10, 2025
Merged

feat: use shared html resource and add checks to keep resources in sync#258
andrewrobinsonhodges-snyk merged 9 commits intomainfrom
feat/static-resource-checks

Conversation

@andrewrobinsonhodges-snyk
Copy link
Copy Markdown
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
Comment thread .github/workflows/resource-check.yml Outdated
- 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
Copy Markdown
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 ;)

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why?

Copy link
Copy Markdown
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.

No need to call String.valueOf to append to a string.
@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.

3 participants