The documentation (https://code.visualstudio.com/docs/languages/json) does not say specific version. I know that VSCode supports draft-04 for sure as I am using it, but I wonder if it supports draft-06 too.
Related
No matter what c# script i boot up, no errors are displayed and neither is IntelliSense.
I've reinstalled vsc, reinstalled some extensions, made sure errors are turned on but nothing seems to work.
They work fine in regular vs but not vsc.
VScode by default only support web technologies if you want to use it for other programming languages you have to install microsoft dedicated extension for that technology like - C# for VScode
We have built a Visual Studio Extension (VSIX). It is a custom editor for editing a special file that contains definitions for the datamodel in our CMS.
We are porting our CMS to .Net 6.0 from .Net 4.8 ( framework -> core ), however we are struggling getting the editor to work in .Net 6.0 projects. It works fine in web applications written in .Net 4.8, but not in .Net 6.0 web application projects.
Whenever we click the save button in Visual Studio, we get a very general and non specific error message that says: "The operation could not be completed. Unspecified error"
We run the extension with source code in debug mode using the Visual Studio SDK, and there is no exception that is picked up by Visual Studio. ( We use one Visual Studio instance to start another instance of Visual Studio in debug mode, as normal with VSIX projects). Breakpoints etc. work, and we have activated all exceptions in the debugger. When we click save in Visual Studio projects, we get the error message before any method is called in our code. We do not even enter the "IVsPersistDocData2.SaveDocData" method of the "WindowPane" class. The plugin is written in C#. Apart from save, everything works fine. The editor loads fine and function as normal in both types of projects.
There must be some difference in the way the extension integrates with Visual Studio that differ between .Net4.8 projects and .Net6.0 projects. Of course, there are differences in file paths etc in these projects, but I do not see how this is the root of the problem as we do not even get to the stage where any method is called in our editor source code.
As a test I created a very simple extension with only the bare minimum to enable a WindowPane extension, and I get the same error message when saving in 6.0 projects
We created the first version of the plugin back in 2013, using templates from Microsoft and have been updating it for every new version of Visual Studio. There have been some changes in the documentation and projects templates for VSIX, but unfortunately, there is no longer any C# template for custom editors, only C++. (https://learn.microsoft.com/en-us/visualstudio/extensibility/walkthrough-creating-a-custom-editor?view=vs-2022) Pherhaps someone knows any workings examples of custom editors written in c#?
So, we are a little stuck, the error message does not give us any clue to what is wrong. I have not found any documentation that could explain differences in Net 4.8 and Net 6.0 web projects that could cause this.
Anyone had a similar problem? Or perhaps a clue to what is causing this.
(BTW, we are using the latest version of Visual Studio 2022 Community and Windows 11)
After opening a support incident with Microsoft, further investigation and live debugging pointed to problems with VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.SaveItem and a possible internal bug in Visual Studio.
A temporary workaround suggested by Microsoft support, was to add the definition of IPersistFileFormat to the WindowPane implementation. ( None of the methods needed to be implemented. )
This solved the problem for us. The definition of our working WindowPane is now:
public sealed class OntologyDesignerEditorPane : WindowPane, IVsPersistDocData2, IPersistFileFormat, IVsFileChangeEvents
I am developing my VS Code extension. Old version is 1.0.0. I add a new feature which leverages VS Code's new feature Remote-development, which only available with VS Code engine version higher than 1.36.1. I added my extension new feature and upgraded my extension to 2.0.0.
I would like to restrict user's VS Code engine when installing my extension. If user would like to install my extension v2.0.0, he must have VS Code engine version higher than 1.36.1.
I set the minimum VS Code version restriction in extension's package.json file, engines fields, following VS Code Official Docs: Extension Manifest. But later I figured out that user with VS Code engine version lower then 1.36.1 still can search my 2.0.0 extension and install it. VS Code does not pop out any suggestion to inform user to upgrade their engine. And the extension can not work properly, of course.
// package.json
"engines": {
"vscode": "^1.36.1"
}
Did I miss something?
How can I restrict user with lower VS Code engine version either to upgrade their VS Code engine or install the old extension release?
Now user with lower VS Code engine version just install my new extension release and the extension can not work. Any help is appreciated!
I figured out the reason myself:
VS Code package.json's engines field does work. If user's engine lower than the required minimum engine version, VS Code will install lower version extension for user.
In my scenario, I have a dependency extension, whose engine requirement is not aligned with the main extension. This is the root cause of the main extension installation failure.
When user with lower version VS Code engine tries to install my extension, VS Code checks the dependency extension's engine requirement and fails to find a main extension release with proper dependency release. In this case, the installation of main extension fails.
Solution:
I have to find a way to remove my previous extension release from marketplace, whose engine requirement is not right.
Today I found a VSCode extension that I would very much love to use in Visual Studio 2017 (Pro or Enterprise). I'm not at all familiar with VSCode. Are the platforms entirely different, or is there some hope that I could somehow modify the extension and "port it over"?
Are the platforms entirely different [...]
Yes, they are - VSCode extensions run in a JavaScript engine (and are usually written with TypeScript), while Visual Studio extensions seem to run on .NET (usually C#). They also have different extension APIs:
Visual Studio 2017 SDK
Visual Studio Code Extension API
That doesn't mean that extension couldn't be ported over of course, provided Visual Studio has equivalents for all the required APIs, but it would essentially be a rewrite.
Now, there's an exception to this with language servers, using Microsoft's Language Server Protocol. It is designed to be IDE-independent and servers can be written in basically whatever language you prefer. There's LSP clients implementations for both VSCode (built-in) and Visual Studio. The extension you linked doesn't fall under that though.
I've been developing on Visual Studio, and here comes Visual Studio Code which is described as a source code editor that supports multiple platforms. For me, I find it promising considering it's a lightweight editor compared to Visual Studio.
Since Visual Studio Code is still a baby, is it safe to say as time passes by and this baby becomes mature, this will be the new Visual Studio considering it can run on multiple platform?
Does Visual Studio Code has a roadmap on the upcoming features?
Visual Studio Code will not replace the regular Visual Studio, if that's what you're asking. VSCode is intended to be a very lightweight, code-focused IDE. There are a plethora of features present in Visual Studio that I don't expect we'll ever see in VSCode simply because they are not within the scope of the project. For example, I don't think you'll ever see the designer in VSCode, which is something you would sorely miss if you were developing a WPF or WinForms application.
Right now VSCode seems to be mostly targeting web application developers using ASP.NET 5 and node.js.
As for what's ahead for VSCode, I'm not sure if a roadmap has been laid out anywhere but I do know that a plugin/extension system is in the works, along with ES6/7 support and a few other things.
If you want to follow the development of VSCode, check out their blog, Twitter, and UserVoice.