-
Notifications
You must be signed in to change notification settings - Fork 57
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 web extension support for syntax highlighting #2323
feat: Add web extension support for syntax highlighting #2323
Conversation
Looks good. Do you think you could use |
clients/cobol-lsp-vscode-extension/src/web/test/suite/extension.test.ts
Outdated
Show resolved
Hide resolved
Adds support to build a web extension that contains a subset of features from the main Cobol LSP extension. Currently only includes the syntax highlighting.
Limit/Disable the commands available when it is run as a web extension. Add documentation denoting that the extension's capabilities are limited as well.
Updated the web extension's output directory to use the dist/web/ folder instead of the root of the dist one.
Updated the build.sh to build the web extension.
Update the npm build:web command to use the browser as the platform rather than node.
Changed the workspace detection in package.json to use the "isWeb" variable rather than virtual workspaces. (Web is a subset of use cases when the filesystem is virtual.)
1167a16
to
878ef80
Compare
Add the package command to create the web compatible extension. Also exclude the extension.js and associated source map from being ignored in vscodeignore.
Replaced webpack with esbuild. Fixed test:web command such that the tests can run.
Add web build step to the build.yml
Removed unused Webpack-related packages.
Add package:web step to Github workflow
Update package-lock.json
This reverts commit 53df542.
Updated package-lock.json
.github/workflows/build.yml
Outdated
- name: Package COBOL LS vsix for Web | ||
working-directory: clients/cobol-lsp-vscode-extension | ||
run: | | ||
npm run package:web | ||
cp *.vsix ../../. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will run 6x (once in each native configuration) and possibly overwrite the "desktop" VSIX package.
I suggest creating a separate job (e.g. buildWeb) in this file that will just do
- checkout
- "update version for PR" step
- npm ci
- npm run test:web
- npm run package:web
- upload artifact to preserve the VSIX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes a separate vsix file with the name cobol-language-support-web-[version]
where version
is the latest numbered version. (2.1.2 as of this writing.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a separate job for building the web extension. Will need some help with the upload as there isn't an existing one to handle the artifact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
che-che4z-lsp-for-cobol/.github/workflows/build.yml
Lines 344 to 348 in 2c0b20f
- uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: warn | |
name: vsix-cobol-language-support-${{ env.target }} | |
path: 'cobol-language-support*.vsix' |
const path = require('path'); | ||
const polyfill = require('@esbuild-plugins/node-globals-polyfill'); | ||
|
||
const production = process.argv.includes('--production'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that the argument is actually provided in the build scripts.
Fix the issue with "Assert" not being available as a package.
Remove Node Polyfill
Make buildWeb a separate job step for CI
Ran prettier to fix the linting issues.
Add upload step to buildWeb job
Co-authored-by: slavek-kucera <53339291+slavek-kucera@users.noreply.github.com>
Please upgrade various ignore files... |
Implemented requested changes to TDD for it to account for the web extension.
…m/che-che4z-lsp-for-cobol into web-extension-support
Rename esbuild.js to avoid collision with just "esbuild".
Update .vscodeignore to exclude extension related javascript and map files from the extension/dist/ folders.
Look through the build logs, I think that the web version also builds the desktop version in the |
Fix web build and package.
Add production flag to web build in prepackage
Updated .vscodeignore to remove the unneeded and unused exceptions to the ignore.
Adds support to build a web extension that contains a subset of features from the main Cobol LSP extension. Currently only includes the syntax highlighting.
How Has This Been Tested?
This has been tested through building the extension and checking the functionality thereof within VS Code for Web following this guide. No unit tests were created this only provides the syntaxes developed for the main LSP extension within a web compatible extension.
Checklist: