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

Upgrade to slang 0.19 and use prettier 3 on the codebase #635

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

antico5
Copy link
Collaborator

@antico5 antico5 commented Feb 6, 2025

  • Upgraded slang to 0.19, which doesnt have native bindings nor optional packages
  • Replaced all static imports for dynamic imports. This means many sync functions are now async.
  • Updated all calls to slang with the new apis
  • Updated documentSymbols and semanticTokens features
  • Installed prettier 3 with an alias (prettier3), to be used on our codebase. Wrote a small script to access it binary. This is necessary to support TS 5.3+ syntax (import attributes in our case).

Closes #632

kanej and others added 4 commits January 30, 2025 18:39
This was previously implicit and depended on a the root build. This
clashes with my attempts to update the typescript version, so I am
scoping the e2e tests to their own build.
This commit at its heart does the following:

1. Updates the version of typescript we are using to 5.5
2. Switches to node16 as our module resolution strategy
3. Updates the underlying node-language-server version we are using

These are all initial steps to allow us to pull in ESM module based dependencies, in particular `slang@19`.

* chore: add eslint config for coc

This brings coc inline with the eslint config pattern found for other
packages in the repo. It showed up as an issue when attempting to update
the typescript version.

* chore: bump version of language server

The language server was 2 years out of date. To maximize ease of
integration with typescript@5 we are updating to the latest version.

* chore: bump version of lodash types

The latest version of lodash types is been taken to better work with
typescript@5.

* chore: bump version of eslint and plugins

Eslint and its plugins are 2 years out of date. They have been brought
up to the same version used in the Hardhat repo.

We initially tried to jump straight to `eslint@10` but backed out with
the config format changes. We will look at this again with the repo
modernization efforts.

* chore: bump verion of @types/node to latest

Node 20 is now the version used in VSCode. The types have been updated
to reflect the new node versions.

* chore: bump version of esbuild

To package the extension we use a bundler, esbuild needs to be updated
to match the new version of typescript.

* chore: update version of typescript

We need better module resolution support as we deal with Slang's ESM
packages, specifically the loading of TS types from commonjs.

* chore: bump node target in tsconfig

To support pulling in more modern ts libraries like Slang@18, we want to
swap to `node16` module resolution. This is not ESM, but the modern
version of commonjs.

It lets us use TS types from Slang from the VSCode extension's commonjs
packages.

* chore: disable lib check on server

This is a hack that we should accept temporarily.

A library that the language server node library uses fails more refined
typechecking in typescript@5. For the moment checking types in dependent
packages is skipped.

* chore: fix linting error on t.type

The update to eslint revealed this equality error.

* chore: update eslint errors

New rules are affecting our naming conventions. Rather than disable the
rule I have scattered disable lines. This is a tradeoff, but we expect a
revamp of the eslint rules based on HH3 in the near future.

* Update bundle script - @solidity-parser got hoisted

---------

Co-authored-by: Armando Andini <[email protected]>
@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Feb 6, 2025
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 5.20833% with 91 lines in your changes missing coverage. Please review.

Project coverage is 53.16%. Comparing base (a22fd00) to head (712e2d1).

Files with missing lines Patch % Lines
...services/semanticHighlight/onSemanticTokensFull.ts 8.33% 11 Missing ⚠️
...er/src/services/documentSymbol/onDocumentSymbol.ts 0.00% 9 Missing ⚠️
...er/src/frameworks/Hardhat/worker/WorkerProtocol.ts 16.66% 5 Missing ⚠️
server/src/parser/slangHelpers.ts 33.33% 2 Missing ⚠️
...vices/documentSymbol/finders/ConstantDefinition.ts 0.00% 2 Missing ⚠️
...es/documentSymbol/finders/ConstructorDefinition.ts 0.00% 2 Missing ⚠️
...vices/documentSymbol/finders/ContractDefinition.ts 0.00% 2 Missing ⚠️
.../services/documentSymbol/finders/EnumDefinition.ts 0.00% 2 Missing ⚠️
...services/documentSymbol/finders/ErrorDefinition.ts 0.00% 2 Missing ⚠️
...services/documentSymbol/finders/EventDefinition.ts 0.00% 2 Missing ⚠️
... and 27 more
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #635      +/-   ##
===============================================
- Coverage        54.53%   53.16%   -1.38%     
===============================================
  Files              226      226              
  Lines             5200     5199       -1     
  Branches           800      801       +1     
===============================================
- Hits              2836     2764      -72     
- Misses            2127     2198      +71     
  Partials           237      237              

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Semantic Highlighting and Outline to use Slang@19
2 participants