platformio-vscode-ide icon indicating copy to clipboard operation
platformio-vscode-ide copied to clipboard

Publish extensions to open-vsx

Open jjchico opened this issue 5 years ago • 63 comments

Workaround

See https://github.com/platformio/platformio-vscode-ide/issues/1802#issuecomment-3370225987

Reason

Microsoft does not allow to use C/C++ extension with other editors. See https://github.com/microsoft/vscode-cpptools/issues/6388#issuecomment-720719298

We are working on an alternative solution for C/C++ code completion and navigation.

This issue depends on

  • https://github.com/clangd/clangd/issues/533
  • https://github.com/llvm/llvm-project/issues/47610

Temporary solution 1

You will need to install manually these extensions:

  • https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
  • https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide
  1. Open extension in the Microsoft Marketplace following the link above
  2. Download extension's VSIX file by clicking on "Download Extension" in "Resources" section (right sidebar)
  3. Navigate to VSCodium Extensions view and click "...", select "Install from ".VSIX".
  4. Repeat for each VSIX/Extension.

Restart VSCodium.

Temporary solution 2

See https://github.com/platformio/platformio-vscode-ide/issues/1802#issuecomment-710683116


Hi!

I'm a VS Codium user, a FLOSS version of VS Code, it's the same code but without the Microsoft's telemetry and branding.

I want to request if possible to add the PlatformIO IDE extension on the open-vsx.org market so that we doesn't need to works with the Microsoft marketplace as it is unclear if it's legal to use it on VS Code forks, see here.

This is how to publish a new extension.

Thanks.

jjchico avatar Jun 18 '20 12:06 jjchico

I am with the same "problem". It would be really nice to have it published to work with VSCodium.

alfredocdmiranda avatar Jul 03 '20 15:07 alfredocdmiranda

It is technically possible:

  • https://github.com/eclipse/openvsx/wiki/Publishing-Extensions
  • https://github.com/VSCodium/vscodium/blob/master/DOCS.md#extensions-marketplace

@ivankravets Do you think platformio extension for codium is also legal?

rafacouto avatar Jul 09 '20 07:07 rafacouto

PlatformIO extension for VSCode depends on C/C++ extension by Microsoft. We use it for code completion/navigation. How to resolve this issue?

ivankravets avatar Jul 09 '20 17:07 ivankravets

This one? It is MIT licensed.

rafacouto avatar Jul 11 '20 23:07 rafacouto

@rafacouto Yes, is it possible to have it in the open-vcs registry as well?

ivankravets avatar Jul 12 '20 12:07 ivankravets

it was already merged here https://github.com/open-vsx/publish-extensions/pull/54 but it doesn't appear on open-vsx.org Probably because it isn't build correctly? Could you help me with fixing that #1884 please?

54696d21 avatar Jul 18 '20 14:07 54696d21

I updated this issue and added temporary solution https://github.com/platformio/platformio-vscode-ide/issues/1802

ivankravets avatar Jul 18 '20 15:07 ivankravets

I believe the Microsoft vscode-cpp extension you guys are using for code completion is incompatible with open-vsx. The linked discussions seem to imply that it's not legal to use the Microsoft C/C++ extension in any other product than VSCode.

I was able to use the clang language server instead and getting it working (in Eclipse Theia), by

  1. Deleting the ms cpp extension
  2. Removing it from platformio-vscode-ide 's package.json as a dependency
  3. Installing the clang extension
  4. Creating a compile_commands.json from the PIO terminal, and putting it in the root of the project.

PlatformIO is still complaining about the incompatibility but all code completion functionality seems to work. Note that I'm using clang only as a language server, and the builds are still being handled by PIO.

This suggests to me that it is possible to separate the build and language server tools, and with small configurations, PlatformIO can actually play well with the clangd language server and therefore be open-vsx compatible.

yunuscukran avatar Oct 16 '20 22:10 yunuscukran

@yunuscukran Thank you so much for your solution! I added it to the top of post.

We already have started research around C/C++ extension and replacement for it. Indeed, we use noly 5% functionality of that extension - just code completion and navigation. So, we would be happy to switch to something open source with better peformance and clang should be a great candidate here.

ivankravets avatar Oct 17 '20 09:10 ivankravets

@yunuscukran what is your feedback about clangd server? Do you like how does it work?

ivankravets avatar Nov 03 '20 12:11 ivankravets

This one? It is MIT licensed.

That one called vscode-cpptools is under Microsoft License, not MIT, which made this issue-There is no a c/c++ extension on VSCodium marketplace #6518

BackMountainDevil avatar Nov 16 '20 16:11 BackMountainDevil

@yunuscukran what is your feedback about clangd server? Do you like how does it work?

Hi,

The functionality regarding language features is good!

One aspect which I think is hacky is that the default place for compile_commands.json must be redefined in the project settings, and the actual act of creating the file with a PIO command must be called somewhere, via a post-build script for example. So right now clangs works with a modified PIO project.

yunuscukran avatar Nov 17 '20 16:11 yunuscukran

Any updates on switching to clangd for the language server? It seems to me what is needed is simply the generation of a compile_commands.json file on project creation and occasional re-creations after builds.

yunuscukran avatar Dec 28 '20 15:12 yunuscukran

We depend on:

  • https://github.com/clangd/clangd/issues/533
  • https://bugs.llvm.org/show_bug.cgi?id=48266

ivankravets avatar Dec 28 '20 18:12 ivankravets

Hi @ivankravets

I hope you can switch to vscode-clangd ASAP - it's rapidly improving and gaining features, as is clangd. I have asked one of our contributors an update about one of your two blocking issues - I hope he can help.

I think coming together and collaborating, us non-Visual-Studio product/framework makers, open registry provider and extension consumers, to offer a better solution, vs the superficiallty-FOSS (really proprietary) extension, that we can't use anyway, is the best thing we can do.

marcdumais-work avatar Feb 03 '21 22:02 marcdumais-work

Regarding clangd/clangd#533, do you people control the compiler location already? If so while waiting for clangd to have a solution around predefined macros, you can just set --query-driver flag yourself within the ide.

kadircet avatar Feb 04 '21 13:02 kadircet

@marcdumais-work thanks for the response! I welcome @valeros here and ask him to provide more details.

ivankravets avatar Feb 05 '21 13:02 ivankravets

Hi guys!

@kadircet Could you please elaborate further? We're already using --query-driver and as you suggested in clangd/clangd#533 I opened a ticket https://bugs.llvm.org/show_bug.cgi?id=48266 as it seems to be a rather clang problem because macros generated by clang simply differ from GCC that breaks intellisense.

valeros avatar Feb 05 '21 14:02 valeros

Hi guys!

@kadircet Could you please elaborate further?

i've replied on clangd/clangd#533, but repeating it here for completeness. i was looking into both this issue and clangd/clangd#539 at the same time. so i confused the two :/ ofc it is not possible to workaround a missing behaviour in query-driver, by enabling query-driver 😂

kadircet avatar Feb 05 '21 14:02 kadircet

Looks like this is also needed to be able to use platformio from onivim2, see https://github.com/onivim/oni2/issues/3026 .

jerabaul29 avatar Feb 07 '21 20:02 jerabaul29

Any update on this?

I think this may be quite useful for you to release as open-vsx in order to keep users :)

For example, my main motivation for using platformio nowadays compared with Arduino IDE 2.0 is that it lets me use my favorite editor of the moment (before the Arduino IDE 2.0 came out, my main motivation for using platformio was to get linter and static analysis which was not available on Arduino 1.8, but now that Arduino IDE 2.0 is getting this and it works nicely already, this removes this part of the extra value of platformio). For me nowadays editor of choice means onivim2. So if I cannot get platformio to work for onivim2, I think that I will (unfortunately) default to switching to Arduino IDE 2.0, as I am really tired of the sluggishness of vscode and similar.

jerabaul29 avatar Mar 11 '21 19:03 jerabaul29

Hi, Please release us from false opensourceness of microsoft that void many people from using the platformio extension.

ouinouin avatar Mar 17 '21 23:03 ouinouin

Since C++ is present by default on VSCode anyway, maybe just drop it from deps and add popup with download link to vsix?

This would be a quick fix, allowing both adding PlatformIO to open-vsx and moving on with previous completion engine.

cab404 avatar Apr 02 '21 22:04 cab404

@cab404 can you do it yourself and publish a fork in open-vsx?

HKalbasi avatar Apr 18 '21 22:04 HKalbasi

Since C++ is present by default on VSCode anyway, maybe just drop it from deps and add popup with download link to vsix?

This would be a quick fix, allowing both adding PlatformIO to open-vsx and moving on with previous completion engine.

The problem, already stated above, is that license of vscode-cpptools prevents using it out of non-free MS VS Code. Suggesting the user to just circumvent the legal restriction is not appropriate.

jjchico avatar Jun 14 '21 14:06 jjchico

But the idea regarding the vscode-cpptools was to instead to move to the clang tool that is fully open and permissive license, right? :) .

jerabaul29 avatar Jun 23 '21 09:06 jerabaul29

Hello! I'd love to help get the PlatformIO published to OpenVSX. Is there anything I can do to help? 🙂

jankeromnes avatar Sep 29 '21 09:09 jankeromnes

@jankeromnes Does PlatformIO IDE extension work with Theia if you install it manually? The last time when I tested it, it didn't work. Theia does not support VSCode's API on which PlatformIO IDE extension depends.

ivankravets avatar Sep 29 '21 09:09 ivankravets

@ivankravets I'm not sure about Theia, but Gitpod, openvscode-server and VSCodium all use stock VS Code today (and Theia support in Gitpod has been deprecated).

jankeromnes avatar Sep 29 '21 09:09 jankeromnes

Wow! Founders of Theia switched to VSCode for Gitpod. Great decision!

I don't see C/C++ extension on Gitpod. PlatformIO IDE depends on it.

ivankravets avatar Sep 29 '21 09:09 ivankravets