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

Implement recommended extension/server setup #200

Conversation

WilsonZiweiWang
Copy link
Contributor

@WilsonZiweiWang WilsonZiweiWang commented Apr 12, 2024

Why

I want to get rid of this message that showed up during the execution of the script installServerIntoExtension:

The script is deprecated. See https://github.com/microsoft/vscode-extension-samples/tree/master/lsp-sample for an example on how to setup an extension / server project.

Source of the deprecation message:
https://github.com/microsoft/vscode-languageserver-node/blob/0226f6cd925d279dda2b777d25c5b69518ac0035/server/bin/installServerIntoExtension#L70

Ticket: 14334

How

To implement the recommended setup in lsp-sample:

  1. The extension manifest needs to be at the workspace root's package.json. (vsce package will need to run in root afterwards)
  2. Files in the server and the client should be compiled to their own out/

Other changes to make:

  1. Need to update the root's README for it will be used as the extension information in the marketplace.
  2. Update paths in launch.json, main.yml.
  3. Update ignore patterns in .gitignore, .vscodeignore and .npmignore.

Test results

All functionalities seem to work on my end
VSIX
image

npm package
image

What is not working

The integration tests don't seem to work. Local run and CI froze at this stage.

@WilsonZiweiWang WilsonZiweiWang self-assigned this Apr 12, 2024
@WilsonZiweiWang WilsonZiweiWang force-pushed the use-recommended-extension-server-structure branch 2 times, most recently from 25f1bcd to 41bef55 Compare April 12, 2024 20:34
@deribaucourt
Copy link
Member

deribaucourt commented Apr 15, 2024

Probably resolves #178
Very excited for this. All packages, debug configurations and test configurations must be fully working though.

@WilsonZiweiWang WilsonZiweiWang force-pushed the use-recommended-extension-server-structure branch 5 times, most recently from fa89e3f to 2e584a0 Compare April 15, 2024 20:35
@WilsonZiweiWang WilsonZiweiWang marked this pull request as ready for review April 15, 2024 21:28
@WilsonZiweiWang
Copy link
Contributor Author

The client's README content needs to move to the root. Need to decide what to do with the existing one.

@WilsonZiweiWang WilsonZiweiWang changed the title Implement recommended extension/server structure Implement recommended extension/server setup Apr 15, 2024
…mple

Reference:
https://github.com/microsoft/vscode-extension-samples/tree/main/lsp-sample
1. extension manifest is the root's package.json
2. client and server are compiled to their own out/
3. Paths in launch.json, main.yml, package.json,etc are updated accordingly
4. Other files such as .vscodeignore and CHANGELOG are moved to the root as well
By default, the grammar test framework need to run in the directory where the extension manifest exists,
which contains the contributes for language and grammar. Since the extension manifest has been moved to root,
the grammar test scripts are moved as well.
The extension manifest is now root's package.json, the README in root is then used for marketplace page.
The images used in the README are also moved. Some un-used images are removed.
@WilsonZiweiWang WilsonZiweiWang force-pushed the use-recommended-extension-server-structure branch from 2e584a0 to 7a6c729 Compare April 16, 2024 14:41
Now we don't need to move the static files like resources/ and wasm file around as long as
the relative layout is the same for both src/ and out/. For npm package, we just package
the files needed while respecting the relative layout.
.vscode/launch.json Show resolved Hide resolved
.github/workflows/main.yml Show resolved Hide resolved
.vscodeignore Show resolved Hide resolved
images/bitbake-terminal-profile.png Outdated Show resolved Hide resolved
.vscode/launch.json Show resolved Hide resolved
.vscodeignore Show resolved Hide resolved
server/package.json Show resolved Hide resolved
Copy link
Member

@deribaucourt deribaucourt left a comment

Choose a reason for hiding this comment

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

Code LGTM, discussions

@WilsonZiweiWang WilsonZiweiWang merged commit d25dd9d into yoctoproject:staging Apr 22, 2024
5 checks passed
@WilsonZiweiWang WilsonZiweiWang deleted the use-recommended-extension-server-structure branch April 22, 2024 14:52
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