microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.46k stars 449 forks source link

CMakeLists.txt is not syntax highlighted #534

Open python152 opened 6 years ago

python152 commented 6 years ago

Brief Issue Summary

CMakeLists.txt is not syntax highlighted

Expected:

When I open CMakeLists.txt, expected syntax highlight and intellisense.

Apparent Behavior:

It is opened as a plaintext, and if I want to change the language association, there is no "Cmake" - the closest thing is makefile.

CMake Tools Log

None

Platform and Versions

[[For issues, fill out the following. Otherwise delete this section.]]

decimad commented 6 years ago

There are addons providing syntax highliting for cmake... This one is concerned about building with cmake.

mmanyen commented 6 years ago

https://marketplace.visualstudio.com/items?itemName=twxs.cmake

soroshsabz commented 5 years ago

ITNOA

I think it is very good to provide Colorization and Completion Lists features with this extension to see complete solution to work with cmake.

@vector-of-bool did you can merge twxs.cmake with this project?

thx

oryandunn commented 4 years ago

I would also prefer if this extension provided the syntax highlighting. I'm currently using the twxs.cmake, however, it differs from the highlighting that Microsoft themselves provide for cmake files in Visual Studio 2019. In particular, variables and control flow statements are different. I find the VS2019 highlighting to be better.

Also, in some environments, it's easier to get approval to use extensions provided by Microsoft themselves.

bobbrow commented 4 years ago

Thanks for the feedback. This feature request is not yet on our roadmap. Please make sure you add a 👍 to the first post to add your vote.

YaniManster commented 4 years ago

"CMake Tools provides the native developer a full-featured, convenient, and powerful workflow for CMake-based projects in Visual Studio Code."

munsingh commented 4 years ago

It would be great if this can be addressed. Visual Studio does it and so do many other editors. Its high time Visual Studio Code also does syntax highlighting for CMakeLists.txt files.

bobbrow commented 4 years ago

@munsingh there is an extension that does syntax highlighting for CMakeLists.txt files in VS Code. It just isn't bundled with this extension.

FranciscoPombal commented 4 years ago

@munsingh there is an extension that does syntax highlighting for CMakeLists.txt files in VS Code. It just isn't bundled with this extension.

That extension is missing several keywords, and looks like it's abandoned. Furthermore, I don't see why 2 CMake extensions should be required just to get syntax highlighting. "full-featured, convenient, and powerful workflow for CMake-based projects in Visual Studio Code." should also include "syntax highlighting". Alternatively, CMake syntax highlighting could come natively with VSCode.

Thanks for the feedback. This feature request is not yet on our roadmap. Please make sure you add a :+1: to the first post to add your vote.

This feature has been the most :+1:'d for ages. Why is it still in the Backlog milestone, and not in the On deck one at least? Is not "ready to be looked into" yet?

bobbrow commented 4 years ago

Unfortunately, providing language services for CMake is currently out of scope for this extension because it's a significant investment that we haven't been able to justify funding while another extension exists that provides the feature already. We'd certainly accept a pull request with the implementation if anyone feels like tackling it.

If folks are upset with the use of the term "full-featured", I will remove that from the description. That was the previous maintainer's word choice and we didn't change it when we assumed maintainer responsibilities because it was part of the "legacy."

ghost commented 3 years ago

I image most other people will do exactly what I've just done.

  1. Open a cmake project
  2. Click to install the suggested extension with the prompt in the bottom right
  3. Be confused that there's no syntax highlighting
  4. Look at the other extensions in the marketplace
  5. Be confused as to whether they overlap with the suggested one I just installed
  6. Find this issue

Every other language I've tried in vscode will get highlighting after installing the suggested extension. Perhaps the twxs.cmake extension could also get suggested-status? That would give an actually full-featured experience.

woodz- commented 3 years ago

@johnmarkwayve same for me. To the devs: how would you explain not taking into account highlighting from the early beginning, which is such a visual experience going all the way through the idea of vsc and its extensions leading to catch many people with less experience?

melroy89 commented 2 years ago

So CMake tools notification pop-up told me to remove the CMake extension by twxs, however now I don't have syntax highlighting??

CMake Tools said in this message they implemented those features in this cmake tools extension by Microsoft. But where is my syntax highlighting???

And where is there no update on this issue after 4 years?

bobbrow commented 2 years ago

There are two extensions you can pick from right now. The CMake extension by twxs which you mentioned, and a new one CMake Language Support. We received complaints about this change and reverted our extension pack back to bundle the one by twxs. You can install either one. We believe the new one is better and recommend you install that one, but because of compatibility issues we decided to roll back the changes.

And where is there no update on this issue after 4 years?

There is no update here because acceptable extensions exist in the Marketplace to provide the language services. While it would be nice to add the support directly into our extension and we do eventually want to do it, the priority is currently lower than other issues that do not have a solution readily available.

dsyx commented 1 year ago

Recently, I was trying to migrate from legacy CMake to modern CMake. before that, I was using ms-vscode.cmake-tools and twxs.cmake. However, I now find that the code highlighting and hinting in twxs.cmake is inadequate to support modern CMake.

In the extension marketplace, I found josetr.cmake-language-support-vscode, which appears to be a replacement for twxs.cmake. However, when I went to the repository for josetr.cmake-language-support-vscode, I found that the repository was blank and it also asked me to install ms-dotnettools.vscode-dotnet-runtime.

I think it would be better if ms-vscode.cmake-tools provides code highlighting and hints if possible. I believe people prefer to use official extensions rather than personal, non-open source extensions.

dantrag commented 1 year ago

No syntax highlighting support (STILL) is ofc ridiculous. But do we at least get to know which highlighting extension do the developers use themselves? Must be a real shame using another tool for something your own tool was supposed to be doing.

gcampbell-msft commented 8 months ago

Hi everyone, we would like to update you all on our plans to improve the Language Services for CMake (scripts).

We do not have feature deliverables for language services in the upcoming CMakeTools 1.17 release, which is just around the corner (shipping on 2/13).

However, we do have language service capabilities in Visual Studio, and we would like to further improve them and bring them over to CMake Tools, planning for CMake Tools 1.18. We would like to do this in an iterative fashion, so we deliver what we have first, first. We will create dedicated work items to track each of the features and link them in this Github issue.

We hope to continuously improve on the CMake Tools Language Services story, eventually providing full support with for: hover (quick info), completions, find all references, etc.

FYI, @dantrag @dsyx @melroy89 @woodz- @FranciscoPombal @munsingh @YaniManster @oryandunn @soroshsabz @decimad @python152, and others!

gcampbell-msft commented 4 months ago

All, I removed the fixed (release pending) tag. This is due to the fact that we were not able to implement quick info in time for the 1.18 release and we don't want a drop in functionality from previous releases. We hope to merge these changes back into pre-release when available.

H-G-Hristov commented 4 months ago

@gcampbell-msft If this Feature replaces the twsx extension, which provides highlighting etc. and the twsx extension is installed on its own or via the MS C++ extension package. What will happen? Will the be a conflict of interest, will they be uninstalled or the user will be offered to uninstall them?

gcampbell-msft commented 4 months ago

@H-G-Hristov Only one syntax highlighting will be selected by VS Code, so there won't be bad behavior, but it may be indeterminate which extension will actually be being used.

As long as you haven't manually installed the twsx extension yourself, it will be uninstalled when we remove our dependency. Thanks.

H-G-Hristov commented 2 months ago

This was closed as completed but there are no sign in the change log. What is the deal with this original FR? I see it was split in sub-tasks above. Do we get something in 1.19?

gcampbell-msft commented 2 months ago

@H-G-Hristov Thank you for the notification. It got marked as completed, but we have not completed this work quite yet, re-opening to correctly reflect our status. Thanks!